Skip to main content

Supply Chain Verification

Entigo Platform is delivered as OCI artifacts: the Infralib agent image, the Infralib release with its OpenTofu modules and Helm charts, and the container images those charts run. Supply chain verification answers one question about all of them: is the thing about to run exactly what Entigo released?

Two mechanisms answer it together. A sha256 digest identifies content. A cosign signature identifies who published it.

Digests: the same bytes every time​

An OCI registry stores every artifact under the sha256 checksum of its content, the digest.

Pulling by digest has three consequences:

  • The content cannot be replaced. The client computes the checksum of what it received and rejects anything that does not match.
  • Mirrors and proxies do not have to be trusted. A copy in another registry has the same digest, so a pull-through cache or a private mirror can only serve the original bytes.
  • What was tested is what runs. A digest recorded when a release was tested still names that content years later.

For a multi-arch image the digest is that of the image index, which lists the digest of each platform's image. One digest therefore covers every architecture.

A digest does not say who made the content. Anyone can compute a digest for anything. A digest is only as trustworthy as the place you got it from, and this is where signatures come in.

Signatures: who published it​

Cosign signs an artifact's digest and stores the signature next to the artifact in the registry. Entigo uses keyless signing, so there is no long-lived private key that could leak and no public key to distribute:

  1. The release workflow in GitHub Actions proves its identity to the Sigstore certificate authority with a token issued by GitHub.
  2. The certificate authority issues a certificate that is valid for a few minutes and names that workflow: the repository, the workflow file and the branch.
  3. The workflow signs the artifact's digest, and the signature is recorded in a public transparency log.

Verifying a signature checks that a signature exists for this exact digest, that it was made with a certificate issued to the expected workflow, and that it was logged. The expected identity is the part the verifier has to know in advance. A signature from another repository or another workflow is a valid signature, but it does not pass.

The chain of trust​

Signing and checking every artifact separately is not needed. A signed artifact can list the digests of other artifacts, and those can contain the digests of the next ones. Verifying one signature at the top then covers everything below it, because no link can be changed without changing a digest above it.

signature ──▶ artifact A
└─ lists the digest of ──▶ artifact B
└─ lists the digest of ──▶ artifact C

Entigo publishes its releases in this form:

ArtifactHow it is secured
Infralib agent imageSigned with cosign by the agent's release workflow.
Infralib release indexSigned with cosign by the release workflow of the repository the release comes from.
OpenTofu modules and Helm chartsTheir digests are listed in the release index.
Base images that run the pipeline stepsTheir digests are listed in the release index. They are also signed, for people who use the images directly.
Container images and Crossplane packages that run in the clusterTheir digests are listed in a values-images.yaml file inside each Helm chart.

So there are two signatures to check, the agent image and the release index, and everything else is reached through digests. The Infralib agent checks the second one itself.

Configuration​

Use an OCI source and set both options on it:

sources:
- url: oci://public.ecr.aws/entigolabs/entigo-infralib-release
verify_signature: true
use_oci_digests: true
  • verify_signature makes the agent verify the cosign signature of the release index before it uses the release. A failed verification stops the run.
  • use_oci_digests makes the agent reference modules and base images by the sha256 digests from the index instead of by version tags.

verify_signature: true turns use_oci_digests on as well, because a verified index is of little use when its digests are ignored. Setting both keeps the intent visible in the config.

Both options are off by default. Without them the agent resolves version tags in the registry and trusts what the registry returns.

The chain step by step​

you ──verify──▶ agent image (signed)
└─ agent ──verifies──▶ release index (signed)
├─ digest ──▶ OpenTofu modules
│ └─ vendored community modules
├─ digest ──▶ base images of the pipeline steps
└─ digest ──▶ Helm charts
└─ values-images.yaml
└─ digest ──▶ container images and Crossplane packages

1. The agent image​

The agent is the root of the chain: it contains the verification code and the identity a release must be signed with. Nothing can check the agent for you, so this step is yours.

Every agent release is signed with cosign by the release workflow of the agent repository, and the release notes list the image digest. Verify the digest with cosign in the registry you pull the agent from.

Amazon ECR Public:

cosign verify --certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp '^https://github\.com/entigolabs/entigo-infralib-agent/' \
public.ecr.aws/entigolabs/entigo-infralib-agent@sha256:<digest>

Docker Hub:

cosign verify --certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp '^https://github\.com/entigolabs/entigo-infralib-agent/' \
entigolabs/entigo-infralib-agent@sha256:<digest>

The command exits non-zero when there is no valid signature. Then run the agent by that digest, not by a tag:

# Amazon ECR Public
docker run -it --rm ... public.ecr.aws/entigolabs/entigo-infralib-agent@sha256:<digest>

# Docker Hub
docker run -it --rm ... entigolabs/entigo-infralib-agent@sha256:<digest>

The image is multi-arch and has the same digest in both registries, and it is signed in each of them.

2. The release index​

Every Infralib release has an index, an OCI artifact at <source>/index:<version>. It contains a manifest.json that lists every module and base image of the release with its sha256 digest in each registry.

With verify_signature: true the agent resolves the release to the digest of its index, verifies the cosign signature on that digest, and only then reads the manifest. The signature must come from the Release workflow, on the main branch, of the GitHub repository the source is released from. The agent derives that repository from the source URL:

SourceMust be signed by the Release workflow of
<registry>/<org>/<name>-releasegithub.com/<org>/<name> or github.com/<org>/<name>-source
<registry>/<org>/<name>github.com/<org>/<name>

For oci://public.ecr.aws/entigolabs/entigo-infralib-release that is github.com/entigolabs/entigo-infralib. An index signed by any other repository, workflow or branch is rejected, also when the signature itself is valid.

Because these rules are part of the agent, a verified agent image is what makes the index check trustworthy. This is why the index needs no separate check by you.

3. Modules and base images​

With use_oci_digests: true the agent takes the digests from the verified manifest and writes them into what it generates:

  • OpenTofu modules are referenced by digest in the generated code.
  • Helm charts become ArgoCD Applications with an oci:// source and a <version>@sha256:<digest> revision. The Infralib version is shown in the Application's info in the ArgoCD UI.
  • Base images, the images that run the plan and apply steps of the pipelines, are referenced as <version>@sha256:<digest>. This applies to releases from v1.25.7 on, and only when base_image_version is not set.

OpenTofu, ArgoCD and the pipeline service each check the digest when they pull. Changed content in a registry, a proxy or a mirror fails the pull instead of being deployed.

4. Community OpenTofu modules​

Several Infralib modules build on community OpenTofu modules, for example the EKS and VPC modules of terraform-aws-modules. Normally OpenTofu downloads such a module from the module registry or from GitHub at init, outside of everything described above: nothing in the release would say what that download has to contain.

Infralib modules therefore carry the community modules they call inside the module itself, the same way a Helm chart carries its dependencies:

Helm chartInfralib OpenTofu module
Wanted dependencies and versionsChart.yamlvendor.yaml
What they resolved toChart.lockvendor.lock: repository, commit and sha256 checksum
The dependencies themselvescharts/vendors/

A dependency of a vendored module is vendored next to it, so nothing is left to download.

The vendored copies are part of the module artifact, and the artifact is fetched by a digest from the verified index. A community module can therefore not be changed between the release and your pipeline: not in the module registry, not in its GitHub repository and not on the way. What your pipeline runs is the code the release was tested with. vendor.lock records the upstream commit and checksum of each copy, so the origin of the code stays traceable, and the Infralib tests fail when a copy no longer matches its lock entry.

OpenTofu providers are not vendored yet. OpenTofu downloads them at init. We are working on bringing them into the chain as well.

5. Container images in the cluster​

Every Helm chart of an Infralib release contains a values-images.yaml file with the sha256 digests of the container images and Crossplane packages the chart deploys:

image:
tag: "1.4.2@sha256:9f2c…"

The agent adds this file to the value files of each ArgoCD Application, so pods and Crossplane packages are pulled by digest. The file is part of the chart, and the chart was fetched by a digest from the verified index. The image digests are therefore covered by the same signature and need no check of their own.

Your own module inputs still win over values-images.yaml. If you override an image or its version in the inputs, your value is used as you wrote it. Include the digest in your value to keep that image pinned.

What is not covered​

  • It proves origin and integrity, not quality. A verified artifact is the one Entigo released. Whether a release is safe to run is the job of the tests every release passes and of vulnerability scanning.
  • Third-party images are pinned as they were when the release was tested. Their digests are recorded by Entigo at that point. Verification shows that an image has not changed since then, not what its upstream publisher did before.
  • Anything referenced by tag is outside the chain. If you override a version with a plain tag, that artifact is resolved by the registry at pull time.
  • Git and local sources. Only OCI sources have an index to verify. For other sources verify_signature is skipped with a warning, as it is for an OCI source without an <org>/<name> path.
  • Sources that are not released through the Entigo release workflow. The signer is found by the naming convention above. A mirror keeps working as long as the last two path segments stay <org>/<name>.
  • base_image_version and a custom base_image_source. A configured base image version is used as written. A custom base image source gets a digest only when the release manifest lists that repository; otherwise the agent warns and uses the tag.
  • The agent image of the pipelines. The agent jobs that the agent creates in your cloud account reference the agent image by the tag in agent_version, latest by default. Set agent_version to the version you verified. The reference is still a tag, so this link relies on the registry. We are working on referencing this image by digest too.
  • OpenTofu providers. They are downloaded by OpenTofu at init and are not pinned by the release yet. We are working on it.
  • Releases older than the signature. An index that was not signed by the release workflow fails verification. Use a newer release or turn verify_signature off for that source.

Air-gapped environments​

Verification needs the Sigstore trusted root, which the agent downloads by default. Without internet access, pass it as a file with the --offline-trust-bundle flag or the OFFLINE_TRUST_BUNDLE environment variable. The signatures are stored in the registry next to the index, so copy them along with the index when you mirror a release.

Verifying a release by hand​

You do not need to do this when the agent verifies the release, but the same check works with cosign:

cosign verify --certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp '^https://github\.com/entigolabs/entigo-infralib-test/\.github/workflows/module-release\.yaml@refs/' \
--certificate-github-workflow-repository entigolabs/entigo-infralib \
public.ecr.aws/entigolabs/entigo-infralib-release/index:1.25.7

The identity names the shared release workflow that signs every release, and the repository option names the repository that called it. OCI version tags have no leading v.