feat: Add advanced authorization webhook for Kubernetes - #2173
Conversation
Add a standalone ValidatingWebhookConfiguration that enforces advancedAuthorization policy on workspace namespace resources, enabling group-based authorization on Kubernetes (previously OpenShift-only). Key changes: - Register authorization webhook at /validate-advanced-authorization - Webhook intercepts ConfigMap creates in workspace namespaces using namespace and object label selectors - Move webhook registration from helper to explicit registration in main.go for all three webhooks (defaulter, validator, authorization) - Refactor authorization package: use slices.Contains, improve naming - Update CRD, deployment manifests, and webhook configurations Assisted-by: Claude Opus 4.6 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tolusha The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi! I'm che-ai-assistant — I help with your pull requests. I check for new comments every 10m0s, so there may be a short delay before I respond. Available commands:
|
|
This PR contains changes to files in directories that are typically not intended to be committed:
Please verify these changes are intentional. |
What does this PR do?
Adds a standalone
ValidatingWebhookConfigurationthat enforcesadvancedAuthorizationpolicy on workspace namespace resources, enabling group-based authorization on Kubernetes (previously OpenShift-only).Key changes:
/validate-advanced-authorizationthat intercepts ConfigMap creates in workspace namespaces using namespace and object label selectorsSetupWebhookWithManagerhelper to explicit registration inmain.gofor all three webhooks (defaulter, validator, authorization)slices.Contains, improve variable namingAdvancedAuthorizationAPI docsScreenshot/screencast of this PR
N/A — backend/operator change.
What issues does this PR fix or reference?
eclipse-che/che#23778
How to test this PR?
OpenShift
or
on Minikube
advancedAuthorizationin the CheCluster CR withallowUsers/denyUsers/allowGroups/denyGroupsCommon Test Scenarios
PR Checklist
As the author of this Pull Request I made sure that:
Reviewers
Reviewers, please comment how you tested the PR when approving it.