Add cargo-audit workflow for dependency security scanning#272
Open
ChunMinChang wants to merge 2 commits intomozilla:trailblazerfrom
Open
Add cargo-audit workflow for dependency security scanning#272ChunMinChang wants to merge 2 commits intomozilla:trailblazerfrom
ChunMinChang wants to merge 2 commits intomozilla:trailblazerfrom
Conversation
Run on all PRs to enforce security compliance. Can be set as a required check in branch protection rules to block PRs until vulnerabilities are fixed. Also runs weekly and on push to trailblazer.
There was a problem hiding this comment.
Pull request overview
This PR introduces automated security scanning for Rust dependencies using cargo-audit, configured to run on a weekly schedule, on all pull requests, and on pushes to the trailblazer branch.
Changes:
- Added a new GitHub Actions workflow for security auditing
- Configured the workflow to run weekly on Sundays and on all PRs
- Set up cargo-audit to scan dependencies in both the main project and the coreaudio-sys-utils subdirectory
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.github/workflows/security-audit.yml
Outdated
Comment on lines
+20
to
+27
| - name: Install cargo-audit | ||
| run: cargo install cargo-audit | ||
|
|
||
| - name: Run security audit | ||
| run: cargo audit | ||
|
|
||
| - name: Run security audit (coreaudio-sys-utils) | ||
| run: cargo audit --file coreaudio-sys-utils/Cargo.lock |
There was a problem hiding this comment.
Installing cargo-audit on every workflow run is inefficient and slow. Consider caching the installation or using a pre-built action like rustsec/audit-check@v2 which includes cargo-audit and is optimized for CI environments.
Suggested change
| - name: Install cargo-audit | |
| run: cargo install cargo-audit | |
| - name: Run security audit | |
| run: cargo audit | |
| - name: Run security audit (coreaudio-sys-utils) | |
| run: cargo audit --file coreaudio-sys-utils/Cargo.lock | |
| - name: Run security audit | |
| uses: rustsec/audit-check@v2 | |
| - name: Run security audit (coreaudio-sys-utils) | |
| uses: rustsec/audit-check@v2 | |
| with: | |
| crate-dir: coreaudio-sys-utils |
Replace manual cargo-audit installation with rustsec/audit-check@v2 action for faster CI runs. The action includes cargo-audit pre-built and is optimized for CI environments.
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.
Run weekly on all PRs for trailblazer to enforce security compliance. Can be set as a required check in branch protection rules to block PRs until issues are fixed.