The article suggests writing tests on columns in log data with sensitive names e.g., containing “token”, “secret”, “key”, which is a common practise, and finds many cases 2/5
But you should think of this as a strong typing issue, all sensitive data needs to have a type that doesn't have a way of printing it at all, or only as "redacted". Look at the type signatures for a crypto library, there are operations on keys but you cannot extract them 3/5
A password should only have operations to check a hash, for example. There are very few exceptions, eg capabilities (eg one time URLs) can be passed, but this should not be a generic print method but more structured. Type systems are your friend. 4/5
Obviously this still needs tests, but the tests are much more generic, and behaviour can't be accidentally violated at the call site, and you can't depend on being able to read secrets. Get you security people to help design your types and operations. 5/5
You can follow @justincormack.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.