grafeas/kritis

Support GenericSignedAttestation

Aperta

#412 aperta il 16 ott 2019

 (8 commenti) (3 reazioni) (1 assegnatario)Go (135 fork)auto 404
enhancementhelp wanted

Metriche repository

Star
 (710 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Is your feature request related to a problem? Please describe. gcloud creates attestations using the genericSignedAttestation rather than pgpSignedAttestation (docs). Kritis doesn't seem to support these attestation as there's no mention of in the repo.

Command to create such attestation:

gcloud --project="${ATTESTOR_PROJECT_ID}" beta container binauthz attestations create
    --artifact-url="${image}" \
    --attestor="projects/${ATTESTOR_PROJECT_ID}/attestors/${ATTESTOR_ID}" \
    --signature-file="${gpg_signed_payload.pgp" \
    --pgp-key-fingerprint="${pgp_key_fingerprint}"

Which produces:

[
  {
    "attestation": {
      "attestation": {
        "genericSignedAttestation": {
          "contentType": "SIMPLE_SIGNING_JSON",
          "serializedPayload": "ewogICJjcml0aWNhbCI6IHsKICAgICJpZGVudGl0eSI6IHsKICAgICAgImRvY2tlci1yZWZlcmVuY2UiOiAiZ2NyLmlvL2dvb2dsZS1zYW1wbGVzL2hlbGxvLWFwcCIKICAgIH0sCiAgICAiaW1hZ2UiOiB7CiAgICAgICJkb2NrZXItbWFuaWZlc3QtZGlnZXN0IjogInNoYTI1NjpjNjJlYWQ1YjhjMTVjMjMxZjllNzg2MjUwYjA3OTA5ZGFmNmMyNjZkMGZjZGRkOTNmZWE4ODJlYjcyMmMzYmU0IgogICAgfSwKICAgICJ0eXBlIjogIkdvb2dsZSBjbG91ZCBiaW5hdXRoeiBjb250YWluZXIgc2lnbmF0dXJlIgogIH0KfQo=",
          "signatures": [
            {
              "publicKeyId": "redacted",
              "signature": "redacted"
            }
          ]
        }
      }
    },
    "createTime": "2019-10-16T11:39:38.639322Z",
    "kind": "ATTESTATION",
    "name": "projects/tm-ginfra-project/occurrences/20ee9b9b-3afe-4d7a-96af-37973ad91a58",
    "noteName": "projects/tm-ginfra-project/notes/build-attest-note",
    "resource": {
      "uri": "https://gcr.io/google-samples/hello-app@sha256:c62ead5b8c15c231f9e786250b07909daf6c266d0fcddd93fea882eb722c3be4"
    }
  }
]

Describe the solution you'd like Kritis should switch to supporting these attestations too. I would also suggest that attestations Kritis creates use the new format.

Describe alternatives you've considered

Additional context The protobufs are also out of date, this might need solving first

gcloud -v
Google Cloud SDK 267.0.0
alpha 2019.10.15
beta 2019.10.15
bq 2.0.49
core 2019.10.15
gsutil 4.44
kubectl 2019.10.15

Guida contributor