-
Notifications
You must be signed in to change notification settings - Fork 8
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
Remove generate-lockfile
To Prevent Overwriting Checked-In Lock Files
#20
Conversation
We also just experienced the action missing a potential vulnerability in our binaries because the lock file was regenerated. However, I think it may make sense to regenerate a lock file for library crates because the lock file will be ignored if the library is used as a dependency. How about making the lock file (re)generation optional? |
It is generally recommended to check in lock files for binaries but not for libraries. For checked in lock files in binary projects and CI actions I don't think it should be re-generated during auditing workflows and absolutely respected. |
The official recommendations regarding checking in lock files for libraries were changed last year: https://blog.rust-lang.org/2023/08/29/committing-lockfiles.html My thinking was that as a library author you may want to know if using your library may leave a project vulnerable regardless of whether you choose to commit the lock file or not. |
Ah yeah this change is still encouraging to check in for binaries but does not use "enforcing" language from my perspective.
Totally agree on this and it was not part of my perspective previously. |
Re-built with latest upstream changes (upgrade to node 20) to resolve merge conflicts. |
Why are there changes to |
As far as I understand how this action works is that the minified and bundled I mentioned in Zulip that this makes review harder and is whacky for concurrent PRs and would be open to contribute another PR where the repository workflows automatically builds the I also updated the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, in the future it would be good to keep any changes to dependencies completely isolated and with a rationale for why they're being changed/updated, as they're an easy to introduce surreptitious supply chain attacks.
Automating the index.js builds (and more generally, automating deployments) would be good as well.
That said, approved.
@tarcieri Can we get a release with this change please? |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rustsec/audit-check](https://redirect.github.com/rustsec/audit-check) | action | major | `v1.4.1` -> `v2.0.0` | --- ### Release Notes <details> <summary>rustsec/audit-check (rustsec/audit-check)</summary> ### [`v2.0.0`](https://redirect.github.com/rustsec/audit-check/releases/tag/v2.0.0) [Compare Source](https://redirect.github.com/rustsec/audit-check/compare/v1.4.1...v2.0.0) #### What's Changed - Run on Node 20.x by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - Remove `generate-lockfile` To Prevent Overwriting Checked-In Lock Files by [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - Added support for `working-directory` by [@​ranger-ross](https://redirect.github.com/ranger-ross) in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - fix: security fix for vulnerability in `braces` library by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/23](https://redirect.github.com/rustsec/audit-check/pull/23) - npm audit fix by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) - v2.0.0 release prep by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/25](https://redirect.github.com/rustsec/audit-check/pull/25) #### New Contributors - [@​clechasseur](https://redirect.github.com/clechasseur) made their first contribution in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) made their first contribution in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - [@​ranger-ross](https://redirect.github.com/ranger-ross) made their first contribution in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - [@​tarcieri](https://redirect.github.com/tarcieri) made their first contribution in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) **Full Changelog**: rustsec/audit-check@v1.4.1...v2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/spiraldb/vortex). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOltdfQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rustsec/audit-check](https://redirect.github.com/rustsec/audit-check) | action | major | `v1.4.1` -> `v2.0.0` | --- ### Release Notes <details> <summary>rustsec/audit-check (rustsec/audit-check)</summary> ### [`v2.0.0`](https://redirect.github.com/rustsec/audit-check/releases/tag/v2.0.0) [Compare Source](https://redirect.github.com/rustsec/audit-check/compare/v1.4.1...v2.0.0) #### What's Changed - Run on Node 20.x by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - Remove `generate-lockfile` To Prevent Overwriting Checked-In Lock Files by [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - Added support for `working-directory` by [@​ranger-ross](https://redirect.github.com/ranger-ross) in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - fix: security fix for vulnerability in `braces` library by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/23](https://redirect.github.com/rustsec/audit-check/pull/23) - npm audit fix by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) - v2.0.0 release prep by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/25](https://redirect.github.com/rustsec/audit-check/pull/25) #### New Contributors - [@​clechasseur](https://redirect.github.com/clechasseur) made their first contribution in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) made their first contribution in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - [@​ranger-ross](https://redirect.github.com/ranger-ross) made their first contribution in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - [@​tarcieri](https://redirect.github.com/tarcieri) made their first contribution in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) **Full Changelog**: rustsec/audit-check@v1.4.1...v2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rustic-rs/rustic_core). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiQS1kZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: simonsan <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rustsec/audit-check](https://redirect.github.com/rustsec/audit-check) | action | major | `v1.4.1` -> `v2.0.0` | --- ### Release Notes <details> <summary>rustsec/audit-check (rustsec/audit-check)</summary> ### [`v2.0.0`](https://redirect.github.com/rustsec/audit-check/releases/tag/v2.0.0) [Compare Source](https://redirect.github.com/rustsec/audit-check/compare/v1.4.1...v2.0.0) #### What's Changed - Run on Node 20.x by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - Remove `generate-lockfile` To Prevent Overwriting Checked-In Lock Files by [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - Added support for `working-directory` by [@​ranger-ross](https://redirect.github.com/ranger-ross) in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - fix: security fix for vulnerability in `braces` library by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/23](https://redirect.github.com/rustsec/audit-check/pull/23) - npm audit fix by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) - v2.0.0 release prep by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/25](https://redirect.github.com/rustsec/audit-check/pull/25) #### New Contributors - [@​clechasseur](https://redirect.github.com/clechasseur) made their first contribution in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) made their first contribution in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - [@​ranger-ross](https://redirect.github.com/ranger-ross) made their first contribution in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - [@​tarcieri](https://redirect.github.com/tarcieri) made their first contribution in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) **Full Changelog**: rustsec/audit-check@v1.4.1...v2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 9pm,before 6am" in timezone Europe/Zurich, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/smartive/zitadel-rust). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC44MC4wIiwidXBkYXRlZEluVmVyIjoiMzguODAuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rustsec/audit-check](https://redirect.github.com/rustsec/audit-check) | action | major | `v1.4.1` -> `v2.0.0` | --- ### Release Notes <details> <summary>rustsec/audit-check (rustsec/audit-check)</summary> ### [`v2.0.0`](https://redirect.github.com/rustsec/audit-check/releases/tag/v2.0.0) [Compare Source](https://redirect.github.com/rustsec/audit-check/compare/v1.4.1...v2.0.0) #### What's Changed - Run on Node 20.x by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - Remove `generate-lockfile` To Prevent Overwriting Checked-In Lock Files by [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - Added support for `working-directory` by [@​ranger-ross](https://redirect.github.com/ranger-ross) in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - fix: security fix for vulnerability in `braces` library by [@​clechasseur](https://redirect.github.com/clechasseur) in [https://github.com/rustsec/audit-check/pull/23](https://redirect.github.com/rustsec/audit-check/pull/23) - npm audit fix by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) - v2.0.0 release prep by [@​tarcieri](https://redirect.github.com/tarcieri) in [https://github.com/rustsec/audit-check/pull/25](https://redirect.github.com/rustsec/audit-check/pull/25) #### New Contributors - [@​clechasseur](https://redirect.github.com/clechasseur) made their first contribution in [https://github.com/rustsec/audit-check/pull/16](https://redirect.github.com/rustsec/audit-check/pull/16) - [@​tillmann-crabnebula](https://redirect.github.com/tillmann-crabnebula) made their first contribution in [https://github.com/rustsec/audit-check/pull/20](https://redirect.github.com/rustsec/audit-check/pull/20) - [@​ranger-ross](https://redirect.github.com/ranger-ross) made their first contribution in [https://github.com/rustsec/audit-check/pull/21](https://redirect.github.com/rustsec/audit-check/pull/21) - [@​tarcieri](https://redirect.github.com/tarcieri) made their first contribution in [https://github.com/rustsec/audit-check/pull/24](https://redirect.github.com/rustsec/audit-check/pull/24) **Full Changelog**: rustsec/audit-check@v1.4.1...v2.0.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Never, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/rustic-rs/rustic). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45NC4zIiwidXBkYXRlZEluVmVyIjoiMzguOTQuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiQS1kZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
## Summary This is an upgrade of the `audit-check` package used in CI for running `cargo audit`. ## Background This upgrade includes [a fix](rustsec/audit-check#20) for an issue where `audit-check` would not respect the committed `Cargo.lock` file. ## Changes - Upgrade `audit-check`.
In CI builds, Rust applications or libraries are usually built with
--locked
or--frozen
which uses the checked-inCargo.lock
file in the repository to decide which exact dependency version is used.The current
audit-check
action does not respect this checked-inCargo.lock
file as it automatically overwrites the versions based on theCargo.toml
policies. This means the audited library or application is using different dependencies than the release/production build in most cases.The
cargo audit
readme mentions to usecargo generate-lockfile
but we couldn't figure out why this should be done in CI builds or in cases when the application or library is built with the--locked
or--freeze
argument.cargo-audit
implements logic to generate aCargo.lock
file if not already existing inlocate_or_generate
. The additional lock file generation seems not needed and causes checked-in lock files to be ignored and overwritten.We tested the behavior of
cargo audit
with and without lock files in the following action runs:Unmodified Action
outdated lock file is ignored, no vulns are found
no lock file exists, no vulns are found
Modified Action
Removed
generate-lockfile
invocation fromaudit-check
action.outdated lock file is respected, vulns are found
no lock file exists, no vulns are found
Manual Action
This action uses
dtolnay/rust-toolchain
to install Rust and runs plaincargo audit
. It was used to compare behavior.outdated lockfile is respected, vulns are found