Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Don't expose your secrets in Github (or other) repos / codebases

Many developers make the mistake of exposing their API credentials, secrets, and sensitive info on their github repositories or other public codebases. Remember, even sharing an env file of secrets and keys in a private repo can be a security risk as it only takes 1 repo contributor being compromised to expose your credentials. Github tries to make it easier for devs and companies to stay secure by using a thing called 'secrets scanning' which can help identify any exposed values in your codebases.

Threat actors take advantage of developer negligence and mistakes by searching the web for public repos & finding exposed keys. They then use these credentials to access your otherwise secure integrations, customer data, and more. You should look into enabling Github secret scanning even if you are certain you have safely and securely uploaded your codebase. It's worth it to make sure you are protected.
Good advice for anyone using git
The fucking LEGEND.
I was on a couple of development-centered forums.

I spent a lot of time just going on to people posting about their new projects (mostly CRUD apps they made while learning lol)
and basically replied the same thing

"Properly configure your tokens and never push them to your repository, even if it's private"

~ Returning +Reps ~
[Image: 550037005493338134.png]
~ Programming HW Service | GFX Designing Service ~
(May 28, 2024 06:17 AM)TooBurnt Wrote:  Good advice for anyone using git

(May 28, 2024 01:53 PM)banonkiel Wrote:  I was on a couple of development-centered forums.

I spent a lot of time just going on to people posting about their new projects (mostly CRUD apps they made while learning lol)
and basically replied the same thing

"Properly configure your tokens and never push them to your repository, even if it's private"

yeah people need to be way more careful
threat actors will just use Google Dorks or other repo searches to find secrets eventually. It'll keep happening as long as people keep making this mistake.
instructions too hard, uploaded all api creds and db info
(May 28, 2024 05:56 AM)Hackers Wrote:  Many developers make the mistake of exposing their API credentials, secrets, and sensitive info on their github repositories or other public codebases. Remember, even sharing an env file of secrets and keys in a private repo can be a security risk as it only takes 1 repo contributor being compromised to expose your credentials. Github tries to make it easier for devs and companies to stay secure by using a thing called 'secrets scanning' which can help identify any exposed values in your codebases.

Threat actors take advantage of developer negligence and mistakes by searching the web for public repos & finding exposed keys. They then use these credentials to access your otherwise secure integrations, customer data, and more. You should look into enabling Github secret scanning even if you are certain you have safely and securely uploaded your codebase. It's worth it to make sure you are protected.

Wow! A new feature! I never knew GitHub would add a new feature like this. I always just gitignore the env files and just put samples on the end for sample purposes. 😎
Had a friend making a discord bot just for fun for our friends server and forgot to delete the key from the repository, one day had my phone with 500 notifications from discord because we were invaded by bots warning us about it ahah
(May 28, 2024 09:06 PM)happygonutty Wrote:  Wow! A new feature! I never knew GitHub would add a new feature like this. I always just gitignore the env files and just put samples on the end for sample purposes. 😎

yep, you are doing it right! That's what you should be doing :)

(May 29, 2024 02:43 PM)obsidiand Wrote:  Had a friend making a discord bot just for fun for our friends server and forgot to delete the key from the repository, one day had my phone with 500 notifications from discord because we were invaded by bots warning us about it ahah

Lol sounds about right. at least it was a kind person warning your friend & not a malicious person.
This happens all the time I'm sure - they must find a lot to justify having a warning bot running.
(May 30, 2024 04:49 AM)Hackers Wrote:  yep, you are doing it right! That's what you should be doing :)

Yes, I am really paranoid with the systems I develop especially the env files since that is almost the heart of everything. 🙃


Possibly Related Threads...
Thread / Author Replies Views Last Post
by johndoeman805May 29, 2025 02:51 AM 8 415 May 29, 2025 02:51 AM
Last Post: padrino
by HackersMay 10, 2024 06:25 PM 28 568 May 10, 2024 06:25 PM
Last Post: itcorp
by EpycApr 2, 2023 02:44 AM 1 68 Apr 2, 2023 02:44 AM
Last Post: DashPHP