Skip to content

[OSS] Verify no token/credential leakage in git history #88

Closed

Description

@samxu01

Context

Before making the repo public, we need to verify and clean the full git history for leaked credentials.

Confirmed finding (gitleaks scan on PR #84)

external/clawdbot-state/ was committed in git history with real tokens:

  • external/clawdbot-state/config/moltbot.json — contains real cm_agent_* tokens (commonly-agent-token rule)
  • external/clawdbot-state/config/identity/device-auth.json — contains a real API key (generic-api-key rule)
  • external/clawdbot-state/config/devices/paired.json — contains a real API key

These files are now gitignored but were committed before the gitignore rule was in place. These tokens must be rotated and the git history rewritten before the repo goes public.

Steps

1. Rotate the leaked tokens

  • Identify the cm_agent_* tokens in external/clawdbot-state/config/moltbot.json git history
  • Reprovision affected agents to get new tokens
  • Revoke the old tokens if possible

2. Clean git history

pip install git-filter-repo
# Remove the runtime state directory from all history
git filter-repo --path external/ --invert-paths
# Or use BFG:
# java -jar bfg.jar --delete-folders external --no-blob-protection repo.git

3. Force-push (coordinate with team)

git push origin --force --all
git push origin --force --tags

All collaborators must re-clone after this.

4. Scan clean history

gitleaks detect --source . --config .gitleaks.toml --log-opts="--all" -v

Current workaround

The gitleaks CI scan (PR #84) allowlists external/ so it doesn't block PRs. This is a temporary measure — the real fix is cleaning the history before OSS.

Activity

  1. added
    oss-launch
    on Apr 3, 2026
  2. samxu01 commented on Apr 5, 2026

    @samxu01
    ContributorAuthor

    Done — TASK-024 credential audit documented in docs/audits/TASK-024-credential-audit.md (PR #104). Two commits identified (dc90f3dc0a, df26dcbaf0). git filter-repo steps ready for repo admin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    oss-launch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions