DEP: upgrade and pin github action dependencies to immutable hash forms#160
DEP: upgrade and pin github action dependencies to immutable hash forms#160neutrinoceros wants to merge 1 commit intobrandon-rhodes:masterfrom
Conversation
But isn't pinning also a security risk, since if a bug is found in, say, But I'm new at this and maybe there are other docs you need to point me at. Thanks! |
Yeah, but that's only if you never upgrade again. Dependabot works well enough for periodic upgrades at a relatively long interval now (quarterly), and it also support cooldown periods to ignore versions that are more recent than a given threshold (usually, a week), protecting you against supply chain attacks by giving plenty time to upstream maintainers to course correct in case they ever get compromised. |
So — to see if I understand this point — Dependabot these days understands not only the notation Let me think through the two possible vulnerability surfaces here. There are two dangerous situations: Danger 1 — an existing action is discovered to be vulnerable to an exploit. Once the problem is discovered, the vendor, either GitHub or the PyPA, releases a fixed version of the action to replace the flawed version. If my actions are specified with a version like If my actions are specified like So to decide between approaches, I need to weigh Danger 1 against Danger 2, since switching to hashes fixes one danger while making the other much worse. It seems to me that Danger 1 is by far the more likely. Vendors discover problems in code all the time and have to release patches and fixes. But Danger 2 seems very unlikely. While there will doubtless be an occasion on which either GitHub Actions or the PyPA are compromised, and malicious code is released in their name, I would expect that to be far rarer than the case where they accidentally release code of their own that, it turns out, has a flaw. So switching to hashes would seem much more dangerous than sticking with the advice of the official GitHub docs, and using designations like If you could: try writing up how you think of the trade-off, using these same two "Danger" categories, or adding more if there are other ways an attack surface could arise that I'm not thinking of. And thanks again for all the effort you're making here with sgp4! I'm learning a lot, and am grateful. |
yes. It'll open PRs on its own actually, according to a preset schedule, and only go out of schedule when and if a vulnerability is detected in your pinned versions.
Still, only if you don't have a way to automate upgrades. Your whole reasoning is very sound, it's just missing a crucial bit of information that I added here :)
Thanks for being so thoughtful in your reviews, I really appreciate these discussions ! |
|
Alas — given the troubles I've had before with GitHub Actions, I'm not ready at this point to switch away from the But I would be happy to accept this if the upgrades switch to the simple |
|
It's really no trouble, but it is a different enough goal that I'd rather do it as a separate PR |
My starting point was a warning on CI, related to
actions/upload-artifact@v4using a deprecated version of node, and thus, in need for an upgrade. I usedpinact init + pinact run --updateto upgrade all GHA dependencies, which also comes with the benefit of pinning them to immutable git hashes, replacing mutable (sometimes intentionally moving) git tags which consistute a security risk as they can be leveraged to create supply chain attacks.