Commit Graph
2 Commits
Author SHA1 Message Date
Lauri Ojansivu ed19817433 releases/sec: SUMMARY.md carries no secret scanning field, and kept secrets are owner-only.
Code scanning alert #604 (py/clear-text-storage-sensitive-data, CWE-312):
download_github_security.py wrote a secret scanning alert's
secret_type_display_name into SUMMARY.md. That is the secret's type, not the
secret, but SUMMARY.md is the one file that is never redacted and the one most
likely to be pasted somewhere, so it now says only "Secret scanning alert" and
points at secret-scanning/, where the type still is. When
--include-secret-values keeps the secrets, the files holding them are created
readable by their owner only.

tests/securityDownloadScript.test.cjs checks the summary of a redacted and of a
kept download for the secret, its type and its type name, the 0600 mode of
kept secrets, and that describe() reads no field of a secret scanning alert
and every secret scanning write passes the private flag.

Thanks to GitHub CodeQL and xet7 !
2026-11-12 16:07:39 +02:00
Lauri Ojansivu 801f8956fe releases/sec: download a GitHub organization's Security and quality alerts with gh.
releases/sec/download-github-security.sh ORGANIZATION saves, for every
repository of the organization (or the ones named with --repo), its
Dependabot, code scanning, secret scanning and security advisory alerts
to .tools/log/sec/<organization>/<repository>/<YYYY-MM-DD_HH-MM-SS>/,
a directory per kind: alerts.json, a file per alert, an open code
scanning alert's instances, and SUMMARY.md with every open alert and its
link. It runs the GitHub CLI outside the editor's sandbox, where gh and
its login are, so the alerts can then be read and fixed from the files
inside it. A kind GitHub does not answer - not enabled, or not visible
to the account - gets status.txt with the reason and the run goes on;
archived repositories and forks are skipped unless asked for; the secret
a secret scanning alert found is redacted unless --include-secret-values
is given. A name that is not a GitHub name is refused before it becomes
a path or an API address. .tools/ keeps the downloads out of git.

tests/securityDownloadScript.test.cjs runs it against a stand-in gh: the
layout, both pages of a paginated answer, the summary, a disabled kind,
the redaction everywhere in the download and, as negatives, bad names,
no gh and gh signed out writing nothing. buildScriptParity knows why
build.sh has no menu entry for it.

Thanks to xet7 !
2026-11-11 04:25:18 +02:00