Skip to content

Commit 430d0dc

Browse files
authored
Add documentation for failed scans (#37)
1 parent 27a79c8 commit 430d0dc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/action_scanning.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,37 @@ jobs:
9999
path: '${{ steps.codeql_analysis.outputs.sarif-output }}/actions.sarif'
100100
retention-days: 1
101101
overwrite: 'true'
102+
103+
- name: 'Explain Failures and Next Steps'
104+
if: "failure() && steps.vuln_check.conclusion == 'failure'"
105+
run: |
106+
SARIF_FILE="${{ steps.codeql_analysis.outputs.sarif-output }}/actions.sarif"
107+
{
108+
echo "### Security Scan Results"
109+
echo ""
110+
echo "This is an automated scan to check for common classes of GitHub Actions security bugs."
111+
echo "The checks are currently in **evaluate mode**. Merging is still possible with a failing test, but please ensure there are no real vulnerabilities."
112+
echo "If you believe this is a false positive, please contact us (see below)."
113+
echo ""
114+
} >> "$GITHUB_STEP_SUMMARY"
115+
116+
if [ -f "$SARIF_FILE" ]; then
117+
echo "#### Findings" >> "$GITHUB_STEP_SUMMARY"
118+
jq -r '.runs[0].results[] | "- **" + .ruleId + "**: " + .message.text + " (" + .locations[0].physicalLocation.artifactLocation.uri + ":" + (.locations[0].physicalLocation.region.startLine | tostring) + ")"' "$SARIF_FILE" >> "$GITHUB_STEP_SUMMARY"
119+
else
120+
echo "SARIF file not found, cannot list specific failures." >> "$GITHUB_STEP_SUMMARY"
121+
fi
122+
123+
{
124+
echo ""
125+
echo "#### Documentation"
126+
echo "- [Untrusted Checkout (High)](https://codeql.github.com/codeql-query-help/actions/actions-untrusted-checkout-high/)"
127+
echo "- [Artifact Poisoning (Critical)](https://codeql.github.com/codeql-query-help/actions/actions-artifact-poisoning-critical/)"
128+
echo "- [Cache Poisoning (Poisonable Step)](https://codeql.github.com/codeql-query-help/actions/actions-cache-poisoning-poisonable-step/)"
129+
echo "- [Envpath Injection (Critical)](https://codeql.github.com/codeql-query-help/actions/actions-envpath-injection-critical/)"
130+
echo "- [Envvar Injection (Critical)](https://codeql.github.com/codeql-query-help/actions/actions-envvar-injection-critical/)"
131+
echo ""
132+
echo "#### Contact"
133+
echo "- **External users**: [email protected]"
134+
echo "- **Internal users**: go/github-requests (File a bug)"
135+
} >> "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)