Skip to content

Commit d4b0cb2

Browse files
authored
Merge pull request #76 from com-pas/chore/implement-signed-release
fix: sign Docker images with Cosign
2 parents 4875234 + 93ae221 commit d4b0cb2

3 files changed

Lines changed: 26 additions & 28 deletions

File tree

.github/workflows/automate-projects.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/release-please.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
permissions:
1010
contents: write
11+
id-token: write
1112
pull-requests: write
1213

1314
name: release-please
@@ -61,6 +62,10 @@ jobs:
6162
with:
6263
username: ${{ secrets.DOCKER_HUB_USERNAME }}
6364
password: ${{ secrets.DOCKER_HUB_TOKEN }}
65+
66+
- name: Install Cosign
67+
if: ${{ steps.release.outputs.release_created }}
68+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
6469

6570
- name: Create custom Maven Settings.xml
6671
if: ${{ steps.release.outputs.release_created }}
@@ -78,3 +83,9 @@ jobs:
7883
run: ./mvnw -B -s custom_maven_settings.xml -Pnative-image,release clean deploy
7984
env:
8085
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
87+
- name: Sign Docker image with Cosign
88+
if: ${{ steps.release.outputs.release_created }}
89+
run: |
90+
DIGEST=$(docker buildx imagetools inspect lfenergy/compas-sitipe-service:${{ steps.release.outputs.version }} --format '{{.Manifest.Digest}}')
91+
cosign sign --yes lfenergy/compas-sitipe-service@"${DIGEST}"

SECURITY.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ SPDX-License-Identifier: Apache-2.0
55
-->
66
# Security Policy
77

8+
## Verifying Docker images
9+
10+
Docker images published by this project are signed using [Cosign](https://github.com/sigstore/cosign) keyless signing via [Sigstore](https://www.sigstore.dev/). Signatures are recorded in the public [Rekor](https://rekor.sigstore.dev/) transparency log — no private key is stored or required.
11+
12+
To verify an image, install Cosign ([instructions](https://docs.sigstore.dev/cosign/system_config/installation/)) and run:
13+
14+
```sh
15+
cosign verify \
16+
--certificate-identity "https://github.com/com-pas/compas-sitipe-service/.github/workflows/release-please.yml@refs/heads/main" \
17+
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
18+
lfenergy/compas-sitipe-service:<tag>
19+
```
20+
21+
Replace `<tag>` with the specific release tag (e.g. `v0.3.1`) or `latest`.
22+
823
## Reporting a Vulnerability
924

1025
Please go to [Security Advisories](https://github.com/com-pas/compas-sitipe-service/security/advisories) to privately report a security vulnerability,

0 commit comments

Comments
 (0)