What security best practices should I follow to prevent Cloudflare API tokens from becoming invalid or compromised?

Question

Grade: Education Subject: Support
What security best practices should I follow to prevent Cloudflare API tokens from becoming invalid or compromised?
Asked by:
115 Viewed 115 Answers

Answer (115)

Best Answer
(507)
To enhance security and token validity, always create API Tokens with the principle of least privilege, granting only the specific permissions needed for their task and restricting them to specific zones. Set appropriate expiration dates for temporary tokens. Utilize IP address filtering to limit where tokens can be used. Store tokens securely (e.g., environment variables, secret managers) and avoid hardcoding them. Regularly audit and revoke tokens that are no longer in use or suspected of compromise.