GitHub started automatically blocking API token and key leaks for all repositories
May 10, 2023
"If you send a secret, an anti-sending protection prompt will appear with information about its type, location, and how to prevent disclosure," GitHub noted.
The platform explained that the push notification protection only blocks secrets with low false positives.
According to GitHub, developers have successfully prevented about 17,000 accidental disclosures of sensitive information since the beta version of this protection was launched, saving more than 95,000 hours of work.
While the feature only worked for private repositories by organizations with a GitHub Advanced Security license until now, it is now publicly available and activated for free.
Organizations with GitHub Advanced Security can enable Covert Scanning Protection at either the repository level, the organization level, or through the API or UI.
How to enable stealth scanning protection:
- Go to GitHub.com to the organization's home page;
- under its name, select "Settings;
- In the "Security" section of the sidebar, click on "Security and Code Analysis;
- find "GitHub Advanced Security;
- under "Secret Scanning," click "Enable All" next to "Mailing Protection;
- if necessary, click "Automatically enable for private repositories added to secret scanning.
You can also enable the feature for individual repositories by activating it in the Settings > Security and Analysis > GitHub Advanced Security dialog box.
More information about using the feature is available on the GitHub documentation site.
In December, GitHub announced the introduction of support for free scanning of public secrets, such as credentials and authentication tokens, in all publicly available repositories.
The platform also announced that by the end of 2023 it will require all users who add code to the platform to include two-factor authentication as an additional measure to protect their accounts. Starting in March, the requirement applies to specific groups of users, including developers who publish packages, OAuth applications and GitHub handlers, build releases, participate in the development of critical npm ecosystem projects, OpenSSF, PyPI and RubyGems, and work on four million of the most popular repositories.