Skip to content

security: lefthook + gitleaks secret gate; remove hardcoded credentials - #1431

Open
gHashTag wants to merge 1 commit into
mainfrom
fix/secret-gate
Open

gHashTag wants to merge 1 commit into
mainfrom
fix/secret-gate

Conversation

@gHashTag

@gHashTag gHashTag commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Closes #1430

What changed

Same fixes as gHashTag/trinity-fpga PR #900, applied to the files this repo shares with it, plus the secret gate.

  • fpga/esp32_wifi_bridge/esp32_wifi_bridge.ino: AP credentials move to a gitignored secrets.h; secrets.h.example added.
  • fpga/COMPLETE_CONNECTION_GUIDE.md: placeholders instead of the Wi-Fi password.
  • deploy/trinity-nexus/canvas/src/main_gui.zig, src/trinity_node/main_gui.zig: wallet password read from the environment (fails with error.MissingWalletPassword when unset).
  • tools/telegram-bridge/2fa-neuro-sage.sh: 2FA password from the environment.
  • .gitleaks.toml: shared [extend] + hardcoded-password-literal rule, byte-identical with the canonical copy (gHashTag/t27 PR #6433). Narrow allowlists: synthetic Kaggle data (1381 stripe-pattern false positives), public contract deployment JSON, archived .vibee spec examples, QA fixtures, and three lines (public token address, RFC 6455 example nonce, a registry slot name) plus the S07 prose note.
  • lefthook.yml: secret-gate added to the existing pre-commit and pre-push (existing commands kept). This repo uses core.hooksPath=.githooks, whose tracked hooks call lefthook run, so the gate runs without lefthook install.
  • .github/workflows/secret-scan.yml: new CI twin scanning the PR / push range.
  • .gitignore: secrets.h, .creds. README.md: "Secrets never enter the repository" section (no SECURITY.md here).

The docs/book generators, Kaggle scripts and ralph report script that held keys in trinity-fpga were already reading from the environment here.

Branch is fix/secret-gate, not security/...: the repo's pre-push branch-name rule only accepts feat|fix|docs|refactor|test|chore.

Verified

  • gitleaks dir . --config .gitleaks.toml -> exit 0
  • staged probe const char* wifi_password = "hunter2hunter2"; -> gitleaks git --staged exit 1 (probe removed)
  • lefthook install -> exit 1 (refuses because core.hooksPath is set to .githooks; left as is). The commit went through pre-commit secret-gate and the push through pre-push secret-gate via .githooks.

Credentials to rotate

They were pushed, so removing them does not unpublish them:

  • Wi-Fi AP password (ESP32 bridge firmware) - fpga/esp32_wifi_bridge/esp32_wifi_bridge.ino, fpga/COMPLETE_CONNECTION_GUIDE.md
  • Wallet password (node GUI) - deploy/trinity-nexus/canvas/src/main_gui.zig, src/trinity_node/main_gui.zig
  • Telegram account 2FA password - tools/telegram-bridge/2fa-neuro-sage.sh
  • Also in history (already removed from this tree earlier): DeepSeek API key (docs/book generators), Kaggle API token (targets/kaggle scripts), Telegram bot token (.trinity/ralph) - in this repo's git history (added, later removed); rotate them along with the trinity-fpga PR feat(queen): a round has a resolution moment #900 list.

🤖 Generated with Claude Code

- fpga/esp32_wifi_bridge: Wi-Fi AP credentials move to a gitignored
  secrets.h (secrets.h.example added); connection guide uses placeholders
- deploy/trinity-nexus/canvas and src/trinity_node main_gui.zig: wallet
  password read from the environment
- tools/telegram-bridge/2fa-neuro-sage.sh: 2FA password from the environment
- .gitleaks.toml: shared rules (canonical copy gHashTag/t27 PR #6433) plus
  narrow allowlists for synthetic Kaggle data, public contract addresses,
  archived spec examples, QA fixtures and three verified lines
- lefthook.yml: secret-gate on pre-commit and pre-push
- .github/workflows/secret-scan.yml: CI twin over the PR range
- .gitignore: secrets.h, .creds; README: secrets section

Same fixes as gHashTag/trinity-fpga PR #900.

Closes #1430

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gitguardian

gitguardian Bot commented Oct 5, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
37883008 Triggered Generic Password 0b74c39 tools/telegram-bridge/2fa-neuro-sage.sh View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@github-actions github-actions Bot added the status:in-progress 🔵 Agent working label Oct 5, 2026
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

X Brain Health Check

Score: 100.0/100
Status: 🟢 HEALTHY
Threshold: 80/100

X Brain is above merge threshold

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🧪 Brain Stress Test Results

Tests: 261/261 passed, 0 leaked
Status: 🟢 PASS
Gate: every test in zig build test-brain-stress passes and none leaks

This branch has not been deployed

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

Labels

status:in-progress 🔵 Agent working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

security: lefthook + gitleaks secret gate; remove hardcoded credentials

1 participant