hydra icon indicating copy to clipboard operation
hydra copied to clipboard

mTLS for admin/public interfaces

Open aarmam opened this issue 2 years ago • 7 comments

Preflight checklist

Describe your problem

We would like to have mTLS option for both the admin and public interfaces.

Describe your ideal solution

Introduce configurable ClientAuth and ClientCAs in server handler tls configuration.

Configuration:

serve.public.tls.client_ca: /path/to/file.pem
serve.admin.tls.client_ca: /path/to/file.pem

when specified, then ClientAuth would be set to ClientAuthType.RequireAndVerifyClientCert

Version

2.x

Additional Context

Willing to help implementing it if necessary!

aarmam avatar Jan 09 '23 10:01 aarmam

Thanks for filing this @aarmam! @zepatrik I'd love your opinion here as we're working on improvements to API keys and PAKs. Would mTLS be possible to implement in this context?

kmherrmann avatar Jan 24 '23 11:01 kmherrmann

There are many ways to do service authentication. While mTLS definitely is one of the most common, we would like to keep this complexity out of our services and rather recommend to offload this to a sidecar. Hydra would then only listen on localhost and therefore be only available through the sidecar. The complexity comes when you require multiple CAs with different priviledges, need CA rotation, ....

A sidecar approach allows anyone to use any kind of auth, not just mTLS. Does that answer your question @aarmam?

zepatrik avatar Jan 24 '23 11:01 zepatrik

I agree with Patrik here - mTLS (termination) should be done in envoy or another ingress proxy. Solving this in Hydra will have a lot of complexity - from different TLS modes to CAs, self signed certs, and so on :)

aeneasr avatar Jan 24 '23 14:01 aeneasr

I think mTLS is a reasonable request. The only difficulty in the implementation would be auto-reloading the client CAs from disk.

alnr avatar Jan 24 '23 14:01 alnr

@aarmam after internal discussion, we won't be prioritizing mTLS support on our end. We'd be happy to review a PR if you'd like to contribute it though!

kmherrmann avatar Jan 24 '23 17:01 kmherrmann

Before contributing please read through https://github.com/ory/fosite/issues/661 :)

aeneasr avatar Jan 24 '23 18:01 aeneasr

Hello contributors!

I am marking this issue as stale as it has not received any engagement from the community or maintainers for a year. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas on how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan for resolving the issue.

Throughout its lifetime, Ory has received over 10.000 issues and PRs. To sustain that growth, we need to prioritize and focus on issues that are important to the community. A good indication of importance, and thus priority, is activity on a topic.

Unfortunately, burnout has become a topic of concern amongst open-source projects.

It can lead to severe personal and health issues as well as opening catastrophic attack vectors.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone.

If this issue was marked as stale erroneously you can exempt it by adding the backlog label, assigning someone, or setting a milestone for it.

Thank you for your understanding and to anyone who participated in the conversation! And as written above, please do participate in the conversation if this topic is important to you!

Thank you 🙏✌️

github-actions[bot] avatar Jan 25 '24 00:01 github-actions[bot]