prevention_policy
Create, update, enable, disable and delete Falcon prevention policies. The same task creates the prevention policy when it is missing, updates it when
Added in version 4.15.0
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
description | str | No | The description of the prevention policy. An empty string clears the description. When not set, the module does not change the description. | |
enabled | bool | No | Whether the prevention policy is enabled. A new policy is disabled unless this is C(true). When not set, the module does not change it. | |
host_groups | list | No | The IDs of the host groups to assign the prevention 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 I(state=absent). | |
name | str | No | The name of the prevention policy. The module finds an existing policy by this exact name on the platform in I(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 I(platform_name). Mutually exclusive with I(policy_id). | |
platform_name | str | No | The platform of the prevention 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 I(name). The platform of an existing policy cannot change. Required with I(name). | |
policy_id | str | No | The ID of an existing prevention policy. The ID is compared without regard to case. With I(state=present), the module fails when the ID does not exist. Mutually exclusive with I(name) and I(platform_name). | |
purge_host_groups | bool | No | false | If I(purge_host_groups=true) and I(host_groups) is set, the module removes the host groups of the policy that are not in I(host_groups). If I(host_groups) is not set, the module does not change the host groups, even if I(purge_host_groups=true). With I(host_groups=[]) and I(purge_host_groups=true), the module removes all the host groups of the policy. |
state | str | No | present | The desired state of the prevention policy. With I(state=absent), the module disables an enabled policy before it deletes it, because the API does not delete an enabled policy. |
Examples
Section titled “Examples”- name: Create an enabled Windows prevention policy crowdstrike.falcon.prevention_policy: name: "Example prevention policy" platform_name: Windows description: "Managed by Ansible" enabled: true
- name: Update the description of the policy crowdstrike.falcon.prevention_policy: name: "Example prevention policy" platform_name: Windows description: "Updated by Ansible"
- name: Disable the policy crowdstrike.falcon.prevention_policy: name: "Example prevention policy" platform_name: Windows enabled: false
- name: Assign the policy to two host groups crowdstrike.falcon.prevention_policy: name: "Example prevention policy" platform_name: Windows host_groups: - "abcdef1234567890abcdef1234567890" - "1234567890abcdef1234567890abcdef"
- name: Set the exact host groups of the policy and remove the others crowdstrike.falcon.prevention_policy: name: "Example prevention policy" platform_name: Windows host_groups: - "abcdef1234567890abcdef1234567890" purge_host_groups: true
- name: Delete the policy by name and platform crowdstrike.falcon.prevention_policy: name: "Example prevention policy" platform_name: Windows state: absent
- name: Delete a prevention policy by ID crowdstrike.falcon.prevention_policy: policy_id: "12345678901234567890abcdef123456" state: absentReturn Values
Section titled “Return Values”| Key | Type | Description |
|---|---|---|
prevention_policy | dict | The prevention 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. |