Skip to content

Commit 8782df0

Browse files
committed
ci: replace SLSA generator with actions/attest
1 parent 1694eab commit 8782df0

1 file changed

Lines changed: 18 additions & 34 deletions

File tree

.github/workflows/build_push_dev.yml

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
contents: read
1616
packages: write
1717
attestations: write
18+
artifact-metadata: write
1819
id-token: write
1920
outputs:
2021
digest: ${{ steps.build-and-push-backend.outputs.digest }}
@@ -53,7 +54,7 @@ jobs:
5354
platforms: linux/amd64
5455
push: true
5556
# Disable buildkit attestations so the pushed reference is the image
56-
# manifest digest (not an index), which the SLSA generator requires.
57+
# manifest digest (not an index), which actions/attest requires.
5758
provenance: false
5859
tags: oci.stackable.tech/stackable/secobserve-backend:dev
5960
build-args: |
@@ -63,29 +64,21 @@ jobs:
6364
-
6465
name: Sign the published backend image
6566
run: cosign sign -y oci.stackable.tech/stackable/secobserve-backend@${{ steps.build-and-push-backend.outputs.digest }}
66-
67-
provenance_backend_dev:
68-
needs: [docker_backend_dev]
69-
permissions:
70-
actions: read # detect the build workflow that generated the image
71-
id-token: write # mint the OIDC token for keyless signing
72-
packages: write # needed until https://github.com/slsa-framework/slsa-github-generator/issues/1257 is resolved
73-
# MUST be referenced by a @vX.Y.Z tag (not a SHA), otherwise the
74-
# reusable workflow cannot verify its own provenance.
75-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
76-
with:
77-
image: oci.stackable.tech/stackable/secobserve-backend
78-
digest: ${{ needs.docker_backend_dev.outputs.digest }}
79-
registry-username: robot$stackable+github-action-build
80-
secrets:
81-
registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
67+
-
68+
name: Attest the published backend image
69+
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
70+
with:
71+
subject-name: oci.stackable.tech/stackable/secobserve-backend
72+
subject-digest: ${{ steps.build-and-push-backend.outputs.digest }}
73+
push-to-registry: true
8274

8375
docker_frontend_dev:
8476
runs-on: ubuntu-latest
8577
permissions:
8678
contents: read
8779
packages: write
8880
attestations: write
81+
artifact-metadata: write
8982
id-token: write
9083
outputs:
9184
digest: ${{ steps.build-and-push-frontend.outputs.digest }}
@@ -123,7 +116,7 @@ jobs:
123116
platforms: linux/amd64
124117
push: true
125118
# Disable buildkit attestations so the pushed reference is the image
126-
# manifest digest (not an index), which the SLSA generator requires.
119+
# manifest digest (not an index), which actions/attest requires.
127120
provenance: false
128121
tags: oci.stackable.tech/stackable/secobserve-frontend:dev
129122
build-args: |
@@ -133,19 +126,10 @@ jobs:
133126
-
134127
name: Sign the published frontend image
135128
run: cosign sign -y oci.stackable.tech/stackable/secobserve-frontend@${{ steps.build-and-push-frontend.outputs.digest }}
136-
137-
provenance_frontend_dev:
138-
needs: [docker_frontend_dev]
139-
permissions:
140-
actions: read # detect the build workflow that generated the image
141-
id-token: write # mint the OIDC token for keyless signing
142-
packages: write # needed until https://github.com/slsa-framework/slsa-github-generator/issues/1257 is resolved
143-
# MUST be referenced by a @vX.Y.Z tag (not a SHA), otherwise the
144-
# reusable workflow cannot verify its own provenance.
145-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_container_slsa3.yml@v2.1.0
146-
with:
147-
image: oci.stackable.tech/stackable/secobserve-frontend
148-
digest: ${{ needs.docker_frontend_dev.outputs.digest }}
149-
registry-username: robot$stackable+github-action-build
150-
secrets:
151-
registry-password: ${{ secrets.HARBOR_ROBOT_STACKABLE_GITHUB_ACTION_BUILD_SECRET }}
129+
-
130+
name: Attest the published frontend image
131+
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
132+
with:
133+
subject-name: oci.stackable.tech/stackable/secobserve-frontend
134+
subject-digest: ${{ steps.build-and-push-frontend.outputs.digest }}
135+
push-to-registry: true

0 commit comments

Comments
 (0)