Skip to content

Commit dc7dcbe

Browse files
committed
export gh secret scanning results
LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
1 parent d7040cd commit dc7dcbe

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

Makefile

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ SECURITY_GOVULN_PACKAGES := $(filter-out ./scripts,$(TEST_PACKAGES))
170170
testall:
171171
$(GOTEST) -count=1 $(TEST_PACKAGES)
172172

173-
.PHONY: security-govulncheck security-govulncheck-json security-osv security-gitleaks security-semgrep security-dependabot security-triage
173+
.PHONY: security-govulncheck security-govulncheck-json security-osv security-gitleaks security-semgrep security-dependabot security-gh-secret-scanning security-triage
174174

175175
# Run Go vulnerability analysis for reachable vulnerabilities.
176176
security-govulncheck:
@@ -277,6 +277,21 @@ security-dependabot:
277277
--paginate > "$$dated_report"; \
278278
echo "Wrote $$dated_report"
279279

280+
# Pull secret scanning alerts via GitHub API and emit a dated JSON artifact under security_issues/.
281+
security-gh-secret-scanning:
282+
@command -v $(GH) >/dev/null 2>&1 || { \
283+
echo "gh not found. Install from https://cli.github.com/"; \
284+
exit 1; \
285+
}
286+
@mkdir -p security_issues
287+
@dated_report="security_issues/gh-secret-scanning-live-review-$(shell date +%d-%m-%Y).json"; \
288+
$(GH) api \
289+
-H "Accept: application/vnd.github+json" \
290+
-H "X-GitHub-Api-Version: 2022-11-28" \
291+
/repos/$(GH_REPO)/secret-scanning/alerts \
292+
--paginate > "$$dated_report"; \
293+
echo "Wrote $$dated_report"
294+
280295
# Regenerate machine-readable and markdown triage artifacts from the latest OSV report.
281296
security-triage: security-osv
282297
@python3 scripts/extract_osv_report.py \

0 commit comments

Comments
 (0)