MediumScript packFreeMicrosoft MVP

Security Assessment for Cloudflare

Read-only security checks for Cloudflare account settings, zones, R2, and WAF.

By SamErde · Version 0.1.0 · Published 1 Dec 2026

← All tests

MP.SE.CF.1008 Account-owned API tokens should expire and be used regularly

Severity: MediumSE.CF.Api

Active account-owned API tokens should have an expiry and should stay within configurable lifetime and inactivity thresholds. This family returns one row per token, including disabled and recently expired tokens as Not Applicable rows. It never reads or reports a token secret.

Defaults: SeCf.TokenMaxLifetimeDays = 365 and SeCf.TokenInactivityDays = 90. When last use is absent, the check measures inactivity from issuance. A missing expiry fails. Missing issuance or activity data needed to calculate a threshold yields Investigate unless another condition already fails. These thresholds are pack policy.

The API returns account-owned tokens visible to the caller, regardless of whether the assessment credential is account-owned or user-owned. A caller restricted to list_self sees only tokens it created. Reconcile the returned rows against the expected inventory. Personal user tokens are outside this check. List account-owned tokens

Remediation

Rotate or disable inactive tokens, set an expiry, and use the smallest permissions and resource scope needed for each integration.

%TestResult%

Install
Install-MtPack SamErde/maester-pack-for-cloudflare

Assumes Maester is installed. New to Maester? Get started.

Next: connect and run
Connect
$env:MAESTER_SE_CF_API_APITOKEN = Read-Host 'Cloudflare API token' -MaskInputConnect-Maester -Service SE.CF.Api -ServiceSetting @{ AccountId = (Read-Host 'Cloudflare account ID').Trim() }
Run
Invoke-Maester -Path . -Pack SE.CF -SkipBuiltIn -NonInteractiveRemove-Item Env:MAESTER_SE_CF_API_APITOKEN -ErrorAction SilentlyContinueDisconnect-Maester