Skip to content
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

Check for vulnerable dependencies in CI #21424

Merged

Conversation

cole-miller
Copy link
Contributor

@cole-miller cole-miller commented Dec 2, 2024

This PR adds GitHub's dependency review action to CI, to flag PRs that introduce new Cargo.lock entries for vulnerable crates according to the GHSA database.

An alternative would be to run cargo audit, which checks against the RustSec database. The state of synchronization between these two databases seems a bit messy, but as far as I can tell GHSA has most recent RustSec advisories on file, while RustSec is missing a larger number of recent GHSA advisories.

The dependency review action should be smart enough not to flag PRs because an untouched entry in Cargo.lock has a new advisory.

I've turned off the "license check" functionality since we have a separate CI step for that.

Release Notes:

  • N/A

This PR add's GitHub's dependency review action to CI, to flag PRs that
introduce new Cargo.lock entries for vulnerable crates according to the
GHSA database.

An alternative would be to run `cargo audit`, which checks against the
RustSec database. The state of synchronization between these two
databases seems a bit messy, but as far as I can tell GHSA has most
recent RustSec advisories on file, while RustSec is missing a larger
number of recent GHSA advisories.

The dependency review action should be smart enough not to flag PRs
because an untouched entry in Cargo.lock has a new advisory.

I've turned off the "license check" functionality since we have a
separate CI step for that.
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 2, 2024
@cole-miller cole-miller requested a review from osiewicz December 2, 2024 21:36
Copy link
Contributor

@osiewicz osiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cole-miller cole-miller merged commit e1c509e into zed-industries:main Dec 2, 2024
13 checks passed
notpeter added a commit that referenced this pull request Jan 15, 2025
Only run actions dependency-review-action if running in a PR action.
This broke as part of a release action.
- https://github.com/zed-industries/zed/actions/runs/12793068921/job/35664998296

Originally introduced in:
- #21424

But was only tested with `merge_group` which has since been reverted.
notpeter added a commit that referenced this pull request Jan 15, 2025
Only run actions dependency-review-action if running in a PR action.

This broke when run as part of action for commit on main and on a
preview branch:
- https://github.com/zed-industries/zed/actions/runs/12793068921/job/35664998296
- https://github.com/zed-industries/zed/actions/runs/12793045639

Originally introduced in:
- #21424

But was only tested with `merge_group` which has since been reverted.
notpeter added a commit that referenced this pull request Jan 15, 2025
Only run actions dependency-review-action if running in a PR action.

This broke when run as part of action for commit on main and on a
preview branch:
- https://github.com/zed-industries/zed/actions/runs/12793068921/job/35664998296
- https://github.com/zed-industries/zed/actions/runs/12793045639

Originally introduced in:
- #21424

But was only tested with `merge_group` which has since been reverted.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants