Running on servers
On a server there is no desktop and nobody to click a dialog. Server mode installs PushWarden as a system service that starts at boot, watches your code folders and logs to the system journal.
Install
curl -fsSL https://pushwarden.com/install.sh | sudo PUSHWARDEN_SERVER=1 PUSHWARDEN_ROOTS="/srv /var/www" sh
Or with the program already downloaded:
sudo ./pushwarden install --server --roots /srv/sites
Add --dry-run first to see what it would do. It needs sudo.
It then:
- installs the program and a system service (
pushwarden-guard), and starts it - watches
/srv,/var/www,/optand/usr/local/src(or your--roots) - with PushWarden Pro, blocks the attackers’ servers at the firewall (skip with
--no-block-c2) - runs a first scan
What it does when code arrives
- A deploy writes a file. It is checked within a second.
- If it is clearly malware, it is moved to quarantine. With Pro only the malware is cut out and your app keeps running.
- A process carrying a strict malware marker is stopped.
- You are told through the log and your webhook.
- Anything can be put back with
sudo pushwarden history --restore PATH.
Choose what it may change
By default it quarantines. If a person must approve every change, install with --report-only, or switch later:
sudo pushwarden config --set action=report
sudo systemctl restart pushwarden-guard
You then act yourself with scan --fix or history.
Every day
Use sudo so you see the server’s own data:
sudo pushwarden status # is it running?
sudo pushwarden alerts # recent alerts and why
sudo pushwarden history # everything it found and did
journalctl -u pushwarden-guard -f # live log
The record in /var/lib/pushwarden/journal.jsonl has one JSON object per line, ready for a log shipper.
Alerts
Set a webhook for Slack, Discord, Teams or your own endpoint:
sudo pushwarden config --set webhook_url=https://hooks.slack.com/services/T000/B000/XXXX
sudo systemctl restart pushwarden-guard
See Team reporting.
Pro on a server
Put the key in /etc/pushwarden/environment and restart the service:
PUSHWARDEN_LICENSE_KEY=PW-XXXXX-XXXXX-XXXXX-XXXXX
Each server uses one of the key’s devices. See Free, Pro and Team.
Without a service
Scan from cron or a pipeline. --ci (a Pro feature) never asks and exits 1 when something is found:
15 3 * * * root pushwarden scan --ci --no-system --json /var/log/pushwarden-scan.json /srv /var/www
For build servers see CI and automation.
Remove it
sudo pushwarden uninstall # remove the service
sudo pushwarden uninstall --unblock # also remove the firewall block
sudo pushwarden uninstall --purge # also delete settings, quarantine and history
Remember
- Server mode is for Linux. The service runs as root.
- Settings, quarantine and history are in
/var/lib/pushwarden. - Updates install themselves and roll back if the new version does not start.
- Code that is already running keeps running until restarted. Restart the app after PushWarden removes a file.