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

Add support for TLS (TLS server certificate validation) #312

Open
Tyrrx opened this issue Jun 16, 2023 · 0 comments
Open

Add support for TLS (TLS server certificate validation) #312

Tyrrx opened this issue Jun 16, 2023 · 0 comments
Assignees

Comments

@Tyrrx
Copy link

Tyrrx commented Jun 16, 2023

Describe the problem to solve
At the moment it is possible to use TLS with a client certificate to authenticate at a Syslog server. This is great but this just allows the server to verify the identity of the client but it does not work in the opposite direction. The client is not able to verify the identity of the server. This can be a critical security vulnerability. Mutual TLS protects against e.g. on-path attacks and spoofing attacks. For more details see e.g. What is mutual TLS (mTLS).

Describe the enhancement proposed
I would say the best way to implement mTLS in a NLog Target is to provide a trusted certificate store through the config that contains all
trusted root and intermediate certificates. The client then uses these trusted certificates to verify the provided TLS server certificate during client authentication. The SslStream can do this using the AuthenticateAsClient(SslClientAuthenticationOptionssslClientAuthenticationOptions) method. The RemoteCertificateValidationCallback should build the entire chain with the root certificate from the store and may also check the CRL to verify the TLS server certificate.

Describe alternatives

  • The TLS server certificate verification might be configurable. E.g. flag for checking the CRL online or offline.
  • It might be easier to implement the chain building by splitting the trusted certificate store into a trusted root and a trusted intermediate certificate store
  • It might be easier to use Bouncy Castle libs for certificate verification instead of the .net libs (chain building and CRL)

Additional context
What is mutual TLS (mTLS)
X509Chain Class
Bouncy Castle PkixCertPathBuilder

@Tyrrx Tyrrx changed the title Add support for mTLS (TLS server certificate validation) Add support for TLS (TLS server certificate validation) Jun 19, 2023
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

2 participants