4 ms·
One of the things I remember being discussed on m.d.s.policy not so long ago was making a registry (maybe handled by IANA) for example private keys. Turns out P
by tialaramex 4y ago
One of the things I remember being discussed on m.d.s.policy not so long ago was making a registry (maybe handled by IANA) for example private keys. Turns out Peter Gutmann did the heavy lifting (thank you Peter) to turn that from idle discussion into a draft document:
https://datatracker.ietf.org/doc/draft-gutmann-testkeys/ https://datatracker.ietf.org/doc/draft-gutmann-testkeys/
From the point of view of m.d.s.policy the main idea is to require CAs to reject these keys in certificates for the Web PKI and encourage software to use these keys (rather than their own examples) in sample code. Basically when you build my-cool-website.example and copy paste the private key from an example into your certificate fetching code, the CA should say "Er, no, you need to actually choose your own private key, that's what the word private means" and this should happen when you copy-paste a high-rated Stack Overflow example, the provided sample code from the library you used etc. Ideally these would all be the same keys is the idea.
It would also make sense for tools to care about these example keys e.g. GitHub could flag code that's checked in and has keys which are not these examples since maybe you used real keys by mistake in your GitHub repo, meanwhile your build-for-production CI tools could reject keys which are on the list because that means you forgot to pick actual keys for the real build.
- spockz 4y agoWe actually do this in our internal framework. All secrets (passwords, key material, etc) that we have in documentation and example projects are blacklisted for production in the framework itself and applications refuse to start.
- oneepic 4y agoOut of curiosity, do you have any tools/processes to avoid a situation like putting real secrets in new docs? Such as this popular story from 2017 [0]. And is there a way to automate publishing a test secret(s) to a doc and also send it to the blacklist? [0] https://www.reddit.com/r/cscareerquestions/comments/6ez8ag/accidentally_destroyed_production_database_on/ https://www.reddit.com/r/cscareerquestions/comments/6ez8ag/a...
- spockz 4y agoNone other than peer reviews and habit. All our passphrases are something like “exampledatabasepassword” whereas in reality they are long tokens. Then, secrets from production are hard to extract and typically rotated (semi-continuously). So it would be very strange if that somehow ended in up in a developers paste buffer to add to the docs.
- aaomidi 4y agoFor what it’s worth, if a private key related to a certificate is exposed and then revoked. That private key is effectively retroactively banned from that CA in its entirety.
- teddyh 4y ago> https://datatracker.ietf.org/doc/draft-gutmann-testkeys/ https://datatracker.ietf.org/doc/draft-gutmann-testkeys/ I read the document hoping for an example Authorization: Bearer token auth, but was disappointed. Even more surprising was the lack of any ed25519 key; I would also have used this in my documentation.
- scosman 4y agoI wonder if sample code using keys that don't look secure ("1111...") would lead to more or fewer incidents. Easier to guess, but more clear you're using guessable keys to the developer importing the code.