Files
Mateusz Gruszczyński de13d851a8
Go quality gates / test (push) Waiting to run
v0.1.1
2026-11-30 14:44:28 +01:00

5.6 KiB

Security model

Trust boundaries

Browser → session cookie (HMAC-SHA256, HttpOnly, SameSite=Strict, optional Secure) → Go backend → EasyDNS REST using generated control.token or local Unix socket. The EasyDNS bearer never reaches HTML, JavaScript, CSS, logs or browser requests.

The panel is highly privileged. The login password is generated by the .deb postinst into /etc/easydns-ui/panel.password (root:easydns-ui, 0640, directory 0750). The panel session key is independently generated into /etc/easydns-ui/session.key. Password files have no hardcoded defaults. The Go service account is added to the easydns Unix group, when available, so it can read the Rust server's existing token (control.token) or access its control socket.

All state-changing browser actions are POST and require a per-session HMAC CSRF token; browser Origin (if supplied) must match the current host. No generic API endpoint proxy is exposed. ETag/If-Match on record and zone replacement prevents silent serial conflict. Error messages are server-derived; no secrets logged. Data is escaped by Go html/template. The default listen address is 127.0.0.1:8088 only; never publish plaintext on the internet. Serve HTTPS through a trusted reverse proxy and set EASYDNS_UI_COOKIE_SECURE=true.

Operational recommendations

  • Keep EasyDNS API on loopback or Unix socket, and panel on loopback behind a TLS proxy, or access over SSH tunnel.
  • Restrict who can read /etc/easydns/data/control.token: token is admin-level access to DNS.
  • Prefer a protected token file or Docker secret mount; TOML and .env can also contain explicit bearer tokens when their access is strictly restricted. Never expose tokens to HTML or browser JavaScript.
  • Rotate panel session key to invalidate all current sessions after an incident; restart service.
  • Rotate the panel password in /etc/easydns-ui/config.toml (or panel.password if using the default password file), or via Docker Compose .env; restart or recreate the service.
  • Secure reverse proxy with IP allowlist or VPN and an additional authentication layer as appropriate.
  • Audit privileges: Go service account has no write permission to Rust EasyDNS configuration or token file.
  • Logging: journalctl -u easydns-ui; does not log credentials or API payloads.

Scope / known limitations

Login lockout is per remote IP and in-memory (8 failed attempts / 15 minutes); multi-instance coordination is not supported. Session credentials are stateless: once issued they expire within 12 h; logout removes the browser cookie, but does not revoke a previously stolen copy. The panel does not implement additional user/role CRUD, SSO, TOTP or token rotation because EasyDNS REST does not expose these operations. For multi-user administration, add an upstream authenticated reverse proxy rather than inventing DNS API endpoints.

Optional multi-server management

The optional feature is disabled by default. The enabled state can be set explicitly by the protected Debian TOML file or the Compose environment; either makes it read-only in the web UI. When no explicit setting exists, Configuration offers an authenticated, CSRF-protected toggle and persists its preference to settings.json (0600). Explicit configuration wins over saved UI preferences. Disabled mode stops remote polling without deleting saved panel-added token files.

Each remote connection uses a separate existing EasyDNS-generated token. The Add server form accepts it once and never re-renders it in an HTML page or response. Tokens are stored as mode-0600 files in a 0700 state directory owned by easydns-ui. The registry metadata file contains URLs, names, IDs and UI role labels, not bearer token values. Removing a connection removes its token; purging the Debian package removes all panel-owned registry state.

Remote connections must use HTTPS with default server-certificate verification, or loopback HTTP over a local forwarding tunnel. Cross-host plaintext HTTP URLs are rejected. Redirect following is disabled for the API client to avoid forwarding credentials to a different host. There is no generic API proxy route, no native cluster API, and no browser access to the EasyDNS control tokens.

The server selector is a protected POST and stores only a node ID in an HttpOnly, SameSite=Strict cookie; API credentials stay on the Go side. The selected node is validated against the registry on every request. Panel display labels do not modify native DNS roles or grant finer-grained permissions: every panel administrator who can add or select remote nodes effectively holds full EasyDNS admin privileges for those installations. Secure the panel accordingly.

When enabled, health probes read each configured endpoint on demand. Remote nodes are polled for statistics every 15 seconds; a disabled mode stops remote polling. A failed node does not cause fabricated status data for other nodes.

Configuration file protections

Debian stores application configuration in /etc/easydns-ui/config.toml, owned root:easydns-ui with permissions 0640. The directory is 0750. Avoid putting this file in world-readable backups. The package treats it as a conffile and does not overwrite it during upgrades. Inline passwords and tokens are permitted but the default Debian configuration uses the separately generated panel.password, session.key and EasyDNS control.token files. For Docker, .env must be private (chmod 600), and administrators with Docker daemon access can inspect process environment variables.

All hashed static resources use immutable caching and build-specific filenames. No secrets are embedded in the assets.