-
Notifications
You must be signed in to change notification settings - Fork 123
flowey: make values secret, not variables #1338
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
Conversation
Nice! Pushing secrecy to the value level seems like it should work better than having it at the variable level. My thinking was to lift secrecy to the type system (similar to claimed/not-claimed), but wrangling that extra type param would be far more annoying than this approach. Also, glad to see some the cleanup in/around some of the more gnarly bits of internal plumbing! |
Yeah, I had thought about putting it into the type system so that callers were aware they were using something that (might be) secret. But I think that makes it hard to auto-propagate the secret marker without playing lots of type system games or making everything extremely explicit. This approach seems the cleanest. |
Currently, a `ReadVar`/`WriteVar` pair can be marked as secret, in which case flowey is careful never to display it in logs. To mark a variable, the user must remember to create the variable pair with `new_secret_var()`, and the user must ensure that users of the variable to do not rewrite its contents into some other, non-secret variable. This is hard to do accurately, especially as we change the code to create more variables implicitly. Change the model so that _variables_ are not secret but their _values_ can be--when any variable is written to, the caller can specify that the value is secret. Propagate this to readers of the variable, even if this variable is converted into and back from a CI environment variable. By default, be conservative: once a Rust step reads a secret from a variable, treat all future values written as secret. Add specific `write_secret` and `write_non_secret` methods for overriding this default.
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.
Currently, a
ReadVar
/WriteVar
pair can be marked as secret, in which case flowey is careful never to display its value in logs. To mark a variable as such, the user must remember to create the variable pair withnew_secret_var()
, and the user must ensure that users of the variable to do not rewrite its contents into some other, non-secret variable. This is hard to do accurately, especially as we change the code to create more variables implicitly (via<foo>v
-style methods such asreqv
andemit_rust_stepv
).Change the model so that variables are not secret but their values can be--when any variable is written to, the caller can specify that the value is secret. Propagate this to readers of the variable, even if this variable is converted into and back from a CI environment variable.
By default, be conservative in marking values as secret: once a Rust step reads a secret value from a variable, mark all future values written by that step as secret. Add specific
write_secret
andwrite_non_secret
methods for overriding this default.