richardfan1126 / nitro-enclaves-eif-build-action

This GitHub Action use kaniko and Amazon Linux container with nitro-cli to build a reproducible AWS Nitro Enclaves EIF file and its information.
Apache License 2.0
6 stars 1 forks source link
aws cosign enclave enclaves nitro-enclave nitro-enclaves oras sigstore

AWS Nitro Enclaves EIF Build GitHub Action

This GitHub Action use kaniko and Amazon Linux container with nitro-cli to build a reproducible AWS Nitro Enclaves EIF file and its information.

Artifact upload and signing

This actions has an optional feature to upload the EIF file and its info the ghcr registry.

There is another optional feature to use SigStore and the Github actions token to sign the upload artifact.

To enable these feature, set the input enable-ghcr-push (For artifact upload) and enable-artifact-sign (For artifact signing) to true

Read this on downloading and verifying the signed artifact

Usage

Example

# The following permissions are required when "enable-ghcr-push" is true
permissions:
  packages: write
  id-token: write

steps:
  - name: Build EIF
    id: build-eif
    uses: richardfan1126/nitro-enclaves-eif-build-action@v1
    with:
      docker-build-context-path: app/
      dockerfile-path: Dockerfile
      enable-ghcr-push: true
      enable-artifact-sign: true
      eif-file-name: enclave.eif
      eif-info-file-name: enclave-info.json
      artifact-tag: latest
      save-pcrs-in-annotation: true
      github-token: ${{ secrets.GITHUB_TOKEN }}

See richardfan1126/nitro-enclaves-cosign-sandbox for sample use case.

Pre-requisites

This action only runs on x64 Linux runner.

If enable-ghcr-push is true, the following permission is required for the workflow:

Inputs

Outputs

How to verify the artifact signature

In this Github Action, the artifact is uploaded to ghcr by ORAS and signed by SigStore cosign.

The uploaded artifact path is in the output ghcr-artifact-path, you can use the following command to pull it:

oras pull ghcr.io/username/repo:tag@sha256:<digest>

The artifact signing is recorded in Rekor transparency log.

With the Log index in output rekor-log-index, you can find the signing log on Rekor Search

To verify the uploaded artifact against the signature, you can use the following command:

Replace <username> with your Github username and <repo> with the Github repository name

cosign verify ghcr.io/username/repo:tag \
    --certificate-identity-regexp https://github.com/<username>/<repo>/ \
    --certificate-oidc-issuer https://token.actions.githubusercontent.com