From 4a43c55c3346440cfd516fe998abba919b753d6a Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Mon, 2 Dec 2024 11:47:40 -0600 Subject: [PATCH 1/5] mod: add bin to ignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c41cc9e..99644ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/target \ No newline at end of file +/target +.bin From 0c2dccec32ca5f8f2e063533f4b502a61af8fe51 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Mon, 2 Dec 2024 11:48:22 -0600 Subject: [PATCH 2/5] mod: install cosign and sign wasm component --- .github/workflows/publish.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a086b43..2a9d69f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -53,3 +53,14 @@ jobs: - name: Run publish script run: bash scripts/publish.sh ${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }} + + - name: Install Cosign + uses: sigstore/cosign-installer@v3.7.0 + + - name: Sign wasm component + run: | + image="ghcr.io/${{ github.actor }}/rust-wasi-hello:${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}" + cosign sign --yes --key env://COSIGN_PRIVATE_KEY $image + env: + COSIGN_PRIVATE_KEY: ${{ secrets.COSIGN_PRIVATE_KEY }} + COSIGN_PASSWORD: ${{ secrets.COSIGN_PASSWORD }} From dd37d9b0ac471618429b22a62a2db058453e35ba Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Mon, 9 Dec 2024 10:40:17 -0600 Subject: [PATCH 3/5] testing attest --- .github/workflows/attest.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/attest.yml diff --git a/.github/workflows/attest.yml b/.github/workflows/attest.yml new file mode 100644 index 0000000..5d96ce6 --- /dev/null +++ b/.github/workflows/attest.yml @@ -0,0 +1,27 @@ +name: build-attested-component + +on: + push: + branches: [cosign] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + id-token: write + packages: write + contents: read + attestations: write + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Attest + uses: actions/attest@v1 + id: attest + with: + subject-name: ghcr.io/yoshuawuyts/rust-wasi-hello:0.1.0 + # subject-digest: ${{ steps.push.outputs.digest }} + subject-digest: sha256:67940472ac167f1c79224ee645ba59ca54483d95c633f9e67a4d16719d1fa356 + predicate-type: "https://in-toto.io/attestation/release/v0.1" + predicate: '{"purl":"pkg:oci/..."}' + push-to-registry: true From d77d07a555421e546129deb6d5e18ff455d364b5 Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Mon, 9 Dec 2024 10:41:50 -0600 Subject: [PATCH 4/5] remove tag from image name --- .github/workflows/attest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/attest.yml b/.github/workflows/attest.yml index 5d96ce6..97e7c64 100644 --- a/.github/workflows/attest.yml +++ b/.github/workflows/attest.yml @@ -19,7 +19,7 @@ jobs: uses: actions/attest@v1 id: attest with: - subject-name: ghcr.io/yoshuawuyts/rust-wasi-hello:0.1.0 + subject-name: ghcr.io/yoshuawuyts/rust-wasi-hello # subject-digest: ${{ steps.push.outputs.digest }} subject-digest: sha256:67940472ac167f1c79224ee645ba59ca54483d95c633f9e67a4d16719d1fa356 predicate-type: "https://in-toto.io/attestation/release/v0.1" From 5cf7d1bcb84af67300c84f8192423e98386a08da Mon Sep 17 00:00:00 2001 From: Josh Duffney Date: Mon, 9 Dec 2024 10:43:13 -0600 Subject: [PATCH 5/5] add docker login --- .github/workflows/attest.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/attest.yml b/.github/workflows/attest.yml index 97e7c64..dc7b800 100644 --- a/.github/workflows/attest.yml +++ b/.github/workflows/attest.yml @@ -15,6 +15,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Attest uses: actions/attest@v1 id: attest