Skip to content

state: enable mTLS on the client side - #28

Draft
rlahfa-dinum wants to merge 2 commits into
mainfrom
rustls-client
Draft

state: enable mTLS on the client side#28
rlahfa-dinum wants to merge 2 commits into
mainfrom
rustls-client

Conversation

@rlahfa-dinum

Copy link
Copy Markdown
Collaborator

This fixes #13.

We vendor rustls-pkcs11 (MIT) because it's a single file and has dependencies which we would like to change (logtracing or rustlstokio_rustls).
In addition, we probably will modify this dependency to match more our usecases.

Once this is done, we have an out-of-the-box client certificate resolver to pass to rustls.

Some things are not handled:

  • errors
  • PIN prompts/caching
  • PKI setup on the client side → we should use the system store and call it a day.
  • Testing

This should reasonably support (m)TLS on the server side now:

- If you set the TLS certificates parameters, TLS is terminated directly
on the proxy.
- If you set the client CA parameters, client certs are verified and we
are in mTLS operations mode.
- If you set none, there's no TLS whatsover.

In the future, we should allow via settings whether people can still
authenticate to the proxy without a client certificate and inject this
information into the ACL.

I think CRLs should not be supported, let's just have short revocation
times, here, problem solved.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
By using rustls-pkcs11, we can build a PKCS#11 resolver
(TPM2/HSM/Yubikey/etc.) to resolve client certificates without
specifying URIs.

This resolver does not support targeting a precise URI (except if we
combine it with special PKCS#11 libraries such as OpenSC).

In addition, we do not handle PIN yet, we need a prompt mechanism for
that and caching probably.

Signed-off-by: Ryan Lahfa <ryan.lahfa.ext@numerique.gouv.fr>
@rlahfa-dinum

Copy link
Copy Markdown
Collaborator Author

For testing here, I think the scenarios should involve:

  • A test with file certificates.
  • A test with TPM2 backed certificates, provisioning code should be included in the start of the test.

Here, the tests can only work with a Portail upstream and we should ensure we can do mTLS in the inner tunnel via curl properly to a NGINX target.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support mTLS outbound connections using PKCS#11

1 participant