Cloudflare DNS
Cloudflare DNS runs one of the largest DNS networks in the world.
Asset Types Fetched
- Devices, Users (when Fetch Users is selected), Domains & URLs, Certificates (when Fetch Certificates is selected), Load Balancers (when Fetch Load Balancers is selected), Network Services, Network Routes, Network/Firewall Rules (when Fetch Threat Profiles is selected), Application Settings (when Account ID is provided)
Before You Begin
Authentication Method
API Key (legacy) or API Token
Required Permissions
- Account Settings Read
- Zone Read
- Zone WAF Read (required to fetch WAF rulesets as Firewall assets when Fetch Threat Profiles is selected)
- DNS Read
- Account DNS Settings Read (required to fetch Application Settings)
- SSL and Certificates Read
- Load Balancing: Monitors and Pools Read (account scope; required to fetch Load Balancer pools when Fetch Load Balancer pools and map origins to Load Balancer listeners is selected)
- Include All accounts
- Include All zones
APIs
The following API endpoints are used:
- accounts -> https://developers.cloudflare.com/api/resources/accounts/
- zones -> https://developers.cloudflare.com/api/resources/zones/
- dns records -> https://developers.cloudflare.com/api/resources/dns/subresources/records/
- custom hostnames -> https://developers.cloudflare.com/api/resources/custom_hostnames/
- rule sets -> https://developers.cloudflare.com/api/resources/rulesets/
- dns settings -> https://developers.cloudflare.com/api/resources/dns/subresources/settings/
- load balancer pools -> https://developers.cloudflare.com/api/resources/load_balancers/subresources/pools/
Setting Up Cloudflare DNS to Work with Axonius
To create a token, open your Cloudflare account and navigate to Get your API Key -> API Tokens -> Create Token.
Then create the a token with the permissions listed in the image below. Once completed, obtain the generated API Token.
Connecting the Adapter in Axonius
Navigate to the Adapters page, search for Cloudflare DNS, and click on the adapter tile. Click Add Connection.
To connect the adapter in Axonius, provide the following parameters:
Required Parameters
- Cloudflare Domain - Keep as
https://api.cloudflare.com.
- User Email (legacy) - the Email address associated with your Cloudflare account. For more details, see Cloudflare API documentation
- API Key (a legacy authentication method) - Provides full permissions.
API Token - Provides custom permissions, which you can configure.
Optional Parameters
-
Account ID - If you are using an API token that begins with
cfat_,, you MUST provide it here, since account-owned tokens cannot list accounts via the Cloudflare API. When provided, the adapter targets this account directly instead of listing accounts.
If you are using a regular API token or user-scoped token, leave this field empty. The adapter will automatically discover accessible accounts.To fetch Application Settings (account-level DNS settings), you must provide an Account ID.
To locate your Account ID:
- In the Cloudflare dashboard, navigate to any zone or website in your account.
- The Account ID is displayed in the right sidebar under "Account ID" or in the URL path.
-
Verify SSL - Select whether to verify the SSL certificate of the server against the CA database inside of Axonius. For more details, see SSL Trust & CA Settings.
-
HTTPS Proxy - Connect the adapter to a proxy instead of directly connecting it to the domain.
To learn more about common adapter connection parameters and buttons, see Adding a New Adapter Connection.
Advanced Settings
Note
Advanced settings can either apply for all connections for this adapter, or you can set different advanced settings and/or different scheduling for a specific connection, refer to βAdvanced Configuration for Adapters.
-
Parse A and AAAA records as devices - By default Axonius also parses A and AAAA records as Devices. Use this option to parse them only as Domains and URLs.
-
Parse CNAME records as devices - Select whether to fetch each CNAME record as a separate device.
-
Fetch Custom Hostnames - Select whether to fetch additional custom hostname information.
-
Fetch users - Select whether to fetch users, in addition to devices.
-
Fetch Cloudflare WAF Rules - Select this option to fetch WAF rules and associate them to devices based on the Zone they belong to. Custom firewall rules are added to the Firewall Rules field of the devices for zones that use Cloudflare's current WAF (the Rulesets engine), and not for zones that use the deprecated legacy WAF managed rules. Each rule includes its ID, Name (the rule description), Action, Comment (the rule expression), and Is Enabled. Managed rules are not added to this field. To fetch the WAF rules of each zone as Firewall assets, use Fetch Threat Profiles.
-
Fetch Certificates - Select this option to fetch certificates.
-
Fetch Load Balancers - Select this option to fetch load balancers. Load Balancer assets use their Cloudflare name as their hostname.
-
Fetch Spectrum Applications - Select this option to fetch Spectrum Applications and parse them as URLs/domains.
-
Fetch Threat Profiles (default: false) - Select this option to fetch the WAF rules of each zone as Firewall assets (Network/Firewall Rules) with the CVEs that deployed managed rulesets block or log as threat profiles. This option is separate from Fetch Cloudflare WAF Rules, which adds WAF data to the DNS record devices and does not create Firewall assets. The API token needs the Zone WAF Read permission on the fetched zones. This option costs 2 more API requests for each zone, plus 1 for each managed ruleset version, which can increase the fetch time.
-
Map CNAME record targets to URL destination hostnames (default: false) - Select this option to add each CNAME record target as a destination hostname on the corresponding URL asset.
-
Map AAAA record addresses to URL IP addresses (default: false) - Select this option to add each valid AAAA record address as an IP address on the corresponding URL asset.
-
Fetch Load Balancer pools and map origins to Load Balancer listeners (default: false) - Select this option to fetch Load Balancer pools and map enabled default and fallback pools, with their enabled origins, to Forward listeners. This option requires Fetch Load Balancers.
More on WAF Rules and Threat Profiles
The adapter reads the custom WAF rules and the managed WAF rules of each zone. Each rule becomes one Firewall asset with the asset type Cloudflare WAF Rule. The Firewall asset includes Name (the rule description), Policy Name (the ruleset name, or the phase when the ruleset has no name), Is Enabled, Action (Denied when the rule action is block), Last Modified At, and one entry in Rules with UUID, Name, Action, Comments (the rule expression) and Is Enabled.
A managed rule that deploys a managed ruleset gets the threat profiles of that ruleset. Axonius reads the CVE IDs from the description of each ruleset rule, and applies the overrides of the deploying rule (rule override, then category override, then ruleset override). A ruleset rule that is disabled, or whose action is not block, log or challenge, is not included.
A deploying rule gets up to two threat profiles: one for the CVEs that the ruleset blocks, and one for the CVEs that it only logs or challenges. A threat profile includes the following:
-
ID - The ruleset ID with
_blockor_logat the end. -
Name - The ruleset name with "(block)" or "(log)" at the end.
-
Signatures - The CVE IDs of the enabled ruleset rules with that action. If there are more than 50 CVE IDs, the list keeps the 50 newest.
-
Signatures Count - The number of CVE IDs before the 50 limit.
-
Block - True for the "(block)" threat profile, false for the "(log)" threat profile.
-
Alarm - True for both threat profiles.
-
Enabled - False when the deploying rule is disabled.
If the API token cannot read the WAF rulesets of some zones, the fetch shows an event that tells you to grant the Zone WAF Read permission. The Firewall rules and threat profiles of those zones are not fetched.
Note
To learn more about Adapter Configuration tab advanced settings, see Adapter Advanced Settings.
Updated about 4 hours ago
