What changed, and why it matters
This commit tightens the GitHub Actions workflow permissions for the Trezor firmware repository. Previously, the entire workflow had broad permissions: it could write OIDC tokens, read repository contents, and write pull-request comments. Now those permissions are removed from the top level and granted only to the specific jobs that actually need them. This is a defensive hardening change that reduces the damage if a malicious or compromised step were abused, but it does not by itself fix an active vulnerability.
Review the change as a routine security hardening improvement. Ensure that every job receiving `id-token: write` genuinely requires AWS OIDC federation, that the trust policy on the AWS IAM roles is scoped to this repository and branch/tag patterns, and that no other workflow in the repository retains overly broad top-level permissions. No urgent incident response is indicated.
Security signals we found
Principle of least privilege applied to CI/CD permissions
Reduction of workflow-wide `id-token: write` and `pull-requests: write` scopes
Scoped OIDC token write permission to AWS-assuming jobs only
Scoped pull-request write permission to the single job that posts comments
No functional code or firmware logic changed
Evidence from the diff
The change modifies .github/workflows/core.yml. It removes the global permissions block that granted id-token: write, contents: read, and pull-requests: write to every job, leaving only contents: read at the workflow level. It then adds narrowly scoped permissions blocks to individual jobs that require elevated access: id-token: write plus contents: read for jobs that assume an AWS role via OIDC, pull-requests: write only for the job that posts PR comments, and id-token: write alone for jobs that only need AWS access. This follows the principle of least privilege for GitHub Actions workflows.
Changed components
.github/workflows/core.ymlGitHub Actions CI/CD pipeline for Trezor Core firmwareInspect captured patch +21 / −4
### .github/workflows/core.yml
@@ -25,9 +25,7 @@ concurrency:
cancel-in-progress: true
permissions:
- id-token: write # for fetching the OIDC token
- contents: read # for actions/checkout
- pull-requests: write # for dflook comments on PR
+ contents: read # for actions/checkout
env:
SDL_VIDEODRIVER: dummy
@@ -410,6 +408,9 @@ jobs:
TEST_LANG: ${{ matrix.lang }}
TESTOPTS: "--durations 10 --session-timeout ${{ matrix.model == 'T3W1' && '3000' || '1800' }}" # pytest global timeout
timeout-minutes: ${{ matrix.model == 'T3W1' && 60 || 40 }} # CI job timeout
+ permissions:
+ id-token: write # for fetching the OIDC token for AWS
+ contents: read # for actions/checkout
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
@@ -465,6 +466,9 @@ jobs:
TEST_LANG: ${{ matrix.lang }}
TESTOPTS: "--durations 10 --session-timeout '1800'" # pytest global timeout (30m)
timeout-minutes: 40
+ permissions:
+ id-token: write # for fetching the OIDC token for AWS
+ contents: read # for actions/checkout
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
@@ -552,6 +556,9 @@ jobs:
env:
TREZOR_PROFILING: ${{ matrix.asan == 'noasan' && '1' || '0' }}
PYTEST_TIMEOUT: 400
+ permissions:
+ id-token: write # for fetching the OIDC token for AWS
+ contents: read # for actions/checkout
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:
@@ -856,6 +863,10 @@ jobs:
timeout-minutes: 10
needs:
- param
+ permissions:
+ id-token: write # for fetching the OIDC token for AWS
+ contents: read # for actions/checkout
+ pull-requests: write # for dflook comments on PR
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
- run: sleep 1m # try avoiding github api rate limit
@@ -869,7 +880,6 @@ jobs:
with:
role-to-assume: arn:aws:iam::538326561891:role/gh_actions_deploy_dev_firmware_data
aws-region: eu-west-1
-
- run: python ci/make_summary_htmls.py "index" '${{ needs.param.outputs.test_lang }}' "tests/ui_tests/reporting/"
- run: python ci/make_summary_htmls.py "diff" '${{ needs.param.outputs.test_lang }}' "tests/ui_tests/reporting/"
- name: Upload per-language HTML summaries to S3
@@ -888,6 +898,8 @@ jobs:
needs:
- core_emu
- core_emu_arm
+ permissions:
+ id-token: write # for fetching the OIDC token for AWS
steps:
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
with:
@@ -921,6 +933,8 @@ jobs:
needs:
- core_emu
- core_emu_arm
+ permissions:
+ id-token: write # for fetching the OIDC token for AWS
steps:
- uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # actions/download-artifact@v8.0.0
with:
@@ -1007,6 +1021,9 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: core_firmware
+ permissions:
+ id-token: write # for fetching the OIDC token for AWS
+ contents: read # for actions/checkout
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # actions/checkout@v6.0.2
with:Why this scored 39/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.