# Copyright 2022 The Sigstore Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-image-policies
  namespace: cosign-system
  labels:
    cosigned.sigstore.dev/release: devel

data:
  _example: |
    ################################
    #                              #
    #    EXAMPLE CONFIGURATION     #
    #                              #
    ################################
    cluster-image-policy-0: |
      images:
      - glob: rando
      authorities:
      - key:
          data: inlinedata here
      - key:
          kms: whatevs
    cluster-image-policy-1: |
      images:
      - glob: randomstuff*
      authorities:
      - key:
          data: otherinline here
    cluster-image-policy-2: |
      images:
      - glob: rando3
      authorities:
      - keyless:
          ca-cert:
            data: cacert chilling here
          url: http://keylessurl.here
          identities:
          - issuer: issuer
            subject: subject
    cluster-image-policy-3: |
      images:
      - glob: inlinecert
      authorities:
      - key:
          data: |-
            -----BEGIN PUBLIC KEY-----
            MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExB6+H6054/W1SJgs5JR6AJr6J35J
            RCTfQ5s1kD+hGMSE1rH7s46hmXEeyhnlRnaGF8eMU/SBJE/2NKPnxE7WzQ==
            -----END PUBLIC KEY-----
    cluster-image-policy-json: "{\"images\":[{\"glob\":\"ghcr.io/example/*\",\"regex\":\"\"}],\"authorities\":[{\"key\":{\"data\":\"-----BEGIN PUBLIC KEY-----\\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAExB6+H6054/W1SJgs5JR6AJr6J35J\\nRCTfQ5s1kD+hGMSE1rH7s46hmXEeyhnlRnaGF8eMU/SBJE/2NKPnxE7WzQ==\\n-----END PUBLIC KEY-----\"}}]}"

