Skip to content

Commit a677bfe

Browse files
Signed release packages using Github artifact attestation (#1390)
* Add attestation steps for packaging * tab to spaces * update permissions * Update README for verify procedure * fix * version to commit hash * update * remove ubuntu 18.04 * move permissions * should be package dir * remove wildcard * bump version str * remove unnecessary id * revert test version bump * add link to attestation page --------- Co-authored-by: Liu, An-Chi <[email protected]>
1 parent 8efa65d commit a677bfe

File tree

2 files changed

+61
-4
lines changed

2 files changed

+61
-4
lines changed

.github/workflows/package.yml

Lines changed: 47 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
runs-on: ubuntu-latest
2323
permissions:
2424
contents: write
25+
attestations: write
26+
id-token: write
2527
container: seladb/${{ matrix.image }}
2628
strategy:
2729
matrix:
@@ -68,6 +70,11 @@ jobs:
6870
- name: Package
6971
run: cmake --build "$BUILD_DIR" --target package
7072

73+
- name: Generate artifact attestation
74+
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
75+
with:
76+
subject-path: "${{ env.BUILD_DIR }}/*.tar.gz,${{ env.BUILD_DIR }}/*.deb,${{ env.BUILD_DIR }}/*.rpm"
77+
7178
- name: Upload binaries to release
7279
if: github.ref_type == 'tag'
7380
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
@@ -81,6 +88,8 @@ jobs:
8188
runs-on: ubuntu-latest
8289
permissions:
8390
contents: write
91+
attestations: write
92+
id-token: write
8493
strategy:
8594
matrix:
8695
include:
@@ -103,19 +112,26 @@ jobs:
103112
cmake --build "$BUILD_DIR" -j 4
104113
cmake --build "$BUILD_DIR" --target package
105114
115+
- name: Generate artifact attestation
116+
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
117+
with:
118+
subject-path: "${{ env.BUILD_DIR }}/*.tar.gz"
119+
106120
- name: Upload binaries to release
107121
if: github.ref_type == 'tag'
108122
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
109123
with:
110124
draft: true
111125
allowUpdates: true
112126
updateOnlyUnreleased: true
113-
artifacts: ${{ env.BUILD_DIR }}/*.tar.gz
127+
artifacts: "${{ env.BUILD_DIR }}/*.tar.gz"
114128

115129
macos:
116130
runs-on: macos-14
117131
permissions:
118132
contents: write
133+
attestations: write
134+
id-token: write
119135
strategy:
120136
matrix:
121137
xcode-version: [15.4, 14.3.1]
@@ -139,6 +155,11 @@ jobs:
139155
- name: Package
140156
run: cmake --build "$BUILD_DIR" --target package
141157

158+
- name: Generate artifact attestation
159+
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
160+
with:
161+
subject-path: "${{ env.BUILD_DIR }}/*.tar.gz,${{ env.BUILD_DIR }}/*.pkg"
162+
142163
- name: Upload binaries to release
143164
if: github.ref_type == 'tag'
144165
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
@@ -152,6 +173,8 @@ jobs:
152173
runs-on: windows-latest
153174
permissions:
154175
contents: write
176+
attestations: write
177+
id-token: write
155178
strategy:
156179
matrix:
157180
include:
@@ -202,14 +225,19 @@ jobs:
202225
shell: msys2 {0}
203226
run: cmake --build "$BUILD_DIR" --target package
204227

228+
- name: Generate artifact attestation
229+
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
230+
with:
231+
subject-path: "${{ env.BUILD_DIR }}/*.zip"
232+
205233
- name: Upload binaries to release
206234
if: github.ref_type == 'tag'
207235
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
208236
with:
209237
draft: true
210238
allowUpdates: true
211239
updateOnlyUnreleased: true
212-
artifacts: ${{ env.BUILD_DIR }}/*.zip
240+
artifacts: "${{ env.BUILD_DIR }}/*.zip"
213241

214242
visual-studio:
215243
strategy:
@@ -221,6 +249,8 @@ jobs:
221249
runs-on: ${{ matrix.os }}
222250
permissions:
223251
contents: write
252+
attestations: write
253+
id-token: write
224254
steps:
225255
- name: Checkout code
226256
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -244,14 +274,19 @@ jobs:
244274
- name: Package
245275
run: cmake --build "$env:BUILD_DIR" --config ${{ matrix.configuration }} --target package
246276

277+
- name: Generate artifact attestation
278+
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
279+
with:
280+
subject-path: "${{ env.BUILD_DIR }}/*.zip"
281+
247282
- name: Upload binaries to release
248283
if: github.ref_type == 'tag'
249284
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
250285
with:
251286
draft: true
252287
allowUpdates: true
253288
updateOnlyUnreleased: true
254-
artifacts: ${{ env.BUILD_DIR }}/*.zip
289+
artifacts: "${{ env.BUILD_DIR }}/*.zip"
255290

256291
android-build:
257292
strategy:
@@ -314,6 +349,8 @@ jobs:
314349
runs-on: ubuntu-latest
315350
permissions:
316351
contents: write
352+
attestations: write
353+
id-token: write
317354

318355
steps:
319356
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
@@ -326,11 +363,17 @@ jobs:
326363
export PACKAGE_DIR=$(ls | grep pcapplusplus)
327364
echo "PACKAGE_DIR=$PACKAGE_DIR" >> $GITHUB_ENV
328365
tar cvf "${PACKAGE_DIR}.tar.gz" "${PACKAGE_DIR}"
366+
367+
- name: Generate artifact attestation
368+
uses: actions/attest-build-provenance@bdd51370e0416ac948727f861e03c2f05d32d78e # v1.3.2
369+
with:
370+
subject-path: "${{ env.PACKAGE_DIR }}.tar.gz"
371+
329372
- name: Upload binaries to release
330373
if: github.ref_type == 'tag'
331374
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0
332375
with:
333376
draft: true
334377
allowUpdates: true
335378
updateOnlyUnreleased: true
336-
artifacts: ${{ env.PACKAGE_DIR }}.tar.gz
379+
artifacts: "${{ env.PACKAGE_DIR }}.tar.gz"

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,20 @@ git clone https://github.com/seladb/PcapPlusPlus.git
9696

9797
Follow the build instructions according to your platform in the [Build From Source](https://pcapplusplus.github.io/docs/install#build-from-source) page in PcapPlusPlus web-site.
9898

99+
### Verify your packages
100+
101+
PcapPlusPlus releases which newer than v23.09 are signed with GitHub attestation. All of the attestations can be found [here](https://github.com/seladb/PcapPlusPlus/attestations). You can verify the attestation of these packages with GitHub CLI. To verify packages you can follow the most recent instructions from [gh attestation verify](https://cli.github.com/manual/gh_attestation_verify). For simple instructions you can use the following command:
102+
103+
```shell
104+
gh attestation verify <path-to-package-file> --repository seladb/PcapPlusPlus
105+
```
106+
107+
and you should see the following output in your terminal:
108+
109+
```shell
110+
✓ Verification succeeded!
111+
```
112+
99113
## Feature Overview
100114

101115
- __Packet capture__ through an easy to use C++ wrapper for popular packet capture engines such as [libpcap](https://www.tcpdump.org/), [WinPcap](https://www.winpcap.org/), [Npcap](https://nmap.org/npcap/), [Intel DPDK](https://www.dpdk.org/), [eBPF AF_XDP](https://www.kernel.org/doc/html/next/networking/af_xdp.html), [ntop’s PF_RING](https://www.ntop.org/products/packet-capture/pf_ring/) and [raw sockets](https://en.wikipedia.org/wiki/Network_socket#Raw_socket) [[Learn more](https://pcapplusplus.github.io/docs/features#packet-capture)]

0 commit comments

Comments
 (0)