How to Audit Cloudflare Zone Records Easily

Auditing, verifying and confirming DNS records is important for organisations of all sizes to ensure:

  1. Zones don’t become cluttered with unused records.
  2. Zones have not been manipulated or edited without the proper authorisation.
  3. Zones can be re-created easily should it become corrupted.

In order to help with this, I have written a simple Python3 script that makes use of Cloudflare’s APIs to automatically get all of the relevant zones and the records within those zones.

This script will:

  1. Find all of the zones within the account (irrespective of the number of organisations).
  2. Create a CSV for each zone.
  3. Send an aggregated email with the records within each zone.
Automated Email (date stamped) with the records of each zone in the account.
Example CSV generated for each zone record.

This script needs:

  • A Cloudflare token.
  • Python3
  • Requests (pip install requests)
  • An SMTP Account / Server

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *