이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 3. Verifying signed artifacts in an offline environment


In some cases, you need to verify an artifact’s authenticity, but do not have access to the Red Hat Trusted Artifact Signer (RHTAS) service that signed that artifact. In these cases, you can still verify an artifact’s signature by doing an offline verification.

Before you can start doing offline artifact verification, you need access to the RHTAS signing environment, and access to an image registry. In the offline environment, you only need access to the same image registry as the signing environment.

Prerequisites

  • Installation of RHTAS running either on the Red Hat OpenShift Container Platform, or on Red Hat Enterprise Linux (RHEL) managed by Ansible.
  • A workstation with the cosign, tuftool, tar, and sha256sum binaries installed.
  • Initialization of cosign with the current signing environment.

Procedure

  1. In the signing environment, do the following steps:

    1. Sign an image by using cosign:

      cosign sign IMAGE_NAME:TAG
      Copy to Clipboard Toggle word wrap
      $ cosign sign -y ttl.sh/rhtas/example-image:1h
      Copy to Clipboard Toggle word wrap
    2. Get the Trust Root URL.

      1. For RHTAS deployments on Red Hat Enterprise Linux:

        $ export BASE_HOSTNAME=BASE_HOSTNAME_OF_RHTAS_SERVICE
        $ export TUF_SERVER_URL=https://tuf.${BASE_HOSTNAME}
        Copy to Clipboard Toggle word wrap
      2. For RHTAS deployments on Red Hat OpenShift Container Platform:

        $ export TUF_SERVER_URL="$(oc get tuf -o jsonpath='{.items[0].status.url}' -n trusted-artifact-signer)"
        Copy to Clipboard Toggle word wrap
    3. Create a clone of the Trust Root locally:

      $ export TUF_REPOSITORY="${HOME}/repository"
      $ tuftool clone --allow-root-download --metadata-dir "${TUF_REPOSITORY}" --targets-dir "${TUF_REPOSITORY}/targets" --metadata-url "${TUF_SERVER_URL}" --targets-url "${TUF_SERVER_URL}/targets"
      Copy to Clipboard Toggle word wrap
    4. Create a compressed archive file of the Trust Root:

      $ tar -czvf repository.tar.gz "${TUF_REPOSITORY}"
      $ sha256sum repository.tar.gz
      Copy to Clipboard Toggle word wrap

      Make note of the checksum output for use later in the offline environment.

    5. Copy the compressed archive file to the offline environment.

      Important

      You must copy the Trust Root compressed archive file every time you update The Update Framework (TUF) metadata files or when you rotate any RHTAS component keys and certificates.

  2. In the offline environment, do the following steps:

    1. Change directory to where you copied the compressed archive file of the Trust Root.
    2. Verify the checksum by using the checksum value from the signing environment:

      $ echo "SHA256_CHECKSUM repository.tar.gz" > checksum.txt
      $ sha256sum --check checksum.txt || echo "Archive integrity compromised, don't continue with the procedure\!"
      Copy to Clipboard Toggle word wrap
      Important

      Only continue if the integrity check is successful.

    3. Expand the compressed archive file:

      $ tar -xzvf repository.tar.gz
      Copy to Clipboard Toggle word wrap
  3. Initialize cosign:

    $ cd repository/
    $ cosign initialize --mirror=file://$(pwd)/ --root=$(pwd)/1.root.json
    Copy to Clipboard Toggle word wrap
  4. Verify the signed artifacts:

    $ export IMAGE="IMAGE_NAME:TAG"
    $ export SIGNING_EMAIL_ADDR=SIGNING_EMAIL_ADDRESS
    $ export SIGNING_OIDC_ISSUER=OIDC_ISSUER_URL
    $ cosign verify --certificate-identity="${SIGNING_EMAIL_ADDR}" --certificate-oidc-issuer="${SIGNING_OIDC_ISSUER}" "${IMAGE}"
    Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat