Repository navigation
[WISE] No secrets in files: gitignore, CI check, AGENTS.md rule #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+76
−0
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
48e94f6
[WISE] No secrets in files: gitignore, No env files check, AGENTS.md …
swu-wise[bot] 2234507
[WISE] No secrets in files: backup instead of rotate
swu-wise[bot] 333780c
[WISE] No env files: allow non-secret .cursor/infisical.env
swu-wise[bot] 0ca7082
[WISE] No env files: match suffixed .vars files, add job timeout
swu-wise[bot] fff019e
[WISE] No env files v2: suffix variants, no .dist, infisical.env cont…
swu-wise[bot] e63aa5a
[WISE] No env files v2: suffix variants, no .dist, infisical.env cont…
swu-wise[bot] 0d5f6bb
[WISE] No env files: exact infisical keys, safe path loop, exception …
swu-wise[bot] c40f1cc
[WISE] No env files: case-insensitive, any path component, envrc giti…
swu-wise[bot] a77681a
CI: content-check placeholder env files for real credential values. …
swu-rob[bot] 187ee6d
CI: allow quoted-empty placeholder values in env template check. Ass…
swu-rob[bot] 1206f1a
CI: match placeholder markers against the value only in env template …
swu-rob[bot] 115eb69
CI: anchor the auth alternative in the env template credential check.…
swu-rob[bot] 74bc8b2
fix(ci): classify placeholder values independently of key names
swu-echo[bot] c202719
CI: broaden auth matching in env template check with a non-secret kee…
swu-rob[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: No env files | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| no-env-files: | ||
| name: No env files | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Fail if an env or vars file is tracked | ||
| run: | | ||
| tracked=$(git ls-files) | ||
| bad=$(printf '%s\n' "$tracked" | grep -Ei '(^|/)[^/]*(\.env|\.vars|\.envrc)(\.[^/]*)?(/|$)' | grep -Eiv '\.(example|sample|template)$' | grep -Ev '(^|/)\.cursor/infisical\.env$' || true) | ||
|
swu-wise[bot] marked this conversation as resolved.
Resolved
|
||
| if [ -n "$bad" ]; then | ||
| echo "::error::Tracked env or vars files are not allowed. All secrets live only in Infisical." | ||
| echo "$bad" | ||
| exit 1 | ||
| fi | ||
| - name: Check Infisical coordinates files hold no secrets | ||
| run: | | ||
| status=0 | ||
| tracked=$(git ls-files) | ||
| while IFS= read -r f; do | ||
| [ -n "$f" ] || continue | ||
| if grep -Ev -- '^[[:space:]]*(#.*)?$' "./$f" | grep -Evq '^INFISICAL_(PROJECT_ID|ENV|DOMAIN)=[A-Za-z0-9._:/@-]*$'; then | ||
| echo "::error::$f may hold only INFISICAL_PROJECT_ID, INFISICAL_ENV and INFISICAL_DOMAIN" | ||
| status=1 | ||
| fi | ||
| done < <(printf '%s\n' "$tracked" | grep -E '(^|/)\.cursor/infisical\.env$' || true) | ||
| exit $status | ||
| - name: Check placeholder env files hold no real values | ||
| run: | | ||
| status=0 | ||
| tracked=$(git ls-files) | ||
| while IFS= read -r f; do | ||
| [ -n "$f" ] || continue | ||
| hits=$(grep -E -- '^[A-Za-z_][A-Za-z0-9_]*=[^[:space:]#]+' "./$f" | grep -Ev -- "^[A-Za-z_][A-Za-z0-9_]*=(\"\"|'')[[:space:]]*(#.*)?$" | sed -E 's/[[:space:]]+#.*$//' | awk '{ i = index($0, "="); k = tolower(substr($0, 1, i - 1)); v = tolower(substr($0, i + 1)); if (k ~ /(secret|token|password|passwd|api[-_]?key|private|credential|_key|(^|_)auth)/ && k !~ /^(author|auth_enabled)$/ && v !~ /(xxx|\.\.\.|<|changeme|change-me|your[-_]|example|placeholder|path\/to|redacted|dummy|todo)/) print }' || true) | ||
| if [ -n "$hits" ]; then | ||
|
swu-rob[bot] marked this conversation as resolved.
Resolved
|
||
| echo "::error::$f is a placeholder file but a credential-like key carries a non-placeholder value" | ||
| status=1 | ||
| fi | ||
| done < <(printf '%s\n' "$tracked" | grep -Ei '(^|/)[^/]*(\.env|\.vars|\.envrc)(\.[^/]*)?(/|$)' | grep -Ei '\.(example|sample|template)$' || true) | ||
|
swu-rob[bot] marked this conversation as resolved.
Resolved
|
||
| exit $status | ||
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.