Skip to content

Commit ab0a8d4

Browse files
Austen Bruhnclaude
authored andcommitted
chore(security): gitignore testdata/publisher.key + clarify in README
Audit before forking work to teammates: testdata/publisher.key (the ed25519 private key used to sign attestation-good.json) was always local-only and never in git history (verified via `git log --all --diff-filter=A -- testdata/publisher.key` returning empty). The repo's README incorrectly listed it as if it shipped. Belt-and-suspenders: - .gitignore now excludes testdata/publisher.key, testdata/*.key, and *.pem at repo root - README revised: explicitly notes the key is gitignored, public key embedded in verifier.go (PublisherPublicKeyB64), and gives the regeneration recipe for the rare case someone needs to rotate Public key in verifier.go is the only key surface in this repo by design — that's the verification path. Private key never goes in. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 706c7a8 commit ab0a8d4

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# Built binary
22
demo-sbom-verifier
33

4+
# Private key for demo signature fixtures — DO NOT COMMIT.
5+
# The matching base64 public key is embedded in
6+
# internal/verifier/verifier.go (PublisherPublicKeyB64). The private
7+
# key is only needed to regenerate the signed fixtures in testdata/
8+
# (attestation-good.json / attestation-bad.json) and otherwise plays
9+
# no role in the demo flow.
10+
testdata/publisher.key
11+
testdata/*.key
12+
*.pem
13+
414
# Editor / OS
515
.DS_Store
616
*.swp

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal/verifier/verifier_test.go tests fail until verifier is fixed
2323
testdata/
2424
attestation-good.json valid in-toto statement, signed
2525
attestation-bad.json same payload, tampered signature
26-
publisher.key (private — only used to regenerate fixtures)
26+
(publisher.key is gitignored — see below)
2727
Makefile build, test, run, reset
2828
```
2929

@@ -65,6 +65,28 @@ make reset
6565

6666
> **Branch protection note:** `main` should be protected against force-pushes and require a manual review for any merge, so accidental fixes to the stub never land. The intended booth artifact is the agent's *diff*, not a merged PR.
6767
68+
## Regenerating fixtures (rarely needed)
69+
70+
`testdata/publisher.key` is the ed25519 private key that signed
71+
`attestation-good.json`. It's **gitignored** — keys never go in the
72+
repo, even demo-only ones. The matching public key is base64-embedded
73+
in `internal/verifier/verifier.go` (`PublisherPublicKeyB64`).
74+
75+
If you ever need to rotate the keypair (new fixtures), generate a new
76+
ed25519 keypair, sign the canonical-JSON of the in-toto statement
77+
payload, and update both:
78+
79+
- `internal/verifier/verifier.go::PublisherPublicKeyB64` (raw 32-byte
80+
ed25519 public key, base64-encoded)
81+
- `testdata/attestation-good.json` (`signature` field)
82+
- `testdata/attestation-bad.json` (same `payload`; tamper the
83+
signature by flipping any byte)
84+
85+
There's no script in this repo for rotation since it's a one-time
86+
setup task; copy the inline Go from this repo's initial commit
87+
message if you need it. The local `testdata/publisher.key` is what
88+
the original author used and stays out of source control.
89+
6890
## License
6991

7092
Apache 2.0.

0 commit comments

Comments
 (0)