ci: security hardening#195
Draft
zi0Black wants to merge 1 commit into
Draft
Conversation
- Pin actions/checkout@v4 to SHA 11bd71901bbe5b1630ceea73d27597364c9af683 (v4.2.2) - Add persist-credentials: false to checkout step - Add workflow-level permissions: contents: read (least privilege)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR hardens the GitHub Actions CI configuration for
.github/workflows/move_tests.yamlbased on azizmorsecurity audit (v1.24.1).Fixes Applied
1. SHA-pin
actions/checkoutactions/checkout@v4(mutable floating tag)actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.22. Add
persist-credentials: falseto checkout.git/config, reducing the blast radius if the job is compromised or if build artifacts (workspace files) are inadvertently uploaded.move-testsjob does not perform anygit pushorgit commitoperations after checkout.3. Add least-privilege
permissionsblockpermissions: contents: readat the workflow level.move-testsjob only needs to read repository contents to run tests — it does not write to git, upload releases, or use OIDC. The default GitHub Actions permissions are overly broad (write access to most scopes when using a PAT-style token context).Zizmor Results
unpinned-uses(HIGH) onactions/checkout@v4artipacked(MEDIUM) — nopersist-credentials: falseexcessive-permissions(MEDIUM) — no permissions blockRe-running
zizmor .github/after this patch returns 0 findings.Intentional Non-Fixes
aptos-labs/*actions are present in this repo currently, so the policy of not SHA-pinning internal actions has no applicable instances here.artipackedexemptions needed — the checkout step was not legitimately writing back to git.