Skip to content

feat(tracking): add key rotation and worker abuse protections#295

Open
salmonumbrella wants to merge 3 commits intosteipete:mainfrom
salmonumbrella:issue-293-294-tracking-security
Open

feat(tracking): add key rotation and worker abuse protections#295
salmonumbrella wants to merge 3 commits intosteipete:mainfrom
salmonumbrella:issue-293-294-tracking-security

Conversation

@salmonumbrella
Copy link
Contributor

Summary

Test plan

  • Go build compiles cleanly
  • All Go tests pass (go test ./internal/tracking/... ./internal/cmd/...)
  • Key rotation: versioned encrypt → decrypt with multiple keys → legacy fallback
  • Bot detection: expanded UA matching, header presence checks, timing-based prefetch detection
  • /q/ endpoint requires admin Bearer token (security fix from code review)
  • Drive filter pass-through with compound queries, case sensitivity
  • Gmail MIME non-ASCII header encoding edge cases

Closes #293
Closes #294

🤖 Generated with Claude Code

salmonumbrella and others added 3 commits February 14, 2026 12:15
…aders

Drive search now detects raw API filter syntax (field comparisons,
contains, membership, has) and passes it through instead of wrapping
in fullText contains. Plain-text searches always append trashed=false
to prevent false positives.

Gmail MIME now RFC 2047-encodes display names with non-ASCII characters
in From/To/Cc/Bcc/Reply-To headers using net/mail.

Fixes steipete#254, fixes steipete#255

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Closes steipete#293 and steipete#294.

- add TRACKING_KEY_V<n> secrets and current-version tracking metadata\n- add gmail track key rotate command and config metadata\n- persist all key versions and deploy rotated key set to worker\n- add per-IP rate limit + duplicate open dedupe in worker\n- harden bot detection heuristics and tokenized decryption compatibility\n
- Fix Go syntax error in IsConfigured() multiline return
- Fix variable scoping bug in DecryptWithVersions (unmarshalErr)
- Add admin auth to /q/ endpoint to protect IP/location data
- Fix slice mutation in decryptionVersionOrder
- Fix test configs missing AdminKey and --no-deploy flag position

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

Security: Add rate limiting to email tracking Cloudflare Worker Security: Add key rotation mechanism for email tracking encryption

1 participant