feat: add secure-enclave EIF build and GHCR carrier image workflow#9
Conversation
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 |
There was a problem hiding this comment.
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:
- An attacker compromises the
docker/metadata-actionrepository or tricks maintainers into merging malicious code. - They push a new commit and update the
v5tag to point to their compromised version (tags in Git are mutable by default). - Your workflow runs and pulls
docker/metadata-action@v5, which now fetches the attacker's malicious code instead of the original. - 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. - 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
- Replace the version tag in the
usesline with the full 40-character commit SHA fordocker/metadata-actioninstead of@v5. - Keep the current major version visible in a comment so the workflow stays readable, for example:
uses: docker/metadata-action@<full-commit-sha> # v5. - Get the correct SHA from the
docker/metadata-actionrepository release or tag that corresponds tov5, 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.
|
Semgrep found 9
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. |
Summary
This PR adds the Nitro enclave EIF build for
secure-enclaveand publishes a carrier image.Follows the enclave pattern used for the
world-chainproof system: workload image → EIF + PCRs → carrier image.