Cloudflare Executive Report - CLI for multi-zone reporting and cache
Project description
โ๏ธ Cloudflare Executive Report
Turn Cloudflare analytics into executive-ready PDF reports with security scores, NIST mappings, and multi-zone portfolio views.
๐ฏ Why this tool exists
Cloudflare dashboard data is great for daily ops, but executives need more:
| Problem | Solution |
|---|---|
| ๐ Dashboard only shows recent data | Historical windows beyond convenience |
| ๐ One zone at a time | One report across many zones |
| ๐ Raw numbers, no narrative | Reusable PDFs with risk scoring and actions |
| ๐ Too much detail | Concise leadership summaries |
Cloudflare Executive Report fills that gap with local caching and deterministic PDF generation.
โจ What you get
| Feature | What it does for you |
|---|---|
| ๐พ Historical cache | Sync once, generate reports later - no re-querying |
| ๐ Multi-zone portfolio | One page with score, grade, and risks across all zones |
| ๐ Executive summary | Verdict, KPIs, takeaways, and actions per zone |
| ๐ฏ Security score | 0-100 + grade, based on real risk takeaways |
| ๐ NIST mapping | Compliance context for auditors |
| ๐ง Email delivery | Auto-send PDFs via SMTP after generation |
| ๐จ Brand colors | Match your company's primary/accent colors |
๐ See it in action
Try the sample reports (generated from synthetic data):
| Minimal | Executive | Detailed | High Quality* |
|---|---|---|---|
| ๐ View PDF | ๐ View PDF | ๐ฌ View PDF | โจ View PDF |
*SVG/high quality = larger file size, sharper visuals for printing
๐ Quick start (30 seconds)
pip install cloudflare-executive-report
cf-report init
cf-report sync --last 30
cf-report report -o security-report.pdf
That's it. You just generated your first executive report.
๐๏ธ Report profiles (choose your depth)
| Profile | Cover | Portfolio | Zone summary | Details | Best for |
|---|---|---|---|---|---|
| minimal | โ | โ | โ | โ | Quick status check |
| executive | โ | โ | โ | โ | Leadership (default) |
| detailed | โ | โ | โ | โ | Technical deep dive |
๐ API token setup
Create a read-only API token in Cloudflare Dashboard โ Manage Account โ Account API Tokens
Required permissions
| Permission | Required |
|---|---|
| Zone > Zone Read | โ Yes |
| Zone > Analytics Read | โ Yes |
| Zone > DNS Read | โ ๏ธ Recommended |
| Zone > SSL and Certificates Read | โ ๏ธ Recommended |
| Zone > Zone Settings Read | โ ๏ธ Recommended |
| Zone > Firewall Services Read | โ ๏ธ Recommended |
| Zone > WAF Read | โ ๏ธ Recommended |
| Account > Access: Audit Logs Read | โน๏ธ Nice-to-have |
| Account > Account Settings Read | โน๏ธ Nice-to-have |
โ Required = Tool won't work | โ ๏ธ Recommended = Full features | โน๏ธ Nice-to-have = Better validation
Quick validation
# Shows exactly which permissions you have
cf-report validate
Security notes
- ๐ Read-only only - The tool never needs write permissions
- ๐พ All data stays local - Cached in
~/.cf-report/, no telemetry - ๐ Full security guide โ - Step-by-step token creation, data storage details, and security checklist
๐ How scoring works
Only risk takeaways affect your score. Everything else (win, action, comparison, observation) is informational.
Score = max(0, 100 - (total_risk_weight / 60) * 100)
| Risk weight | Score | Grade | Example |
|---|---|---|---|
| 0 | 100 | A+ | No risks found |
| 19 | 68 | C+ | SSL off (10) + WAF disabled (9) |
| 26 | 57 | C | Three medium risks |
| 60+ | 0 | F | Critical security gaps |
โฑ๏ธ Data retention (by Cloudflare plan)
| Plan | DNS | Security | HTTP |
|---|---|---|---|
| Free | 7d | 7d | 30d |
| Pro | 31d | 7d | 30d |
| Business | 31d | 31d | 30d |
| Enterprise | 62d | 90d | 30d |
Days outside these windows =
unavailable(cached, no API calls)
โ๏ธ Quick config (~/.cf-report/config.yaml)
api_token: "cfat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
cache_dir: "~/.cf-report/cache"
history_dir: "~/.cf-report/history"
log_level: "info"
zones:
- id: "abc123..."
name: "example.com"
pdf:
profile: "executive" # minimal | executive | detailed
chart_format: "png" # png | svg
map_format: "png" # png | svg
colors:
primary: "#2563eb" # your brand color
accent: "#f38020"
email:
enabled: true
smtp_host: "smtp.example.com"
recipients:
- "security@example.com"
ai-summary:
enabled: true
model: "openrouter/google/gemma-2-9b-it:free"
๐ ๏ธ CLI cheat sheet
# Sync data
cf-report sync --last 30 # Last 30 days
cf-report sync --zone example.com --last 7 # Single zone
# Generate report
cf-report report -o report.pdf # Basic PDF
cf-report report -o report.pdf --email # PDF + email
cf-report report --skip-zone-health # Skip health checks
# Manage zones
cf-report zones list
cf-report zones add --id abc123 --name example.com
# Clean cache
cf-report clean --older-than 90
# Generate report with AI summary and send it by email
cf-report report -o report.pdf --email --ai-summary
๐ Documentation
| Guide | What it covers |
|---|---|
| User guide | Full CLI reference and config |
| AI Summary: Powered by LLMs (Optional) | AI summary and email generation |
| Dashboard verification | Compare report vs Cloudflare UI |
| Reliability metrics | Understanding approximations |
| Developer docs | Architecture and internals |
โ Common questions
How accurate are the metrics? Trend-oriented approximations. Use for executive posture guidance, not packet-level forensics.
Can I run this in CI/CD?
Yes - works headless. Set CF_REPORT_API_TOKEN (preferred) and pass --config to a non-secret config file.
What if I have 100+ zones? Works fine. Sync may take a while initially, but caching helps.
๐ฆ Links
๐ License
MIT - go wild. See LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloudflare_executive_report-1.0.0.tar.gz.
File metadata
- Download URL: cloudflare_executive_report-1.0.0.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8941721cf80b7aa4186ce1b27ed9c6cd83853dab60c0dd539534e34d61350b17
|
|
| MD5 |
4293cdf9c02b21715bf6749dd8e593fe
|
|
| BLAKE2b-256 |
44b7397f4ca5438a76b440e0d0cf18eea89869d876b61d9474b1084ac8456baf
|
Provenance
The following attestation bundles were made for cloudflare_executive_report-1.0.0.tar.gz:
Publisher:
publish.yml on vhsantos/cloudflare-executive-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudflare_executive_report-1.0.0.tar.gz -
Subject digest:
8941721cf80b7aa4186ce1b27ed9c6cd83853dab60c0dd539534e34d61350b17 - Sigstore transparency entry: 1420867446
- Sigstore integration time:
-
Permalink:
vhsantos/cloudflare-executive-report@5226acb5bbed32ca794e185a28acb46ebfe81d1d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/vhsantos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5226acb5bbed32ca794e185a28acb46ebfe81d1d -
Trigger Event:
release
-
Statement type:
File details
Details for the file cloudflare_executive_report-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cloudflare_executive_report-1.0.0-py3-none-any.whl
- Upload date:
- Size: 203.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d17873de74b313f7ccb827797fe51de4376f794568951930386b8879155e97f
|
|
| MD5 |
839935dfb0fdfba73b57b5cf025ca0d0
|
|
| BLAKE2b-256 |
5e1c3741dbf8a1cbd7e48e71d547d683a78c10cf6575a3307c1055358ef4face
|
Provenance
The following attestation bundles were made for cloudflare_executive_report-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on vhsantos/cloudflare-executive-report
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cloudflare_executive_report-1.0.0-py3-none-any.whl -
Subject digest:
5d17873de74b313f7ccb827797fe51de4376f794568951930386b8879155e97f - Sigstore transparency entry: 1420867518
- Sigstore integration time:
-
Permalink:
vhsantos/cloudflare-executive-report@5226acb5bbed32ca794e185a28acb46ebfe81d1d -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/vhsantos
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5226acb5bbed32ca794e185a28acb46ebfe81d1d -
Trigger Event:
release
-
Statement type: