Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read client certificates before dropping privileges #363

Open
k0ekk0ek opened this issue Jul 29, 2024 · 0 comments
Open

Read client certificates before dropping privileges #363

k0ekk0ek opened this issue Jul 29, 2024 · 0 comments

Comments

@k0ekk0ek
Copy link

Andreas Schulze gave some feedback on the mutual tls(-auth) (#185 and #337) feature on the nsd-users mailing list.

It appears certificates specified with client-cert are read on opening a connection. Think about updating the logic to read the certificates before dropping privileges, a more extensive description is provided by Andreas below:

NSD serving as simple TLS server is configured with:

server:
	username: nsd
	ip-address: ::@853
	tls-service-key: /path/to/key.pem
	tls-service-pem: /path/to/cert+intermediate.pem
	tls-port: 853

	# since 4.10.1rc2
	ip-address: ::@1853
	tls-auth-port: 1853
	tls-auth-xfr-only: yes
	tls-cert-bundle: /path/to/ca-certificates.crt

In this mode, /path/to/*.pem may accessible for the root user only.

Now, when adding a tls-auth for the purpose of client authentication I add:

tls-auth:
	name: primary.nsd.example
	auth-domain-name: primary.nsd.example
	client-cert: /path/to/cert+intermediate.pem
	client-key: /path/to/key.pem

Here, the files /path/to/*.pem are used by a child process with limited privileges of the username 'nsd' It would be better, if nsd read all tls-auth client-[cert|key] data before dropping privileges. Then the files could be still limited to be readable by the root user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant