Skip to content

fix(orb): require anonymization secret for export - #1267

Closed
JSONbored wants to merge 1 commit into
mainfrom
codex/propose-fix-for-empty-hmac-key
Closed

fix(orb): require anonymization secret for export#1267
JSONbored wants to merge 1 commit into
mainfrom
codex/propose-fix-for-empty-hmac-key

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent accidental de-anonymization when ORB_ANONYMIZE is enabled but ORB_WEBHOOK_SECRET is missing or trivially short, which allowed empty-key HMACs to be shipped to the collector.

Description

  • Require a stable per-instance anonymization secret when anonymization is on by returning early from exportOrbBatch if ORB_WEBHOOK_SECRET is not set or is shorter than 32 characters, and increment a metric gittensory_orb_export_errors_total with reason=missing_anonymization_secret (change in src/selfhost/orb-collector.ts).
  • Update unit tests in test/unit/selfhost-orb-collector.test.ts to use a long test secret for normal flows and add regression tests that assert export fails closed and does not call the collector when the secret is missing or weak.
  • Clarify the sample environment guidance in .env.example to document that ORB_WEBHOOK_SECRET is required (32+ characters) when ORB_ANONYMIZE=true.

Testing

  • Ran the targeted unit tests with npm test -- --run test/unit/selfhost-orb-collector.test.ts, and all tests in that file passed.
  • Verified git diff --check produced no spacing/conflict issues locally.
  • Attempted to run the full gate with npm run test:ci, which began but was blocked by local type resolution for optional native dependencies (pg / ioredis) during tsc and thus did not complete in this environment.
  • npm audit --audit-level=moderate was attempted but could not complete due to the registry audit endpoint returning 403 in this environment.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.03%. Comparing base (a6e32e7) to head (ac53908).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1267   +/-   ##
=======================================
  Coverage   95.03%   95.03%           
=======================================
  Files         177      177           
  Lines       19886    19889    +3     
  Branches     7166     7167    +1     
=======================================
+ Hits        18898    18901    +3     
  Misses        395      395           
  Partials      593      593           
Files with missing lines Coverage Δ
src/selfhost/orb-collector.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored

Copy link
Copy Markdown
Owner Author

Superseded by #1257. #1257 keys Orb anonymization off a dedicated, domain-separated key derived from the GitHub App private key and makes exportOrbBatch a no-op when that key is absent (if (!appKey) return 0) — i.e. it already requires an anonymization secret for export, and does so with higher-entropy, single-purpose material than a reused webhook secret. Closing this narrower fix in favor of #1257 (rebased + green). Reopen if #1257 is dropped.

@JSONbored JSONbored closed this Jun 24, 2026
@JSONbored
JSONbored deleted the codex/propose-fix-for-empty-hmac-key branch June 29, 2026 21:21
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.

Orb: fleet calibration collector + analytics (retire per-instance App; feed from review_audit)

1 participant