Skip to content

Traefik as edge proxy (web group) #27

Open

Description

@VectoDE

Traefik joins the web group as an optional edge proxy in front of the web server and the apps.

  • Module traefik: upstream release binary (pinned, checksum verified, amd64 and arm64), own user, systemd sandbox, CAP_NET_BIND_SERVICE only
  • Traefik owns 80/443 and 443/udp (HTTP/3): ACME or certificates of the tls module, security headers, HSTS, redirect to HTTPS, JSON access log, dashboard only on localhost
  • With Traefik, nginx/apache/caddy listen on 127.0.0.1 only and keep serving vhost sites, PHP and the admin tools behind Traefik
  • Apps (stage 6) routed through Traefik: file provider by default; Docker provider opt-in via a read-only socket proxy, never the raw socket
  • WAF: LSS_TRAEFIK_WAF=coraza|modsecurity|both|off; Coraza plugin with the OWASP Core Rule Set at the edge, ModSecurity in the backend web server, or both
  • Unit tests, integration on every supported system (Debian 12/13, Ubuntu 22.04/24.04/26.04, Rocky 9, AlmaLinux 10, amd64 and arm64), idempotent second run
  • README (module table, resource figures from CI), docs/hardening.md
  • SonarQube Cloud: no open issues and no new security hotspots on the pull request
  • No module refuses a system; no log line starts with "Not" or "No"

Activity

  1. VectoDE commented on Oct 16, 2026

    @VectoDE
    OwnerAuthor

    Status on 42486e1 (CI 38848732012, Integration 38848732009, all green on every system, amd64 and arm64):

    • WAF, left open: Coraza is held back on amd64. Every Traefik release (3.7.15, 3.6.25, master) embeds wazero 1.8.0. Its amd64 compiler does not save DX around runtime.memmove, and Go 1.24 and later clobber DX there (wazevo(amd64): reserve dx when calling memmove to support go 1.24 wazero/wazero#2378, fixed in 1.9.0). With the plugin loaded, Traefik crashed at random ("unsafe.Slice: len out of range", "split stack overflow"). On amd64, lss now uses ModSecurity in the web server instead, if it is installed, and warns either way. To switch Coraza back on, set TRAEFIK_CORAZA_AMD64=true and move to a Traefik release built with the fix. On arm64, Coraza is active and verify gets a 403 for both the SQL injection and the path traversal. modsecurity and both are verified on all systems.
    • Apps, left open: the web_proxy_route NAME DOMAIN UPSTREAM hook is in lib/web.sh and tested (unit tests and the LSS_TRAEFIK_ROUTES route in CI). The Docker provider through the read-only socket proxy is verified on all VM systems. Routing for the real stage 6 app modules can only be checked once those modules are merged.
  2. VectoDE commented on Oct 16, 2026

    @VectoDE
    OwnerAuthor

    Status on 02a4a4a (CI 38920862034, Integration 38920861912 green on every system, amd64 and arm64; the three arm64 monitoring jobs first failed on the Grafana mirror, unrelated to this branch, and passed on rerun. SonarCloud: 0 issues, 0 hotspots, gate OK):

    • WAF, done in the form the owner decided on. While Traefik ships wazero < 1.9, LSS_TRAEFIK_WAF=coraza (the default) or both works like this on amd64:
      • lss installs modsecurity for nginx or Apache itself. It does this once, and removes it again with Traefik.
      • lss routes the applications through the web server too (Traefik → nginx/Apache with ModSecurity → app).
      • A traefik: warning in the log explains why.
      • verify gets a 403 for an SQL injection through Traefik, both for vhost sites and for the app-style route echo. This passed on all 7 systems: nginx with auto-installed ModSecurity, and Apache with both.
      • Coraza at the edge is verified on arm64.
      • TRAEFIK_CORAZA_AMD64=true brings Coraza and direct routes back on amd64.
    • Behind Caddy there is no WAF on amd64. Caddy has no ModSecurity connector, so lss warns on every run. The same applies to Docker-provider containers.
    • Fixed on the way: Apache 2.4.65 answered 421 for every site behind Traefik except the default one, because of its new SNI vhost policy. In backend mode lss now sets SSLVHostSNIPolicy authonly.
    • Apps, still open: the routing of the real stage-6 modules can only be checked once they are merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions