Add `.env` and secret-scanning to CI to prevent credential commits
@ranjeet150 is already working on this.
Since Oct 9, 2026.
Assessment
- Difficulty
- 3/5
- Estimated time
- Half a day
- Newbie friendliness
- 42/100
Research direction
Start with .github/workflows/build-check.yml to see the existing jobs, then package.json line 28 for security:check, scripts/generate-secrets.sh, .gitignore, and the README warning at line 107. Check the git history for any committed .env file before choosing the allowlist. Done means a secret-scan job runs on pull requests over full history, security:check runs it, a reviewed baseline exists, and the rotate-then-purge process is documented.
Written by the indexing model from the issue text.
Description
Problem
There is no secret scanning in .github/workflows/build-check.yml, which runs only: install → codegen diff → tsc --noEmit → a narrow Jest subset → build, plus an OpenAPI/SDK job on pushes.
Meanwhile the repository is unusually exposed to credential leaks:
.env.example,.env.production.example,.env.secrets.templateare all committed (correctly, as templates)npm run security:generate-secretsruns a shell script (scripts/generate-secrets.sh) that creates secretssecurity:check(package.json:28) runsnpm audit, lint, and the KYC guard scan — but no secret scan, and it is not wired into CI- The README (line 107) warns "Never commit
.envfiles"
Nothing enforces that warning.
Why it matters
A committed secret is permanent in git history even after a later commit removes it, and anyone cloning gets it. On a project handling wallet signing keys, JWT secrets, and provider API keys, a leaked JWT_SECRET allows forging tokens — including admin tokens, given RolesGuard is registered globally.
GitHub's own secret scanning is unavailable for public repos only in older plan configurations and does not cover everything; a repo-side check is a useful second layer and catches leaks before they are pushed rather than after.
Suggested Direction
- Add a secret scan to CI using a maintained tool —
gitleaksortrufflehog— as a job in.github/workflows/build-check.ymlthat scans the full history, not just the working tree. Pin the action version and keep the config in-repo. - Extend
npm run security:check(package.json:28) to include the scan, so contributors can run the same checks locally that CI runs. - Verify
.gitignoreactually excludes.envand that no.envfile is present in history. This is the first thing to check — if a secret was already committed, remediation is: rotate it first, then purge history. Rotation is mandatory; history rewriting alone does not help. - Add a baseline file so existing known-safe matches (for example placeholder values in
.env.example) do not block every build. Tune the allowlist rather than disabling the scan. - Document the process — what to do when the scan fires, and that rotation comes before history rewriting.
Constraints
- A scan with no baseline will fail immediately on the existing templates; plan for a reviewed allowlist.
- Do not paste a detected secret into a CI log or an issue. The scanner must redact the value it reports.
scripts/generate-secrets.shmust be reviewed to confirm it writes outside version control.- Pair this with the plaintext-refresh-token issue — a leaked database dump is the same class of problem.
Acceptance Criteria
- A secret-scanning job runs in CI on pull requests and scans git history.
-
npm run security:checkincludes the scan. -
.gitignorecovers.env, confirmed by checking history for committed.envfiles. - A reviewed baseline allowlist exists so legitimate placeholder values do not fail the build.
- Detected values are redacted from scanner output.
- The response process (rotate first, then purge history) is documented.
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 55
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 5
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SourceXXL/alian_structure-api
-
good first issue help wanted security
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#266 ·
-
Parallelize the cache-warming loop in `cache-warming.service.ts` — warmers run strictly sequentiallyPossibly taken @syntaxsuuvam-spec claimed this 1 day ago. Opengood first issue performance
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SourceXXL/alian_structure-api#240 ·
-
documentation help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
SourceXXL/alian_structure-api#215 ·
-
good first issue refactor tooling
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
SourceXXL/alian_structure-api#199 ·
-
help wanted intermediate refactor
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
SourceXXL/alian_structure-api#196 ·
All issues in SourceXXL/alian_structure-api
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
microsoft/playwright#43327 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
microsoft/TypeScript#64758 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
opensearch-project/OpenSearch-Dashboards#12937 ·
Maintainers usually reply within 2 days
-
Liveness marks block-included attesters live in the block's epoch instead of the attestation's epochOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
status: needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
a2ui-project/a2ui#3158 ·
Maintainers usually reply within 2 days