crowdstrike.falcon.response_policy module – Manage Falcon Real Time Response policies

Note

This module is part of the crowdstrike.falcon collection (version 4.15.0).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install crowdstrike.falcon. You need further requirements to be able to use this module, see Requirements for details.

To use it in a playbook, specify: crowdstrike.falcon.response_policy.

New in crowdstrike.falcon 4.15.0

Synopsis

  • Create, update, enable, disable and delete Falcon Real Time Response policies.

  • The same task creates the Real Time Response policy when it is missing, updates it when it is different, and deletes it with state=absent.

  • The module finds a policy by policy_id, or by name and platform_name.

  • Each setting option turns one Real Time Response setting of the policy on or off. When a setting option is not set, the module does not change that setting. A new policy has the settings that are not set turned off.

  • Some settings are available only on some platforms. With state=present, the module fails before any change when a setting option is set that the platform of the policy does not have, because the API ignores such a setting.

Requirements

The below requirements are needed on the host that executes this module.

  • Host groups [READ] API scope, only when host_groups adds host groups

  • Response policies [READ, WRITE] API scope

  • crowdstrike-falconpy >= 1.5.0

  • python >= 3.12

Parameters

Parameter

Comments

auth

dictionary

The registered result of the crowdstrike.falcon.auth module, or a dictionary containing the access_token and cloud keys.

If provided, the client_id, client_secret, member_cid, and cloud options are ignored.

Useful when needing to make multiple API calls to avoid rate limiting issues.

access_token

string

The OAuth2 access token to use for authentication.

cloud

string

The CrowdStrike cloud region to use.

This can differ from the module’s cloud argument due to autodiscovery.

client_id

aliases: falcon_client_id

string

The CrowdStrike API client ID to use.

See the Falcon documentation for more information about API clients.

The FALCON_CLIENT_ID environment variable can also be used.

client_secret

aliases: falcon_client_secret

string

The CrowdStrike API secret that corresponds to the client ID.

See the Falcon documentation for more information about API clients.

The FALCON_CLIENT_SECRET environment variable can also be used.

cloud

string

The CrowdStrike cloud region to use.

All clouds are automatically discovered if not specified, except for the us-gov-1 cloud.

The FALCON_CLOUD environment variable can also be used.

Choices:

  • "us-1" ← (default)

  • "us-2"

  • "us-3"

  • "us-gov-1"

  • "us-gov-2"

  • "eu-1"

custom_scripts

boolean

Whether custom scripts can run on the hosts of the policy.

The API setting ID is CustomScripts, in the Scripts category.

Available on Windows, Mac and Linux.

When not set, the module does not change it.

Choices:

  • false

  • true

description

string

The description of the Real Time Response policy.

An empty string clears the description.

When not set, the module does not change the description.

enabled

boolean

Whether the Real Time Response policy is enabled.

A new policy is disabled unless this is true.

When not set, the module does not change it.

Choices:

  • false

  • true

exec_command

boolean

Whether the run command is allowed.

The API setting ID is ExecCommand, in the High risk commands category.

Available on Windows, Mac and Linux.

When not set, the module does not change it.

Choices:

  • false

  • true

ext_headers

dictionary

Extended headers that are prepended to the default headers dictionary.

falcon_scripts

boolean

Whether Falcon scripts can run on the hosts of the policy.

The API setting ID is FalconScripts, in the Scripts category.

Available on Windows only.

The API says that this setting requires custom scripts to be enabled. The module does not check it.

When not set, the module does not change it.

Choices:

  • false

  • true

get_command

boolean

Whether the get command is allowed.

The API setting ID is GetCommand, in the High risk commands category.

Available on Windows, Mac and Linux.

When not set, the module does not change it.

Choices:

  • false

  • true

host_groups

list / elements=string

The IDs of the host groups to assign the Real Time Response policy to.

The IDs are compared without regard to case. An ID that is in the list more than once counts once.

The module fails before any change when a host group to add does not exist.

When not set, the module does not change the host groups of the policy.

Ignored with state=absent.

member_cid

string

The CrowdStrike member CID for MSSP authentication.

See the Falcon documentation for more information about API clients.

The FALCON_MEMBER_CID environment variable can also be used.

memdump_command

boolean

Whether the memdump command is allowed.

The API setting ID is MemDumpCommand, in the High risk commands category.

Available on Windows only.

When not set, the module does not change it.

Choices:

  • false

  • true

name

string

The name of the Real Time Response policy.

The module finds an existing policy by this exact name on the platform in platform_name, without regard to case.

The module does not change the name of an existing policy. A name that differs only in case finds the same policy.

Requires platform_name.

Mutually exclusive with policy_id.

platform_name

string

The platform of the Real Time Response policy. The value is case-sensitive.

A name is unique only for each platform, so the module uses the platform to find the policy by name.

The platform of an existing policy cannot change.

Required with name.

Choices:

  • "Windows"

  • "Mac"

  • "Linux"

policy_id

string

The ID of an existing Real Time Response policy.

The ID is compared without regard to case.

With state=present, the module fails when the ID does not exist.

Mutually exclusive with name and platform_name.

purge_host_groups

boolean

If purge_host_groups=true and host_groups is set, the module removes the host groups of the policy that are not in host_groups.

If host_groups is not set, the module does not change the host groups, even if purge_host_groups=true.

With host_groups=[] and purge_host_groups=true, the module removes all the host groups of the policy.

Choices:

  • false ← (default)

  • true

put_and_run_command

boolean

Whether the put-and-run command is allowed.

The API setting ID is PutAndRunCommand, in the High risk commands category.

Available on Windows and Mac.

When not set, the module does not change it.

Choices:

  • false

  • true

put_command

boolean

Whether the put command is allowed.

The API setting ID is PutCommand, in the High risk commands category.

Available on Windows, Mac and Linux.

When not set, the module does not change it.

Choices:

  • false

  • true

real_time_functionality

boolean

Whether Real Time Response is on for the hosts of the policy.

The API setting ID is RealTimeFunctionality, in the Enable/Disable category.

Available on Windows, Mac and Linux.

When not set, the module does not change it.

Choices:

  • false

  • true

state

string

The desired state of the Real Time Response policy.

With state=absent, the module disables an enabled policy before it deletes it, because the API does not delete an enabled policy.

Choices:

  • "present" ← (default)

  • "absent"

user_agent

string

Custom User-Agent string to use for requests to the API.

The user agent string is prepended to the default user agent string (crowdstrike-ansible/<version>).

See RFC 7231 for more information.

The FALCON_USER_AGENT environment variable can also be used.

xmemdump_command

boolean

Whether the xmemdump command is allowed.

The API setting ID is XMemDumpCommand, in the High risk commands category.

Available on Windows only.

When not set, the module does not change it.

Choices:

  • false

  • true

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target, if not supported the action will be skipped.

diff_mode

Support: full

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode

platform

Platforms: all

Target OS/families that can be operated against

See Also

See also

crowdstrike.falcon.response_policy_info

Get information about Falcon Real Time Response policies.

crowdstrike.falcon.host_group

Manage Falcon host groups.

crowdstrike.falcon.host_group_info

Get information about Falcon host groups.

Response Policies API reference

The CrowdStrike API operations that this module uses.

Examples

- name: Create an enabled Linux Real Time Response policy
  crowdstrike.falcon.response_policy:
    name: "Example response policy"
    platform_name: Linux
    description: "Managed by Ansible"
    enabled: true
    real_time_functionality: true
    custom_scripts: true
    put_command: true

- name: Create a Windows Real Time Response policy that allows Falcon scripts
  crowdstrike.falcon.response_policy:
    name: "Example Windows response policy"
    platform_name: Windows
    real_time_functionality: true
    custom_scripts: true
    falcon_scripts: true

- name: Turn off the get command of the Linux policy
  crowdstrike.falcon.response_policy:
    name: "Example response policy"
    platform_name: Linux
    get_command: false

- name: Assign the policy to two host groups
  crowdstrike.falcon.response_policy:
    name: "Example response policy"
    platform_name: Linux
    host_groups:
      - "abcdef1234567890abcdef1234567890"
      - "1234567890abcdef1234567890abcdef"

- name: Set the exact host groups of the policy and remove the others
  crowdstrike.falcon.response_policy:
    name: "Example response policy"
    platform_name: Linux
    host_groups:
      - "abcdef1234567890abcdef1234567890"
    purge_host_groups: true

- name: Delete the policy by name and platform
  crowdstrike.falcon.response_policy:
    name: "Example response policy"
    platform_name: Linux
    state: absent

- name: Delete a Real Time Response policy by ID
  crowdstrike.falcon.response_policy:
    policy_id: "12345678901234567890abcdef123456"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key

Description

response_policy

dictionary

The Real Time Response policy after the change, read again from the API.

In check mode, the current policy, or the wanted values when the policy does not exist.

Returned: when state=present

cid

string

The customer ID that the policy belongs to.

Returned: success

Sample: "abcdef1234567890abcdef1234567890"

created_by

string

The user who created the Real Time Response policy.

Returned: success

Sample: "user@example.com"

created_timestamp

string

The time when the Real Time Response policy was created.

Returned: success

Sample: "2026-01-01T00:00:00.000000000Z"

description

string

The description of the Real Time Response policy. Can be empty.

Returned: success

Sample: "Example description"

enabled

boolean

Whether the Real Time Response policy is enabled.

Returned: success

Sample: true

groups

list / elements=dictionary

The host groups that the policy is assigned to.

Returned: success

created_by

string

The user who created the host group.

Returned: success

Sample: "user@example.com"

created_timestamp

string

The time when the host group was created.

Returned: success

Sample: "2026-01-01T00:00:00.000000000Z"

description

string

The description of the host group.

Returned: success

Sample: "Example host group description"

group_type

string

The type of the host group.

Returned: success

Sample: "static"

id

string

The ID of the host group.

Returned: success

Sample: "abcdef1234567890abcdef1234567890"

modified_by

string

The user who last changed the host group.

Returned: success

Sample: "user@example.com"

modified_timestamp

string

The time when the host group was last changed.

Returned: success

Sample: "2026-01-01T00:00:00.000000000Z"

name

string

The name of the host group.

Returned: success

Sample: "Example host group"

id

string

The ID of the Real Time Response policy.

Returned: success

Sample: "12345678901234567890abcdef123456"

modified_by

string

The user who last changed the Real Time Response policy.

Returned: success

Sample: "user@example.com"

modified_timestamp

string

The time when the Real Time Response policy was last changed.

Returned: success

Sample: "2026-01-01T00:00:00.000000000Z"

name

string

The name of the Real Time Response policy.

Returned: success

Sample: "Example Real Time Response policy"

platform_name

string

The platform of the Real Time Response policy.

Returned: success

Sample: "Windows"

settings

list / elements=dictionary

The Real Time Response settings of the policy, in categories.

Returned: success

name

string

The name of the settings category.

Returned: success

Sample: "Example category"

settings

list / elements=dictionary

The settings in the category.

Returned: success

description

string

The description of the setting.

Returned: success

Sample: "Example setting description"

id

string

The ID of the setting.

Returned: success

Sample: "RealTimeFunctionality"

name

string

The name of the setting.

Returned: success

Sample: "Example setting"

type

string

The type of the setting.

Returned: success

Sample: "toggle"

value

dictionary

The value of the setting.

enabled is whether the setting is on. Some settings also have configured.

Returned: success

Sample: {"configured": true, "enabled": true}

Authors

  • Carlos Matos (@carlosmmatos)