Repository navigation
Epic 18 - #417
Merged
Merged
Epic 18#417
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
… runs - Add pre-test cleanup of orphaned secret engines, auth engines, and policies left by previous integration test runs - Split integration tests into unit-tagged and controller packages with separate coverage profiles, then merge into cover.out - Adjust timeouts (10m for unit-tagged, 30m for controller integration) Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Create shared VAP infrastructure in config/vap/ with two policies: - vco-immutable-path: CEL-based path immutability for 72 CRDs - vco-immutable-name: CEL-based name immutability for 65 CRDs Remove migrated Go validation (spec.path and spec.name checks) from 92 webhook ValidateUpdate methods. Configure envtest with VAP admission plugin and add enforcement smoke tests. Fixes 4 CRDs previously missing path immutability checks: AzureAuthEngineRole, GCPAuthEngineRole, JWTOIDCAuthEngineRole, LDAPAuthEngineGroup. Target-namespace-guard VAP deferred to follow-up plan. Story: 18.1 rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Split from Story 18.1 during implementation. Creates the parameterized vco-target-namespace-guard VAP (92 CRDs) with CleansePath/JoinNamespace CEL logic, vco-vap-params ConfigMap, and removes ValidateTargetNamespaceUpdate from all 91 webhook files. Must complete before Story 18.3. rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
- Create parameterized vco-target-namespace-guard VAP with CEL CleansePath/JoinNamespace logic and vco-vap-params ConfigMap - Add kustomize namespace replacement for binding paramRef - Add 8 envtest VAP enforcement tests covering all edge cases - Remove ValidateTargetNamespaceUpdate from 91 webhook files - Remove ValidateTargetNamespaceUpdate and displayNamespace from commons.go - Clean up associated test files - Fix Makefile: use helm upgrade -i for idempotent helmchart-test - Configure bmad-build: no auto-commit, grok 4.7 for reviews Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Add 30 ValidatingAdmissionPolicies + 30 bindings covering: - Shared credential-source mutual-exclusivity (root + bind) - Per-CRD validations: immutability, conditional fields, one-way flags - CRD-specific rules for Transit, TOTP, AWS role, RandomSecret, mounts Story 18.2: Credential Source + CRD-Specific VAPs Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
…ter-only Story 18.3: Webhook code removal and residual webhook cleanup. - Delete 68 webhook files with no-op Default() and VAP-covered validation - Gut 7 webhook files to defaulter-only (CF, K8s, GCP, Okta, SSH, Terraform, Radius auth/secret engine configs) - Retain 24 webhook files: 1 Cat-A (AWSAuthEngineClientConfig), 15 Cat-C (uncovered CRD-specific validation), 7 Cat-B (defaulter-only), 1 Cat-E (RabbitMQ raw handler) - Remove 68 SetupWebhookWithManager calls from cmd/main.go (91→23) - Trim webhook_validate_update_test.go and webhook_suite_test.go - Delete orphaned namespace_webhook_test.go and transitsecretenginekey_webhook_test.go - Bump minKubeVersion 1.29.0→1.30.0, OCP annotation v4.16→v4.17 - Regenerate config/webhook/manifests.yaml and CRD bases 90 files changed, ~224 insertions, ~9563 deletions Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Add comprehensive test coverage for all ValidatingAdmissionPolicy rules in both envtest (unit tier) and Kind (integration tier). envtest tests (api/v1alpha1/vap_test.go — 90 specs): - Immutable-path rejection for 15 CRDs (incl. 4 gap CRDs) - Immutable-name rejection for 15 CRDs (incl. 12 gap CRDs) - Target-namespace-guard rejection and allowance - Credential source mutual-exclusivity (create + update) - CRD-specific VAP enforcement (9 types, 20+ cases) - Positive allowance tests for all shared VAPs Kind integration tests (internal/controller/vap_integration_test.go): - VAP manifest deployment verification - Immutable-path enforcement with Eventually retry - CRD-specific enforcement (TransitSecretEngineKey) VAP manifest fixes — add has() guards for omitempty fields: - vco-validate-totpsecretenginekey: generate, keySize - vco-validate-randomsecret: isKVSecretsEngineV2 - vco-validate-authenginemount: type, description - vco-validate-secretenginemount: type, description, local, sealWrap, externalEntropyAccess - vco-validate-transitsecretenginekey: convergentEncryption, derived, type, keySize, exportable, allowPlaintextBackup Existing webhook tests stripped to retain only residual Go webhook validation (AppRoleAuthEngineRole localSecretIDs, LDAPSecretEngineStaticRole username/dn). Story: 18.4 Epic: 18 (Webhook-to-VAP Migration) Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Contributor
|
@raffaelespazzoli can you review the test failures? |
Wait for VAP enforcement in BeforeSuite so randomized Ginkgo specs cannot race policy compile, and load helmchart images via archive without BuildKit attestations. Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Docker on GHA saves busybox:1.37 as a multi-arch index; kind import --all-platforms then fails on the arm32v5 digest. Force linux/$arch pull. Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Docker's containerd store keeps the multi-arch index after --platform pull, so save+kind --all-platforms still misses arm32v5. Rebuild locally and import via ctr without --all-platforms. Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
Collaborator
Author
|
cc @sabre1041 |
…x target-namespace-guard params - vco-validate-randomsecret: check (spec.path + "/") for a "/data/" segment, matching the webhook semantics (GetPath() = path + "/" + name). A KVv2 RandomSecret with spec.path "secret/data" was valid before the VAP migration and is now rejected on CREATE and on every UPDATE. - vco-immutable-path: spec.path is optional on several CRDs; guard it with has() like vco-immutable-name does. - vco-target-namespace-guard: drop vaultsecrets (no spec.authentication, never covered by the former Go check) and guard spec.authentication. - kustomize: keep the binding paramRef name/namespace in sync with the vco-vap-params ConfigMap (namePrefix in config/default, release namespace in config/helmchart). Without this the parameter is never found and the policy is silently skipped. - envtest: cover the three cases. Fixes redhat-cop#419 Signed-off-by: Sebastien DAVOS <349436848+sebastiendavos@users.noreply.github.com>
Resolve Makefile conflict by keeping epic-18's single-platform ctr import for helmchart-test and accepting main's CONTAINER_BUILD_OPTS alongside DOCKER_BUILD_EXTRA_ARGS. Includes VAP fixes for redhat-cop#419/redhat-cop#422. Co-authored-by: Cursor <cursoragent@cursor.com> rh-pre-commit.version: 2.4.0 rh-pre-commit.check-secrets: ENABLED
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.
remove most of the admission webhook in favor of more lightweight VAPs.