feat(ci): add secret-scan workflow + reusable entry point for org-wide enrollment - #2109
Merged
Merged
Conversation
…e enrollment Defense-in-depth for the #2090-class incident (2026-04-24): GitHub's hosted Copilot Coding Agent leaked a ghs_* installation token into tenant-proxy/package.json via npm init slurping the URL from a token-embedded origin remote. We can't fix upstream's clone hygiene, so we gate at the PR layer. Single workflow, dual purpose: 1. PR / push / merge_group gate on this repo (molecule-monorepo). Refuses any change whose diff additions contain a credential-shaped string. Same shape as Block forbidden paths — error message tells the agent how to recover without echoing the secret value. 2. Reusable workflow entry point (workflow_call) for the rest of the org. Other Molecule-AI repos enroll with a 3-line workflow: jobs: secret-scan: uses: Molecule-AI/molecule-monorepo/.github/workflows/secret-scan.yml@main This makes molecule-monorepo the single source of truth for the regex set; consumer repos pick up new patterns without per-repo PRs. Pattern set covers GitHub family (ghp_, ghs_, gho_, ghu_, ghr_, github_pat_), Anthropic / OpenAI / Slack / AWS. Mirror of the runtime's bundled pre-commit hook (molecule-ai-workspace-runtime: molecule_runtime/scripts/pre-commit-checks.sh) — keep aligned when either side adds a pattern. Self-exclude on .github/workflows/secret-scan.yml so the file's own regex literals don't block its merge. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
HongmingWang-Rabbit
enabled auto-merge
April 26, 2026 19:21
This was referenced Apr 26, 2026
Merged
Closed
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-medo
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-security-scan
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-session-context
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-skill-code-review
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-skill-cron-learnings
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-skill-cross-vendor-review
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-skill-llm-judge
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-skill-update-docs
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-workflow-retro
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-workflow-triage
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-superpowers
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/docs
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-openclaw
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-langgraph
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-deepagents
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-crewai
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-autogen
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-claude-code
that referenced
this pull request
Apr 29, 2026
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-claude-code
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-gemini-cli
that referenced
this pull request
Apr 29, 2026
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-gemini-cli
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-hermes
that referenced
this pull request
Apr 29, 2026
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-workspace-template-hermes
that referenced
this pull request
Apr 29, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-prompt-watchdog
that referenced
this pull request
May 2, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-compliance
that referenced
this pull request
May 2, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-org-template-molecule-worker-gemini
that referenced
this pull request
May 2, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-plugin-molecule-freeze-scope
that referenced
this pull request
May 2, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-org-template-reno-stars
that referenced
this pull request
May 2, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
HongmingWang-Rabbit
added a commit
to Molecule-AI/molecule-ai-org-template-medo-smoke
that referenced
this pull request
May 2, 2026
chore(ci): enroll in org-wide secret-scan reusable workflow (EnterOS-AI/enter-os-core#2109)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Molecule-Platform-Evolvement-Manager]
Org-wide CI gate against credential leaks. Defense-in-depth for the #2090-class incident — audit log proved the leak source was GitHub's hosted Copilot Coding Agent (UA
GitHub CLI 2.90.0 Agent/claude-code), not Molecule's CP-BE. That agent runs in GitHub infra outside our control and clones with the token embedded in the remote URL;npm initthen slurps it intopackage.json. We can't fix upstream's clone hygiene — we gate at the PR layer.Pairs with
Molecule-AI/molecule-ai-workspace-runtime#55which adds the same scan as a runtime-side pre-commit hook (catches commits made by our runtime; this PR catches commits made by GitHub-hosted agents that bypass our runtime).Single workflow, dual purpose
pull_request,push(main/staging),merge_groupworkflow_callPattern set
Covers GitHub family (
ghp_,ghs_,gho_,ghu_,ghr_,github_pat_), Anthropic, OpenAI, Slack, AWS. Mirror of the runtime's bundled pre-commit hook (molecule-ai-workspace-runtime: molecule_runtime/scripts/pre-commit-checks.sh). When either side adds a pattern, update both.Anchored on prefixes with low false-positive rates against agent-generated content. No plain hex blobs (would false-positive on commit hashes / IDs).
Error message redacts the matched value
Prints
<file> (matched: <pattern>)only — the secret value never lands in CI logs (logs are searchable + retained, so echoing widens the blast radius).Self-exclude
.github/workflows/secret-scan.ymlis on the SELF exclude list because the file's own regex literals would otherwise block its own merge.Rollout plan (follow-up PRs, separate scope)
After this lands, enroll the high-traffic repos surfaced in the audit log (top 5 by Copilot Coding Agent activity over 7 days):
molecule-coredocsmolecule-monorepomolecule-controlplanemolecule-ai-workspace-runtimeEach enrollment PR is 3 lines:
Plus a one-line branch-protection update to mark
Scan diff for credential-shaped stringsas required.Test plan
ghs_[A-Za-z0-9]{36,}against itself; if SELF didn't work the workflow would fail on its own mergemolecule-controlplaneas the canary consumer to confirmworkflow_callcross-repo invocation worksmolecule-monoreporepo's 169 agent events are legitimate (not orphan) before enrolling🤖 Generated with Claude Code