Skip to content

DLP CLI commands

Use the Cloudflare CLI (cf) to manage supported Data Loss Prevention (DLP) resources from the command line. Sign in with cf auth login before running account commands.

The command groups below are generated from the Cloudflare CLI version pinned in this repository. For available flags and examples, run a command with --help.

Profiles

List and manage predefined and custom DLP profiles.

zero-trust dlp profiles custom create

Creates a DLP custom profile.

cf zero-trust dlp profiles custom create [options]
  • --ai-context-enabledboolean default: false

    The ai_context_enabled field

  • --allowed-match-countnumber default: 0

    Related DLP policies will trigger when the match count exceeds the number set.

  • --confidence-thresholdstring default: low

    The confidence_threshold field

  • --context-awareness-enabledboolean

    If true, scan the context of predefined entries to only return matches surrounded by keywords.

  • --context-awareness-skip-filesboolean

    If the content type is a file, skip context analysis and return all matches.

  • --data-classesstring

    Data class IDs to associate with the profile.

  • --data-tagsstring

    Data tag IDs to associate with the profile.

  • --descriptionstring

    The description of the profile.

  • --entriesstring

    The entries field. Provide as a JSON array of objects or @path/to/file.json. Shape: [({"enabled": boolean, "name": string, "pattern": {...}, "description"?: (string | null)} | {"enabled": boolean, "name": string, "words": [string]})]. ? marks optional keys.

  • --namestring required

    The name field

  • --ocr-enabledboolean default: false

    The ocr_enabled field

  • --sensitivity-levelsstring

    Sensitivity levels to associate with the profile. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"group_id": string, "level_id": string}].

  • --shared-entriesstring

    Entries from other profiles (e.g. pre-defined Cloudflare profiles, or your Microsoft Information Protection profiles). Provide as a JSON array of objects or @path/to/file.json. Shape: [{"enabled": boolean, "entry_id": string}].

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp profiles custom delete

Deletes a DLP custom profile.

cf zero-trust dlp profiles custom delete <profile-id>
  • <PROFILE-ID>string required

    Profile ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp profiles custom update

Updates a DLP custom profile.

cf zero-trust dlp profiles custom update <profile-id> [options]
  • <PROFILE-ID>string required

    Profile ID

  • --ai-context-enabledboolean

    The ai_context_enabled field

  • --allowed-match-countnumber

    The allowed_match_count field

  • --confidence-thresholdstring

    The confidence_threshold field

  • --context-awareness-enabledboolean

    If true, scan the context of predefined entries to only return matches surrounded by keywords.

  • --context-awareness-skip-filesboolean

    If the content type is a file, skip context analysis and return all matches.

  • --data-classesstring

    Data class IDs to associate with the profile. If omitted, existing associations are unchanged.

  • --data-tagsstring

    Data tag IDs to associate with the profile. If omitted, existing associations are unchanged.

  • --descriptionstring

    The description of the profile.

  • --entriesstring

    Custom entries from this profile. If this field is omitted, entries owned by this profile will not be changed. Provide as a JSON array of objects, null, or @path/to/file.json. Shape: [(({"enabled": boolean, "name": string, "pattern": {...}, "description"?: (string | null)} & {"entry_id": string}) | {"enabled": boolean, "name": string, "pattern": {...}, "description"?: (string | null)})]. ? marks optional keys.

  • --namestring required

    The name field

  • --ocr-enabledboolean

    The ocr_enabled field

  • --sensitivity-levelsstring

    Sensitivity levels to associate with the profile. If omitted, existing associations are unchanged. Provide as a JSON array of objects, null, or @path/to/file.json. Shape: [{"group_id": string, "level_id": string}].

  • --shared-entriesstring

    Other entries, e.g. predefined or integration. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"enabled": boolean, "entry_id": string}].

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp profiles get

Fetches a DLP profile by ID.

cf zero-trust dlp profiles get <profile-id>
  • <PROFILE-ID>string required

    Profile ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp profiles list

Lists all DLP profiles in an account.

cf zero-trust dlp profiles list [options]
  • --allboolean

    Return all profiles, including those that current account does not have access to.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp profiles predefined update

Updates a DLP predefined profile. Only supports enabling/disabling entries.

cf zero-trust dlp profiles predefined update <profile-id> [options]
  • <PROFILE-ID>string required

    Profile ID

  • --ai-context-enabledboolean

    The ai_context_enabled field

  • --allowed-match-countnumber

    The allowed_match_count field

  • --confidence-thresholdstring

    The confidence_threshold field

  • --context-awareness-enabledboolean

    If true, scan the context of predefined entries to only return matches surrounded by keywords.

  • --context-awareness-skip-filesboolean

    If the content type is a file, skip context analysis and return all matches.

  • --entriesstring

    The entries field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"enabled": boolean, "id": string}].

  • --ocr-enabledboolean

    The ocr_enabled field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

Detection entries and patterns

Manage custom detection entries and validate regular-expression patterns. For supported regex syntax and length limits, refer to Pattern entries.

zero-trust dlp entries create

Creates a DLP custom entry.

cf zero-trust dlp entries create [options]
  • --descriptionstring

    The description field

  • --enabledboolean required

    The enabled field

  • --namestring required

    The name field

  • --pattern-regexstring required

    The pattern.regex field

  • --pattern-validation"luhn"

    The pattern.validation field

  • --profile-idstring

    The profile_id field

  • --validator-idsstring

    Validators the new entry should reference, by id, at most 10.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp entries delete

Deletes a DLP custom entry.

cf zero-trust dlp entries delete <entry-id>
  • <ENTRY-ID>string required

    Entry ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp entries get

Fetches a DLP entry by ID.

cf zero-trust dlp entries get <entry-id>
  • <ENTRY-ID>string required

    Entry ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp entries list

Lists all DLP entries in an account.

cf zero-trust dlp entries list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp entries update

Updates a DLP entry.

cf zero-trust dlp entries update <entry-id> [options]
  • <ENTRY-ID>string required

    Entry ID

  • --enabledboolean required

    The enabled field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp patterns validate

Validates whether this pattern is a valid regular expression. Rejects it if the regular expression is too complex or can match an unbounded-length string. The regex will be rejected if it uses * or +. Bound the maximum number of characters that can be matched using a range, e.g. {1,100}.

cf zero-trust dlp patterns validate [options]
  • --max-match-bytesnumber

    Maximum number of bytes that the regular expression can match.

    If this is null then there is no limit on the length. Patterns can use * and +. Otherwise repeats should use a range {m,n} to restrict patterns to the length. If this field is missing, then a default length limit is used.

    Note that the length is specified in bytes. Since regular expressions use UTF-8 the pattern . can match up to 4 bytes. Hence .{1,256} has a maximum length of 1024 bytes.

  • --regexstring required

    The regex field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

Datasets and document fingerprints

Manage datasets and document fingerprints used by DLP detection entries. Check the relevant dataset preparation instructions before uploading sensitive data.

zero-trust dlp datasets create

Creates a new DLP (Data Loss Prevention) dataset for storing custom detection patterns. Datasets can contain exact match data, word lists, or EDM (Exact Data Match) configurations.

cf zero-trust dlp datasets create [options]
  • --case-sensitiveboolean

    Only applies to custom word lists. Determines if the words should be matched in a case-sensitive manner Cannot be set to false if secret is true or undefined

  • --descriptionstring

    The description of the dataset.

  • --encoding-versionnumber

    Dataset encoding version

    Non-secret custom word lists with no header are always version 1. Secret EDM lists with no header are version 1. Multicolumn CSV with headers are version 2. Omitting this field provides the default value 0, which is interpreted the same as 1.

  • --namestring required

    The name field

  • --secretboolean

    Generate a secret dataset.

    If true, the response will include a secret to use with the EDM encoder. If false, the response has no secret and the dataset is uploaded in plaintext.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp datasets delete

This deletes all versions of the dataset.

cf zero-trust dlp datasets delete <dataset-id>
  • <DATASET-ID>string required

    Dataset ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp datasets get

Gets a dataset and its latest upload status.

cf zero-trust dlp datasets get <dataset-id>
  • <DATASET-ID>string required

    Dataset ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp datasets list

Lists all DLP datasets configured for the account, including custom word lists and EDM datasets.

cf zero-trust dlp datasets list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp datasets prepare-upload

Creates a new version of a DLP dataset, allowing you to stage changes before activation. Used for single-column EDM and custom word lists.

cf zero-trust dlp datasets prepare-upload <dataset-id>
  • <DATASET-ID>string required

    Dataset ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp datasets update

Updates the configuration of an existing DLP dataset, such as its name, description, or detection settings.

cf zero-trust dlp datasets update <dataset-id> [options]
  • <DATASET-ID>string required

    Dataset ID

  • --case-sensitiveboolean

    Determines if the words should be matched in a case-sensitive manner.

    Only required for custom word lists.

  • --descriptionstring

    The description of the dataset.

  • --namestring

    The name of the dataset, must be unique.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp datasets upload

This is used for single-column EDMv1 and Custom Word Lists. The EDM format can only be created in the Cloudflare dashboard. For other clients, this operation can only be used for non-secret Custom Word Lists. The body must be a UTF-8 encoded, newline (NL or CRNL) separated list of words to be matched.

cf zero-trust dlp datasets upload <dataset-version> [options]
  • <DATASET-VERSION>string required

    Version

  • --dataset-idstring required

    Dataset ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

  • --filestring

    Path to a file to upload as the request body

zero-trust dlp document-fingerprints create

Creates a new document fingerprint for DLP scanning. Document fingerprints detect documents that are structurally similar to the uploaded sample.

cf zero-trust dlp document-fingerprints create [options]
  • --descriptionstring default:

    The description field

  • --match-percentnumber required

    The match_percent field

  • --namestring required

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp document-fingerprints delete

Removes a document fingerprint from DLP configuration. Documents matching this fingerprint will no longer be detected.

cf zero-trust dlp document-fingerprints delete <document-fingerprint-id>
  • <DOCUMENT-FINGERPRINT-ID>string required

    Document fingerprint ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp document-fingerprints get

Gets a document fingerprint and its latest upload status.

cf zero-trust dlp document-fingerprints get <document-fingerprint-id>
  • <DOCUMENT-FINGERPRINT-ID>string required

    Document fingerprint ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp document-fingerprints list

Lists all document fingerprints configured for DLP scanning in the account.

cf zero-trust dlp document-fingerprints list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp document-fingerprints update

Updates metadata for an existing document fingerprint, such as its name or description.

cf zero-trust dlp document-fingerprints update <document-fingerprint-id> [options]
  • <DOCUMENT-FINGERPRINT-ID>string required

    Document fingerprint ID

  • --descriptionstring

    The description field

  • --match-percentnumber

    The match_percent field

  • --namestring

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp document-fingerprints upload

Uploads a new document to create or update a fingerprint. The document structure is analyzed to enable detection of similar documents.

cf zero-trust dlp document-fingerprints upload <document-fingerprint-id>
  • <DOCUMENT-FINGERPRINT-ID>string required

    Document fingerprint ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

  • --filestring

    Path to a file to upload as the request body

Data Classification

Manage data classes, data-tag categories and tags, sensitivity groups and levels, and the available templates.

zero-trust dlp data-classes create

Creates a data class for use in DLP profiles.

cf zero-trust dlp data-classes create [options]
  • --data-tagsstring required

    The data_tags field

  • --descriptionstring

    The description field

  • --expressionstring required

    The expression field

  • --namestring required

    The name field

  • --sensitivity-levelsstring required

    The sensitivity_levels field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"group_id": string, "level_id": string}].

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp data-classes delete

Deletes a data class from the account.

cf zero-trust dlp data-classes delete <data-class-id>
  • <DATA-CLASS-ID>string required

    Data class ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp data-classes get

Gets the configuration for a data class.

cf zero-trust dlp data-classes get <data-class-id>
  • <DATA-CLASS-ID>string required

    Data class ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-classes list

Lists data classes configured for the account.

cf zero-trust dlp data-classes list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-classes update

Updates the configuration for a data class.

cf zero-trust dlp data-classes update <data-class-id> [options]
  • <DATA-CLASS-ID>string required

    Data class ID

  • --data-tagsstring

    The data_tags field

  • --descriptionstring

    The description field

  • --expressionstring

    The expression field

  • --namestring

    The name field

  • --sensitivity-levelsstring

    The sensitivity_levels field. Provide as a JSON array of objects, null, or @path/to/file.json. Shape: [{"group_id": string, "level_id": string}].

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp data-tag-categories create

Creates a data tag category, optionally from a template.

cf zero-trust dlp data-tag-categories create [options]
  • --descriptionstring

    The description field

  • --namestring required

    The name field

  • --tagsstring

    Tags to create with the category. Mutually exclusive with template_id. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"name": string, "description"?: (string | null)}]. ? marks optional keys.

  • --template-idstring

    The template_id field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp data-tag-categories delete

Deletes a data tag category and its tags.

cf zero-trust dlp data-tag-categories delete <category-id>
  • <CATEGORY-ID>string required

    Category ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp data-tag-categories get

Gets a data tag category and its tags.

cf zero-trust dlp data-tag-categories get <category-id>
  • <CATEGORY-ID>string required

    Category ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-tag-categories list

Lists data tag categories configured for the account.

cf zero-trust dlp data-tag-categories list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-tag-categories update

Updates a data tag category and its tags.

cf zero-trust dlp data-tag-categories update <category-id> [options]
  • <CATEGORY-ID>string required

    Category ID

  • --descriptionstring

    The description field

  • --namestring

    The name field

  • --tagsstring

    The desired final state of tags.

    • None (omitted): no tag changes.
    • Some([]): delete all tags.
    • Some([...]): desired final set + order. Provide as a JSON array of objects, null, or @path/to/file.json. Shape: [({"description"?: (string | null), "name"?: (string | null)} & {"id"?: (string | null)})]. ? marks optional keys.
  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp data-tags create

Creates a data tag in a category.

cf zero-trust dlp data-tags create <category-id> [options]
  • <CATEGORY-ID>string required

    Category ID

  • --descriptionstring

    The description field

  • --namestring required

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp data-tags delete

Deletes a data tag from a category.

cf zero-trust dlp data-tags delete <tag-id> [options]
  • <TAG-ID>string required

    Tag ID

  • --category-idstring required

    Category ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp data-tags get

Gets a data tag from a category.

cf zero-trust dlp data-tags get <tag-id> [options]
  • <TAG-ID>string required

    Tag ID

  • --category-idstring required

    Category ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-tags list

Lists data tags in a category.

cf zero-trust dlp data-tags list [options]
  • --category-idstring required

    Category ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-tags update

Updates a data tag in a category.

cf zero-trust dlp data-tags update <tag-id> [options]
  • <TAG-ID>string required

    Tag ID

  • --category-idstring required

    Category ID

  • --descriptionstring

    The description field

  • --namestring

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp sensitivity-groups create

Creates a sensitivity group, optionally from a template.

cf zero-trust dlp sensitivity-groups create [options]
  • --descriptionstring

    The description field

  • --levelsstring

    Levels to create with the group. Mutually exclusive with template_id. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"name": string, "description"?: (string | null)}]. ? marks optional keys.

  • --namestring required

    The name field

  • --template-idstring

    The template_id field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp sensitivity-groups delete

Deletes a sensitivity group and its levels.

cf zero-trust dlp sensitivity-groups delete <sensitivity-group-id>
  • <SENSITIVITY-GROUP-ID>string required

    Sensitivity group ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp sensitivity-groups get

Gets a sensitivity group and its levels.

cf zero-trust dlp sensitivity-groups get <sensitivity-group-id>
  • <SENSITIVITY-GROUP-ID>string required

    Sensitivity group ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp sensitivity-groups get-level-order

Gets the current order of sensitivity levels in a group.

cf zero-trust dlp sensitivity-groups get-level-order <sensitivity-group-id>
  • <SENSITIVITY-GROUP-ID>string required

    Sensitivity group ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp sensitivity-groups list

Lists sensitivity groups configured for the account.

cf zero-trust dlp sensitivity-groups list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp sensitivity-groups update

Updates a sensitivity group and its levels.

cf zero-trust dlp sensitivity-groups update <sensitivity-group-id> [options]
  • <SENSITIVITY-GROUP-ID>string required

    Sensitivity group ID

  • --descriptionstring

    The description field

  • --levelsstring

    The desired final state of levels.

    • None (omitted): no level changes.
    • Some([]): delete all levels.
    • Some([...]): desired final set + order. Provide as a JSON array of objects, null, or @path/to/file.json. Shape: [({"description"?: (string | null), "name"?: (string | null)} & {"id"?: (string | null)})]. ? marks optional keys.
  • --namestring

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp sensitivity-groups update-level-order

Updates the order of sensitivity levels in a group.

cf zero-trust dlp sensitivity-groups update-level-order <sensitivity-group-id> [options]
  • <SENSITIVITY-GROUP-ID>string required

    Sensitivity group ID

  • --level-idsstring required

    The level_ids field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp sensitivity-levels create

Creates a sensitivity level in a group.

cf zero-trust dlp sensitivity-levels create <sensitivity-group-id> [options]
  • <SENSITIVITY-GROUP-ID>string required

    Sensitivity group ID

  • --descriptionstring

    The description field

  • --namestring required

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp sensitivity-levels delete

Deletes a sensitivity level from a group.

cf zero-trust dlp sensitivity-levels delete <sensitivity-level-id> [options]
  • <SENSITIVITY-LEVEL-ID>string required

    Sensitivity level ID

  • --sensitivity-group-idstring required

    Sensitivity group ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp sensitivity-levels get

Gets a sensitivity level from a group.

cf zero-trust dlp sensitivity-levels get <sensitivity-level-id> [options]
  • <SENSITIVITY-LEVEL-ID>string required

    Sensitivity level ID

  • --sensitivity-group-idstring required

    Sensitivity group ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp sensitivity-levels list

Lists sensitivity levels in a sensitivity group.

cf zero-trust dlp sensitivity-levels list [options]
  • --sensitivity-group-idstring required

    Sensitivity group ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp sensitivity-levels update

Updates a sensitivity level in a group.

cf zero-trust dlp sensitivity-levels update <sensitivity-level-id> [options]
  • <SENSITIVITY-LEVEL-ID>string required

    Sensitivity level ID

  • --sensitivity-group-idstring required

    Sensitivity group ID

  • --descriptionstring

    The description field

  • --namestring

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp sensitivity-group-templates get

Gets an available sensitivity group template.

cf zero-trust dlp sensitivity-group-templates get <template-id>
  • <TEMPLATE-ID>string required

    Template ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp sensitivity-group-templates list

Lists available sensitivity group templates.

cf zero-trust dlp sensitivity-group-templates list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-tag-category-templates get

Gets an available data tag category template.

cf zero-trust dlp data-tag-category-templates get <template-id>
  • <TEMPLATE-ID>string required

    Template ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp data-tag-category-templates list

Lists available data tag category templates.

cf zero-trust dlp data-tag-category-templates list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

AI prompt topics

Manage custom prompt topics for DLP content detection.

zero-trust dlp custom-prompt-topics create

Creates a DLP custom prompt topic entry.

cf zero-trust dlp custom-prompt-topics create [options]
  • --descriptionstring

    The description field

  • --enabledboolean required

    The enabled field

  • --namestring required

    The name field

  • --profile-idstring

    The profile_id field

  • --topicstring required

    The topic field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp custom-prompt-topics delete

Deletes a DLP custom prompt topic entry.

cf zero-trust dlp custom-prompt-topics delete <entry-id>
  • <ENTRY-ID>string required

    Entry ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp custom-prompt-topics get

Fetches a DLP custom prompt topic entry by ID.

cf zero-trust dlp custom-prompt-topics get <entry-id>
  • <ENTRY-ID>string required

    Entry ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp custom-prompt-topics list

Lists all DLP custom prompt topic entries in an account.

cf zero-trust dlp custom-prompt-topics list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp custom-prompt-topics update

Updates a DLP custom prompt topic entry.

cf zero-trust dlp custom-prompt-topics update <entry-id> [options]
  • <ENTRY-ID>string required

    Entry ID

  • --descriptionstring

    The description field

  • --enabledboolean required

    The enabled field

  • --namestring required

    The name field

  • --topicstring required

    The topic field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

Account settings, validators, and limits

Review account-level settings, content validators, and DLP resource limits.

zero-trust dlp settings delete

Deletes account-level DLP settings and returns the initial values.

cf zero-trust dlp settings delete
  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp settings edit

Missing fields keep their existing values.

cf zero-trust dlp settings edit [options]
  • --ai-context-analysisboolean

    Whether AI context analysis is enabled at the account level.

  • --ocrboolean

    Whether OCR is enabled at the account level.

  • --payload-logging-masking-level"full" | "partial" | "clear" | "default"

    Masking level for payload logs.

    • full: The entire payload is masked.
    • partial: Only partial payload content is masked.
    • clear: No masking is applied to the payload content.
    • default: DLP uses its default masking behavior.
  • --payload-logging-public-keystring

    Base64-encoded public key for encrypting payload logs.

    • Set to a non-empty base64 string to enable payload logging with the given key.
    • Set to an empty string to disable payload logging.
    • Omit or set to null to leave unchanged (PATCH) or reset to disabled (PUT).
  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp settings get

Gets the account-level DLP settings.

cf zero-trust dlp settings get
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp settings update

Missing fields are reset to initial (unconfigured) values.

cf zero-trust dlp settings update [options]
  • --ai-context-analysisboolean

    Whether AI context analysis is enabled at the account level.

  • --ocrboolean

    Whether OCR is enabled at the account level.

  • --payload-logging-masking-level"full" | "partial" | "clear" | "default"

    Masking level for payload logs.

    • full: The entire payload is masked.
    • partial: Only partial payload content is masked.
    • clear: No masking is applied to the payload content.
    • default: DLP uses its default masking behavior.
  • --payload-logging-public-keystring

    Base64-encoded public key for encrypting payload logs.

    • Set to a non-empty base64 string to enable payload logging with the given key.
    • Set to an empty string to disable payload logging.
    • Omit or set to null to leave unchanged (PATCH) or reset to disabled (PUT).
  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp validators get

Fetches a validator of any kind by ID.

cf zero-trust dlp validators get <validator-id>
  • <VALIDATOR-ID>string required

    Validator ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp validators list

Lists the validators configured for the account, of every kind.

cf zero-trust dlp validators list [options]
  • --kind"proximity_words" | "worker"

    Only return validators of this kind. Omit to return every kind.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp validators proximity-words create

Creates a reusable list of weighted words that detection entries can attach to in order to refine their matches. An account may own at most 100 validators across all kinds.

cf zero-trust dlp validators proximity-words create [options]
  • --namestring required

    A name for this validator, at most 50 characters.

  • --wordsstring required

    The words that raise confidence when found near a match, at most 100 per validator. Matching ignores case, so the list may not contain the same word twice with different capitalisation. Words are stored as sent.

    For example, a validator for medical record numbers might use [{"word": "patient", "weight": "strong"}, {"word": "diagnosis", "weight": "moderate"}, {"word": "mrn", "weight": "weak"}]. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"weight": "strong" | "moderate" | "weak", "word": string}].

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp validators proximity-words delete

Deletes a proximity_words validator. Fails with 409 while any detection entry is still attached to it; detach it from those entries first.

cf zero-trust dlp validators proximity-words delete <validator-id>
  • <VALIDATOR-ID>string required

    Validator ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp validators proximity-words get

Fetches a proximity_words validator by ID.

cf zero-trust dlp validators proximity-words get <validator-id>
  • <VALIDATOR-ID>string required

    Validator ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp validators proximity-words list

Lists the proximity_words validators configured for the account.

cf zero-trust dlp validators proximity-words list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp validators proximity-words update

Replaces the name and word list of a proximity_words validator. Attachments to detection entries are owned from the entry side and are not affected.

cf zero-trust dlp validators proximity-words update <validator-id> [options]
  • <VALIDATOR-ID>string required

    Validator ID

  • --namestring required

    A name for this validator, at most 50 characters.

  • --wordsstring required

    The words that raise confidence when found near a match, at most 100 per validator. Matching ignores case, so the list may not contain the same word twice with different capitalisation. Words are stored as sent.

    For example, a validator for medical record numbers might use [{"word": "patient", "weight": "strong"}, {"word": "diagnosis", "weight": "moderate"}, {"word": "mrn", "weight": "weak"}]. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"weight": "strong" | "moderate" | "weak", "word": string}].

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp validators worker create

Registers a customer Worker as a validator. An account may own at most 100 validators across all kinds.

cf zero-trust dlp validators worker create [options]
  • --defaultstring

    The default field. Accepts a JSON scalar or plain string, or @path/to/file.

  • --namestring required

    A name for this validator, at most 50 characters.

  • --script-tagstring required

    The public script tag of the customer's Worker that scores matches.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp validators worker delete

Deletes a worker validator. Fails with 409 while any detection entry is still attached to it; detach it from those entries first.

cf zero-trust dlp validators worker delete <validator-id>
  • <VALIDATOR-ID>string required

    Validator ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp validators worker get

Fetches a worker validator by ID.

cf zero-trust dlp validators worker get <validator-id>
  • <VALIDATOR-ID>string required

    Validator ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp validators worker list

Lists the worker validators configured for the account.

cf zero-trust dlp validators worker list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp validators worker status get

Reports whether the validator's Worker can be used. Returns worker_not_found if the Worker cannot be found, and worker_error if the Worker does not have a valid validation entrypoint or is returning incorrect responses.

cf zero-trust dlp validators worker status get <validator-id>
  • <VALIDATOR-ID>string required

    Validator ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp validators worker update

Replaces the name, script tag and fallback verdict of a worker validator. Attachments to detection entries are owned from the entry side and are not affected.

cf zero-trust dlp validators worker update <validator-id> [options]
  • <VALIDATOR-ID>string required

    Validator ID

  • --defaultstring

    The default field. Accepts a JSON scalar or plain string, or @path/to/file.

  • --namestring required

    A name for this validator, at most 50 characters.

  • --script-tagstring required

    The public script tag of the customer's Worker that scores matches.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp limits list

Retrieves current DLP usage limits and quotas for the account, including maximum allowed counts and current usage for custom entries, dataset cells, and document fingerprints.

cf zero-trust dlp limits list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

Gateway HTTP policies

The Cloudflare CLI exposes Zero Trust Gateway rule management. Use the Gateway rules command group to create and manage Gateway policies; verify the DLP Profile selector expression and rule behavior in a test account before applying rules to production traffic.

zero-trust gateway rules create

Create a new Zero Trust Gateway rule.

cf zero-trust gateway rules create [options]
  • --action"on" | "off" | "allow" | "block" | "scan" | "noscan" | "safesearch" | "ytrestricted" | "isolate" | "noisolate" | "override" | "l4_override" | "egress" | "resolve" | "quarantine" | "redirect" | "forward" required

    Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to true.

  • --descriptionstring default:

    Specify the rule description.

  • --device-posturestring default:

    Specify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

  • --enabledboolean default: false

    Specify whether the rule is enabled.

  • --expiration-durationnumber

    Defines the default duration a policy active in minutes. Must set in order to use the reset_expiration endpoint on this rule.

  • --expiration-expires-atstring

    The expiration.expires_at field

  • --filtersstring

    Specify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.

  • --identitystring default:

    Specify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

  • --namestring required

    Specify the rule name.

  • --precedencenumber

    Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to Order of enforcement to manage precedence via Terraform.

  • --rule-settings-add-headersstring

    Add custom headers to allowed requests as key-value pairs. Use header names as keys that map to arrays of header values. Header values may contain @{selector.name} variable references that are interpolated at the edge. Use @@{ to escape a literal @{. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes and each header value may not exceed 4 KB. Settable only for http rules with the action set to allow. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": [string]}.

  • --rule-settings-allow-child-bypassboolean

    Set to enable MSP children to bypass this rule. Only parent MSP accounts can set this. this rule. Settable for all types of rules.

  • --rule-settings-biso-admin-controls-copy"enabled" | "disabled" | "remote_only"

    Configure copy behavior. If set to remote_only, users cannot copy isolated content from the remote browser to the local clipboard. If this field is absent, copying remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-dcpboolean

    Set to false to enable copy-pasting. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-ddboolean

    Set to false to enable downloading. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-dkboolean

    Set to false to enable keyboard usage. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-download"enabled" | "disabled" | "remote_only"

    Configure download behavior. When set to remote_only, users can view downloads but cannot save them. If this field is absent, downloading remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-dpboolean

    Set to false to enable printing. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-duboolean

    Set to false to enable uploading. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-keyboard"enabled" | "disabled" | "enable_read_only_actions"

    Configure keyboard usage behavior. When set to enable_read_only_actions, only approved browser commands (find, copy, print, zoom, and select-all) may execute; other keyboard input is blocked from reaching the page. Copy and print remain subject to their independent controls. If this field is absent, keyboard usage remains enabled. Applies only when version == "v2". The enable_read_only_actions value requires an explicit version of "v2".

  • --rule-settings-biso-admin-controls-paste"enabled" | "disabled" | "remote_only"

    Configure paste behavior. If set to remote_only, users cannot paste content from the local clipboard into isolated pages. If this field is absent, pasting remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-printing"enabled" | "disabled"

    Configure print behavior. Default, Printing is enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-upload"enabled" | "disabled"

    Configure upload behavior. If this field is absent, uploading remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-version"v1" | "v2"

    Indicate which version of the browser isolation controls should apply.

  • --rule-settings-biso-admin-controls-wm-idstring

    Specify the watermark ID (UUID) to apply to the isolated browser session. When present, enables watermark rendering in the isolated browser.

  • --rule-settings-block-page-include-contextboolean

    Specify whether to pass the context information as query parameters.

  • --rule-settings-block-page-target-uristring

    Specify the URI to which the user is redirected.

  • --rule-settings-block-page-enabledboolean

    Enable the custom block page. Settable only for dns rules with action block.

  • --rule-settings-block-reasonstring

    Explain why the rule blocks the request. The custom block page shows this text (if enabled). Settable only for dns, l4, and http rules when the action set to block.

  • --rule-settings-bypass-parent-ruleboolean

    Set to enable MSP accounts to bypass their parent's rules. Only MSP child accounts can set this. Settable for all types of rules.

  • --rule-settings-check-session-durationstring

    Sets the required session freshness threshold. The API returns a normalized version of this value.

  • --rule-settings-check-session-enforceboolean

    Enable session enforcement.

  • --rule-settings-delete-headersstring

    Remove headers from allowed requests by name. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes. Settable only for http rules with the action set to allow.

  • --rule-settings-dns-resolvers-ipv4string

    The rule_settings.dns_resolvers.ipv4 field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"ip": string, "port"?: number, "route_through_private_network"?: boolean, "vnet_id"?: string}]. ? marks optional keys.

  • --rule-settings-dns-resolvers-ipv6string

    The rule_settings.dns_resolvers.ipv6 field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"ip": string, "port"?: number, "route_through_private_network"?: boolean, "vnet_id"?: string}]. ? marks optional keys.

  • --rule-settings-egress-ipv4string

    Specify the IPv4 address to use for egress.

  • --rule-settings-egress-ipv4-fallbackstring

    Specify the fallback IPv4 address to use for egress when the primary IPv4 fails. Set '0.0.0.0' to indicate local egress via WARP IPs.

  • --rule-settings-egress-ipv6string

    Specify the IPv6 range to use for egress.

  • --rule-settings-forensic-copy-enabledboolean

    Enable sending the copy to storage.

  • --rule-settings-forward-worker-idstring

    Specify the public Worker ID of the target Worker.

  • --rule-settings-ignore-cname-category-matchesboolean

    Ignore category matches at CNAME domains in a response. When off, evaluate categories in this rule against all CNAME domain categories in the response. Settable only for dns and dns_resolver rules.

  • --rule-settings-insecure-disable-dnssec-validationboolean

    Specify whether to disable DNSSEC validation (for Allow actions) [INSECURE]. Settable only for dns rules.

  • --rule-settings-ip-categoriesboolean

    Enable IPs in DNS resolver category blocks. The system blocks only domain name categories unless you enable this setting. Settable only for dns and dns_resolver rules.

  • --rule-settings-ip-indicator-feedsboolean

    Indicates whether to include IPs in DNS resolver indicator feed blocks. Default, indicator feeds block only domain names. Settable only for dns and dns_resolver rules.

  • --rule-settings-l4override-ipstring

    Defines the IPv4 or IPv6 address.

  • --rule-settings-l4override-portnumber

    Defines a port number to use for TCP/UDP overrides.

  • --rule-settings-notification-settings-enabledboolean

    Enable notification.

  • --rule-settings-notification-settings-include-contextboolean

    Indicates whether to pass the context information as query parameters.

  • --rule-settings-notification-settings-msgstring

    Customize the message shown in the notification.

  • --rule-settings-notification-settings-support-urlstring

    Defines an optional URL to direct users to additional information. If unset, the notification opens a block page.

  • --rule-settings-override-hoststring

    Defines a hostname for override, for the matching DNS queries. Settable only for dns rules with the action set to override.

  • --rule-settings-override-ipsstring

    Defines a an IP or set of IPs for overriding matched DNS queries. Settable only for dns rules with the action set to override.

  • --rule-settings-payload-log-enabledboolean

    Enable DLP payload logging for this rule.

  • --rule-settings-quarantine-file-typesstring

    Specify the types of files to sandbox.

  • --rule-settings-redirect-include-contextboolean

    Specify whether to pass the context information as query parameters.

  • --rule-settings-redirect-preserve-path-and-queryboolean

    Specify whether to append the path and query parameters from the original request to target_uri.

  • --rule-settings-redirect-target-uristring

    Specify the URI to which the user is redirected.

  • --rule-settings-resolve-dns-internally-fallback"none" | "public_dns"

    Specify the fallback behavior to apply when the internal DNS response code differs from 'NOERROR' or when the response data contains only CNAME records for 'A' or 'AAAA' queries.

  • --rule-settings-resolve-dns-internally-view-idstring

    Specify the internal DNS view identifier to pass to the internal DNS service.

  • --rule-settings-resolve-dns-through-cloudflareboolean

    Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS resolver. Cannot set when 'dns_resolvers' specified or 'resolve_dns_internally' is set. Only valid when a rule's action set to 'resolve'. Settable only for dns_resolver rules.

  • --rule-settings-set-headersstring

    Replace existing headers on allowed requests with the specified key-value pairs. If a header does not exist, it is added. Header values may contain @{selector.name} variable references that are interpolated at the edge. Use @@{ to escape a literal @{. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes and each header value may not exceed 4 KB. Settable only for http rules with the action set to allow. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": [string]}.

  • --rule-settings-untrusted-cert-action"pass_through" | "block" | "error"

    Defines the action performed when an untrusted certificate seen. The default action an error with HTTP code 526.

  • --schedule-fristring

    Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-monstring

    Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-satstring

    Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-sunstring

    Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-thustring

    Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-time-zonestring

    Specify the time zone for rule evaluation. When a valid time zone city name is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.

  • --schedule-tuestring

    Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-wedstring

    Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --trafficstring default:

    Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust gateway rules delete

Delete a Zero Trust Gateway rule.

cf zero-trust gateway rules delete <rule-id>
  • <RULE-ID>string required

    Identify the API resource with a UUID.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust gateway rules get

Get a single Zero Trust Gateway rule.

cf zero-trust gateway rules get <rule-id>
  • <RULE-ID>string required

    Identify the API resource with a UUID.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust gateway rules list

List Zero Trust Gateway rules for an account.

cf zero-trust gateway rules list [options]
  • --filterstring

    Filter the returned rules by one or more field:value pairs. Repeat the parameter to combine filters with logical AND.

    Supported fields are name, id, action, enabled, source_account, is_shared, filters, and expression (max 1024 bytes). The source_account value is matched as a normalized UUID substring. The filters value must be one of the rule filter names and matches a member of the rule's filters array. The expression filter performs a case-insensitive literal substring match across traffic, identity, and device posture expressions.

  • --searchstring

    Case-insensitive substring search across rule name and description.

  • --order-by"name" | "created_at" | "updated_at" | "precedence"

    Field to sort the returned rules by. Supported values are name, created_at, updated_at, and precedence.

  • --direction"asc" | "desc"

    Sort direction. When order_by is omitted, this controls the direction of the existing precedence ordering. Shared rules remain first in either direction. Accepted values are asc and desc.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust gateway rules list-tenant

List Zero Trust Gateway rules for the parent account of an account in the MSP configuration.

cf zero-trust gateway rules list-tenant
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust gateway rules reset-expiration

Resets the expiration of a Zero Trust Gateway Rule if its duration elapsed and it has a default duration. The Zero Trust Gateway Rule must have values for both expiration.expires_at and expiration.duration.

cf zero-trust gateway rules reset-expiration <rule-id>
  • <RULE-ID>string required

    Identify the API resource with a UUID.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust gateway rules update

Update a configured Zero Trust Gateway rule.

cf zero-trust gateway rules update <rule-id> [options]
  • <RULE-ID>string required

    Identify the API resource with a UUID.

  • --action"on" | "off" | "allow" | "block" | "scan" | "noscan" | "safesearch" | "ytrestricted" | "isolate" | "noisolate" | "override" | "l4_override" | "egress" | "resolve" | "quarantine" | "redirect" | "forward" required

    Specify the action to perform when the associated traffic, identity, and device posture expressions either absent or evaluate to true.

  • --descriptionstring

    Specify the rule description.

  • --device-posturestring

    Specify the wirefilter expression used for device posture check. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

  • --enabledboolean

    Specify whether the rule is enabled.

  • --expiration-durationnumber

    Defines the default duration a policy active in minutes. Must set in order to use the reset_expiration endpoint on this rule.

  • --expiration-expires-atstring

    The expiration.expires_at field

  • --filtersstring

    Specify the protocol or layer to evaluate the traffic, identity, and device posture expressions. Can only contain a single value.

  • --identitystring

    Specify the wirefilter expression used for identity matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

  • --namestring required

    Specify the rule name.

  • --precedencenumber

    Set the order of your rules. Lower values indicate higher precedence. At each processing phase, evaluate applicable rules in ascending order of this value. Refer to Order of enforcement to manage precedence via Terraform.

  • --rule-settings-add-headersstring

    Add custom headers to allowed requests as key-value pairs. Use header names as keys that map to arrays of header values. Header values may contain @{selector.name} variable references that are interpolated at the edge. Use @@{ to escape a literal @{. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes and each header value may not exceed 4 KB. Settable only for http rules with the action set to allow. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": [string]}.

  • --rule-settings-allow-child-bypassboolean

    Set to enable MSP children to bypass this rule. Only parent MSP accounts can set this. this rule. Settable for all types of rules.

  • --rule-settings-biso-admin-controls-copy"enabled" | "disabled" | "remote_only"

    Configure copy behavior. If set to remote_only, users cannot copy isolated content from the remote browser to the local clipboard. If this field is absent, copying remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-dcpboolean

    Set to false to enable copy-pasting. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-ddboolean

    Set to false to enable downloading. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-dkboolean

    Set to false to enable keyboard usage. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-download"enabled" | "disabled" | "remote_only"

    Configure download behavior. When set to remote_only, users can view downloads but cannot save them. If this field is absent, downloading remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-dpboolean

    Set to false to enable printing. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-duboolean

    Set to false to enable uploading. Only applies when version == "v1".

  • --rule-settings-biso-admin-controls-keyboard"enabled" | "disabled" | "enable_read_only_actions"

    Configure keyboard usage behavior. When set to enable_read_only_actions, only approved browser commands (find, copy, print, zoom, and select-all) may execute; other keyboard input is blocked from reaching the page. Copy and print remain subject to their independent controls. If this field is absent, keyboard usage remains enabled. Applies only when version == "v2". The enable_read_only_actions value requires an explicit version of "v2".

  • --rule-settings-biso-admin-controls-paste"enabled" | "disabled" | "remote_only"

    Configure paste behavior. If set to remote_only, users cannot paste content from the local clipboard into isolated pages. If this field is absent, pasting remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-printing"enabled" | "disabled"

    Configure print behavior. Default, Printing is enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-upload"enabled" | "disabled"

    Configure upload behavior. If this field is absent, uploading remains enabled. Applies only when version == "v2".

  • --rule-settings-biso-admin-controls-version"v1" | "v2"

    Indicate which version of the browser isolation controls should apply.

  • --rule-settings-biso-admin-controls-wm-idstring

    Specify the watermark ID (UUID) to apply to the isolated browser session. When present, enables watermark rendering in the isolated browser.

  • --rule-settings-block-page-include-contextboolean

    Specify whether to pass the context information as query parameters.

  • --rule-settings-block-page-target-uristring

    Specify the URI to which the user is redirected.

  • --rule-settings-block-page-enabledboolean

    Enable the custom block page. Settable only for dns rules with action block.

  • --rule-settings-block-reasonstring

    Explain why the rule blocks the request. The custom block page shows this text (if enabled). Settable only for dns, l4, and http rules when the action set to block.

  • --rule-settings-bypass-parent-ruleboolean

    Set to enable MSP accounts to bypass their parent's rules. Only MSP child accounts can set this. Settable for all types of rules.

  • --rule-settings-check-session-durationstring

    Sets the required session freshness threshold. The API returns a normalized version of this value.

  • --rule-settings-check-session-enforceboolean

    Enable session enforcement.

  • --rule-settings-delete-headersstring

    Remove headers from allowed requests by name. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes. Settable only for http rules with the action set to allow.

  • --rule-settings-dns-resolvers-ipv4string

    The rule_settings.dns_resolvers.ipv4 field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"ip": string, "port"?: number, "route_through_private_network"?: boolean, "vnet_id"?: string}]. ? marks optional keys.

  • --rule-settings-dns-resolvers-ipv6string

    The rule_settings.dns_resolvers.ipv6 field. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"ip": string, "port"?: number, "route_through_private_network"?: boolean, "vnet_id"?: string}]. ? marks optional keys.

  • --rule-settings-egress-ipv4string

    Specify the IPv4 address to use for egress.

  • --rule-settings-egress-ipv4-fallbackstring

    Specify the fallback IPv4 address to use for egress when the primary IPv4 fails. Set '0.0.0.0' to indicate local egress via WARP IPs.

  • --rule-settings-egress-ipv6string

    Specify the IPv6 range to use for egress.

  • --rule-settings-forensic-copy-enabledboolean

    Enable sending the copy to storage.

  • --rule-settings-forward-worker-idstring

    Specify the public Worker ID of the target Worker.

  • --rule-settings-ignore-cname-category-matchesboolean

    Ignore category matches at CNAME domains in a response. When off, evaluate categories in this rule against all CNAME domain categories in the response. Settable only for dns and dns_resolver rules.

  • --rule-settings-insecure-disable-dnssec-validationboolean

    Specify whether to disable DNSSEC validation (for Allow actions) [INSECURE]. Settable only for dns rules.

  • --rule-settings-ip-categoriesboolean

    Enable IPs in DNS resolver category blocks. The system blocks only domain name categories unless you enable this setting. Settable only for dns and dns_resolver rules.

  • --rule-settings-ip-indicator-feedsboolean

    Indicates whether to include IPs in DNS resolver indicator feed blocks. Default, indicator feeds block only domain names. Settable only for dns and dns_resolver rules.

  • --rule-settings-l4override-ipstring

    Defines the IPv4 or IPv6 address.

  • --rule-settings-l4override-portnumber

    Defines a port number to use for TCP/UDP overrides.

  • --rule-settings-notification-settings-enabledboolean

    Enable notification.

  • --rule-settings-notification-settings-include-contextboolean

    Indicates whether to pass the context information as query parameters.

  • --rule-settings-notification-settings-msgstring

    Customize the message shown in the notification.

  • --rule-settings-notification-settings-support-urlstring

    Defines an optional URL to direct users to additional information. If unset, the notification opens a block page.

  • --rule-settings-override-hoststring

    Defines a hostname for override, for the matching DNS queries. Settable only for dns rules with the action set to override.

  • --rule-settings-override-ipsstring

    Defines a an IP or set of IPs for overriding matched DNS queries. Settable only for dns rules with the action set to override.

  • --rule-settings-payload-log-enabledboolean

    Enable DLP payload logging for this rule.

  • --rule-settings-quarantine-file-typesstring

    Specify the types of files to sandbox.

  • --rule-settings-redirect-include-contextboolean

    Specify whether to pass the context information as query parameters.

  • --rule-settings-redirect-preserve-path-and-queryboolean

    Specify whether to append the path and query parameters from the original request to target_uri.

  • --rule-settings-redirect-target-uristring

    Specify the URI to which the user is redirected.

  • --rule-settings-resolve-dns-internally-fallback"none" | "public_dns"

    Specify the fallback behavior to apply when the internal DNS response code differs from 'NOERROR' or when the response data contains only CNAME records for 'A' or 'AAAA' queries.

  • --rule-settings-resolve-dns-internally-view-idstring

    Specify the internal DNS view identifier to pass to the internal DNS service.

  • --rule-settings-resolve-dns-through-cloudflareboolean

    Enable to send queries that match the policy to Cloudflare's default 1.1.1.1 DNS resolver. Cannot set when 'dns_resolvers' specified or 'resolve_dns_internally' is set. Only valid when a rule's action set to 'resolve'. Settable only for dns_resolver rules.

  • --rule-settings-set-headersstring

    Replace existing headers on allowed requests with the specified key-value pairs. If a header does not exist, it is added. Header values may contain @{selector.name} variable references that are interpolated at the edge. Use @@{ to escape a literal @{. A maximum of 20 header operations (add + set + delete) is allowed per policy. Each header name may not exceed 256 bytes and each header value may not exceed 4 KB. Settable only for http rules with the action set to allow. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": [string]}.

  • --rule-settings-untrusted-cert-action"pass_through" | "block" | "error"

    Defines the action performed when an untrusted certificate seen. The default action an error with HTTP code 526.

  • --schedule-fristring

    Specify the time intervals when the rule is active on Fridays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Fridays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-monstring

    Specify the time intervals when the rule is active on Mondays, in the increasing order from 00:00-24:00(capped at maximum of 6 time splits). If this parameter omitted, the rule is deactivated on Mondays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-satstring

    Specify the time intervals when the rule is active on Saturdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Saturdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-sunstring

    Specify the time intervals when the rule is active on Sundays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Sundays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-thustring

    Specify the time intervals when the rule is active on Thursdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Thursdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-time-zonestring

    Specify the time zone for rule evaluation. When a valid time zone city name is provided, Gateway always uses the current time for that time zone. When this parameter is omitted, Gateway uses the time zone determined from the user's IP address. Colo time zone is used when the user's IP address does not resolve to a location.

  • --schedule-tuestring

    Specify the time intervals when the rule is active on Tuesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Tuesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --schedule-wedstring

    Specify the time intervals when the rule is active on Wednesdays, in the increasing order from 00:00-24:00. If this parameter omitted, the rule is deactivated on Wednesdays. API returns a formatted version of this string, which may cause Terraform drift if a unformatted value is used.

  • --trafficstring

    Specify the wirefilter expression used for traffic matching. The API automatically formats and sanitizes expressions before storing them. To prevent Terraform state drift, use the formatted expression returned in the API response.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

Email DLP

zero-trust dlp email account-mapping create

Creates a mapping between a Cloudflare account and an email provider for DLP email scanning integration.

cf zero-trust dlp email account-mapping create [options]
  • --auth-requirements-allowed-microsoft-organizationsstring

    The auth_requirements.allowed_microsoft_organizations field

  • --auth-requirements-type"Org" | "NoAuth" required

    The auth_requirements.type field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp email account-mapping get

Retrieves the email provider mapping configuration for DLP email scanning.

cf zero-trust dlp email account-mapping get
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp email rules bulk-edit

Reorders DLP email scanning rules by updating their priority values. Higher priority rules are evaluated first.

cf zero-trust dlp email rules bulk-edit [options]
  • --new-prioritiesstring required

    The new_priorities field. Provide as a JSON object or @path/to/file.json. Shape: {"<key>": number}.

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp email rules create

Creates a new DLP email scanning rule that defines what content patterns to detect in email messages and what actions to take.

cf zero-trust dlp email rules create [options]
  • --action-action"Block" required

    The action.action field

  • --action-messagestring

    The action.message field

  • --conditionsstring required

    Triggered if all conditions match. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"operator": "InList" | "NotInList" | "MatchRegex" | ...more, "selector": "Recipients" | "Sender" | "DLPProfiles", "value": ([string] | string)}].

  • --descriptionstring

    The description field

  • --enabledboolean required

    The enabled field

  • --namestring required

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

zero-trust dlp email rules delete

Removes a DLP email scanning rule. The rule will no longer be applied to email messages.

cf zero-trust dlp email rules delete <rule-id>
  • <RULE-ID>string required

    Rule ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --forceboolean default: false

    Skip confirmation (useful in scripts and CI)

zero-trust dlp email rules get

Gets detailed configuration for a specific DLP email scanning rule, including detection patterns and actions.

cf zero-trust dlp email rules get <rule-id>
  • <RULE-ID>string required

    Rule ID

  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp email rules list

Lists all email scanner rules for an account.

cf zero-trust dlp email rules list
  • --dry-runboolean default: false

    Validate and show what would happen without executing

zero-trust dlp email rules update

Updates a DLP email scanning rule.

cf zero-trust dlp email rules update <rule-id> [options]
  • <RULE-ID>string required

    Rule ID

  • --action-action"Block" required

    The action.action field

  • --action-messagestring

    The action.message field

  • --conditionsstring required

    Triggered if all conditions match. Provide as a JSON array of objects or @path/to/file.json. Shape: [{"operator": "InList" | "NotInList" | "MatchRegex" | ...more, "selector": "Recipients" | "Sender" | "DLPProfiles", "value": ([string] | string)}].

  • --descriptionstring

    The description field

  • --enabledboolean required

    The enabled field

  • --namestring required

    The name field

  • --dry-runboolean default: false

    Validate and show what would happen without executing

  • --bodystring

    Raw JSON request body (bypasses individual flags)

Was this helpful?