chore: Be stricter on action permissions #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub Actions Security Analysis with zizmor | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
permissions: {} | |
jobs: | |
zizmor: | |
name: zizmor latest via uv | |
runs-on: ubuntu-latest | |
permissions: | |
security-events: write | |
# required for workflows in private repositories | |
contents: read | |
actions: read | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
api.github.com:443 | |
files.pythonhosted.org:443 | |
github.com:443 | |
objects.githubusercontent.com:443 | |
pypi.org:443 | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
persist-credentials: false | |
- uses: astral-sh/setup-uv@f94ec6bedd8674c4426838e6b50417d36b6ab231 #v5.3.1 | |
- run: uvx zizmor --persona pedantic --format sarif . > results.sarif | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11 | |
with: | |
sarif_file: results.sarif | |
category: zizmor |