Just had an interesting Brevo API key leak incident that exposed some subtle pitfalls in serverless secrets management.
I accidentally shipped a private API key in a public React bundle for 33 days. Brevo’s fraud detection caught an unauthorized Amsterdam VPS, revoked the key before damage, and I got lucky. Lesson one: never put keys in frontend bundles, even if “it worked” on other projects with different build setups.
Rotating keys isn’t as simple as "rotate and forget." Cloudflare Pages binds secrets at deploy time—patching env vars alone doesn’t update running workers unless you redeploy. Azure App Service caches headers in singleton HttpClient instances, so you must restart the app after rotation.
Also, Brevo’s auto-allowlist quietly trusted suspicious IPs for weeks, highlighting dangers in default “convenient” security features.
I’ve moved to per-host keys, disabled auto-allowlist, and built monitoring to catch anomalies early. If you use Cloudflare Pages or Azure App Service, check your rotation and deployment models carefully.
Anyone else run into these issues or have better patterns for key rotation on serverless?
#InfoSec #ServerlessSecurity #APIKeyManagement #CloudflarePages #AzureAppService #DevSecOps
github.com/Ekioo/KittyClaw
