You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if a secret is written to the log/file in more than 1 writes, it risks not being scrubbed as our logic does work for full values.
It shouldn't be a usual behavior, but it could happen, therefore we need to handle it.
Alternate implementation: better streaming capabilities, might allow some timing attack to discover some part of secrets
Regarding this subject, I was thinking about flushing some data that has no beginning of secrets in it, but if it had, then I would buffer until I can be sure no secrets are being written.
Let's say I have a secret this is secret.
We get Write("that is cool and this")
As this is the beginning of the secret, I could either flush that is cool and and conserve this as the future buffer.
Scenario 1: next one is Write("is secret, so don't leak it").
I get this + is secret, so don't leak it, I replace this is secret by *** and send the whole scrubbed data: ***, so don't leak it.
Scenario 2: we get Write("is creative. Nice work").
The rest of the string doesn't match the secret, so we cancel the buffering for now until another match.
I think it would be nice, and avoid the lack of streaming if there is no secret match.
The only thing I fear, is people abusing the system to discover secrets by executing the pipeline with specific strings and check via timing or other analysis that some secret starts with a specific word.
The risk can be reduced by adding some random reslicing of the flushed data: instead of flushing the whole "that is cool and " and buffering this, we could randomly flush "that is cool a" and buffer nd this, so it doesn't completely break the streaming and we don't completely leak some info about the secret as well.
Activity
grouville commentedon May 30, 2023
Currently being addressed by @matiasinsaurralde in #5149