GitHub is making your code safer for everyone

A developer writing code
(Image credit: Shutterstock / Elle Aon)

GitHub’s push protection feature, introduced as a beta in April 2022, is now generally available, the company has announced. 

The feature makes all code repositories safer by preventing them from leaking sensitive information such as API keys. 

Push protection works by scanning for secrets before “git push” operations are accepted, the company explained, adding that 69 token types are supported, including API keys, private keys, secret keys, authentication tokens, access tokens, management certificates, and similar.

GitHub security boost

While some false positives might happen, they should be few and far between.

"If you are pushing a commit containing a secret, a push protection prompt will appear with information on the secret type, location, and how to remediate the exposure," GitHub said. "Push protection only blocks secrets with low false positive rates, so when a commit is blocked, you know it's worth investigating."

Push protection has been in beta for more than a year now, and during that time, developers that used it managed to avoided 17,000 sensitive data leaks, and saved more than 95,000 hours they’d otherwise have to spend on addressing the issue of compromised data, GitHub claims. 

"Today, push protection is generally available for private repositories with a GitHub Advanced Security (GHAS) license," GitHub added. "In addition, to help developers and maintainers across open source proactively secure their code, GitHub is making push protection free for all public repositories."

If you’re interested in giving push protection a spin, you can do so via the API, or by clicking on the corresponding menu in the user interface: head over to GitHub.com > navigate to the main page > click Settings > look for “Security” and click “Code security and analysis” > find “Configure code security and analysis” and look for “GitHub Advanced Security” > Go to “Secret scanning” > find “Push protection” and enable it.

Devs can also enable it for single repositories by going Settings > Security & analysis > GitHub Advanced Security dialog.

Sead is a seasoned freelance journalist based in Sarajevo, Bosnia and Herzegovina. He writes about IT (cloud, IoT, 5G, VPN) and cybersecurity (ransomware, data breaches, laws and regulations). In his career, spanning more than a decade, he’s written for numerous media outlets, including Al Jazeera Balkans. He’s also held several modules on content writing for Represent Communications.

Read more
Shadowed hands on a digital background reaching for a login prompt.
This worrying Git flaw could lead to users leaking credentials
A fish hook is lying across a computer keyboard, representing a phishing attack on a computer system
These fake GitHub "security alerts" could actually let hackers hijack your account
A graphic showing someone on a tablet working through a supply chain.
Security issue in open source software leaves businesses concerned for systems
hacker.jpeg
Thousands of GitHub repositories exposed via Microsoft Copilot
An abstract image of digital security.
Hundreds of GitHub repositories hijacked to trick users into downloading malware
A white padlock on a dark digital background.
GitHub is hiding malware disguised as games, legitimate software
Latest in Security
cybersecurity
Chinese government hackers allegedly spent years undetected in foreign phone networks
Data leak
A major Keenetic router data leak could put a million households at risk
Code Skull
Interpol operation arrests 300 suspects linked to African cybercrime rings
Insecure network with several red platforms connected through glowing data lines and a black hat hacker symbol
Multiple routers hit by new critical severity remote command injection vulnerability, with no fix in sight
Code Skull
This dangerous new ransomware is hitting Windows, ARM, ESXi systems
An abstract image of a lock against a digital background, denoting cybersecurity.
Critical security flaw in Next.js could spell big trouble for JavaScript users
Latest in News
Open AI
OpenAI unveiled image generation for 4o – here's everything you need to know about the ChatGPT upgrade
Apple WWDC 2025 announced
Apple just announced WWDC 2025 starts on June 9, and we'll all be watching the opening event
Hornet swings their weapon in mid air
Hollow Knight: Silksong gets new Steam metadata changes, convincing everyone and their mother that the game is finally releasing this year
OpenAI logo
OpenAI just launched a free ChatGPT bible that will help you master the AI chatbot and Sora
An aerial view of an Instavolt Superhub for charging electric vehicles
Forget gas stations – EV charging Superhubs are using solar power to solve the most annoying thing about electric motoring
NetSuite EVP Evan Goldberg at SuiteConnect London 2025
"It's our job to deliver constant innovation” - NetSuite head on why it wants to be the operating system for your whole business