-
Notifications
You must be signed in to change notification settings - Fork 32
Add InfraScan audit workflow for security scanning #240
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| name: InfraScan Audit | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| infrascan: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pin actions to full commit SHAs for supply chain security. All three actions use tag references which are mutable and can be rewritten by attackers. Pin to full commit SHAs to protect against supply chain attacks. 🔐 Example fix for SHA pinning - name: Checkout code
- uses: actions/checkout@v4
+ uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1Apply similar pinning for As per static analysis hint: "unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)" Also applies to: 20-20, 27-27 🧰 Tools🪛 zizmor (1.25.2)[warning] 11-12: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||
|
|
||
| - name: Create Reports Directory | ||
| run: | | ||
| mkdir -p infrascan-reports | ||
| chmod 777 infrascan-reports | ||
|
|
||
| - name: Run InfraScan | ||
| uses: soldevelo/infrascan@v1.0.6 | ||
| with: | ||
| scanner: comprehensive | ||
| format: html | ||
| out: infrascan-reports/report.html | ||
|
|
||
| - name: Upload InfraScan Report | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() # Upload report even if the scan step fails | ||
| with: | ||
| name: infrascan-report | ||
| path: infrascan-reports/report.html | ||
| retention-days: 14 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set
persist-credentials: falseto prevent credential leakage.The checkout action persists credentials by default, which could be exposed through uploaded artifacts. Since this workflow uploads artifacts, explicitly disable credential persistence.
🔒 Proposed fix to disable credential persistence
- name: Checkout code uses: actions/checkout@v4 + with: + persist-credentials: falseAs per static analysis hint: "credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false"
🧰 Tools
🪛 zizmor (1.25.2)
[warning] 11-12: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
[error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents