Software supply chain failures entered the OWASP Top 10 in 2025, after worms such as Shai-Hulud spread through hundreds of npm packages. Meanwhile 28.65 million secrets leaked in public GitHub commits in 2025, and most leaked keys stay valid for years.
0 of 6 habits in place
Your progress is saved only in this browser. Nothing is sent to us.
Essential
Do this first. It stops the most common attacks.
Recommended
Worth doing once the essentials are in place.
Advanced
Extra protection for people facing higher risk.
Keep secrets out of code
Essential
Use environment variables or a secrets manager, and keep GitHub push protection switched on.
Why it matters
API keys and passwords committed to code are found by automated scanners within minutes. Push protection blocks many secrets before they reach the repository.
How to do it
Store keys in environment variables or a secrets manager, never in source files.
Add .env and similar files to .gitignore.
Turn on secret scanning and push protection for your repositories.
Scan the existing history for old secrets.
Revoke a leaked key instead of just deleting the commit
Essential
If a secret leaks, revoke it and issue a new one; removing the commit is not enough.
Why it matters
Once a secret is public, copies exist elsewhere. Most leaked secrets that were valid in 2022 still worked in January 2026, because nobody revoked them.
How to do it
Revoke the leaked key at the provider immediately.
Create a new key and update your applications.
Check the provider's logs for misuse.
Then clean the repository history if needed.
Commit lockfiles and review dependency updates
Recommended
Commit lockfiles, review updates including nested dependencies, and pin known good versions.
Why it matters
Malicious package versions spread fastest to projects that automatically install the newest release. After the npm supply chain attacks of 2025, CISA recommended reviewing and pinning dependencies.
How to do it
Commit package-lock.json or your ecosystem's equivalent lockfile.
Use npm ci or the equivalent in builds, so that the lockfile is respected.
Review dependency updates before merging them.
Pin known good versions when a compromise in your ecosystem is reported.
Use passkeys or security keys on developer accounts
Essential
Protect GitHub, npm and PyPI accounts with WebAuthn or passkeys instead of one-time codes.
Why it matters
Attackers phish developer accounts to publish malicious package versions. CISA and GitHub both call for phishing-resistant MFA.
How to do it
Add a passkey or security key to your GitHub account.
Do the same for npm, PyPI and any other registry you publish to.
Remove text message and code-based methods once a stronger one is set up.
Store recovery codes offline.
Publish packages with trusted publishing
Advanced
Publish from CI with trusted publishing (OIDC) instead of long-lived tokens.
Why it matters
Stolen publishing tokens let attackers push malicious versions. Trusted publishing for npm has been generally available for GitHub Actions and GitLab CI since July 2025, and it leaves no token to steal.
How to do it
Configure trusted publishing for your package in the registry.
Publish from your CI workflow using OIDC.
Delete old publishing tokens.
Require review for changes to the release workflow.
Check AI-written changes for secrets
Recommended
Review diffs and configuration files written with AI assistants, including MCP configuration, before you push.
Why it matters
In a 2026 study, commits made with AI coding assistants leaked secrets at about twice the usual rate, and thousands of valid secrets were found in MCP configuration files.
How to do it
Read every AI-generated diff before committing it.
Search the changes for keys, tokens and passwords.
Keep MCP and tool configuration files out of public repositories, or point them to a secrets manager.