Skip to content

Prevention Policy

Joshua Hiller edited this page Nov 2, 2021 · 28 revisions

CrowdStrike Falcon Twitter URL

Using the Prevention Policy service collection

Uber class support Service class support Documentation Version

Table of Contents

Operation ID Description
queryCombinedPreventionPolicyMembers
PEP 8 query_combined_policy_members
Search for members of a Prevention Policy in your environment by providing an FQL filter and paging details. Returns a set of host details which match the filter criteria
queryCombinedPreventionPolicies
PEP 8 query_combined_policies
Search for Prevention Policies in your environment by providing an FQL filter and paging details. Returns a set of Prevention Policies which match the filter criteria
performPreventionPoliciesAction
PEP 8 perform_policies_action
Perform the specified action on the Prevention Policies specified in the request
setPreventionPoliciesPrecedence
PEP 8 set_policies_precedence
Sets the precedence of Prevention Policies based on the order of IDs specified in the request. The first ID specified will have the highest precedence and the last ID specified will have the lowest. You must specify all non-Default Policies for a platform when updating precedence
getPreventionPolicies
PEP 8 get_policies
Retrieve a set of Prevention Policies by specifying their IDs
createPreventionPolicies
PEP 8 create_policies
Create Prevention Policies by specifying details about the policy to create
deletePreventionPolicies
PEP 8 delete_policies
Delete a set of Prevention Policies by specifying their IDs
updatePreventionPolicies
PEP 8 update_policies
Update Prevention Policies by specifying the ID of the policy and details to update
queryPreventionPolicyMembers
PEP 8 query_policy_members
Search for members of a Prevention Policy in your environment by providing an FQL filter and paging details. Returns a set of Agent IDs which match the filter criteria
queryPreventionPolicies
PEP 8 query_policies
Search for Prevention Policies in your environment by providing an FQL filter and paging details. Returns a set of Prevention Policy IDs which match the filter criteria

queryCombinedPreventionPolicyMembers

Search for members of a Prevention Policy in your environment by providing an FQL filter and paging details. Returns a set of host details which match the filter criteria

PEP8 method name

query_combined_policy_members

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
id
Service Class Support

Uber Class Support
query string The ID of the Prevention Policy to search for members of.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.query_combined_policy_members(id="string",
                                                filter="string",
                                                offset=integer,
                                                limit=integer,
                                                sort="string"
                                                )
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.queryCombinedPreventionPolicyMembers(id="string",
                                                       filter="string",
                                                       offset=integer,
                                                       limit=integer,
                                                       sort="string"
                                                       )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryCombinedPreventionPolicyMembers",
                          id="string",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

queryCombinedPreventionPolicies

Search for Prevention Policies in your environment by providing an FQL filter and paging details. Returns a set of Prevention Policies which match the filter criteria

PEP8 method name

query_combined_policies

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.query_combined_policies(filter="string",
                                          offset=integer,
                                          limit=integer,
                                          sort="string"
                                          )
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.queryCombinedPreventionPolicies(filter="string",
                                                  offset=integer,
                                                  limit=integer,
                                                  sort="string"
                                                  )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryCombinedPreventionPolicies",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

performPreventionPoliciesAction

Perform the specified action on the Prevention Policies specified in the request

PEP8 method name

perform_policies_action

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
action_name
Service Class Support

Uber Class Support
query string The action to perform. Allowed values:
  • add-host-group
  • add-rule-group
  • disable
  • enable
  • remove-host-group
  • remove-rule-group
action_parameters
Service Class Support

Uber Class Support
body list of dictionaries List of name / value pairs in JSON format.
body
Service Class Support

Uber Class Support
body string Full body payload in JSON format.
ids
Service Class Support

Uber Class Support
body string or list of strings Prevention Policy ID(s) to perform actions against.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

act_params = [{
    "name": "string",
    "value": "string"
}]

id_list = "ID1,ID2,ID3"  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.perform_policies_action(action_name="string",
                                          action_parameters=act_params,
                                          ids=id_list
                                          )
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

act_params = [{
    "name": "string",
    "value": "string"
}]

id_list = "ID1,ID2,ID3"  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.performPreventionPoliciesAction(action_name="string",
                                                  action_parameters=act_params,
                                                  ids=id_list
                                                  )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

PARAMS = {
    "action_name": "string"  # Can also pass action_name using a keyword
}

act_params = [{
    "name": "string",
    "value": "string"
}]

id_list = ['ID1', 'ID2', 'ID3']

BODY = {
    "action_parameters": act_params,
    "ids": id_list
}

response = falcon.command("performPreventionPoliciesAction", parameters=PARAMS, body=BODY)
print(response)

setPreventionPoliciesPrecedence

Sets the precedence of Prevention Policies based on the order of IDs specified in the request. The first ID specified will have the highest precedence and the last ID specified will have the lowest. You must specify all non-Default Policies for a platform when updating precedence

PEP8 method name

set_policies_precedence

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
body
Service Class Support

Uber Class Support
body string Full body payload in JSON format.
ids
Service Class Support

Uber Class Support
body string or list of strings Prevention Policy ID(s) to adjust precedence.
platform_name
Service Class Support

Uber Class Support
body string OS platform name. (Linux, Mac, Windows)

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

id_list = "ID1,ID2,ID3"  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.set_policies_precedence(ids=id_list, platform_name="string")
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

id_list = "ID1,ID2,ID3"  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.setPreventionPoliciesPrecedence(ids=id_list, platform_name="string")
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

id_list = ['ID1', 'ID2', 'ID3']

BODY = {
    "ids": id_list,
    "platform_name": "string"
}

response = falcon.command("setPreventionPoliciesPrecedence", body=BODY)
print(response)

getPreventionPolicies

Retrieve a set of Prevention Policies by specifying their IDs

PEP8 method name

get_policies

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
ids
Service Class Support

Uber Class Support
query string or list of strings The ID(s) of the Prevention Policies to return.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.get_policies(ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.getPreventionPolicies(ids=id_list)
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.command("getPreventionPolicies", ids=id_list)
print(response)

createPreventionPolicies

Create Prevention Policies by specifying details about the policy to create

PEP8 method name

create_policies

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
body
Service Class Support

Uber Class Support
body string Full body payload in JSON format.
clone_id
Service Class Support

Uber Class Support
body string Prevention Policy ID to clone.
description
Service Class Support

Uber Class Support
body string Prevention Policy description.
name
Service Class Support

Uber Class Support
body string Prevention Policy name.
platform_name
Service Class Support

Uber Class Support
body string Operating system platform name.
settings
Service Class Support

Uber Class Support
body list of dictionaries List of policy-specific settings to apply to the newly created policy. Multiple settings can be applied by passing a list containing multiple entries.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

policy_settings = {
    "id": "string",
    "value": {}
}

response = falcon.create_policies(clone_id="string",
                                  description="string",
                                  name="string",
                                  platform_name="string",
                                  settings=policy_settings
                                  )
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

policy_settings = {
    "id": "string",
    "value": {}
}

response = falcon.createPreventionPolicies(clone_id="string",
                                           description="string",
                                           name="string",
                                           platform_name="string",
                                           settings=policy_settings
                                           )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

BODY = {
    "resources": [
        {
            "clone_id": "string",
            "description": "string",
            "name": "string",
            "platform_name": "string",
            "settings": [
                {
                    "id": "string",
                    "value": {}
                }
            ]
        }
    ]
}

response = falcon.command("createPreventionPolicies", body=BODY)
print(response)

deletePreventionPolicies

Delete a set of Prevention Policies by specifying their IDs

PEP8 method name

delete_policies

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
ids
Service Class Support

Uber Class Support
query string or list of strings The ID(s) of the Prevention Policies to delete.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.delete_policies(ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.deletePreventionPolicies(ids=id_list)
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

id_list = 'ID1,ID2,ID3'  # Can also pass a list here: ['ID1', 'ID2', 'ID3']

response = falcon.command("deletePreventionPolicies", ids=id_list)
print(response)

updatePreventionPolicies

Update Prevention Policies by specifying the ID of the policy and details to update

PEP8 method name

update_policies

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
body
Service Class Support

Uber Class Support
body string Full body payload in JSON format.
description
Service Class Support

Uber Class Support
body string Prevention Policy description.
id
Service Class Support

Uber Class Support
body string Prevention Policy ID to update.
name
Service Class Support

Uber Class Support
body string Prevention Policy name.
settings
Service Class Support

Uber Class Support
body list of dictionaries List of policy-specific settings to apply to the newly created policy. Multiple settings can be applied by passing a list containing multiple entries.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

policy_settings = {
    "id": "string",
    "value": "string"
}

response = falcon.update_policies(id="string",
                                  description="string",
                                  name="string",
                                  settings=policy_settings
                                  )
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

policy_settings = {
    "id": "string",
    "value": "string"
}

response = falcon.updatePreventionPolicies(id="string",
                                           description="string",
                                           name="string",
                                           settings=policy_settings
                                           )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

BODY = {
    "resources": [
        {
            "description": "string",
            "id": "string",
            "name": "string",
            "settings": [
                {
                    "id": "string",
                    "value": {}
                }
            ]
        }
    ]
}

response = falcon.command("updatePreventionPolicies", body=BODY)
print(response)

queryPreventionPolicyMembers

Search for members of a Prevention Policy in your environment by providing an FQL filter and paging details. Returns a set of Agent IDs which match the filter criteria

PEP8 method name

query_policy_members

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
id
Service Class Support

Uber Class Support
query string The ID of the Prevention Policy to search for members of.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.query_policy_members(id="string",
                                       filter="string",
                                       offset=integer,
                                       limit=integer,
                                       sort="string"
                                       )
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.queryPreventionPolicyMembers(id="string",
                                               filter="string",
                                               offset=integer,
                                               limit=integer,
                                               sort="string"
                                               )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryPreventionPolicyMembers",
                          id="string",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

queryPreventionPolicies

Search for Prevention Policies in your environment by providing an FQL filter and paging details. Returns a set of Prevention Policy IDs which match the filter criteria

PEP8 method name

query_policies

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
filter
Service Class Support

Uber Class Support
query string FQL query expression that should be used to limit the results.
limit
Service Class Support

Uber Class Support
query integer Maximum number of records to return. Max: 5000.
offset
Service Class Support

Uber Class Support
query string Starting index of overall result set from which to return ids.
sort
Service Class Support

Uber Class Support
query string The property to sort by.
parameters
Service Class Support

Uber Class Support
query string Full query string parameters payload in JSON format.

Usage

Service class example (PEP8 syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.query_policies(filter="string",
                                 offset=integer,
                                 limit=integer,
                                 sort="string"
                                 )
print(response)
Service class example (Operation ID syntax)
from falconpy import PreventionPolicy

falcon = PreventionPolicy(client_id="API_CLIENT_ID_HERE",
                          client_secret="API_CLIENT_SECRET_HERE"
                          )

response = falcon.queryPreventionPolicies(filter="string",
                                          offset=integer,
                                          limit=integer,
                                          sort="string"
                                          )
print(response)
Uber class example
from falconpy import APIHarness

falcon = APIHarness(client_id="API_CLIENT_ID_HERE",
                    client_secret="API_CLIENT_SECRET_HERE"
                    )

response = falcon.command("queryPreventionPolicies",
                          filter="string",
                          offset=integer,
                          limit=integer,
                          sort="string"
                          )
print(response)

CrowdStrike Falcon

Clone this wiki locally