fix(authz): remove list interception from authz webhook #1980
Open
Zaggy21 wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the authz webhook to stop intercepting Kubernetes list requests (which the webhook cannot meaningfully authorize with its “fetch-by-name then check owned-by label” approach) and updates the denial messaging/tests accordingly.
Changes:
- Removed
listfrom webhook CEL matchConditions in the dev-env AuthorizationConfiguration manifests. - Updated the webhook denial reason when
ResourceAttributesare missing / have no name to mention collection operations and recommend RBAC. - Updated the corresponding unit test assertion for the new denial reason text.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| dev-env/webhook/structured-authz-secure.yaml | Removes list from webhook verb matchConditions. |
| dev-env/webhook/structured-authz-insecure.yaml | Removes list from webhook verb matchConditions. |
| cmd/authz/authorization.go | Updates denial reason returned when attributes are missing or unnamed. |
| cmd/authz/authorization_test.go | Updates test expectation for the new denial reason. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
On-behalf-of: @SAP krzysztof.zagorski@sap.com Signed-off-by: Zaggy21 <k.zaggy@gmail.com>
On-behalf-of: @SAP krzysztof.zagorski@sap.com Signed-off-by: Zaggy21 <k.zaggy@gmail.com>
abhijith-darshan
requested changes
May 11, 2026
On-behalf-of: @SAP krzysztof.zagorski@sap.com Signed-off-by: Zaggy21 <k.zaggy@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR removes the
listverb from authorization webhook's match conditions and clarifies denial message for collection operations.The webhook authorizes access by fetching a specific named resource and checking its greenhouse.sap/owned-by label against the requester's support-group claims. This design is fundamentally incompatible with list operations - sending list requests to the webhook adds pointless round-trips.
What type of PR is this? (check all applicable)
Related Tickets & Documents
Added tests?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Added to documentation?
Checklist