Skip to content

EdgeWatch: new service - #437

Merged
crypt0rr merged 4 commits into
mainfrom
t3/add-edgewatch-service
Nov 24, 2026
Merged

crypt0rr merged 4 commits into
mainfrom
t3/add-edgewatch-service

Conversation

@jackspiering

@jackspiering jackspiering commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Adds a stack for EdgeWatch, a self-hosted network-surface monitor that scans with Nmap and Naabu on a schedule and alerts when the exposed ports change. It uses the image upstream publishes, ghcr.io/crypt0rr/edgewatch:latest.

  • compose.yaml follows the template. It keeps upstream's hardening on the application container: cap_drop: ALL plus NET_RAW, SETUID, SETGID, and KILL, no-new-privileges, a read-only root, a 128 MB /tmp tmpfs with TMPDIR in the data folder, a 512 MB memory limit, a 7m stop grace period, and bounded json-file logs.
  • config.yaml is upstream's config.example.yaml. It sets web.allowed_hosts to edgewatch.<tailnet>.ts.net and web.trusted_proxies to loopback for Tailscale Serve, and adapts the comments to the sidecar setup. It's mounted read-only, as upstream does. Compose refuses content configs for a read-only container (file is the sole supported option), so a tracked file is the only way to keep read_only: true. Vikunja and Caddy already track a file at the stack root.
  • Health check: wget against /healthz (CONTRIBUTING option 2). It returns 200 when ready and 503 while starting or unhealthy. The check keeps upstream's 20m start period and 5s start_interval so migrations can finish.
  • There's no ports block, because EdgeWatch refuses non-loopback listeners.
  • The row in the root README goes under "Networking and security", between DDNS Updater and FlareSolverr.

Related Issues

  • None.

Verification

  • docker compose config --quiet from services/edgewatch, with dummy values for required variables (there are none). It exits 0 with no "variable is not set" warnings. check-service-list.sh and check-sidecar.sh also pass locally, and the Serve JSON is valid.
  • The stack started from a copy outside the repository, with a test auth key. Both containers became healthy, and the node joined the Tailnet. The test node can't be reached from the test host, so I tested Serve from inside the stack's network namespace: curl --resolve <name>.<tailnet>.ts.net:443:<tailscale-ip> returned 200 for the console and for /api/v1/setup/status. I ran the health command (wget -q -O /dev/null http://127.0.0.1:8080/healthz) with docker exec, and it exits 0.
  • Main function, through Serve:
    • The first administrator was created with the setup token from the log (201).
    • Sign-in returned the __Host-edgewatch_session cookie, so EdgeWatch detected HTTPS behind Serve.
    • The audit log recorded the client's Tailscale address, so the trusted X-Forwarded-For works.
    • A job with a SYN scan of scanme.nmap.org on ports 22 and 80 found both open. Nmap's raw packets and the scanner sandbox work in the sidecar's namespace: identity pool, Landlock, and seccomp are enforced, and edgewatch health reports ready.
    • The admin, the job, the scan, and the Tailscale device survived both docker compose restart and down/up.
  • rumdl check --config .markdownlint.yml . (0.3.0, the version CI pins) on the whole repository, and git diff --check origin/main, both clean.

Also checked:

  • With the placeholder edgewatch.<tailnet>.ts.net still in config.yaml, the daemon stops at start with web.allowed_hosts[0]: invalid host name.
  • A foreign Host gets 421 Misdirected Request.
  • A data folder owned by a normal user fails with mkdir /var/lib/edgewatch/tmp: permission denied. A folder that Docker creates works.
  • Log timestamps follow TZ.
  • The README's recovery command, docker compose exec application edgewatch admin setup-token --config /etc/edgewatch/config.yaml --force, works with the read-only root and issues a new token, which created the first administrator in a second test. Within one minute of the previous token, it refuses with setup token was issued too recently. A container that is recreated before setup is finished shows no token in its log, and this command issues one.
  • Other Docker networks, tested with a stand-in for the sidecar that joins no Tailnet:
    • Without an override, the scanners can't reach a container on another Docker network: its port shows as filtered, and its name doesn't resolve.
    • With the override from the README's "Other Docker networks" bullet (validated with docker compose config), an EdgeWatch job found the container's open port by IP address and by container name. Internet scans kept working, and the default route stayed on the stack's own network.
    • While the stack is attached, docker network rm of the other network fails with "active endpoints".

Not run (taken from the upstream documentation): the Naabu SYN NET_ADMIN override, UDP and IPv6 scans, scanning Tailnet addresses, and ARM64.

Impact on existing users

  • None. This is a new service.

Checklist

  • I have performed a self-review of my code and followed the templates structure.
  • I did not commit a working auth key, password, token, or other credential.
  • The service README uses the headings of the template, in the same order, and is up to date.
  • I added, removed, or renamed the service in the root README.md, in alphabetical order, or this PR does not change the list of services.

Additional Context

  • Why a sidecar. EdgeWatch has no built-in Tailscale support: no tailscale.com dependency in go.mod, and no tailscale or tailscaled in the image. Upstream documents Tailscale Serve as a way to reach the loopback-only console, which is what the sidecar provides.
  • No host networking. Upstream runs EdgeWatch with network_mode: host so scanners see the host's networks. Here the application shares the sidecar's namespace, as every stack does, so scans leave through Docker's network and can't see the host's own interfaces. Scans of external targets work, as tested above. To scan containers in other stacks, the README shows how to attach their networks to the tailscale service. The README lists this under "Deviations from the standard setup".
  • Docker Engine 25 or later is needed for start_interval. No other stack uses it, so the README mentions it under "Before you start".

Add a stack for EdgeWatch, a scheduled network-surface monitor, with the upstream container hardening, a tracked config.yaml for Tailscale Serve, and a row in the service list.
@jackspiering
jackspiering marked this pull request as draft November 23, 2026 10:15
@jackspiering jackspiering added the new service request to add a new service label Nov 23, 2026
@jackspiering jackspiering self-assigned this Nov 23, 2026
… note /metrics behind Serve

Run tailscale status through the Compose service key instead of a container name that changes with SERVICE. Say that Serve forwards /metrics too once web.metrics is on, as upstream advises keeping it off the proxy.
@jackspiering
jackspiering marked this pull request as ready for review November 24, 2026 07:47
Say what the scanners reach from the sidecar's network, and add a tested override that attaches another stack's network to the tailscale service. Also point to the setup-token command when a recreated container no longer shows the token in its log.
@crypt0rr
crypt0rr merged commit d535329 into main Nov 24, 2026
2 checks passed
@crypt0rr
crypt0rr deleted the t3/add-edgewatch-service branch November 24, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new service request to add a new service

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants