crowdstrike.falcon.prevention_policy_info module – Get information about Falcon prevention 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.prevention_policy_info.

New in crowdstrike.falcon 4.15.0

Synopsis

  • Returns details of Falcon prevention policies.

  • Gets prevention policies by ID, by name, or searches for them with an FQL filter.

  • With no option, returns every prevention policy.

  • The module returns every match. It reads more pages when there are more than 5000 matches.

  • Each policy has all its prevention settings, so the result can be large. Use a Jinja filter to keep only the keys that you need.

Requirements

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

  • Prevention policies [READ] 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"

ext_headers

dictionary

Extended headers that are prepended to the default headers dictionary.

filter

string

The FQL filter to search for prevention policies.

platform_name:'Windows' matches the platform name exactly and is case-sensitive. The values are Windows, Windows_Legacy, Linux, Mac, iOS and Android.

platform_name:['Windows','Mac'] matches any of the platforms in the list.

enabled:'true' and enabled:'false' match enabled or disabled policies.

description:~'word' matches whole words of the description without regard to case, in any order. Part of a word does not match.

name:~'text' matches whole words of the name without regard to case, in any order. name:'text' without ~ matches only a lowercase word. Use name to get a policy by its full name.

created_timestamp:>'2024-01-01T00:00:00Z' and created_timestamp:<'2022-01-01T00:00:00Z' match the creation time, and modified_timestamp:>'2026-01-01T00:00:00Z' the last change. The value must be a timestamp.

Join conditions with + (AND), for example platform_name:'Windows'+enabled:'true'.

Mutually exclusive with policy_ids.

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.

name

string

The exact name of the prevention policies to get, compared without regard to case.

A name is unique only for each platform, so more than one policy can match. Add filter with platform_name:'Windows' to get the policy of one platform.

Can be combined with filter.

Mutually exclusive with policy_ids.

policy_ids

list / elements=string

The IDs of the prevention policies to get.

An empty list returns no prevention policies.

The module fails when an ID does not exist. Then the failed result has the policies that were found in prevention_policies, and the API errors.

The IDs are compared without regard to case.

Mutually exclusive with name, filter and sort.

sort

string

The property and direction to sort the results by.

name sorts upper case letters before lower case letters.

created_timestamp and modified_timestamp sort to the second.

Mutually exclusive with policy_ids.

Choices:

  • "name.asc"

  • "name.desc"

  • "created_timestamp.asc"

  • "created_timestamp.desc"

  • "modified_timestamp.asc"

  • "modified_timestamp.desc"

  • "enabled.asc"

  • "enabled.desc"

  • "created_by.asc"

  • "created_by.desc"

  • "modified_by.asc"

  • "modified_by.desc"

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.

Attributes

Attribute

Support

Description

check_mode

Support: full

This action does not modify state.

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

diff_mode

Support: N/A

This action does not modify state.

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.prevention_policy

Create, update and delete Falcon prevention policies.

Prevention Policy API reference

The CrowdStrike API operations that this module uses.

Examples

- name: Get all prevention policies
  crowdstrike.falcon.prevention_policy_info:

- name: Get prevention policies by ID
  crowdstrike.falcon.prevention_policy_info:
    policy_ids:
      - "12345678901234567890abcdef123456"

- name: Get the prevention policies with a name
  crowdstrike.falcon.prevention_policy_info:
    name: platform_default

- name: Get the prevention policy with a name for one platform
  crowdstrike.falcon.prevention_policy_info:
    name: platform_default
    filter: "platform_name:'Windows'"

- name: Get the enabled Windows prevention policies, sorted by name
  crowdstrike.falcon.prevention_policy_info:
    filter: "platform_name:'Windows'+enabled:'true'"
    sort: name.asc

Return Values

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

Key

Description

prevention_policies

list / elements=dictionary

The prevention policies that match the IDs, the name or the filter.

An empty list when nothing matches.

Returned: success

cid

string

The customer ID that the policy belongs to.

Returned: success

Sample: "abcdef1234567890abcdef1234567890"

created_by

string

The user who created the prevention policy.

Returned: success

Sample: "user@example.com"

created_timestamp

string

The time when the prevention policy was created.

Returned: success

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

description

string

The description of the prevention policy. Can be empty.

Returned: success

Sample: "Example description"

enabled

boolean

Whether the prevention policy is enabled.

Returned: success

Sample: true

groups

list / elements=dictionary

The host groups that the policy is assigned to.

Returned: success

assignment_rule

string

The assignment rule of the host group.

Returned: success

Sample: "hostname:['example-host']"

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 prevention policy.

Returned: success

Sample: "12345678901234567890abcdef123456"

ioa_rule_groups

list / elements=dictionary

The custom IOA rule groups that are assigned to the policy.

Returned: success

comment

string

The comment of the last change to the rule group.

Returned: success

Sample: "Example comment"

committed_timestamp

string

The time when the last change to the rule group was committed.

Returned: success

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

created_by

string

The user who created the rule group.

Returned: success

Sample: "user@example.com"

created_timestamp

string

The time when the rule group was created.

Returned: success

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

customer_id

string

The customer ID that the rule group belongs to.

Returned: success

Sample: "abcdef1234567890abcdef1234567890"

deleted

boolean

Whether the rule group is deleted.

Returned: success

Sample: false

description

string

The description of the rule group.

Returned: success

Sample: "Example rule group description"

enabled

boolean

Whether the rule group is enabled.

Returned: success

Sample: true

id

string

The ID of the rule group.

Returned: success

Sample: "abcdef1234567890abcdef1234567890"

modified_by

string

The user who last changed the rule group.

Returned: success

Sample: "user@example.com"

modified_timestamp

string

The time when the rule group was last changed.

Returned: success

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

name

string

The name of the rule group.

Returned: success

Sample: "Example rule group"

platform

string

The platform of the rule group.

Returned: success

Sample: "windows"

rule_ids

list / elements=string

The IDs of the rules in the rule group.

Returned: success

Sample: ["1", "2"]

version

integer

The version of the rule group.

Returned: success

Sample: 1

modified_by

string

The user who last changed the prevention policy.

Returned: success

Sample: "user@example.com"

modified_timestamp

string

The time when the prevention policy was last changed.

Returned: success

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

name

string

The name of the prevention policy.

Returned: success

Sample: "Example prevention policy"

platform_name

string

The platform of the prevention policy.

Returned: success

Sample: "Windows"

prevention_settings

list / elements=dictionary

The prevention 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: "ExampleSetting"

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. The keys depend on the type of the setting.

A toggle setting has enabled and most have configured. An mlslider setting has detection and most have prevention.

Returned: success

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

Authors

  • Carlos Matos (@carlosmmatos)