Skip to content

Pre-launch cleanup: fix 5 issues from production readiness review#1

Merged
peg merged 4 commits into
mainfrom
fix/pre-launch-cleanup
Mar 14, 2026
Merged

Pre-launch cleanup: fix 5 issues from production readiness review#1
peg merged 4 commits into
mainfrom
fix/pre-launch-cleanup

Conversation

@peg

@peg peg commented Mar 14, 2026

Copy link
Copy Markdown
Owner

Summary

Addresses 5 critical items from the production readiness review.

Changes

  1. Fix go.mod/CI version mismatch — CI and release workflows used Go 1.22 but go.mod requires 1.24. Aligned both workflows to 1.24.

  2. Update README canary types table (5 → 13) — The README only documented 5 canary types (aws, gcp, github, stripe, generic) but the code supports 13. Added all types with accurate locations, triggers, and reliability ratings. Also removed already-implemented items (OpenAI/Anthropic, K8s) from the roadmap.

  3. Add SHA-256 checksum verification to install script — The install script now downloads the .sha256 checksum file from the release and verifies the binary before installation. Supports both sha256sum (Linux) and shasum (macOS). Also added checksum generation to the release workflow.

  4. Document PyPI/npm global config side effects — Added warning callouts in the README explaining that snare plant --type pypi modifies global pip config (affects all pip install commands) and --type npm modifies ~/.npmrc (affects scoped packages). Users need to know these canaries have side effects on real workflows.

  5. Add comprehensive tests for the token package — 366 lines of tests covering all token generators. Tests verify format correctness, uniqueness (1000-iteration collision checks), minimum length requirements, no giveaway strings (SNARE/FAKE/TEST/etc.), PEM structure, JWT structure, and RNG distribution.

Test results

ok  github.com/peg/snare/internal/bait     1.036s
ok  github.com/peg/snare/internal/manifest  1.030s
ok  github.com/peg/snare/internal/token     1.072s

All tests pass with -race -count=1.

clap [bot] added 4 commits March 14, 2026 00:11
go.mod requires 1.24.0 but CI and release workflows used 1.22.
Also add SHA-256 checksum generation to release workflow.
The README only documented 5 canary types but the code supports 13.
Added all types with accurate locations, triggers, and reliability.
Also added warning notes about PyPI and npm global config side effects,
and removed already-implemented items from the roadmap.
Downloads the .sha256 checksum file from the release and verifies
the binary integrity before installation. Supports both sha256sum
(Linux) and shasum (macOS). Fails with a clear error if checksums
don't match. A security tool should verify its own downloads.
Covers all token generators: NewID, NewAWSKeyID, NewAWSSecretKey,
NewGitHubToken, NewStripeKey, NewOpenAIKey, NewAnthropicKey, NewK8sToken,
NewNPMToken, NewFakeRSAPrivateKey, NewGCPProjectID, NewGCPClientID,
NewGCPPrivateKeyID, and MustRandInt.

Tests verify:
- Format correctness (prefix, length, charset)
- Uniqueness (no collisions across 1000 generations)
- Minimum length requirements (MinTokenLen)
- No giveaway strings (SNARE, FAKE, TEST, etc.) in any output
- PEM structure for RSA keys
- JWT structure for K8s tokens
- Range and distribution for MustRandInt
@peg
peg merged commit cd1b184 into main Mar 14, 2026
1 check passed
@peg
peg deleted the fix/pre-launch-cleanup branch March 15, 2026 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant