Repository navigation
ci: Resolve concurrency-limits, ref-version-mismatch, stale-action-refs, superfluous-actions, and unpinned-uses - #742
Conversation
See: https://github.com/actions/checkout/releases/tag/v6.0.2 See: https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd..0c366fd6a839edf440554fa01a7085ccba70ac98 The only difference is the update to the changelog. Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
| toolchain: ${{ matrix.rust }} | ||
| - run: rustup toolchain add ${TOOLCHAIN} && rustup default ${TOOLCHAIN} | ||
| env: | ||
| TOOLCHAIN: ${{ matrix.rust }} |
There was a problem hiding this comment.
Why can't we use dtolnay/rust-toolchain?
There was a problem hiding this comment.
- It doesn't really offer much over using
rustupdirectly, especially for very simple toolchain needs like we have here. So using this action instead of the pre-installedrustupdoes extra work and increases our attack surface/supply chain risk. Even ifdtolnayalready has write access to this repo (I don't know if they do or not), depending on this action when we don't need to is just a possible path to compromise in the future when they might not have write access anymore. (which, to be clear, I am not suggesting I thinkdtolnayis going to try to do anything. I am suggesting ifdtolnaywere to have their account or credentials compromised, the attackers could then act on their behalf) - It doesn't have proper releases/tags. The only release/tag is v1, and the tag just gets moved around to new commits, making it impossible to properly satisfy
ref-version-mismatchandstale-action-refs. We could tellzizmor/crabwatchto ignore those lints, but because there's no proper version comment that would match the hash consistently, Dependabot can't keep this action updated. An alternative would be to track the literal tag v1 or themasterbranch itself, which should remove the need to update the action to get additional fixes, but that leads tounpinned-usesfailing, which is also not desirable. Similarly, we could configurezizmor/crabwatchto ignore that as well, but unless there's a concrete reason to prefer the action over usingrustupdirectly, it's just better for our security posture to do away with it.
Ultimately, my goal is just to get the lints to pass so we can enable them and improve our security posture across the rust-lang repos. It is preferable to replace the action with rustup directly, but if you have a reason to prefer the action, there are other ways I can satisfy the lints. If you do have a reason and want to keep using the action, I'd need to know if you'd rather stick on a commit, which puts you at risk of falling far behind on updates, or if you'd rather track the tag/branch directly, which leads to less stability and slightly increased supply chain risk over using a commit or rustup directly.
| rust: stable-x86_64-pc-windows-gnu | ||
| steps: | ||
| - uses: actions/checkout@0c366fd6a839edf440554fa01a7085ccba70ac98 # v6.0.2 | ||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
There was a problem hiding this comment.
There's a v7 of checkout now I think so while we're updating it we may as well use that, unless you're specifically trying to align everything to the same version
There was a problem hiding this comment.
I'm specifically trying to avoid updating things unless asked. The v6.0.2 tag does not point to the old commit, it points to the new one. It doesn't look like any tag points to the old commit, and there's no real code changes between the two (see the comparison link in the PR body).
But yeah, I'll update this to v7 for you, that's not a problem at all.
|
@hashcatHitman I'm not familiar with |
Yes, that's
I'm not a member of If you want to avoid the noise of multiple visits, I can also resolve more findings in this PR if you want (I've just started trying that approach elsewhere). But that will come with more of the "questionable-to-no-real-benefit" lints (which very well may never be enabled organization-wide). |
See: https://github.com/actions/checkout/releases/tag/v7.0.1 Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
Actually, now that I check, the only other lint that fires for this repository is |
Signed-off-by: hashcatHitman <155700084+hashcatHitman@users.noreply.github.com>
ref-version-mismatch, stale-action-refs, superfluous-actions, and unpinned-usesconcurrency-limits, ref-version-mismatch, stale-action-refs, superfluous-actions, and unpinned-uses
There was a problem hiding this comment.
Thanks for helping out with this @hashcatHitman!
Standardising our CI workflows across the org does seem like a good idea. I guess we need to move to trusted publishing at some point too. I currently publish releases of log through my own infra so when we make that change I’ll disable mine.
I think @Kobzol has been going around switching a lot of our crates to trusted publishing lately, so you might get a visit from him soon about that. |
|
I'm happy to set that up, though it requires some input from maintainers. I'll discuss it with KodrAus. Edit: opened #743 |
In pursuit of getting more
zizmorlints enforced acrossrust-langrepos throughcrabwatch, this PR fixes all findings of theconcurrency-limits,ref-version-mismatch,stale-action-refs,superfluous-actions, andunpinned-usesrules (there were no findings forunpinned-usesin this repo, though) (this leads to resolving all possible findings withzizmor1.31.1).For
actions/checkout, it seems 6.0.2 may have been re-tagged at some point. You can compare the old commit and the new commit here: https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd..0c366fd6a839edf440554fa01a7085ccba70ac98The only difference is changelog entries being added.
For
dtolnay/rust-toolchain, it seems like re-tagging is the only tagging it knows. Fortunately,rustupis already installed onubuntu-latest,windows-latest, andmacos-latest. Switching to usingrustupdirectly clearsref-version-mismatchandstale-action-refs, with the added benefit of clearingsuperfluous-actions.The hash pin format is supported by tools like Dependabot and Renovate, which can update the pinned hashes and their associated comments. If you'd like help setting either of those up, let me know which you prefer, and if you'd like it in this PR or a new one.