Earlier quoted context omitted.
If only github had a community of developers that could play such a catch up game... oh wait. It's kind of amusing you are arguing that it's impossible to play this game, even though that's exactly what the perpetrators are doing, they are automatically detecting API keys and harvesting the code... maybe their script is hosted on github?
My point in my OP was to not play the game of catch-up, don't even pitch in your vuln strs. Any time you want to show me a 100% future-proof algorithm for sensitive-info detection that works across any/all code on github, I'd be happy to toss my hat in and say, "I was wrong", until then, people will never ever beat 0days they don't know exist (0day being more than just a SW exploit). Just do.not.commit.sensitive.info…
Why Deleting Sensitive Information from GitHub Doesn't Save You
61–70 of 91 posts
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#62I think this problem is widespread enough and there are enough idiots out there(me included),that there should be a feature request for Github to provide a prompt in case Github detects sensitive information in the code hosted.
I don't know about that. It seems to me that you are wanting Github to do what the committer should be doing.
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#63The only recourse is to immediately change or revoke access.
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#64[deleted]
> "API keys [...] need to be in your committed code" No they don't.
> No they don't.
A better approach is what the rest of the comments here are suggesting:
(1) store your secrets (API keys, certs, credentials, whatever) in a highly-secure system, with both strong encryption and immutable audit logging around their access and modification;
(2) expose those secrets at run/compile-time via variables, such that the secret is never stored on-disk anywhere other than in the highly-secure system from (1) and in transient storage while in use;
(3) wrap an authz layer around variable access, so that only authorized services/users/hosts (those that have authenticated properly and who are allowed access via the authz policy established here) can read/write/mutate the secrets
It's (basically) the "privileged identity management" space; the challenge is that the commercial software in that market hasn't kept up with the combination of automated ops infrastructure and cloud-hosted dev tools. There are some ideas around how to do 1-3 better, with a devops/cloud-native design built in. (Full disclosure: I'm part of the founding team at a company doing this.)
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#65Earlier quoted context omitted.
> there should be a feature request for Github to provide a prompt in case Github detects sensitive information in the code hosted. Sure, just enumerate any and all possible types of sensitive data, the format they may be in, regex / matching functions to account for them (supported across 20+ programming languages) and I'm sure Github will have that done asap. Alternatively, don't commit passwords/API-keys/sensitive…
80:20 rule.I am sure, if we check for api_key,password(variants),key should help 80% of the people from making mistakes
The point were you define it is sensitive, but the place where you use it are not.
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#66I think this problem is widespread enough and there are enough idiots out there(me included),that there should be a feature request for Github to provide a prompt in case Github detects sensitive information in the code hosted.
Similarly, a white hat could watch /events and warn users and/or services when credentials are 'burned'. (A major exploitable service like AWS might even want to do this itself.)
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#67Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#68Earlier quoted context omitted.
> if you are like me, you like to store your dot files somewhere public. In your public .bashrc, put a line "source .bashrc.secret." Just keep an empty .bashrc.secret in your public repository, and keep your actual secret credential on your machines.
And don't forget to add it to .gitignore, otherwise when overwritten accidently it might land in public repo.
Otherwise, I'd try to use keystore systems available on your respective OS or language platform toolchain (CSP on .NET, JCE for Java, I dunno wtf else you'd use for anything else because the only people I've heard of that want to go this far are all F500 enterprises basically with software in exactly those two languages only).
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#69Earlier quoted context omitted.
Similarly, a white hat could watch /events and warn users and/or services when credentials are 'burned'. (A major exploitable service like AWS might even want to do this itself.)
AWS actually does that already — they'll ping you by email if they find one of your keys on GitHub!
Re: Why Deleting Sensitive Information from GitHub Doesn't Save You
#70Earlier quoted context omitted.
> "API keys [...] need to be in your committed code" No they don't.
>> "API keys [...] need to be in your committed code" > No they don't. A better approach is what the rest of the comments here are suggesting: (1) store your secrets (API keys, certs, credentials, whatever) in a highly-secure system, with both strong encryption and immutable audit logging around their access and modification; (2) expose those secrets at run/compile-time via variables, such that the secret is never st…
Even AWS CloudHSM is not revolutionary conceptually as much as from a compliance and paperwork standpoint. I think there really needs to be emphasis on a (4) - all secrets must be rotated and revokable on-demand and on semi-random schedule. The goal is to make any credential only valid for a period of time less than what an attacker that is already present on your systems would need to further increase presence or to compromise any of 1-4. Who cares if an instance is owned if it's up for maybe 10 minutes and can literally only communicate on a specific port to a specific server with a specific protocol?
Unfortunately, this is all only reasonable in a highly automated architecture and is basically impossible with almost every single company I've ever seen that's ever uttered the mere word ITIL because those companies tend to be people-driven cultures for everything, not process-driven (most companies try to add policies that are so ineffectual and meaningless that everyone reverts back to tribalism similar to how everyone defaults to e-mail when collaboration tooling is ineffective) that you have to figure out to be effective in cloud environments.
I do devops and security automation as well, and there's nothing self-serving about your points if you ask me.