fix(security): enforce CR reference authorization#500
Merged
Conversation
Signed-off-by: Roel de Cort <roel.decort@adfinis.com>
Signed-off-by: Roel de Cort <roel.decort@adfinis.com>
Signed-off-by: Roel de Cort <roel.decort@adfinis.com>
Signed-off-by: Roel de Cort <roel.decort@adfinis.com>
Contributor
|
This PR is large (over 1000 lines). Consider breaking it down into smaller PRs. |
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.
Summary
Tighten CR author authorization for references and delegated dangerous controls.
This change makes
OpenBaoClusterandOpenBaoRestoreadmission validate that the applying identity is authorized for referenced Kubernetes objects, cloud identity metadata, restore targets, custom executables, and Hardened image verification trust roots.Key changes:
usecloudidentitiesauthorization for main workload, backup, and restore workload identity metadata.restoreauthorization for destructiveOpenBaoRestoretarget selection.usehelperimagesas a compatibility alias while documentingusecustomexecutablesas the preferred verb.Related Issues
N/A
Type of Change
Risk and Compatibility
This intentionally tightens admission and RBAC behavior.
Existing clusters or GitOps pipelines that manage CRs with referenced objects or delegated controls may need additional RBAC before future creates or updates succeed. This includes manifests using custom ServiceAccounts, image pull Secrets, existing PVCs, Gateways, IngressClasses, StorageClasses, ServiceMonitor TLS references, backup/restore credential Secrets, workload identity metadata, custom executables, custom Hardened trust roots, or restore targets.
The admission checks run while the field is present, not only when the field changes. GitOps identities therefore need the relevant grants for unrelated future updates too.
usehelperimagesremains accepted as a compatibility alias for custom executable authorization.Verification
make test-cimake docs-buildgo test ./hack/helmchartTestVAP_OpenBaoCluster_RequiresReferenceUseAuthorizationTestVAP_OpenBaoCluster_RequiresCloudIdentityAuthorizationTestVAP_OpenBaoRestore_RequiresReferenceAuthorizationReviewer Notes
The main review areas are the authorization boundary and onboarding impact:
get,use,usecloudidentities,usecustomexecutables,useimagetrustroots, andrestorematches the intended trust model.spec.serviceAccount.annotationshandling is acceptable. Any ServiceAccount annotation now requiresusecloudidentities;spec.podMetadatais limited to known identity selector keys instead of all metadata.Checklist