Live data from Hacker News

Toyota suffered a data breach by accidentally exposing a secret key on GitHub

blog.gitguardian.com

161–170 of 272 posts

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#161
post #148

Earlier quoted context omitted.

Why would they need to have > customer identification numbers and emails to provide service? Seriously?

Yes, seriously. They need to service the vehicle, OK, but communicate to and through the vehicle.

What does that mean? The repair tech tells my car that it's ready for pickup and my car ignores him because it's a car not a communication channel?

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#162
post #12

Earlier quoted context omitted.

But at least that failure just makes the services fail, not opens a security hole.

Except in the scenarios where the company's support starts telling users to click through the warning, which I've seen a few times.

Yuck. I hadn't considered that.

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#163

Earlier quoted context omitted.

Awesome feature. Saved the day for us some months back when an AWS token was accidentally committed and pushed. (AWS itself also immediately notified us.)

Rant time: this isn’t directed at you. I am just replying to your comment because you said something that triggered me. Also the “you” below is the generic you - not you personally. Disclaimer: I work at AWS in Professional Services, all rants are my own. Now with that out of the way, I hate the fact that there are way too many code samples floating around on the internet that have you explicitly put your access key…

Hindsight is 20/20, but definitely one of those places where flat out giving the credentials should not even be an option (or it should be made artificially tedious and/or explicitly clear that it’s a bad idea by e.g. naming the param _this_is_a_bad_idea_use_credentials_file_instead_secret_key or so). Of course there are always edge cases in the vein of running notebooks in containers (probably not an optimal example, but some edge case like that) where you might need the escape hatch of embedding the credentials straight to the code.

But yeah, if the wrong thing is easier or more straightforward than the right way, people tend to follow it when they have a deadline to meet. To end on a positive note, at least cli v2 makes bootstrapping the credentials to a workstation a tad easier!

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#164

Earlier quoted context omitted.

It's totally free - there are details of how to join the program at https://docs.github.com/en/developers/overview/secret-scanni...

Hm - this would work better if keys were easy to scan with regular expressions. Next time I implement api keys I wonder if it’s worth going out of my way to make them easy to identify. Eg, by prefixing every key with a few well known characters. Like FMLA_xxxxx for a fastmail app key.

If you go make an API key in Fastmail (Settings -> Password & Security -> API tokens), you'll see that it's prefixed very similarly to that (e.g. `fmo1-`) for this very reason! (There are some other neat things about our API key format I'd be happy to tell you about sometime if you're interested.)

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#165

Earlier quoted context omitted.

Rant time: this isn’t directed at you. I am just replying to your comment because you said something that triggered me. Also the “you” below is the generic you - not you personally. Disclaimer: I work at AWS in Professional Services, all rants are my own. Now with that out of the way, I hate the fact that there are way too many code samples floating around on the internet that have you explicitly put your access key…

Hindsight is 20/20, but definitely one of those places where flat out giving the credentials should not even be an option (or it should be made artificially tedious and/or explicitly clear that it’s a bad idea by e.g. naming the param _this_is_a_bad_idea_use_credentials_file_instead_secret_key or so). Of course there are always edge cases in the vein of running notebooks in containers (probably not an optimal example…

> at least cli v2 makes bootstrapping the credentials to a workstation a tad easier!

I know I should know this seeing that I work in ProServe at AWS, but what do you mean?

I’m going to say there is never a use case for embedding credentials just so I can invoke Cunningham’s Law on purpose.

But when I need to test something in Docker locally I do

    docker run -e AWS_ACCESS_KEY_ID= -e AWS_SECRET_ACCESS_KEY= -e AWS_DEFAULT_REGION= 
And since you should be using temporary access keys anyway that you can copy and paste from your standard Control Tower interface, it’s easy to pass those environment variables to your container.

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#166
post #143

Earlier quoted context omitted.

GitHub PM here. Glad that was a good experience! We work with ~50 partners (details in the link below) to notify them when tokens for their service are exposed in public repos, so that they can notify you. https://docs.github.com/en/code-security/secret-scanning/sec...

TIL: make private key for your service easy to match with regexps

Reminds me of how Airbnb redacts Hawaiian street addresses because they look too much like phone numbers, literally replacing them with a "phone number hidden" string in the host|guest chat.

Moral of the story: make your keys regexable without likelihood of false positives!

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#168
post #143

Earlier quoted context omitted.

GitHub PM here. Glad that was a good experience! We work with ~50 partners (details in the link below) to notify them when tokens for their service are exposed in public repos, so that they can notify you. https://docs.github.com/en/code-security/secret-scanning/sec...

TIL: make private key for your service easy to match with regexps

The whole industry should adopt a convention to prefix production keys with a well known prefix, such as "prod_secret_".

We should have our systems and precommit hooks then alert us when those enter places they shouldn't and help us automate rotation.

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#169

Earlier quoted context omitted.

Rant time: this isn’t directed at you. I am just replying to your comment because you said something that triggered me. Also the “you” below is the generic you - not you personally. Disclaimer: I work at AWS in Professional Services, all rants are my own. Now with that out of the way, I hate the fact that there are way too many code samples floating around on the internet that have you explicitly put your access key…

Hindsight is 20/20, but definitely one of those places where flat out giving the credentials should not even be an option (or it should be made artificially tedious and/or explicitly clear that it’s a bad idea by e.g. naming the param _this_is_a_bad_idea_use_credentials_file_instead_secret_key or so). Of course there are always edge cases in the vein of running notebooks in containers (probably not an optimal example…

I remember a Rust AWS library worked like you describe (An old version of rusoto, I think, deprecated now).

I wasn't familiar with how AWS credentials are usually managed so I was very confused why I had to make my own struct and implement the `CredentialSource` trait on it. It felt like I was missing something... because I was. You're not supposed to enter the credentials directly, you're supposed to use the built-in EnvCredentialSource or whatever.

Re: Toyota suffered a data breach by accidentally exposing a secret key on GitHub

#170
post #143

Earlier quoted context omitted.

GitHub PM here. Glad that was a good experience! We work with ~50 partners (details in the link below) to notify them when tokens for their service are exposed in public repos, so that they can notify you. https://docs.github.com/en/code-security/secret-scanning/sec...

TIL: make private key for your service easy to match with regexps

Yeah, prefixing your keys with your service name like SRVCE_{KEY} is the way to go.

Bonus: adding SRVCE_PRVT_{KEY} and SRVCE_PUB_{KEY}.

Post reply on HN