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
Commits
d405de20
Verified
Commit
d405de20
authored
11 months ago
by
Alain Atemnkeng
Browse files
Options
Downloads
Patches
Plain Diff
[
PLATFORM-2185
] Configure Image Provenance admission control with Gatekeeper
parent
2ce9bfe6
1 merge request
!72
[PLATFORM-2185] Configure Image Provenance admission control with Gatekeeper
Pipeline
#839532
passed with stages
Stage:
Stage:
in 15 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Chart.yaml
+1
-1
1 addition, 1 deletion
Chart.yaml
templates/constraint_image_admission_controller.yaml
+41
-0
41 additions, 0 deletions
templates/constraint_image_admission_controller.yaml
with
42 additions
and
1 deletion
Chart.yaml
+
1
−
1
View file @
d405de20
apiVersion
:
v2
name
:
constraint-templates
version
:
1.5.
4
version
:
1.5.
5
appVersion
:
1.0.0
This diff is collapsed.
Click to expand it.
templates/constraint_image_admission_controller.yaml
0 → 100644
+
41
−
0
View file @
d405de20
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", [container.image])
}
---
apiVersion
:
constraints.gatekeeper.sh/v1beta1
kind
:
K8sImageProvenance
metadata
:
name
:
image-provenance-constraint
spec
:
enforcementAction
:
deny
match
:
kinds
:
-
apiGroups
:
[
"
"
]
kinds
:
[
"
Pod"
]
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment