Bỏ qua để đến nội dung
Intrusion alerts & agent token Get told when someone logs in to a server over SSH from a new IP, changes SSH keys, triggers a fail2ban burst or opens a new port; rotate the agent token; pin the control-plane key.

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.

AlertWhenSeverity
SSH loginA successful SSH login. By default only from an IP that has not logged in to that server in the last 30 daysNew IP as root: critical · new IP: warning · known IP: info
SSH key changesAn authorized_keys file of root or a login user gained or lost keys. Keys you add in SSH keys & audit are not reportedKey added for root: critical · added: warning · only removed: info
fail2ban ban burst20 or more addresses banned in one jail within 10 minuteswarning
New open portA 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.

  • 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).
  1. Open Settings → Sign-in & security.
  2. Under Server intrusion alerts, set SSH logins to Off, New IPs only (default) or Every login.
  3. 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.

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:

  1. Open the server and go to Settings → Agent token.
  2. Click Rotate token and confirm it’s you.
  3. 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.

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).

WhatMCP tool / REST
Read the alert settingsnotify_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 eventsnotify_box_events_list · GET /v1/notify/box-events?serverId=&limit=
Agent token stateservers_agent_token_get · GET /v1/servers/{id}/agent-token
Send alerts to a channelnotify_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.