How to Fix Traefik --api.insecure=true Dashboard & Caddy Admin API Exposure
Stop leaking internal service maps via Traefik api.insecure: true, exposedByDefault: true,
or Caddy admin 0.0.0.0:2019. Verify your traefik.yml, traefik.toml, or
Caddyfile locally below with 0 bytes uploaded.
100% client-side reverse-proxy AST linter · 0 bytes sent · One-time Polar.sh license (no subscription) unlocks all 72 rules + CI SARIF 2.1.0.
Vulnerable vs. Hardened traefik.yml & Caddyfile (Before & After)
Disable api.insecure (PRX009) and exposedByDefault (PRX010),
enforce HTTPS redirects (PRX013) and TLS 1.2+ (PRX014), attach bcrypt auth + rate limiting
(PRX015–PRX016), and lock down Caddy's admin listener (PRX001).
api:
insecure: true
dashboard: true
entryPoints:
web:
address: ":80"
providers:
docker:
exposedByDefault: true
serversTransport:
insecureSkipVerify: true
tls:
options:
default:
minVersion: VersionTLS10
api:
insecure: false
dashboard: true
entryPoints:
web:
address: ":80"
http:
redirections:
entryPoint:
to: websecure
scheme: https
websecure:
address: ":443"
providers:
docker:
exposedByDefault: false
endpoint: "tcp://socket-proxy:2375"
serversTransport:
insecureSkipVerify: false
tls:
options:
default:
minVersion: VersionTLS12
{
admin 0.0.0.0:2019
auto_https off
}
http://app.example.com {
reverse_proxy 10.0.0.5:8080 {
transport http { tls_insecure_skip_verify }
}
}
{
admin off
}
app.example.com {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains"
X-Content-Type-Options "nosniff"
X-Frame-Options "DENY"
}
reverse_proxy app:8080
}
Lint Your traefik.yml or Caddyfile Locally (All 16 PRX Rules)
100% in-browser · 0 bytes sent · < 10 ms
Paste any traefik.yml, traefik.toml, or Caddyfile below—or load one of the
built-in samples—to verify all 16 reverse-proxy hardening rules with zero bytes uploaded.
stackguard-cli SARIF 2.1.0 & SOC 2 / DORA seals.
Exact Remediation Reference: Rules PRX009–PRX016 & PRX001
| Rule ID | Severity | Vulnerability & CWE | Exact Fix |
|---|---|---|---|
PRX009 |
CRITICAL |
Traefik API/dashboard exposed insecurely (api.insecure: true)
|
Set api.insecure: false and route api@internal exclusively via HTTPS with strong authentication or Tailscale/WireGuard VPN. |
PRX010 |
CRITICAL |
Traefik Docker provider auto-exposes containers (exposedByDefault: true)
|
Set providers.docker.exposedByDefault: false and opt-in public services explicitly with traefik.enable=true. |
PRX011 |
CRITICAL |
Traefik Docker socket mounted writable or exposed without proxy
|
Point Traefik to a read-only docker-socket-proxy (CONTAINERS=1, POST=0) instead of mounting writable /var/run/docker.sock. |
PRX012 |
CRITICAL |
Upstream TLS verification disabled in Traefik (insecureSkipVerify: true)
|
Set serversTransport.insecureSkipVerify: false and register your internal CA in rootCAs. |
PRX013 |
MEDIUM |
Traefik HTTP entrypoint (:80) missing HTTPS redirection
|
Add http.redirections.entryPoint.to: websecure and scheme: https on the :80 entrypoint. |
PRX014 |
HIGH |
Weak TLS minimum version (< VersionTLS12) in Traefik
|
Enforce minVersion: VersionTLS12 or VersionTLS13 in tls.options.default. |
PRX015 |
CRITICAL |
Plaintext or weak password hash in Traefik basicAuth middleware
|
Generate bcrypt hashes ( htpasswd -nbB admin ...) and load via usersFile or secrets rather than plaintext/MD5 inline credentials. |
PRX016 |
MEDIUM |
Missing rate-limit middleware on Traefik sensitive routes
|
Attach a rateLimit middleware (e.g. average: 50, burst: 100) to auth, webhook, and admin routers. |
PRX001 |
CRITICAL |
Caddy admin API exposed outside localhost
|
Keep Caddy admin on localhost:2019 or set admin off in the global block—never 0.0.0.0:2019. |
Frequently Asked Questions
Why is Traefik --api.insecure=true (PRX009) dangerous in production?
It exposes Traefik's REST API and dashboard without auth on port 8080, revealing every internal service route, IP, and middleware rule to anyone who scans the host.
How do I stop Traefik from auto-exposing internal Docker containers (PRX010)?
Set providers.docker.exposedByDefault: false in traefik.yml so databases, Redis, and internal admin UIs remain unreachable unless explicitly opted in with traefik.enable=true.
How do I secure the Caddy admin API (PRX001) on port 2019?
Keep it bound strictly to localhost:2019 or disable it with admin off if you deploy declarative Caddyfiles via container restart.
Does the embedded Traefik & Caddyfile linter upload my reverse-proxy config?
No. All 16 rules run locally inside your browser tab via scanner-bundle.js with 0 bytes uploaded.