pkg/safeguards/lib/manifests/v2.0.0/container-allowed-images/template.yaml [1:32]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
  name: k8sazurev2containerallowedimages
spec:
  crd:
    spec:
      names:
        kind: K8sAzureV2ContainerAllowedImages
      validation:
        # Schema for the `parameters` field
        openAPIV3Schema:
          properties:
            imageRegex:
              type: string
            excludedContainers:
              type: array
              items:
                type: string
  targets:
    - target: admission.k8s.gatekeeper.sh
      rego: |
        package k8sazurev2containerallowedimages

        violation[{"msg": msg}] {
          container := input_containers[_]
          not input_container_excluded(container.name)
          not regex.match(input.parameters.imageRegex, container.image)
          msg := sprintf("Container image %v for container %v has not been allowed.", [container.image, container.name])
        }

        input_containers[c] {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



pkg/safeguards/lib/v1.0.0/container-allowed-images/template.yaml [1:32]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
  name: k8sazurev2containerallowedimages
spec:
  crd:
    spec:
      names:
        kind: K8sAzureV2ContainerAllowedImages
      validation:
        # Schema for the `parameters` field
        openAPIV3Schema:
          properties:
            imageRegex:
              type: string
            excludedContainers:
              type: array
              items:
                type: string
  targets:
    - target: admission.k8s.gatekeeper.sh
      rego: |
        package k8sazurev2containerallowedimages

        violation[{"msg": msg}] {
          container := input_containers[_]
          not input_container_excluded(container.name)
          not regex.match(input.parameters.imageRegex, container.image)
          msg := sprintf("Container image %v for container %v has not been allowed.", [container.image, container.name])
        }

        input_containers[c] {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



