Skip to content

Remove committed secrets; enforce env vars + gitleaks pre-commit/CI gates - #930

Open
devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1788181270-secrets-sweep
Open

devin-ai-integration[bot] wants to merge 3 commits into
mainfrom
devin/1788181270-secrets-sweep

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Weekly gitleaks sweep found live secrets committed on main (values redacted):

  • .github/workflows/deploy.yml:15-16 — AWS access key ID + secret (AKIA**** / ****)
  • .github/workflows/deploy.yml:23 — Slack bot token (xoxb-****)
  • .github/workflows/deploy.yml:29 — GitHub PAT (ghp_****)
  • .github/workflows/deploy.yml:35 — Stripe live key (sk_live_****)
  • backend/src/config/production.js:14 — hardcoded JWT secret (****), plus Postgres URL with password and SendGrid key
  • frontend/.env — tracked env file (only non-secret VITE_API_URL; removed anyway)

Remediation (same approach as PRs #862/#865/#870/#902/#909/#923):

  • deploy.yml now uses ${{ secrets.* }} references instead of literals.
  • production.js reads config via requireEnv(name) which throws when the env var is missing — no fallback literals.
  • .gitignore: ignore .env / *.env (allow *.env.example); frontend/.env untracked and removed.
  • .pre-commit-config.yaml: gitleaks hook (pinned rev).
  • .github/workflows/gitleaks.yml: CI gate on push/PR running the gitleaks CLI (--no-git working-tree scan; history still contains leaks until purged), checkout pinned to SHA, HTTPS-enforced download.

Post-fix working-tree scan: no leaks. Backend tests (161) pass; frontend lint clean.

Rotation required

All leaked credentials (AWS, Slack, GitHub PAT, Stripe, JWT secret, Postgres password, SendGrid) must be treated as compromised and rotated — git history still contains them. History purging should be done separately.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/a9ed8ff8c04949e29c34812655543ebc
Open in Devin Desktop: https://partner-workshops.devinenterprise.com/desktop/session/a9ed8ff8c04949e29c34812655543ebc?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@sonarqubecloud

Copy link
Copy Markdown

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.

0 participants