Skip to content

Commit f1e1fe4

Browse files
committed
add document for sigstore
1 parent 6d2a1e3 commit f1e1fe4

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ See [https://github.com/chains-project/](https://github.com/orgs/chains-project/
9494
- [Software supply chain attacks on crypto infrastructure](software-supply-chain-attacks-crypto.md)
9595
- [NIX and the supply chain, debrief of NixCon 2022](nixcon-2022.md)
9696
- [SBOMs for your GitHub Releases](sbom-github.md)
97+
- [Sigstore Attestations for your GitHub Releases](maven-sigstore.md)
9798
- [Software suply chain CWEs](cwe-software-supplu-chain.md)
9899
- [CHAINS checklist](chains-repo-checklist.md)
99100

maven-sigstore.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
title: Pushing Sigstore Attestations to Maven Central on Release
3+
---
4+
5+
# Pushing Sigstore Attestations to Maven Central on Release
6+
7+
## Requirements
8+
9+
You need a project, a GitHub repository, and releases done with GitHub Actions. You also need a sigstore plugin that supports your build system.
10+
Here we show how to do it with maven and sigstore-maven-plugin.
11+
12+
## Steps
13+
14+
1. Add a plugin to your pom.xml. If you have a different build system, you can find the appropriate plugin here: [https://docs.sigstore.dev/language_clients/language_client_overview/](https://docs.sigstore.dev/language_clients/language_client_overview/).
15+
16+
```xml
17+
<properties>
18+
<sigstore.skip>true</sigstore.skip>
19+
</properties>
20+
```
21+
22+
```xml
23+
<build>
24+
<plugins>
25+
<plugin>
26+
<groupId>dev.sigstore</groupId>
27+
<artifactId>sigstore-maven-plugin</artifactId>
28+
<version>1.3.0</version>
29+
<configuration>
30+
<skip>${sigstore.skip}</skip>
31+
</configuration>
32+
<executions>
33+
<execution>
34+
<id>sign</id>
35+
<goals>
36+
<goal>sign</goal>
37+
</goals>
38+
</execution>
39+
</executions>
40+
</plugin>
41+
</plugins>
42+
</build>
43+
```
44+
45+
This will create a `<filename>.sigstore.json` with the attestation during the `sign` build step. We add the optional property `sigstore.skip` to make the default to not sign (for easier local development). Signing is then enabled during deployment builds using the maven argument: `-Dsigstore.skip=false`.
46+
47+
2. (GitHub) Add the `id-token` permission to your release job in GitHub Actions.
48+
49+
```yaml
50+
jobs:
51+
build:
52+
name: Build and release
53+
permissions:
54+
id-token: write
55+
[...]
56+
```
57+
58+
This enables OIDC authentication for the release job, which is required for signing artifacts with sigstore. For additional details, see the documentation for [sigstore-maven-plugin](https://github.com/sigstore/sigstore-java/tree/main/sigstore-maven-plugin).
59+
60+
3. (Maven Central) JReleaser automatically uploads the `<filename>.sigstore.json` files to Maven Central.
61+
62+
4. Make a release :) The final result looks like this on Maven Central: https://repo1.maven.org/maven2/io/github/chains-project/maven-lockfile/5.8.2/.
63+

sbom-github.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ By the end of this post, you will clearly understand how to add SBOMs to your so
2626

2727
## Steps
2828

29-
1. Add a plugin to your pom.xml. If you have a different build system, you can find the appropriate plugin here: https://cyclonedx.org/docs/bom-tools/
29+
1. Add a plugin to your pom.xml. If you have a different build system, you can find the appropriate plugin here: [https://cyclonedx.org/docs/bom-tools/](https://cyclonedx.org/docs/bom-tools/)
3030

3131
```xml
3232
<build>

0 commit comments

Comments
 (0)