Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 initial draft of Auth GEP 1494 #3500
base: main
Are you sure you want to change the base?
Add initial draft of Auth GEP 1494 #3500
Changes from all commits
a9db0f1
6706fbd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're saying this is exclusively for north-south traffic, I think I'd rather attach this config at the Gateway level. Maybe it would be safer to say something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this imply that Ana has the ability to override the cluster-admin configuration? I assume some use cases for this functionality might involve testing, but I’m curious to hear about other potential use cases. My concern is that an app developer, who may not have a strong understanding of authentication, would have the ability to override cluster-admin (or security admin) defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some public pages, like a status page or help page, might not need authn?
It could be more flexible if the Gateway API allowed an HTTPRoute to either override or inherit settings from the Gateway under a hierarchical control model. This flexibility would be especially useful in cases where roles overlap, such as in smaller organizations where Ana and Chihiro might be the same person.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the most likely use case here is for healthchecks, or being able to say "the whole website needs auth, except for
/public
" or something.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my experience, cluster admins often lack a clear understanding of the deployed applications and their paths unless developers explicitly provide this information. In this context, the role of the cluster admin would be to enable default authentication globally for all routes. Developers, like Ana, can then override this default authentication at the httproute level or for specific routes within the httproute. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is roughly what I'm thinking here. A default, not an override, although I'm not sure we'll be using Policy Attachment to do this or not yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand it, the current proposal only allows for "add auth to this website, except for this route". Could this be expanded to have some kind of rule-based authentication selection/bypass mechanism? I'd love to have the ability to choose a specific authentication mechanism (or bypass auth entirely) on a per-route basis, based on multiple factors (e.g. client IP, user agent).
This would make the Gateway API an amazing Layer 7 firewall, but I'm not sure if the project wants to support these kinds of capabilities; I saw this proposal was closed partly because the feature "operated too much like a WAF/firewall".
Proposed user stories:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any intend to also cover GRPCRoute?
I think it should be made clear if it's non-goal, or deferred.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While the "raw" passwords in basic auth have additional issues (long lived, impersonating human on login pages), JWT and afaik OAUTH/OIDC are not generally secure against "replay" attacks.
I.e. besides mTLS (which enforces confidentiality) all mechanisms are insecure in plaintext messages, because the authentication token can at least be re-used on other connections to gain the same level of privileges.
I think it's best to move the notion of requiring encryption for safe usage out of Basic Auth and potentially add a note here that basic auth has an additional issue with long-lived (potentially higher power) tokens being exchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be worth referring to https://gateway-api.sigs.k8s.io/geps/gep-91/ as this is already in progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the "also" is misplaced, since it's about the server also verifying a client, not about the client's cert being trusted by the same CA as ??.
The "trust chain" seems weird as well. Generally we have trust roots on a server, and the chain is presented by the client.
Since the client side authentication process of the server is implied prior knowledge, I think this can be condensed a bit.
I suggest:
In this case, the server also authenticates the client, based on the certificate chain presented by the client. Some implementations also allow details about the certificate to be passed through to backend clients, to be used in authorization decisions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While not necessary, I think it's worth pointing to https://datatracker.ietf.org/doc/html/rfc8996 for why TLS 1.1 and earlier are not considered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might leak into the "API" phase, but I think there's 2 levels to this, which are both worth an explicit mention
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As Ana the Application Developer, I wish to be able to redirect users to a login page when they lack authentication, while unauthenticated API access gets the proper 40x response.
^ to make it clear that we need to handle "human" clients (browsers) slightly different to API consumers due to 30X/40X conventions.