...

Text file src/github.com/sigstore/cosign/v2/doc/cosign_verify.md

Documentation: github.com/sigstore/cosign/v2/doc

     1## cosign verify
     2
     3Verify a signature on the supplied container image
     4
     5### Synopsis
     6
     7Verify signature and annotations on an image by checking the claims
     8against the transparency log.
     9
    10```
    11cosign verify [flags]
    12```
    13
    14### Examples
    15
    16```
    17  cosign verify --key <key path>|<key url>|<kms uri> <image uri> [<image uri> ...]
    18
    19  # verify cosign claims and signing certificates on the image with the transparency log
    20  cosign verify <IMAGE>
    21
    22  # verify multiple images
    23  cosign verify <IMAGE_1> <IMAGE_2> ...
    24
    25  # additionally verify specified annotations
    26  cosign verify -a key1=val1 -a key2=val2 <IMAGE>
    27
    28  # verify image with an on-disk public key
    29  cosign verify --key cosign.pub <IMAGE>
    30
    31  # verify image with an on-disk public key, manually specifying the
    32  # signature digest algorithm
    33  cosign verify --key cosign.pub --signature-digest-algorithm sha512 <IMAGE>
    34
    35  # verify image with an on-disk signed image from 'cosign save'
    36  cosign verify --key cosign.pub --local-image <PATH>
    37
    38  # verify image with local certificate and certificate chain
    39  cosign verify --cert cosign.crt --cert-chain chain.crt <IMAGE>
    40
    41  # verify image using keyless verification with the given certificate
    42  # chain and identity parameters, without Fulcio roots (for BYO PKI):
    43  cosign verify --cert-chain chain.crt --certificate-oidc-issuer https://issuer.example.com --certificate-identity foo@example.com <IMAGE>
    44
    45  # verify image with public key provided by URL
    46  cosign verify --key https://host.for/[FILE] <IMAGE>
    47
    48  # verify image with a key stored in an environment variable
    49  cosign verify --key env://[ENV_VAR] <IMAGE>
    50
    51  # verify image with public key stored in Google Cloud KMS
    52  cosign verify --key gcpkms://projects/[PROJECT]/locations/global/keyRings/[KEYRING]/cryptoKeys/[KEY] <IMAGE>
    53
    54  # verify image with public key stored in Hashicorp Vault
    55  cosign verify --key hashivault://[KEY] <IMAGE>
    56
    57  # verify image with public key stored in a Kubernetes secret
    58  cosign verify --key k8s://[NAMESPACE]/[KEY] <IMAGE>
    59
    60  # verify image with public key stored in GitLab with project name
    61  cosign verify --key gitlab://[OWNER]/[PROJECT_NAME] <IMAGE>
    62
    63  # verify image with public key stored in GitLab with project id
    64  cosign verify --key gitlab://[PROJECT_ID] <IMAGE>
    65```
    66
    67### Options
    68
    69```
    70      --allow-http-registry                                                                      whether to allow using HTTP protocol while connecting to registries. Don't use this for anything but testing
    71      --allow-insecure-registry                                                                  whether to allow insecure connections to registries (e.g., with expired or self-signed TLS certificates). Don't use this for anything but testing
    72  -a, --annotations strings                                                                      extra key=value pairs to sign
    73      --attachment string                                                                        DEPRECATED, related image attachment to verify (sbom), default none
    74      --attachment-tag-prefix [AttachmentTagPrefix]sha256-[TargetImageDigest].[AttachmentName]   optional custom prefix to use for attached image tags. Attachment images are tagged as: [AttachmentTagPrefix]sha256-[TargetImageDigest].[AttachmentName]
    75      --certificate string                                                                       path to the public certificate. The certificate will be verified against the Fulcio roots if the --certificate-chain option is not passed.
    76      --certificate-chain string                                                                 path to a list of CA certificates in PEM format which will be needed when building the certificate chain for the signing certificate. Must start with the parent intermediate CA certificate of the signing certificate and end with the root certificate
    77      --certificate-github-workflow-name string                                                  contains the workflow claim from the GitHub OIDC Identity token that contains the name of the executed workflow.
    78      --certificate-github-workflow-ref string                                                   contains the ref claim from the GitHub OIDC Identity token that contains the git ref that the workflow run was based upon.
    79      --certificate-github-workflow-repository string                                            contains the repository claim from the GitHub OIDC Identity token that contains the repository that the workflow run was based upon
    80      --certificate-github-workflow-sha string                                                   contains the sha claim from the GitHub OIDC Identity token that contains the commit SHA that the workflow run was based upon.
    81      --certificate-github-workflow-trigger string                                               contains the event_name claim from the GitHub OIDC Identity token that contains the name of the event that triggered the workflow run
    82      --certificate-identity string                                                              The identity expected in a valid Fulcio certificate. Valid values include email address, DNS names, IP addresses, and URIs. Either --certificate-identity or --certificate-identity-regexp must be set for keyless flows.
    83      --certificate-identity-regexp string                                                       A regular expression alternative to --certificate-identity. Accepts the Go regular expression syntax described at https://golang.org/s/re2syntax. Either --certificate-identity or --certificate-identity-regexp must be set for keyless flows.
    84      --certificate-oidc-issuer string                                                           The OIDC issuer expected in a valid Fulcio certificate, e.g. https://token.actions.githubusercontent.com or https://oauth2.sigstore.dev/auth. Either --certificate-oidc-issuer or --certificate-oidc-issuer-regexp must be set for keyless flows.
    85      --certificate-oidc-issuer-regexp string                                                    A regular expression alternative to --certificate-oidc-issuer. Accepts the Go regular expression syntax described at https://golang.org/s/re2syntax. Either --certificate-oidc-issuer or --certificate-oidc-issuer-regexp must be set for keyless flows.
    86      --check-claims                                                                             whether to check the claims found (default true)
    87      --experimental-oci11                                                                       set to true to enable experimental OCI 1.1 behaviour
    88  -h, --help                                                                                     help for verify
    89      --insecure-ignore-sct                                                                      when set, verification will not check that a certificate contains an embedded SCT, a proof of inclusion in a certificate transparency log
    90      --insecure-ignore-tlog                                                                     ignore transparency log verification, to be used when an artifact signature has not been uploaded to the transparency log. Artifacts cannot be publicly verified when not included in a log
    91      --k8s-keychain                                                                             whether to use the kubernetes keychain instead of the default keychain (supports workload identity).
    92      --key string                                                                               path to the public key file, KMS URI or Kubernetes Secret
    93      --local-image                                                                              whether the specified image is a path to an image saved locally via 'cosign save'
    94      --max-workers int                                                                          the amount of maximum workers for parallel executions (default 10)
    95      --offline                                                                                  only allow offline verification
    96  -o, --output string                                                                            output format for the signing image information (json|text) (default "json")
    97      --payload string                                                                           payload path or remote URL
    98      --private-infrastructure                                                                   skip transparency log verification when verifying artifacts in a privately deployed infrastructure
    99      --registry-password string                                                                 registry basic auth password
   100      --registry-token string                                                                    registry bearer auth token
   101      --registry-username string                                                                 registry basic auth username
   102      --rekor-url string                                                                         address of rekor STL server (default "https://rekor.sigstore.dev")
   103      --sct string                                                                               path to a detached Signed Certificate Timestamp, formatted as a RFC6962 AddChainResponse struct. If a certificate contains an SCT, verification will check both the detached and embedded SCTs.
   104      --signature string                                                                         signature content or path or remote URL
   105      --signature-digest-algorithm string                                                        digest algorithm to use when processing a signature (sha224|sha256|sha384|sha512) (default "sha256")
   106      --sk                                                                                       whether to use a hardware security key
   107      --slot string                                                                              security key slot to use for generated key (default: signature) (authentication|signature|card-authentication|key-management)
   108      --timestamp-certificate-chain string                                                       path to PEM-encoded certificate chain file for the RFC3161 timestamp authority. Must contain the root CA certificate. Optionally may contain intermediate CA certificates, and may contain the leaf TSA certificate if not present in the timestamp
   109```
   110
   111### Options inherited from parent commands
   112
   113```
   114      --output-file string   log output to a file
   115  -t, --timeout duration     timeout for commands (default 3m0s)
   116  -d, --verbose              log debug output
   117```
   118
   119### SEE ALSO
   120
   121* [cosign](cosign.md)	 - A tool for Container Signing, Verification and Storage in an OCI registry.
   122

View as plain text