-
-
Notifications
You must be signed in to change notification settings - Fork 187
build(deps): clear all Dependabot advisories + harden CI security #1331
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
Changes from all commits
d7f7b31
fdde72d
b9cfb25
f1fca37
82bf126
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,40 @@ | ||
| name: Dependency Review | ||
|
|
||
| # Runs on every PR (no paths-ignore) so changes to docs/pnpm-lock.yaml are | ||
| # scanned too — the root CI workflow path-ignores docs/**, which previously | ||
| # left docs dependency bumps unreviewed. | ||
| on: | ||
| pull_request: | ||
| branches: [master] | ||
|
|
||
| concurrency: | ||
| group: dep-review-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| dependency-review: | ||
| name: Dependency Review | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - name: Harden Runner | ||
| uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4 | ||
| with: | ||
| egress-policy: audit | ||
| - name: Checkout | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Dependency Review | ||
| uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0 | ||
| with: | ||
| comment-summary-in-pr: on-failure | ||
| # Block newly-introduced moderate+ advisories in both runtime | ||
| # AND development scopes (the default only fails on runtime/high). | ||
| fail-on-severity: moderate | ||
| fail-on-scopes: runtime, development |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,13 +37,25 @@ jobs: | |
| with: | ||
| egress-policy: audit | ||
|
|
||
| # Mint a short-lived token for the "QuickAdd Release Bot" GitHub App. | ||
| # semantic-release pushes the release commit/tag with this token, so the | ||
| # push is attributed to the App, which is an allowed bypass actor on the | ||
| # master ruleset. The default GITHUB_TOKEN (github-actions[bot]) cannot | ||
| # be made a bypass actor, so its push would be blocked by branch protection. | ||
| - name: Generate release-bot token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | ||
| with: | ||
| app-id: ${{ secrets.RELEASE_APP_ID }} | ||
| private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
| with: | ||
| # semantic-release needs full history + tags and the persisted | ||
| # semantic-release needs full history + tags and the persisted App | ||
| # credential to push the release commit. Do not change these. | ||
| fetch-depth: 0 | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| token: ${{ steps.app-token.outputs.token }} | ||
|
Comment on lines
+45
to
+58
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show the workflow file with line numbers (bounded to keep output small)
nl -ba .github/workflows/release.yml | sed -n '1,200p'Repository: chhoumann/quickadd Length of output: 105 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Print workflow file with line numbers (no nl available)
awk '{printf "%6d\t%s\n", NR, $0}' .github/workflows/release.yml | sed -n '1,220p'Repository: chhoumann/quickadd Length of output: 9464 Delay minting the bypass-capable GitHub App token until right before the Release step
🧰 Tools🪛 zizmor (1.25.2)[warning] 52-58: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false (artipacked) [error] 47-47: dangerous use of GitHub App tokens (github-app): app token inherits blanket installation permissions (github-app) 🤖 Prompt for AI AgentsSource: Linters/SAST tools |
||
|
|
||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 | ||
|
|
@@ -74,7 +86,7 @@ jobs: | |
| - name: Release | ||
| id: release | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | ||
| DRY_RUN: ${{ github.event.inputs.dryRun || 'false' }} | ||
| run: | | ||
| EXTRA_ARGS="" | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: chhoumann/quickadd
Length of output: 232
🏁 Script executed:
Repository: chhoumann/quickadd
Length of output: 232
🏁 Script executed:
Repository: chhoumann/quickadd
Length of output: 12118
🌐 Web query:
actions/create-github-app-token v3.2.0 permission-contents permission-issues input names💡 Result:
In the actions/create-github-app-token action, permissions are configured by prefixing the relevant GitHub API permission name with permission- (e.g., permission-contents or permission-issues) [1][2]. The inputs for permission-contents and permission-issues function as follows: - permission-contents: Sets the level of permission granted to the access token for repository contents, including commits, branches, downloads, releases, and merges [2]. It can be set to either read or write [3][2]. - permission-issues: Sets the level of permission granted to the access token for issues, including related comments, assignees, labels, and milestones [2]. It can be set to either read or write [3][2]. By default, if no permission-* inputs are provided, the generated token inherits all permissions currently granted to the GitHub App installation [1][4]. It is recommended to explicitly list only the permissions required for your specific use case to follow security best practices [1][2]. The action validates these inputs against the allowed permissions schema [5][2].
Citations:
🌐 Web query:
actions/create-github-app-token supported permission-* keys pull-requests releases💡 Result:
The actions/create-github-app-token action supports all available GitHub App permission scopes by using inputs prefixed with
permission-[1][2][3]. To specify a permission, you replace the underscores in the GitHub API permission name with dashes and prefix it withpermission-(e.g., thepull_requestspermission becomespermission-pull-requestsandissuesbecomespermission-issues) [1][2]. Most permissions acceptreadorwriteas valid values, though specific permissions may have restricted options (e.g.,workflowsgenerally supports onlywrite) [4][2][3]. Key points regarding these permissions include: - Default Behavior: If nopermission-*inputs are provided, the generated token inherits all permissions currently granted to the GitHub App installation [1][2][3]. - Validation: Selected permissions must be granted to the GitHub App installation; requesting a permission the installation does not possess will result in an error [1][3]. - Mapping: The action internally maps the action input (e.g.,permission-pull-requests) to the corresponding GitHub API scope (e.g.,pull_requests) [2]. - Best Practice: It is recommended to explicitly list only the permissions required for your specific use case to follow the principle of least privilege [1]. For a complete list of all supported permission keys, you can refer to the action's officialaction.ymlfile, which defines these inputs dynamically [4][1][2].Citations:
Constrain the GitHub App token permissions (least privilege)
actions/create-github-app-tokenmints an installation token with the GitHub App’s granted permissions; if you omitpermission-*inputs, it inherits the App installation’s full scope, and the job-levelpermissions:block doesn’t reduce that scope. This App token is used foractions/checkoutand forsemantic-release(viaGITHUB_TOKEN), so request only the scopes you need.Suggested change
- name: Generate release-bot token id: app-token uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 with: app-id: ${{ secrets.RELEASE_APP_ID }} private-key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }} + permission-contents: write + permission-issues: write + permission-pull-requests: write📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.25.2)
[error] 47-47: dangerous use of GitHub App tokens (github-app): app token inherits blanket installation permissions
(github-app)
🤖 Prompt for AI Agents
Source: Linters/SAST tools