How Can Data Leak from a Private GitHub Repo?

0
17
Asked By CuriousCat92 On

I'm confused about how a data leak could happen from a private GitHub repository. A student ended up with a massive bill of $55,444.78 on Google Cloud because their Gemini API key was leaked on GitHub. If the repository was supposed to be private and everything was encrypted, how could this happen?

5 Answers

Answered By VibeChecker26 On

I’m getting some bad vibes from this entire situation.

Answered By OpenSourceFan45 On

There’s another thing to consider. If you fork a public repo, all of your history goes public even if your new repo is private. That could be a way this happened.

Answered By CodeMaster42 On

Never assume your repo is private. Always avoid checking in your private keys and set limits on your cloud compute accounts to protect yourself from massive bills.

SecuritySavvy01 -

Totally agree! Also, you should never commit those API keys in the first place.

Answered By TechWhiz99 On

According to that post, the repository wasn't actually private. They thought it was, but if it was truly private, only people with access would see it. Regardless, it's a bad practice to commit API keys to any repository, private or not. You should always use a secrets manager and store those keys as environment variables instead of hard-coding them in your project. This avoids accidental leaks when you push your code.

DevGuru77 -

Exactly! Also, keep in mind that deleting a hard-coded key isn’t enough. It’s crucial to check the entire commit history. And don’t forget to set usage limits on your API keys!

Answered By DataNinja84 On

It’s possible the repo was switched to private after they realized what happened. But it's likely that it was public before they found out.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.