Este conteúdo não está disponível no idioma selecionado.

Chapter 5. Attesting and validating a container image


Before Enterprise Contract can validate your signed container image, you must first create SLSA provenance and associate it with your container image. Provenance is the verifiable information about software artifacts, including where, when, and how a given software "link" in a supply chain was produced. For more information about Supply-chain Levels for Software Artifacts (SLSA) provenance, see SLSA Provenance.

Prerequisites

  • A signed container image.
  • Access to the OpenShift web console.
  • A working Red Hat Trusted Artifact Signer installation running on OpenShift version 4.13 or later.
  • A workstation with the cosign and oc binary files installed.

Procedure

  1. Create a SLSA provenance predicate.json file; for example:

    echo '{
     "builder": {
       "id": "https://localhost/dummy-id"
     },
     "buildType": "https://localhost/dummy-type",
     "invocation": {},
     "buildConfig": {},
     "metadata": {
       "buildStartedOn": "2023-09-25T16:26:44Z",
       "buildFinishedOn": "2023-09-25T16:28:59Z",
       "completeness": {
         "parameters": false,
         "environment": false,
         "materials": false
       },
       "reproducible": false
     },
     "materials": []
    }
    ' > predicate.json
  2. Sign and attest the predicate.json file you just created; for example:

    cosign attest -y --fulcio-url=$FULCIO_URL \
       --rekor-url=$REKOR_URL \
       --oidc-issuer=$OIDC_ISSUER_URL \
       --predicate predicate.json \
       --type slsaprovenance $IMAGE

    Keycloak opens to automatically authenticate you based on your login when you signed your container image.

  3. Verify the signature and attestation with Enterprise Contract, for example:

    ec validate image --image $IMAGE \
       --certificate-identity-regexp '.*' \
       --certificate-oidc-issuer-regexp '.*' \
       --output yaml --show-successes
Important

Be as specific as possible when you run the ec validate image command so that each signature matches the expected identity.

Verification

  • When Enterprise Contract has validated your container image, a detailed report of all Enterprise Contract verifications and signatures opens.
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2026 Red Hat
Voltar ao topo