Skip to content

Commit 20b1153

Browse files
authored
Merge pull request DeusData#970 from DeusData/chore/slsa-build-attestations
2 parents d6bbb0a + 8a370b2 commit 20b1153

5 files changed

Lines changed: 83 additions & 8 deletions

File tree

‎.github/workflows/_build.yml‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ on:
88
description: 'Version string (e.g. v0.8.0)'
99
type: string
1010
default: ''
11+
attest:
12+
description: 'Generate build provenance attestations for release artifacts'
13+
type: boolean
14+
default: false
1115

1216
permissions:
1317
contents: read
18+
id-token: write
19+
attestations: write
1420

1521
jobs:
1622
build-unix:
@@ -83,6 +89,12 @@ jobs:
8389
tar -czf "codebase-memory-mcp-${GOOS}-${GOARCH}.tar.gz" \
8490
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
8591
92+
- name: Attest standard binary provenance
93+
if: ${{ inputs.attest }}
94+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
95+
with:
96+
subject-path: codebase-memory-mcp-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
97+
8698
- name: Build UI binary
8799
env:
88100
VERSION: ${{ inputs.version }}
@@ -113,6 +125,12 @@ jobs:
113125
tar -czf "codebase-memory-mcp-ui-${GOOS}-${GOARCH}.tar.gz" \
114126
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
115127
128+
- name: Attest UI binary provenance
129+
if: ${{ inputs.attest }}
130+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
131+
with:
132+
subject-path: codebase-memory-mcp-ui-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz
133+
116134
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
117135
with:
118136
name: binaries-${{ matrix.goos }}-${{ matrix.goarch }}
@@ -158,6 +176,12 @@ jobs:
158176
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
159177
zip codebase-memory-mcp-windows-amd64.zip codebase-memory-mcp.exe LICENSE install.ps1 THIRD_PARTY_NOTICES.md
160178
179+
- name: Attest standard binary provenance
180+
if: ${{ inputs.attest }}
181+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
182+
with:
183+
subject-path: codebase-memory-mcp-windows-amd64.zip
184+
161185
- name: Build UI binary
162186
shell: msys2 {0}
163187
env:
@@ -178,6 +202,12 @@ jobs:
178202
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
179203
zip codebase-memory-mcp-ui-windows-amd64.zip codebase-memory-mcp.exe LICENSE install.ps1 THIRD_PARTY_NOTICES.md
180204
205+
- name: Attest UI binary provenance
206+
if: ${{ inputs.attest }}
207+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
208+
with:
209+
subject-path: codebase-memory-mcp-ui-windows-amd64.zip
210+
181211
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
182212
with:
183213
name: binaries-windows-amd64
@@ -227,6 +257,12 @@ jobs:
227257
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
228258
zip codebase-memory-mcp-windows-arm64.zip codebase-memory-mcp.exe LICENSE install.ps1 THIRD_PARTY_NOTICES.md
229259
260+
- name: Attest standard binary provenance
261+
if: ${{ inputs.attest }}
262+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
263+
with:
264+
subject-path: codebase-memory-mcp-windows-arm64.zip
265+
230266
- name: Build UI binary
231267
shell: msys2 {0}
232268
env:
@@ -247,6 +283,12 @@ jobs:
247283
scripts/gen-third-party-notices.sh THIRD_PARTY_NOTICES.md
248284
zip codebase-memory-mcp-ui-windows-arm64.zip codebase-memory-mcp.exe LICENSE install.ps1 THIRD_PARTY_NOTICES.md
249285
286+
- name: Attest UI binary provenance
287+
if: ${{ inputs.attest }}
288+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
289+
with:
290+
subject-path: codebase-memory-mcp-ui-windows-arm64.zip
291+
250292
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
251293
with:
252294
name: binaries-windows-arm64
@@ -299,6 +341,12 @@ jobs:
299341
tar -czf "codebase-memory-mcp-linux-${ARCH}-portable.tar.gz" \
300342
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
301343
344+
- name: Attest standard binary provenance
345+
if: ${{ inputs.attest }}
346+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
347+
with:
348+
subject-path: codebase-memory-mcp-linux-${{ matrix.arch }}-portable.tar.gz
349+
302350
- name: Build UI binary (static)
303351
env:
304352
VERSION: ${{ inputs.version }}
@@ -318,6 +366,12 @@ jobs:
318366
tar -czf "codebase-memory-mcp-ui-linux-${ARCH}-portable.tar.gz" \
319367
-C build/c codebase-memory-mcp LICENSE install.sh THIRD_PARTY_NOTICES.md
320368
369+
- name: Attest UI binary provenance
370+
if: ${{ inputs.attest }}
371+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
372+
with:
373+
subject-path: codebase-memory-mcp-ui-linux-${{ matrix.arch }}-portable.tar.gz
374+
321375
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
322376
with:
323377
name: binaries-linux-${{ matrix.arch }}-portable

‎.github/workflows/dry-run.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ jobs:
5656
build:
5757
if: ${{ inputs.skip_builds != true && !cancelled() && (needs.test.result == 'success' || needs.test.result == 'skipped') }}
5858
needs: [test]
59+
permissions:
60+
contents: read
61+
id-token: write
62+
attestations: write
5963
uses: ./.github/workflows/_build.yml
64+
with:
65+
attest: false
6066

6167
# ── Smoke test every binary ────────────────────────────────────
6268
# Run unless builds were skipped or a build leg FAILED. Every build leg

‎.github/workflows/release.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ jobs:
5656
# ── 3. Build all platforms ──────────────────────────────────────
5757
build:
5858
needs: [test]
59+
permissions:
60+
contents: read
61+
id-token: write
62+
attestations: write
5963
uses: ./.github/workflows/_build.yml
6064
with:
6165
version: ${{ inputs.version }}
66+
attest: true
6267

6368
# ── 4. Smoke test every binary ──────────────────────────────────
6469
smoke:
@@ -99,10 +104,10 @@ jobs:
99104
- name: Generate checksums
100105
run: sha256sum *.tar.gz *.zip > checksums.txt
101106

102-
- name: Attest build provenance
107+
- name: Attest checksum provenance
103108
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
104109
with:
105-
subject-path: '*.tar.gz,*.zip,checksums.txt'
110+
subject-path: checksums.txt
106111

107112
- name: Generate SBOM
108113
run: |

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ internal/cbm/ Vendored tree-sitter grammars (158 languages) + AST extrac
599599
Every release binary is verified through a multi-layer pipeline before publication:
600600

601601
- **VirusTotal** — all binaries scanned by 70+ antivirus engines (zero detections required to publish)
602-
- **SLSA Level 3** — cryptographic build provenance generated by GitHub Actions; verify with `gh attestation verify <file> --repo DeusData/codebase-memory-mcp`
602+
- **SLSA Level 3** — cryptographic build provenance generated by the trusted GitHub Actions build workflow; verify with `gh attestation verify <file> --repo DeusData/codebase-memory-mcp --signer-workflow DeusData/codebase-memory-mcp/.github/workflows/_build.yml`
603603
- **Sigstore cosign** — keyless signatures on all artifacts; bundles included in every release
604604
- **SHA-256 checksums** — `checksums.txt` published with every release; verified by both install scripts before extraction
605605
- **CodeQL SAST** — blocks release pipeline if any open alerts remain

‎SECURITY.md‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
codebase-memory-mcp interacts deeply with your filesystem. It reads source files across your entire codebase, writes to agent configuration files, and spawns background processes. This is inherent to what it does — not a bug.
66

7-
**If you are uncomfortable with these access patterns**, please audit the source code before running. The full source is available in this repository. Every release binary is reproducibly built from this source and can be independently verified via SLSA provenance, Sigstore signatures, and SHA-256 checksums (see [Verification](#verification) below).
7+
**If you are uncomfortable with these access patterns**, please audit the source code before running. The full source is available in this repository. Release binaries produced by the current release pipeline are verifiably built from this source and can be independently verified via SLSA Build Level 3 provenance, Sigstore signatures, and SHA-256 checksums (see [Verification](#verification) below).
88

99
We are humans and can make mistakes. We take security seriously — it is Priority #1 for this project — but we cannot guarantee perfection. By using this software you accept responsibility for evaluating whether it meets your own security requirements.
1010

@@ -122,13 +122,21 @@ This project implements multiple layers of security verification. Every release
122122

123123
Releases are created as **drafts** (invisible to users) and only published after all verification passes:
124124

125-
1. **SLSA build provenance** — cryptographic attestation proving each binary was built by GitHub Actions from this repository
125+
1. **SLSA Build Level 3 provenance for release binaries** — cryptographic attestation generated inside the trusted GitHub Actions build workflow immediately after each release archive is produced
126126
2. **Sigstore cosign signing** — keyless digital signatures verifiable by anyone
127-
3. **SBOM** — Software Bill of Materials (CycloneDX) listing all vendored dependencies
127+
3. **SBOM** — Software Bill of Materials (SPDX) listing all vendored dependencies
128128
4. **SHA-256 checksums** — published with every release
129129
5. **VirusTotal scanning** — all binaries scanned by 70+ antivirus engines (zero-tolerance: any detection blocks the release)
130130
6. **OpenSSF Scorecard** — repository security health score
131131

132+
Scope of the SLSA claim: this is a build provenance claim for release
133+
artifacts. It proves the attested archive was produced by the repository's
134+
trusted GitHub-hosted build workflow from repository source. It is not
135+
third-party certification, it is not retroactive to older releases, and it does
136+
not mean the source code is vulnerability-free or that maintainers cannot change
137+
source. Consumers should verify the signer workflow, not only repository
138+
ownership.
139+
132140
If ANY antivirus engine flags ANY binary, the release stays as a draft and is not published until the issue is investigated and resolved.
133141

134142
### Code-Level Defenses
@@ -145,8 +153,10 @@ If ANY antivirus engine flags ANY binary, the release stays as a draft and is no
145153
Users can independently verify any release binary:
146154

147155
```bash
148-
# SLSA provenance (proves binary came from this repo's CI)
149-
gh attestation verify <downloaded-file> --repo DeusData/codebase-memory-mcp
156+
# SLSA Build Level 3 provenance for release binaries
157+
gh attestation verify <downloaded-file> \
158+
--repo DeusData/codebase-memory-mcp \
159+
--signer-workflow DeusData/codebase-memory-mcp/.github/workflows/_build.yml
150160

151161
# Sigstore cosign (keyless signature)
152162
cosign verify-blob --bundle <file>.bundle <file>

0 commit comments

Comments
 (0)