T08 · Insecure Dependencies
Warning
- Location
references/ci-setup.md:25- Finding
Unpinned Third-Party CI Actions and Cargo Tools Create Supply-Chain Risk
- Content
View full analysis
- Remediation
View remediation
# v4 - uses: dtolnay/rust-toolchain@ - uses: Swatinem/rust-cache@ # v2 ``` 2. Do not use branch references such as `@master` or moving toolchain references such as `@stable`. Pin the action implementation by SHA and continue specifying the required Rust toolchain through the action's inputs. 3. Pin Cargo tools to reviewed versions and preserve their lockfile resolution: ```shell cargo install cargo-deny --version --locked cargo install cross --version --locked cargo install cargo-hack --version --locked ``` 4. Configure explicit least-privilege permissions at workflow or job level. For jobs that only inspect source code, use: ```yaml permissions: contents: read ``` Grant write permissions only to the specific job that requires them. 5. Avoid passing tokens to actions unless required. Where a token is necessary, restrict its permissions and ensure workflows triggered from untrusted contributions cannot access privileged secrets. 6. Review action source and release provenance before updating pinned SHAs. Use an automated dependency-update service to propose SHA updates through normal code review rather than relying on moving tags. 7. Protect release workflows with environment approval, artifact provenance or attestations, and isolated jobs. Verify release artifacts before publication. 8. Consider installing Cargo tools from a controlled internal artifact repository or prebuilt, checksum-verified toolchain image for high-assurance CI environments. ]]>
