client_id and client_secret are keyword arguments that contain your CrowdStrike API credentials. Please note that all examples below do not hard code these values. (These values are ingested as strings.)
CrowdStrike does not recommend hard coding API credentials or customer identifiers within source code.
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.read_policies()
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.ReadPolicies()
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.command("ReadPolicies")
print(response)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.create_policies(description="string", name="string")
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.CreatePolicies(description="string", name="string")
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
body_payload= {
"description": "string",
"name": "string"
}
response=falcon.command("CreatePolicies", body=body_payload)
print(response)
Full query string parameters payload in JSON format.
Usage
Service class example (PEP8 syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.delete_policy(id="string")
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.DeletePolicy(id="string")
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.command("DeletePolicy", id="string")
print(response)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.read_policy_exclusions()
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.ReadPolicyExclusions()
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.command("ReadPolicyExclusions")
print(response)
List of conditions to apply. Overrides other keywords if provided.
description
body
string
Condition description. Ignored if conditions keyword is used.
prop
body
string
Condition property. Ignored if conditions keyword is used.
ttl
body
integer
Condition time to live. Ignored if conditions keyword is used.
value
body
list of strings
Condition values. Ignored if conditions keyword is used.
Usage
Service class example (PEP8 syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
value_list= ["VALUE1", "VALUE2", "VALUE3"]
response=falcon.update_policy_exclusions(description="string",
prop="string",
ttl=integer,
value=value_list
)
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
value_list= ["VALUE1", "VALUE2", "VALUE3"]
response=falcon.UpdatePolicyExclusions(description="string",
prop="string",
ttl=integer,
value=value_list
)
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
# The following structure can be used in the examples# above (i.e. Service Class usage) by leveraging the# conditions keyword. This will override the other# keywords listed in the examples above.conditions_list= [
{
"description": "string",
"prop": "string",
"ttl": integer,
"value": [
"string"
]
},
{
"description": "string",
"prop": "string",
"ttl": integer,
"value": [
"string"
]
}
]
body_payload= {
"conditions": conditions_list
}
response=falcon.command("UpdatePolicyExclusions", body=body_payload)
print(response)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.read_policy_groups()
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.ReadPolicyGroups()
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.command("ReadPolicyGroups")
print(response)
Full query string parameters payload in JSON format.
Usage
Service class example (PEP8 syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.delete_policy_group(id="string")
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.DeletePolicyGroup(id="string")
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
response=falcon.command("DeletePolicyGroup", id="string")
print(response)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
# Precedence will be applied in the order provided.ordered_list='ID1,ID2,ID3'# Can also pass a list here: ['ID1', 'ID2', 'ID3']response=falcon.update_policy_precedence(precedence=ordered_list)
print(response)
Service class example (Operation ID syntax)
fromfalconpyimportImageAssessmentPolicies# Do not hardcode API credentials!falcon=ImageAssessmentPolicies(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
# Precedence will be applied in the order provided.ordered_list='ID1,ID2,ID3'# Can also pass a list here: ['ID1', 'ID2', 'ID3']response=falcon.UpdatePolicyPrecedence(precedence=ordered_list)
print(response)
Uber class example
fromfalconpyimportAPIHarnessV2# Do not hardcode API credentials!falcon=APIHarnessV2(client_id=CLIENT_ID,
client_secret=CLIENT_SECRET
)
# Precedence will be applied in the order provided.ordered_list='ID1,ID2,ID3'# Can also pass a list here: ['ID1', 'ID2', 'ID3']body_payload= {
"precedence": ordered_list
}
response=falcon.command("UpdatePolicyPrecedence", body=body_payload)
print(response)