Skip to content

chore: delete a test script containing a committed API key - #398

Merged
leggetter merged 1 commit into
mainfrom
chore/remove-committed-api-key
Sep 14, 2026
Merged

leggetter merged 1 commit into
mainfrom
chore/remove-committed-api-key

Conversation

@leggetter

Copy link
Copy Markdown
Collaborator

Deletes test-scripts/test-api-upsert-behavior.sh, which hardcoded a live Hookdeck project API key on line 11 and used it to Bearer-authenticate three calls to api.hookdeck.com.

Exposure

Committed 03adebd, 2025-10-29 — public for 320 days
Reach project tm_htnSCvufI7RK ("First project used in CI testing"), org org_bB7LoMBOeQH0
Spread main, release/v3.0.0, feat/api-2026-09-01, 24 of 29 remote branches, 44 of 102 tags

It was a project-scoped key: full read/write over that one project — connections, sources, destinations, transformations, and event/request payload history. The key has been revoked (GET /projects now returns 401, confirmed), so the committed string is inert.

Mitigating: the project is in the Automated Testing organization, not Hookdeck production, with max_events_per_second: 5.

Why delete rather than parameterise

  • Nothing references it — no workflow, no package.json script, no Makefile target. CI only invokes test-npm-build.sh and test-homebrew-build.sh from that directory, neither of which touches the API.
  • What it probes — whether source and destination are required when updating a connection — is already covered properly by the upsert cases in test/acceptance/connection_test.go.
  • It reads as one-off debugging that got committed by accident. Keeping it means keeping a file whose only remaining purpose is to hold a credential.

History is deliberately not rewritten

Once revoked, the committed string has no value. Purging it would mean rewriting main plus 44 tags and force-pushing a public repository — a larger and riskier change than the remaining exposure justifies. Worth treating as a separate, deliberate decision if it's wanted.

Not affected

The leaked key matched none of the five credentials in the local test/acceptance/.env (compared by SHA-256; values never printed), so it is a sixth, separate credential rather than a copy of a CI secret.

Two things that remain worth confirming, and are not resolved by this PR:

  • HOOKDECK_CLI_TESTING_API_KEY in GitHub Actions was last updated 2025-06-14 — the same date project tm_htnSCvufI7RK was created. The leaked key reaches that same project, and CI runs against it. So the two are related to the same project even though the values differ locally.
  • A local .env can drift from the Actions secret of the same name. The decisive check is empirical: with the key now revoked, re-run the acceptance workflow. If it passes, CI's secret is genuinely a different credential.

Follow-up worth considering

Enable secret scanning / push protection on the repo, and gitignore ad-hoc probe scripts under test-scripts/.


🤖 Generated with Claude Code

https://claude.ai/code/session_01BnrKWZQASV7bFJ4oGWwmo9

test-scripts/test-api-upsert-behavior.sh hardcoded a live Hookdeck project
API key on line 11 and used it to authenticate three calls to api.hookdeck.com.
It was committed on 2025-10-29 and has been public since, across main,
release/v3.0.0, 24 of 29 remote branches and 44 tags whose source tarballs
carry it.

The key has been revoked, so the string is inert. Deleting rather than
parameterising: nothing references this script -- no workflow, no package.json
entry, no Makefile target -- and what it probes (whether source and destination
are required when updating a connection) is covered properly by the upsert
cases in test/acceptance/connection_test.go. Keeping it would mean keeping a
file whose remaining purpose is to hold a credential.

History is not rewritten. Once the key is revoked the committed string has no
value, and purging it would mean rewriting main plus 44 tags and force-pushing
a public repository -- a bigger and riskier change than the exposure now
warrants.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BnrKWZQASV7bFJ4oGWwmo9
@leggetter
leggetter merged commit 3f4b2dd into main Sep 14, 2026
11 of 13 checks passed
@leggetter
leggetter deleted the chore/remove-committed-api-key branch September 14, 2026 18:07
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