-
Notifications
You must be signed in to change notification settings - Fork 595
Add trustDomains and notTrustDomains to AuthzPolicy source #3665
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| apiVersion: release-notes/v2 | ||
| kind: feature | ||
| area: security | ||
|
|
||
| releaseNotes: | ||
| - | | ||
| **Added** `trustDomains` and `notTrustDomains` fields to the `Source` in `AuthorizationPolicy`, | ||
| allowing users to match or exclude requests based on the trust domain derived from the peer certificate. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -506,6 +506,21 @@ message Source { | |
|
|
||
| // Optional. A list of negative match of remote IP blocks. | ||
| repeated string not_remote_ip_blocks = 10; | ||
|
|
||
| // Optional. A list of trust domains derived from the peer certificate. | ||
| // Can be exact, prefix, suffix and presence. | ||
| // This field requires mTLS enabled and is the same as the `source.trustDomain` attribute. | ||
| // | ||
| // If not set, any trust domain is allowed. | ||
| // | ||
| // +cue-gen:AuthorizationPolicy:releaseChannel:extended | ||
| repeated string trust_domains = 13; | ||
|
|
||
| // Optional. A list of negative match of trust domains. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What are the semantics of notTrustDomains is set but the connection doesn't have mTLS enabled?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's the same trap as
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. BTW, for all those negative forms when mTLS is absent, not_* will trivially pass (empty string doesn't match any specified value), potentially allowing unauthenticated traffic through. |
||
| // Can be exact, prefix, suffix and presence. | ||
| // | ||
| // +cue-gen:AuthorizationPolicy:releaseChannel:extended | ||
| repeated string not_trust_domains = 14; | ||
| } | ||
|
|
||
| // Operation specifies the operations of a request. Fields in the operation are | ||
|
|
||
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.
Based on the example, it seems like it's more global based with * vs an envoy string matcher type of API. Does it only match whole components of a SPIFFE URI? Can you do, eg "fo*-bar"?
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.
The matching semantics are clearly documented above. The trustdomains field supports the same pattern matching as all other string fields in the rule (suffix, prefix, exact or presence).
So no, you cannot do
fo*-bar. But that's something to keep in mind to validate in the impl.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.
Ack, thanks for the pointer