|
99 | 99 | path: '${{ steps.codeql_analysis.outputs.sarif-output }}/actions.sarif' |
100 | 100 | retention-days: 1 |
101 | 101 | 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