Skip to content

feat(gatekeeper-config): add doop-dependent policies#1774

Merged
mikolajkucinski merged 2 commits into
mainfrom
feat/gatekeeper-config-doop-policies
Jul 13, 2026
Merged

feat(gatekeeper-config): add doop-dependent policies#1774
mikolajkucinski merged 2 commits into
mainfrom
feat/gatekeeper-config-doop-policies

Conversation

@mikolajkucinski

@mikolajkucinski mikolajkucinski commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Pull Request Details

Add doop-dependent policies as the final batch of the gatekeeper-config migration. All four require services shipped by the gatekeeper-doop PluginDefinition (helm-manifest-parser, doop-image-checker) and default to disabled.

Differences vs upstream:

Policy Upstream This PR
deprecated-api-version apiVersions and kubernetesVersion hardcoded in the chart. Both are Constraint parameters. helmManifestParserURL also parameterized.
oli-labels-required owner-info-on-helm-releases: enforced legacy owner-info labels via inline Rego. Renamed; validates the OLI-injected greenhouse.sap/owned-by label on Helm release Secrets (matched via owner: helm) using helm-manifest-parser. knownExceptions list for temporary exemptions.
outdated-image-bases Layer age threshold hardcoded. doopImageCheckerURL and maxAgeDays are Constraint parameters; complains when the oldest layer is older than maxAgeDays (default 365).
vulnerable-images Single constraint on Pods. Two constraints (vulnerable-images-on-pod and vulnerable-images-on-pod-owner) share one template; reporting level chosen via the reportingLevel parameter.

Breaking Changes

None.

Issues Fixed

  • Partial progress on #1420

Other Relevant Information

Depends on the gatekeeper-doop PluginDefinition (separate PR) for the required services. All four policies default to disabled so the chart can be installed safely without doop.

- add helm_release and image_check libs to _helpers.tpl
- add deprecated-api-version policy (helm_release)
- add oli-labels-required policy (helm_release)
- add outdated-image-bases policy (image_check)
- add vulnerable-images policy (image_check, with on-pod and on-pod-owner constraints)
- bump chart and PluginDefinition to 0.4.0

Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
@mikolajkucinski mikolajkucinski marked this pull request as ready for review July 1, 2026 10:27
@mikolajkucinski mikolajkucinski requested a review from a team as a code owner July 1, 2026 10:27
Copilot AI review requested due to automatic review settings July 1, 2026 10:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Completes the gatekeeper-config migration by adding four new Gatekeeper policies that depend on services shipped by the separate gatekeeper-doop PluginDefinition, with all new policies defaulting to disabled and the chart/PluginDefinition version bumped to 0.4.0.

Changes:

  • Add new ConstraintTemplates + Constraints for: deprecated API versions, OLI/owner-label enforcement, outdated base images, and vulnerable images (doop-dependent).
  • Add shared Rego libraries for calling helm-manifest-parser and doop-image-checker.
  • Expose new Helm values and PluginDefinition options for enabling/configuring these policies.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
gatekeeper-config/README.md Documents the newly added doop-dependent policies.
gatekeeper-config/plugindefinition.yaml Bumps PluginDefinition to 0.4.0 and adds options for the new policies.
gatekeeper-config/charts/Chart.yaml Bumps chart version/appVersion to 0.4.0.
gatekeeper-config/charts/values.yaml Adds values blocks for new policies and their doop service URLs/parameters.
gatekeeper-config/charts/templates/_helpers.tpl Adds shared Rego libs for helm release parsing and image header checks.
gatekeeper-config/charts/templates/constrainttemplate-deprecated-api-version.yaml Introduces the deprecated API version ConstraintTemplate using helm-manifest-parser.
gatekeeper-config/charts/templates/constraint-deprecated-api-version-k8s1-32.yaml Adds a constraint instance for k8s 1.32 API removals.
gatekeeper-config/charts/templates/constrainttemplate-oli-labels-required.yaml Introduces the OLI/owner-label ConstraintTemplate using helm-manifest-parser.
gatekeeper-config/charts/templates/constraint-oli-labels-required.yaml Adds a constraint instance for Helm release Secrets (owner=helm).
gatekeeper-config/charts/templates/constrainttemplate-outdated-image-bases.yaml Introduces the outdated base image ConstraintTemplate using doop-image-checker.
gatekeeper-config/charts/templates/constraint-outdated-image-bases.yaml Adds a constraint instance for workload kinds + Pods with maxAgeDays parameter.
gatekeeper-config/charts/templates/constrainttemplate-vulnerable-images.yaml Introduces the vulnerable images ConstraintTemplate using doop-image-checker.
gatekeeper-config/charts/templates/constraint-vulnerable-images-on-pod.yaml Adds a pod-level vulnerable images constraint instance.
gatekeeper-config/charts/templates/constraint-vulnerable-images-on-pod-owner.yaml Adds an owner-level vulnerable images constraint instance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread gatekeeper-config/charts/templates/_helpers.tpl
Comment thread gatekeeper-config/charts/templates/_helpers.tpl
- oli-labels-required: only flag genuine Helm releases via is_helm_release
  guard, so a non-Helm Secret matching the labelSelector no longer reads as
  a missing owned-by label
- outdated-image-bases: validate the createdAt header is numeric and emit an
  explicit violation when it is missing or non-numeric instead of silently
  passing
- bump chart and PluginDefinition to 0.4.1

Signed-off-by: Mikolaj Kucinski <osidu12@gmail.com>
On-behalf-of: @SAP <mikolaj.kucinski@sap.com>
@mikolajkucinski mikolajkucinski merged commit b81e0d1 into main Jul 13, 2026
9 checks passed
@mikolajkucinski mikolajkucinski deleted the feat/gatekeeper-config-doop-policies branch July 13, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants