Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Gatekeeper Policies
Manage
Activity
Members
Labels
Plan
Issues
1
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IT Common Platform
platform-support
helm-charts
Gatekeeper Policies
Merge requests
!72
[
PLATFORM-2185
] Configure Image Provenance admission control with Gatekeeper
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[
PLATFORM-2185
] Configure Image Provenance admission control with Gatekeeper
PLATFORM-2207-aatemnke2
into
master
Overview
3
Commits
7
Pipelines
14
Changes
2
Merged
Alain Atemnkeng
requested to merge
PLATFORM-2207-aatemnke2
into
master
11 months ago
Overview
3
Commits
7
Pipelines
14
Changes
2
Expand
[
PLATFORM-2185
] Configure Image Provenance admission control with Gatekeeper
0
0
Merge request reports
Compare
master
version 6
d811c0ef
10 months ago
version 5
5480721e
10 months ago
version 4
7930e42f
10 months ago
version 3
79d6e2f0
10 months ago
version 2
26e1cbbd
11 months ago
version 1
d405de20
11 months ago
master (base)
and
version 2
latest version
cf3bea00
7 commits,
10 months ago
version 6
d811c0ef
6 commits,
10 months ago
version 5
5480721e
5 commits,
10 months ago
version 4
7930e42f
4 commits,
10 months ago
version 3
79d6e2f0
3 commits,
10 months ago
version 2
26e1cbbd
2 commits,
11 months ago
version 1
d405de20
1 commit,
11 months ago
2 files
+
42
−
1
Expand all files
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
templates/constraint_image_admission_controller.yaml
0 → 100644
+
41
−
0
Options
apiVersion
:
templates.gatekeeper.sh/v1beta1
kind
:
ConstraintTemplate
metadata
:
name
:
k8simageprovenance
spec
:
crd
:
spec
:
names
:
kind
:
K8sImageProvenance
validation
:
openAPIV3Schema
:
type
:
object
properties
:
targets
:
-
target
:
admission.k8s.gatekeeper.sh
rego
:
|
package k8simageprovenance
violation[{"msg": msg}] {
input.review.object.kind == "Pod"
container := input.review.object.spec.containers[_]
not startswith(container.image, "docker.io/")
not startswith(container.image, "quay.io/")
not startswith(container.image, "public.ecr.aws/")
not startswith(container.image, "gcr.io/")
not startswith(container.image, "ghcr.io/")
not startswith(container.image, "harbor.")
not startswith(container.image, "gitlab.")
msg := sprintf("Image %v is not from an allowed repository. Please contact the platform team", [container.image])
}
---
apiVersion
:
constraints.gatekeeper.sh/v1beta1
kind
:
K8sImageProvenance
metadata
:
name
:
image-provenance-constraint
spec
:
enforcementAction
:
deny
match
:
kinds
:
-
apiGroups
:
[
"
"
]
kinds
:
[
"
Pod"
]