-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
Secrets: Prevent Accidental Exposure #3709
Comments
So a static analysis that tells you where the secret could reach? I like the idea, I think it would be useful. There are limits to how far the analysis can go though. Pass it through String.split or save it in the DB and all bets are off. An extension to this could be to have secrets as their own type. You can convert them to strings via |
How so? I'm sure the limit is somewhere, though.
Yes! Maybe it would turn out like
Totally agreed. I imagine packages requiring you to configure settings within that specific context.
|
It's just a common problem with static analysis: you get false positives, and once there's enough false positives users stop looking at them. Which isn't to say there isn't value here, not at all. Just that we have a type system too and if we can use it alongside the analysis to either reduce or eliminate false positives, we'll get better outcomes for users. |
merged this issue into #5260 |
Currently, Dark "Secrets" aren't shown within the editor UI, but it's trivial to "leak" them accidentally (e.g. create the Secret, then create a route that returns the Secret). This is sort of status quo for a secret manager - it's just a dictionary. Dark has a somewhat unique opportunity to build in mechanisms preventing users from accidentally exposing/leaking their secrets.
Here's one idea. At each function and top-level, you're warned about Secrets used by itself and its dependencies. Some warning icon presents itself within or adjacent to the TopLevel/function. When you click that warning icon, you're presented with a choice of marking the function:
e.g. a fn to map/convert a Secret to another Type
e.g. a function that makes an API call, and needs the secret as part of auth.
You should be able to see all of the warnings centrally somewhere.
(centralized error reporting+logs is worth a separate larger chat!)
Tangential thoughts to extract:
I think Dark only support strings? I've wanted some non-Strings, and had to convert)
there' opportunity here to do this in a unique way.
maybe this is some variant of a Datastore (a new Secrets type there? Maybe it's already supported - I haven't checked)
what if the feature "breaks" somehow, and we don't warn them somewhere? might look bad on Dark
(ideally tests prevent this, but bugs happen)
The text was updated successfully, but these errors were encountered: