What security considerations should I keep in mind when using a Cloudflare API token with Caddy?

Question

Grade: Education Subject: Support
What security considerations should I keep in mind when using a Cloudflare API token with Caddy?
Asked by:
96 Viewed 96 Answers

Answer (96)

Best Answer
(363)
Treat your Cloudflare API token like a password. Never commit it to public repositories. Use environment variables to store the token and avoid hardcoding it in your Caddyfile. Grant the token only the necessary permissions (Edit zone DNS) and restrict it to the specific zones Caddy needs to manage. Regularly rotate your API tokens as a security best practice.