Intrusion alerts & agent token
Nội dung này hiện chưa có sẵn bằng ngôn ngữ của bạn.
The agent on every server watches for signs that someone else got into the box and sends you a security alert. This is separate from your MZPanel account’s sign-in alerts: those tell you someone used your account, these tell you someone used your server. Available on all plans; needs agent 0.2.146 or newer.
What you are alerted about
Section titled “What you are alerted about”| Alert | When | Severity |
|---|---|---|
| SSH login | A successful SSH login. By default only from an IP that has not logged in to that server in the last 30 days | New IP as root: critical · new IP: warning · known IP: info |
| SSH key changes | An authorized_keys file of root or a login user gained or lost keys. Keys you add in SSH keys & audit are not reported | Key added for root: critical · added: warning · only removed: info |
| fail2ban ban burst | 20 or more addresses banned in one jail within 10 minutes | warning |
| New open port | A program started listening on a new public TCP or UDP port (loopback-only ports are ignored) | warning |
No floods. You get at most one alert per server every 10 minutes. The first event is sent at once; anything after it in the window arrives as one summary (“5 security events on web-1”). The first scan after the agent is installed or updated only records what is already there, so you are never alerted about old logins.
Where alerts go
Section titled “Where alerts go”- Always to the in-app inbox (the bell).
- To Telegram, Slack, Discord, email or a webhook through a Chat & Alerts rule that includes Security alert (notifications).
Choose your alerts
Section titled “Choose your alerts”- Open Settings → Sign-in & security.
- Under Server intrusion alerts, set SSH logins to Off, New IPs only (default) or Every login.
- Switch SSH key changes, fail2ban ban bursts and New open ports on or off (all on by default).
The settings apply to every server in the workspace; only the owner or an admin can change them. A type you switch off is still recorded and shown greyed out in the list of recent events under the toggles.
Rotate the agent token
Section titled “Rotate the agent token”The agent signs in to MZPanel with a token stored on the server
(/etc/mzagent/config.json). If the server or a copy of that file may have been exposed:
- Open the server and go to Settings → Agent token.
- Click Rotate token and confirm it’s you.
- The agent saves the new token. The old one keeps working for 10 minutes, then it is refused.
Using “This wasn’t me” in a new-sign-in email also rotates the token of every online server in your workspace. Rotation needs the agent online. If the server itself is compromised, rotate and then reinstall it.
TLS pinning (advanced)
Section titled “TLS pinning (advanced)”Agents 0.2.146+ can refuse to talk to anything that does not present MZPanel’s own key, even
with a valid certificate. Pinning is off until pins are configured. If an agent stops connecting
and journalctl -u mzagent says does not match any pinned key, set
"tls_pinning_off": true in /etc/mzagent/config.json and run systemctl restart mzagent.
mzagent tls-pin shows the control plane’s pins and whether they match.
To pause the watcher on one server, run touch /etc/mzagent/boxwatch.off on it (delete the file
to resume).
Automate it
Section titled “Automate it”| What | MCP tool / REST |
|---|---|
| Read the alert settings | notify_box_alerts_get · GET /v1/notify/box-alerts |
Change them (Full token + system:admin) | notify_box_alerts_set · PUT /v1/notify/box-alerts {sshLogin: off|new_ip|all, authorizedKeys, fail2banBurst, newPort} |
| Recent on-box security events | notify_box_events_list · GET /v1/notify/box-events?serverId=&limit= |
| Agent token state | servers_agent_token_get · GET /v1/servers/{id}/agent-token |
| Send alerts to a channel | notify_rules_create with events: ["security.alert"] |
Rotating the token is a dashboard action only: an API token that may itself be leaked cannot trigger it.