Skip to content

feat: add secure-enclave EIF build and GHCR carrier image workflow#9

Merged
kilianglas merged 3 commits into
mainfrom
feat/enclave-eif-image
Jul 24, 2026
Merged

feat: add secure-enclave EIF build and GHCR carrier image workflow#9
kilianglas merged 3 commits into
mainfrom
feat/enclave-eif-image

Conversation

@kilianglas

@kilianglas kilianglas commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds the Nitro enclave EIF build for secure-enclave and publishes a carrier image.

Follows the enclave pattern used for the world-chain proof system: workload image → EIF + PCRs → carrier image.

Comment thread .github/workflows/build-enclave-eif.yml Outdated
Comment thread .github/workflows/build-enclave-eif.yml Outdated
Comment thread .github/workflows/build-enclave-eif.yml Outdated
Comment thread .github/workflows/build-enclave-eif.yml Outdated

- name: Docker meta
id: meta
uses: docker/metadata-action@v5

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep identified an issue in your code:

Third-party action docker/metadata-action@v5 is referenced by mutable version tag instead of immutable commit SHA, allowing attackers who compromise the repository to inject malicious code into your workflow.

More details about this

The action docker/metadata-action@v5 is pinned to a version tag rather than a specific commit SHA. This means the tag reference (v5) can be updated or replaced at any time by the maintainers of the docker/metadata-action repository, potentially without your knowledge.

Here's a concrete attack scenario:

  1. An attacker compromises the docker/metadata-action repository or tricks maintainers into merging malicious code.
  2. They push a new commit and update the v5 tag to point to their compromised version (tags in Git are mutable by default).
  3. Your workflow runs and pulls docker/metadata-action@v5, which now fetches the attacker's malicious code instead of the original.
  4. The malicious action could extract secrets from the GitHub Actions environment (like ${{ secrets.GITHUB_TOKEN }}), steal repository data, or inject backdoors into your build artifacts.
  5. Since your workflow uses this action to tag and push images to ghcr.io/${{ github.repository }}-enclave-eif, the attacker could now push a compromised container image to your registry.

Using a full commit SHA (like @a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b) instead of the tag makes the reference immutable—the specific code that runs is locked in and cannot be changed retroactively.

To resolve this comment:

✨ Commit fix suggestion
  1. Replace the version tag in the uses line with the full 40-character commit SHA for docker/metadata-action instead of @v5.
  2. Keep the current major version visible in a comment so the workflow stays readable, for example: uses: docker/metadata-action@<full-commit-sha> # v5.
  3. Get the correct SHA from the docker/metadata-action repository release or tag that corresponds to v5, and pin exactly that commit. This makes the action reference immutable so the workflow cannot silently pick up different code later.
💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by third-party-action-not-pinned-to-commit-sha.

You can view more details about this finding in the Semgrep AppSec Platform.

Comment thread .github/workflows/build-enclave-eif.yml Outdated
@semgrep-code-worldcoin

Copy link
Copy Markdown

Semgrep found 9 github-actions-mutable-action-tag findings:

GitHub Actions step uses a mutable tag or branch reference. Tags and branch names can be silently repointed by the action owner, enabling supply-chain attacks — as seen in the trivy-action and kics-github-action compromises. Pin the reference to a full 40-character commit SHA instead, e.g. uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608.

Comment thread secure-enclave/Dockerfile
@kilianglas
kilianglas merged commit 9f323c7 into main Jul 24, 2026
13 checks passed
@kilianglas
kilianglas deleted the feat/enclave-eif-image branch July 24, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants