-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add missing security workflows (dependency-review, trivy, zizmor) #92
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
97904c7
35ad31b
1b36b1a
31ddb99
d8ff560
5274888
c5dd155
a037894
a58f3ac
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,4 @@ | ||
| * @chrismaz11 | ||
| /apps/api/src/ @chrismaz11 | ||
| /circuits/ @chrismaz11 | ||
| /packages/core/ @chrismaz11 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: Dependency diff review | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - work | ||
|
|
||
| # Restrict to the minimum permissions needed for checkout and dependency review. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| name: Dependency diff review | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Dependency diff review | ||
| uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # v4.7.1 | ||
| with: | ||
| fail-on-severity: high |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Trivy repository scan | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - master | ||
| - work | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - work | ||
|
|
||
| # Restrict to minimum required permissions. | ||
| # security-events: write is required only for SARIF upload to code scanning. | ||
| permissions: | ||
| contents: read | ||
| security-events: write | ||
|
|
||
|
Comment on lines
+13
to
+18
|
||
| jobs: | ||
| trivy: | ||
| name: Trivy filesystem scan | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Run Trivy filesystem scan | ||
| uses: aquasecurity/trivy-action@6e7b7d1fd3e4fef0c5fa8cce1229c54b2c9bd0d8 # v0.30.0 | ||
| with: | ||
| scan-type: fs | ||
| scan-ref: "." | ||
| severity: HIGH,CRITICAL | ||
| ignore-unfixed: true | ||
| format: sarif | ||
| output: trivy-results.sarif | ||
|
|
||
| - name: Upload Trivy SARIF to code scanning | ||
| # Skip on forked PRs — GitHub does not grant security-events: write to | ||
| # untrusted fork tokens, so SARIF upload would fail with a permissions error. | ||
| if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }} | ||
| uses: github/codeql-action/upload-sarif@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18 | ||
| with: | ||
| sarif_file: trivy-results.sarif | ||
| category: trivy | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||||||||||||||||
| name: zizmor advisory audit | ||||||||||||||||||||
|
|
||||||||||||||||||||
| on: | ||||||||||||||||||||
| pull_request: | ||||||||||||||||||||
| paths: | ||||||||||||||||||||
| - ".github/workflows/**" | ||||||||||||||||||||
|
|
||||||||||||||||||||
| # Restrict to minimum required permissions. | ||||||||||||||||||||
| permissions: | ||||||||||||||||||||
| contents: read | ||||||||||||||||||||
|
|
||||||||||||||||||||
| jobs: | ||||||||||||||||||||
| zizmor: | ||||||||||||||||||||
| name: zizmor workflow audit | ||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||
| steps: | ||||||||||||||||||||
| - name: Checkout | ||||||||||||||||||||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||||||||||||||||||||
| with: | ||||||||||||||||||||
| persist-credentials: false | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Install zizmor | ||||||||||||||||||||
| run: pip install zizmor==1.5.0 | ||||||||||||||||||||
|
|
||||||||||||||||||||
| - name: Run zizmor workflow audit | ||||||||||||||||||||
| # Advisory mode — findings are reported but do not fail the job. | ||||||||||||||||||||
| # Maintainers should review and address findings before merging workflow changes. | ||||||||||||||||||||
| run: | | ||||||||||||||||||||
| EXIT_CODE=0 | ||||||||||||||||||||
| zizmor --format plain .github/workflows/ || EXIT_CODE=$? | ||||||||||||||||||||
| if [ $EXIT_CODE -ne 0 ]; then | ||||||||||||||||||||
| echo "::warning::zizmor found workflow security findings (advisory). Review the output above before merging." | ||||||||||||||||||||
| fi | ||||||||||||||||||||
| exit 0 | ||||||||||||||||||||
|
Comment on lines
+28
to
+34
|
||||||||||||||||||||
| run: | | |
| EXIT_CODE=0 | |
| zizmor --format plain .github/workflows/ || EXIT_CODE=$? | |
| if [ $EXIT_CODE -ne 0 ]; then | |
| echo "::warning::zizmor found workflow security findings (advisory). Review the output above before merging." | |
| fi | |
| exit 0 | |
| continue-on-error: true | |
| run: zizmor --format plain .github/workflows/ |
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.
This workflow sets
node-version: 22for theverify-artifact-actionjob, but the repo rootpackage.jsondeclares Node20.xand the action itself declares>=20. Using 22 here can mask compatibility issues and adds avoidable drift—please align this job to Node 20 (or update the repo engines if 22 is now required).