If there had been API keys leaked, they probably would have noticed when it was first leaked because bots would have immediately acquired them and started mining crypto on their cloud account. Or, maybe not, depending on which people Elon fired.
I mean, if it’s a local fork or branch that was published, are you sure they didn’t have any keys for local dev? I’ve worked at places that have secret management for dev and prod envs but didnt solve for working local and connecting to dev, which meant you had to get keys and have them local in some instances.
But how/why would you commit/hardcore local configuration in the code repository? That would practically make testing/staging and production deployments complicated/impossible. What about other devs and their environments? The only case I can think of this making sense is some virtual environment where you have your dev profile preconfigured by administrator, but I can still imagine it being a pain with any type of shared resources like aws s3 or mail server.
What does my local setup have to do with production deployments? All production deployments are based on Jenkins built containers and central config repository. No local code should ever be pushed to prod, that makes for impossible to reproduce behavior in an organization of any size.
API keys can't be pushed - they're not even managed by developers. CI scans for them too. In many cases, if you even create & attempt to push a commit with an API key, it'll be revoked.
Dev & prod are completely separate environments. Most developers will never have these secrets. And once again, they're deployed far away from source.
Data isolation - a backend service serving user A cannot accidentally access confidential data from user B. This enforcement happens at the data-layer, so that it does not matter how buggy an application is. It's not like people are just writing $"select * from table where name={name}" everywhere. There are multiple layers of data-access within these companies.
Honestly, FAANGs operate at such a large scale (tens of thousands of engineers). They do great work to make it so even a 'complete idiot' cannot accidentally create a vulnerability, which is why it is surprising if it does happen. A significant amount of the root-cause-analysis would fall on the data-access team, not the mistaken engineer.
BTW there are many alternatives to having raw DB credentials. For example, application containers can be provisioned with a port-forward to a trusting data access layer. In that scenario, the application is literally sandboxed from the API keys.
108
u/Spiritual-Ad-8062 Mar 27 '23
Yes, and I wonder how many secrets (API keys, SSH keys...) were in the code... ready for attackers to use...