r/programming • • Mar 27 '23

Twitter Source Code Leaked on GitHub

https://www.cyberkendra.com/2023/03/twitter-source-code-leaked-on-github.html
8.0k Upvotes

717 comments sorted by

View all comments

Show parent comments

179

u/VonThing Mar 27 '23

Zero secrets in the code, but I see your point.

13

u/[deleted] Mar 27 '23

[removed] — view removed comment

159

u/MinMaxDev Mar 27 '23

there was tonnes of this in the twitch codebase, it happens

36

u/[deleted] Mar 27 '23

[removed] — view removed comment

88

u/ConcernedCitoyenne Mar 27 '23

Yep

49

u/[deleted] Mar 27 '23

[removed] — view removed comment

0

u/[deleted] Mar 27 '23

[deleted]

46

u/Mechakoopa Mar 27 '23

Those responsible for sacking the people who have just been sacked have been sacked.

A Møøse once bit my sister ...

5

u/roboticon Mar 27 '23

Yeah I was gonna say. Just because someone published it on GitHub doesn't mean it's nothing more than a git repo.

3

u/bohreffect Mar 27 '23

PM's want their shit now

25

u/gamrgrant Mar 27 '23

They straight-up ignored Galactus, the all-knowing user service provider aggregator?

→ More replies (1)

8

u/falconfetus8 Mar 27 '23

Every company has noobs in it

13

u/Aerodrache Mar 27 '23

… considering Musk’s apparent strategy of firing anyone he suspects of being smarter than him…?

0

u/[deleted] Mar 27 '23

[deleted]

→ More replies (3)

4

u/VonThing Mar 27 '23

LOL go see my post history.

When I say “I see your point” I meant this could have been true for any other source leak.

1

u/DevonAndChris Mar 27 '23

The dev environment at Twitter was basically every single horror story from Coding Horror rolled into one.

The only reason keys were not in the source code would be because they learned the lesson the hard and painful way.

1

u/mipadi Mar 27 '23

Well clearly, since the site isn't written in Rust.

-1

u/TheWhyOfFry Mar 27 '23

Just curious, have you seen the code? (Where if so?) How are you sure no secrets?

14

u/VonThing Mar 27 '23

Go through my post history lol

I’m ex-Twitter so yes I have seen the code

-6

u/TheWhyOfFry Mar 27 '23

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.

6

u/Cmacu Mar 27 '23

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.

-6

u/TheWhyOfFry Mar 27 '23

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.

5

u/VonThing Mar 27 '23

Can’t divulge more without breaking my NDA but let’s just say we do it differently.

4

u/TheWhyOfFry Mar 27 '23

Fair enough. Hope the post-Twitter world is treating you well!

4

u/ItzWarty Mar 27 '23 edited Mar 27 '23

Large companies do extensive work to ensure

  1. 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.

  2. Dev & prod are completely separate environments. Most developers will never have these secrets. And once again, they're deployed far away from source.

  3. 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.

→ More replies (2)