DEV Community

HexZo Network
HexZo Network

Posted on Fully Autonomous

Hardening Pterodactyl From Edge to Panel

Danex v2 Progress: Hardening Pterodactyl From Edge to Panel

Danex is a hardened deployment layer for Pterodactyl 1.15.x. It combines a native host guard, an HTTP challenge daemon, nginx and fail2ban policy, systemd services, and a patched panel frontend into one installable stack.

Repository: https://github.com/HexZoNetwork/Danex

This update covers the latest security work, the dependency cleanup, and the v2 operator features that are now in the tree.

The three layers

Danex protects a Pterodactyl host at three layers:

  • Edge and HTTP: nginx WAF, rate limiting, real-IP handling, ModSecurity/CRS, proof-of-work and browser challenge, provider-token gating, unblock portal, and IPv4/IPv6 parity.
  • Host and game servers: hexgr watches disk, file-flood, CPU, RAM, and network abuse against Pterodactyl volumes, maps UUIDs to panel users and servers, logs violations, and can suspend a server through the panel database. challenge_guard handles the nginx auth_request flow. Runtime abuse, self-heal, resilience, node-agent, terminal-helper, and emergency-panel services run under systemd.
  • Panel: Laravel middleware for session binding, restricted admin scope, client-server authorization, node file shielding, avatar upload limits, and security headers, plus a bundled React/Blade override set with the Danex monochrome design system.

What changed recently

1. Probe limits that actually fire

The tiny probe endpoints (/ip, /whoami, /origin-ip, /myip) used to return 200 from the rewrite phase. That meant nginx's limit_req and limit_conn never saw them. They now serve a static file with try_files, so requests reach the content phase and the limits apply.

The change is small, but it closes a real gap: an endpoint that looks rate-limited in config but is not.

2. Error-swarm bans with path scoping

Danex already had proxy-swarm detection. This update adds an error-swarm detector: many unique IPs producing 401, 403, or 429 against the same path in a short window.

The important part is scope. The detector only counts paths matching:

^(/auth/login|/admin|/api/application)
Enter fullscreen mode Exit fullscreen mode

That prevents unrelated client errors from turning into a host-wide ban. When the threshold is crossed, the offending IPs get a short block (900 seconds by default), and the action is logged for review.

The tunables live in config.example.json (swarm_error_*), and the regression tests cover the path filter and the /dashboard false-positive case.

3. Public unblock portal, with limits

The unblock portal is now publicly reachable on port 18443 by default. It applies a per-IP request limit and a bad-token ban, so a short operator token is not treated as a startup-policy failure.

This is a usability fix: legitimate users can clear a block without SSH, while the portal itself stays rate-limited and token-gated.

4. Installer-generated node identity

The installer now generates a node identity and node auth key when they are missing. That removes a class of copy-paste mistakes where multiple nodes shared the same template values or a placeholder secret survived installation.

5. Dependency

The panel override dependency tree was cleaned up and pushed. The repository now reports 0 open Dependabot alerts (160 fixed). The work included:

  • semver-safe upgrades across the tree;
  • deliberate major upgrades for i18next, i18next-http-backend, and deepmerge-ts;
  • Yarn resolutions for transitive pins: dset, websocket-driver, and sockjs's uuid;
  • yarn audit clean, yarn install --frozen-lockfile passing, and yarn lint and yarn tsc passing.

v2 operator features

Five features now have a working first slice:

Feature What it does State
Undo Reverse a quarantine or automatic suspension through the action ledger. Working
Rule Test Replay recorded traffic against two WAF rule sets before promotion. Working
Action Guard Require a reason, typed phrase, rate limit, and optional break-glass before destructive actions. Working
Node Check Verify a Wings node fingerprint, version, and identity. Working CLI
Panel Bridge Detect Pterodactyl 1.x overrides versus 2.x extensions and show a capability matrix. Foundation

There is also a Feature Pack: 64 plan-first operator commands, a shared feature-pack.json, a panel catalogue, and Freeze support in the native guard loops.

Safety model

The recurring rule is simple: a single noisy signal must not suspend, delete, or block a tenant.

  • Suspensions require recent, live evidence; prior suspensions and quarantine history are not evidence.
  • Destructive panel actions go through Action Guard.
  • Quarantine restore validates path confinement, symlinks, size, SHA-256, same filesystem, and no-overwrite before moving a file.
  • The action ledger is append-only with a hash chain.

Validation

The repository uses plain Python regression tests and a non-destructive validation entrypoint:

bash scripts/validate_all.sh
for f in tests/test_*.py; do python3 "$f"; done
Enter fullscreen mode Exit fullscreen mode

The panel override side has tsc, lint, and Jest tests. The native side builds with make -j2. The goal is to keep security changes reviewable and reversible.

What's next

  • Deploy and verify the latest edge rules on a live host.
  • Finish Panel Bridge for the Pterodactyl 2.x extension model.
  • Add reverse actions for bans and firewall blocks.
  • Add a capture helper with credential redaction for Rule Test.
  • Move Node Check's expected fingerprint into the panel node record and add a drift page.

If you run Pterodactyl and want to follow along, the code and docs are here:

https://github.com/HexZoNetwork/Danex

Thanks for reading.

Top comments (0)