Discord notifications#
- In Discord, open Server settings → Integrations → Webhooks and create a webhook for the channel.
- Copy the webhook URL into
discord.webhookUrland setdiscord.enabledtotrue. - Restart the scanner.
After each scan the scanner posts a summary embed with the totals per severity, the scan number, the servers scanned, the files scanned and the number of findings per node. With includeDetails on, it adds embeds per severity that list findings per server, up to five per severity and maxFindingsPerMessage in total. If security-report.json exists and is smaller than 7 MB, it is attached as security-report-<scan number>.json.
| Key | Effect |
|---|---|
notifyOnCleanScan |
A scan without findings only posts a message when this is true |
severityThreshold |
all or low posts on any finding. medium, high and critical post when there is a finding of that severity or higher |
discord.enabled is false in the default file. When it is true but webhookUrl is empty, the scanner warns once at start and sends nothing.
Mention roles#
You have two ways to ping people.
- One role for critical findings. Set
mentionOnCriticaltotrueand put the role ID inmentionRoleId. The message is<@&ROLE_ID> **CRITICAL SECURITY THREATS DETECTED!**. - A role per severity. Set
roleNotifications.enabledtotrue. This replaces the first way. List the mentions per severity undermentionRoles, in the form'<@&123456789>', and set the text per severity undermentionMessages.
With roleNotifications.notifyOnFirstDetection on, a severity is only announced the first time a server has a finding of that severity. This is saved in scanner-state.json, so it also holds after a restart. With it off, a severity is announced again after cooldownMinutes, by default 30.
Actions#
The scanner can act on what it finds. Actions only look at pattern and hash findings at or above their onSeverity, by default critical. Keyword findings are reported, but never trigger an action.
| Action | Key | What it does |
|---|---|---|
| Quarantine | actions.quarantine.enabled |
Copies each flagged file to the quarantine folder, or moves it there |
| Suspend | actions.suspendServer.enabled |
Suspends each server with a flagged file through the panel API |
| Delete | actions.autoDelete.enabled |
Deletes each flagged file from the server, without confirmation |
All actions are off by default. They run right after the scan, before the report and the Discord message, in this order: quarantine, suspend, delete.
Quarantine#
Flagged files go to quarantinePath, by default /var/lib/pterodactyl/quarantine, in a folder per server UUID and scan time, with their path inside the server. With keepOriginal: true, the default, the file is copied and stays on the server. With keepOriginal: false, it is moved out of the server.
Turn on quarantine together with delete to keep a copy of every deleted file.
Suspend#
Suspending needs an API key with Servers set to Read & Write.
Warning
Patterns can match files that are fine. Run the scanner with the actions off for a while, read the reports and tune the lists first. Without quarantine, a deleted file cannot be recovered by the scanner.