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

What it checks #

Read-only security assessment of Cloudflare account settings, members, account-owned API tokens, zones, R2 buckets, and WAF managed rulesets.

12 tests

Install #

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

The pack also needs:

  1. PowerShell 7.4+, Maester 3.0+ (validated on stable 3.0.0), the installed pack, one Cloudflare account ID and a scoped read-only API token. See the repository README for pre-release installation.

Connect #

  1. Enter the Cloudflare API token without recording it in shell history.

    PowerShell
    $env:MAESTER_SE_CF_API_APITOKEN = Read-Host 'Cloudflare API token' -MaskInput
  2. Connect to one Cloudflare account. ZoneId and BucketName may be added as optional filters.

    PowerShell
    Connect-Maester -Service SE.CF.Api -ServiceSetting @{ AccountId = (Read-Host 'Cloudflare account ID').Trim() }

More about connecting

Run #

  1. Run this pack's checks without built-in checks.

    PowerShell
    Invoke-Maester -Path . -Pack SE.CF -SkipBuiltIn -NonInteractive
  2. Clear the connection and token after the run.

    PowerShell
    Remove-Item Env:MAESTER_SE_CF_API_APITOKEN -ErrorAction SilentlyContinueDisconnect-Maester

More about running it

App-only #

Needs a signed-in user: it does not run app-only.

Use a Cloudflare API token for non-interactive reads; this pack does not use Microsoft Graph app-only authentication.

README #

Maester Pack for Cloudflare®

Security Assessment for Cloudflare runs 12 read-only Maester checks against one Cloudflare account. It reports which settings need attention and which resources your token could assess. This independent, MIT-licensed community pack was unreleased and unlisted at the December 1, 2026 review. Check GitHub releases for subsequent versions. PR #4 completed protected live validation on Maester 3.0.0. The release checklist tracks validation for later revisions. Live evidence and limits · First release procedure

Run your first assessment

Use Git and PowerShell 7.4 or later. Have your 32-character hexadecimal account ID and a short-lived API token ready. Grant read access to the account and zones you intend to assess. A user-owned token acts with its user's delegated access. An account-owned token can serve as a dedicated integration credential. Either way, check 1008 inventories account-owned tokens only. Permissions by endpoint

Start a fresh PowerShell session in a private working directory with room for two new folders. The first holds the unreleased source. The second holds the project configuration, lock file and report. Review the local pack's Medium risk rating and network destination (api.cloudflare.com) when Maester asks for approval.

$ErrorActionPreference = 'Stop'
Install-Module Maester -RequiredVersion 3.0.0 -Repository PSGallery -Scope CurrentUser
Import-Module Maester -RequiredVersion 3.0.0

git clone --branch main https://github.com/SamErde/maester-pack-for-cloudflare.git
if ($LASTEXITCODE -ne 0) { throw 'Pack checkout failed.' }
$packPath = (Resolve-Path ./maester-pack-for-cloudflare).Path
$validation = Test-MtPack -Path $packPath
if (-not $validation.IsValid -or $validation.Errors -or $validation.Warnings) {
    throw "Pack validation failed: $($validation.Errors + $validation.Warnings -join ', ')"
}

New-Item -ItemType Directory -Path ./cloudflare-assessment | Out-Null
Push-Location ./cloudflare-assessment
try {
    Install-MtPack $packPath -Scope Project
    $settings = @{ AccountId = (Read-Host 'Cloudflare account ID').Trim() }
    $env:MAESTER_SE_CF_API_APITOKEN = Read-Host 'Cloudflare API token' -MaskInput
    Connect-Maester -Service SE.CF.Api -ServiceSetting $settings
    Invoke-Maester -Path . -Pack SE.CF -SkipBuiltIn -NonInteractive
} finally {
    Remove-Item Env:MAESTER_SE_CF_API_APITOKEN -ErrorAction SilentlyContinue
    try { Disconnect-Maester } finally { Pop-Location }
}

Open the report in the assessment directory. Keep it private because result rows can identify members, tokens, zones and buckets. To repeat a run, open the existing assessment directory, reconnect and run the installed pack. To focus discovery results, add ZoneId or BucketName to $settings before connecting. Each filter applies to its own resource family after discovery. Maester Packs

Checks

The IDs below share the prefix MP.SE.CF.. Each link opens the check's interpretation and remediation guide.

Scope Checks
Public zone settings 1001 Always Use HTTPS, 1002 origin TLS Full or stronger, 1003 minimum visitor TLS 1.2, 1004 TLS 1.3 enabled
Full and secondary DNS zones 1005 DNSSEC active
Account and members 1006 account 2FA enforcement, 1007 accepted members' 2FA
Account-owned tokens 1008 expiry, lifetime and inactivity
R2 buckets 1009 public r2.dev URL, 1010 enabled custom domains
Managed WAF 1011 account deployment, 1012 zone coverage

Read the results

Passed means the observed setting met the check. Failed means it missed the configured threshold or required setting. Investigate calls for operator judgment, such as whether a bucket should be public or a WAF exception is intentional. Skipped includes inapplicable checks and unavailable inventory. Read the reason. Error means the check could not assess its target. Check the token scope, response or transport before rerunning.

Compare the rows with your expected inventory. A token can see a subset of the account, including only account tokens its caller created. In unfiltered R2 runs, certain first-page denials or rejections for FedRAMP jurisdictions produce a skip with unknown bucket coverage. Worker routes are outside the R2 checks. Check 1012 selects the Free Managed Ruleset for Free zones and the broader Cloudflare Managed Ruleset for paid zones. An active Free zone can return Investigate when the API does not expose the automatically deployed ruleset. A paused public zone fails because traffic bypasses the WAF. Discovery and coverage · Cloudflare WAF availability

Adjust policy

Set these keys under GlobalSettings in the assessment directory's maester-config.json before the next run. Preserve the existing pack configuration.

Setting Default Effect
SeCf.DashboardSsoEnforced false Set to true only if all assessed members must sign in through dashboard SSO. Checks 1006 and 1007 then skip native 2FA. Verify MFA at the identity provider.
SeCf.TokenMaxLifetimeDays 365 Maximum permitted time from issuance to expiry for an active account-owned token.
SeCf.TokenInactivityDays 90 Maximum time since last use, or since issuance when last use is absent.
SeCf.R2MustBePrivate false An enabled r2.dev URL or custom domain yields Investigate by default. Set to true to fail either check.

Support

Report pack problems to the pack issue tracker. Include the check ID, Maester version, pack commit and a redacted symptom. Keep tokens, account identifiers, member details and reports private. Follow issue #1 for the first release.

Cloudflare is a registered trademark of Cloudflare, Inc. in the United States and other jurisdictions. This community project is independent of Cloudflare, Inc. Trademark guidelines

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