Permissions 0600 for acme.json are too open: Traefik ACME storage
0 reputation · 22 Nov 2020, 05:21 UTC
0 reputation · 22 Nov 2020, 05:21 UTC
Traefik utilizes a JSON file, acme.json, to persist TLS certificates and account keys generated via the ACME protocol. To maintain security, Traefik enforces strict filesystem permissions on this file.
On Linux environments, the acme.json file must have permissions set to 600. If the file is too accessible, Traefik may ignore the existing certificates or fail to initialize the ACME provider, potentially leading to repeated certificate requests and CA rate limiting.
When migrating or restoring this file across different environments or container volumes, maintaining these specific permissions is critical for the proxy to recognize the recovered data.
acme.json is restored with incorrect permissions in a non-root container environment?chmod is performed?acme.json is restored with permissions broader than 600 (e.g., 644 or 0755), Traefik will refuse to read the file. This is a security feature designed to protect private keys and ACME account tokens from unauthorized access on the host.
Traefik does not attempt to automatically correct these permissions. If the file is too accessible, Traefik will log an error message to standard output and ignore the file entirely. This typically results in the proxy failing to initialize the ACME provider, leading it to request new certificates on every restart, which can quickly trigger CA rate limiting from providers like Let's Encrypt.
To resolve this in a non-root containerized environment, you must manually ensure the file permissions and ownership are correct before Traefik starts:
acme.json file on the host or volume.chmod 600 /path/to/acme.json
chown 1000:1000 /path/to/acme.json
If you are using Docker Compose, simple volume mounts often inherit permissions from the host directory's umask. If permissions reset after a container restart, consider using an entrypoint script to set permissions before the main binary executes:
# Example entrypoint logic command: ["sh", "-c", "chmod 600 /etc/traefik/acme.json && /traefik"]
To provide a more specific solution, are you using a standard Docker volume mount, a Kubernetes PersistentVolume, or a specific cloud-provider storage?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.