Persisting credentials on boolean GitHub expressions #411
-
Hey, I got a small follow-up to the issue I posted today. I merged the audit fix for template expansions in our docs action (everything was green) and ended up with red CI only after the push on main. Why? Well, we build our docs on every PR, but deploy them, which involves creating a commit in our docs branch in CI using credentials, only on pushes to main, i.e. when This isn't supported by zizmor, which requires that any value other than false for FWIW, I think the current solution is really good from both user and dev perspectives, because it forces you to think about the ramifications of persisting credentials, and it doesn't try to accommodate every sidestep like what I just presented. But I'm wondering what your verdict is on a case like this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a great question, thank you! Yeah, this points to a basic (but significant) limitation in the expressivity of Some of the audits specialize this a bit (in zizmor/src/audit/artipacked.rs Lines 72 to 82 in b0c6f34 I've been thinking about ways to improve this, but unfortunately many of them are hard to generalize: it'd be great to consider In the mean time, there are probably a couple of things that could be done here
TL;DR: this is something I'm thinking about, and I have some ideas for improving the overall precision of our expression handling. Unfortunately however I think it's going to be impossible to generalize with |
Beta Was this translation helpful? Give feedback.
This is a great question, thank you!
Yeah, this points to a basic (but significant) limitation in the expressivity of
zizmor
's analyses: we often run into states where a value isT | expression
, whereexpression
is something potentially non-trivial.Some of the audits specialize this a bit (in
template-injection
for example, we walk the expression's AST to figure out if it's "safe" to expand), but other audits (likeartipacked
) simply give up and either ignore or blindly flag something depending on the context:zizmor/src/audit/artipacked.rs
Lines 72 to 82 in b0c6f34