Hardening
Much of this malware starts when you open a folder in your editor, or run npm install. Hardening switches those starts off.
Hardening is part of PushWarden Pro. With a key, pushwarden install hardens your editors, and you can do it on its own:
pushwarden harden
Editors
It changes four settings in VS Code, VS Code Insiders, VSCodium, Cursor, Windsurf and Positron:
- tasks no longer run by themselves when you open a folder
- new folders open in restricted mode until you trust them
Your other settings and comments are kept. A backup is saved next to the file.
pushwarden status shows the setting for each editor.
npm install scripts (optional)
pushwarden harden --npm-ignore-scripts
Packages can then no longer run code when you install them. A few packages need their install script to build; run it yourself, or turn this off:
pushwarden harden --undo-npm
Pre-commit hook
pushwarden harden --pre-commit ~/code/my-repo
It checks the files you are about to commit and refuses the commit if one carries malware. That stops an infected machine from infecting a clean repository.
Remember
- Uninstalling PushWarden leaves these safer settings in place.
- Use
--dry-runto see what would change.