Skip to content

Detects

Joshua Hiller edited this page Oct 20, 2021 · 28 revisions

CrowdStrike Falcon Twitter URL

Using the Detects service collection

Uber class support Service class support Documentation Version

Table of Contents

Operation ID Description
GetAggregateDetects
PEP 8 get_aggregate_detects
Get detect aggregates as specified via json in request body.
UpdateDetectsByIdsV2
PEP 8 update_detects_by_ids
Modify the state, assignee, and visibility of detections
GetDetectSummaries
PEP 8 get_detect_summaries
View information about detections
QueryDetects
PEP 8 query_detects
Search for detection IDs that match a given query

GetAggregateDetects

Get detect aggregates as specified via json in request body.

PEP8 method name

get_aggregate_detects

Content-Type

  • Consumes: application/json
  • 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.
date_ranges
Service Class Support

Uber Class Support
body list of dictionaries
field
Service Class Support

Uber Class Support
body string
filter
Service Class Support

Uber Class Support
body string FQL syntax
interval
Service Class Support

Uber Class Support
body string
min_doc_count
Service Class Support

Uber Class Support
body integer Minimum number of documents required to match.
missing
Service Class Support

Uber Class Support
body string
name
Service Class Support

Uber Class Support
body string
q
Service Class Support

Uber Class Support
body string FQL syntax
ranges
Service Class Support

Uber Class Support
body list of dictionaries
size
Service Class Support

Uber Class Support
body integer
sort
Service Class Support

Uber Class Support
body string FQL syntax
time_zone
Service Class Support

Uber Class Support
body string
type
Service Class Support

Uber Class Support
body string

Usage

Service class example (PEP8 syntax)
from falconpy import Detects

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

date_range = {
    "from": "string",
    "to": "string"
}
search_range = {
    "From": integer,
    "To": integer
}

response = falcon.get_aggregate_detects(date_ranges=[date_range],
                                        field="string",
                                        filter="string",
                                        interval="string",
                                        min_doc_count=integer,
                                        missing="string",
                                        name="string",
                                        q="string",
                                        ranges=[search_range],
                                        size=integer,
                                        sort="string",
                                        time_zone="string",
                                        type="string"
                                        )
print(response)
Service class example (Operation ID syntax)
from falconpy import Detects

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

date_range = {
    "from": "string",
    "to": "string"
}
search_range = {
    "From": integer,
    "To": integer
}

response = falcon.GetAggregateDetects(date_ranges=[date_range],
                                        field="string",
                                        filter="string",
                                        interval="string",
                                        min_doc_count=integer,
                                        missing="string",
                                        name="string",
                                        q="string",
                                        ranges=[search_range],
                                        size=integer,
                                        sort="string",
                                        time_zone="string",
                                        type="string"
                                        )
print(response)
Uber class example
from falconpy import APIHarness

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

BODY = [
    {
        "date_ranges": [
        {
            "from": "string",
            "to": "string"
        }
        ],
        "field": "string",
        "filter": "string",
        "interval": "string",
        "min_doc_count": integer,
        "missing": "string",
        "name": "string",
        "q": "string",
        "ranges": [
        {
            "From": integer,
            "To": integer
        }
        ],
        "size": integer,
        "sort": "string",
        "time_zone": "string",
        "type": "string"
    }
]

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

UpdateDetectsByIdsV2

Modify the state, assignee, and visibility of detections

PEP8 method name

update_detects_by_ids

Content-Type

  • Consumes: application/json
  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
assigned_to_uuid
Service Class Support

Uber Class Support
body string A user ID to assign the detection to.
body
Service Class Support

Uber Class Support
body string This endpoint modifies attributes (state and assignee) of detections. This endpoint accepts a query formatted as a JSON array of key-value pairs. You can update one or more attributes one or more detections with a single request.
  • assigned_to_uuid A user ID, such as 1234567891234567891
  • ids One or more detection IDs, which you can find with the query_detects method, the Falcon console, or the Streaming API.
  • show_in_ui
    • true: This detection is displayed in Falcon
    • false: This detection is not displayed in Falcon. Most commonly used together with the status key's false_positive value.
  • status
    • new
    • in_progress
    • true_positive
    • false_positive
    • ignored
  • comment Optional comment to add to the detection. Comments are displayed with the detection in Falcon and usually used to provide context or notes for other Falcon users. A detection can have multiple comments over time.
If you are using the other available keyword arguments, the body keyword is NOT REQUIRED when using this operation.
comment
Service Class Support

Uber Class Support
body string Optional comment to add to the detection. Comments are displayed with the detection in Falcon and are usually used to provide context or notes for other Falcon users. A detection can have multiple comments over time.
ids
Service Class Support

Uber Class Support
body string or list of strings ID(s) of the detection to update. String or list of strings.
show_in_ui
Service Class Support

Uber Class Support
body boolean Boolean determining if this detection is displayed in the Falcon console.
status
Service Class Support

Uber Class Support
body string Current status of the detection.

Allowed values:
  • ignored
  • new
  • in_progress
  • true_positive
  • false_positive

Usage

Service class example (PEP8 syntax)
from falconpy import Detects

falcon = Detects(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.update_detects_by_ids(assigned_to_uuid="string",
                                        comment="string",
                                        ids=id_list,
                                        show_in_ui=boolean,
                                        status="string"
                                        )
print(response)
Service class example (Operation ID syntax)
from falconpy import Detects

falcon = Detects(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.UpdateDetectsByIdsV2(assigned_to_uuid="string",
                                       comment="string",
                                       ids=id_list,
                                       show_in_ui=boolean,
                                       status="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 = {
    "assigned_to_uuid": "string",
    "comment": "string",
    "ids": id_list,
    "show_in_ui": boolean,
    "status": "string"
}
response = falcon.command("UpdateDetectsByIdsV2", body=BODY)
print(response)

GetDetectSummaries

View information about detections

PEP8 method name

get_detect_summaries

Content-Type

  • Consumes: application/json
  • 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 ID(s) of the detections to retrieve. View key attributes of detections, including the associated host, disposition, objective/tactic/technique, adversary, and more.

Specify one or more detection IDs (max 1000 per request). Find detection IDs with the QueryDetects operation, the Falcon console, or the Streaming API.

Usage

In order to use this method, either a body keyword or the ids keyword must be provided.

Service class example (PEP8 syntax)
from falconpy import Detects

falcon = Detects(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_detect_summaries(ids=id_list)
print(response)
Service class example (Operation ID syntax)
from falconpy import Detects

falcon = Detects(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.GetDetectSummaries(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']

BODY = {
    "ids": id_list
}

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

QueryDetects

Search for detection IDs that match a given query

PEP8 method name

query_detects

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
filter
Service Class Support

Uber Class Support
query string Filter detections using a query in Falcon Query Language (FQL) An asterisk wildcard * includes all results.

Complete list of available FQL filters.

More details regarding filters can be found in the documentation inside the Falcon console.
limit
Service Class Support

Uber Class Support
query integer The maximum number of detections to return in this response (default: 9999; max: 9999). Use with the offset parameter to manage pagination of results.
offset
Service Class Support

Uber Class Support
query integer The first detection to return, where 0 is the latest detection. Use with the limit parameter to manage pagination of results.
parameters
Service Class Support

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

Uber Class Support
query string Search all detection metadata for the provided string
sort
Service Class Support

Uber Class Support
query string Sort detections using these options:
  • first_behavior: Timestamp of the first behavior associated with this detection
  • last_behavior: Timestamp of the last behavior associated with this detection
  • max_severity: Highest severity of the behaviors associated with this detection
  • max_confidence: Highest confidence of the behaviors associated with this detection
  • adversary_id: ID of the adversary associated with this detection, if any
  • devices.hostname: Hostname of the host where this detection was detected
Sort either asc (ascending) or desc (descending).

For example: last_behavior|asc
Available FQL Filters

The following tables detail acceptable values for the filter keyword described above. Filter options are broken out into four categories:

  • General
  • Behavioral
  • Devices
  • Miscellaneous
General
adversary_ids date_updated last_behavior max_severity_displayname status
assigned_to_name detection_id max_confidence seconds_to_resolved
cid first_behavior max_severity seconds_to_triaged
Behavioral - behaviors.filter

Example: behaviors.ioc_type

alleged_filetype md5 sha256
behavior_id objective tactic
cmdline parent_details.parent_cmdline technique
confidence parent_details.parent_md5 timestamp
contral_graph_id parent_details.parent_process_id triggering_process_id
device_id parent_details.parent_process_graph_id triggering_process_graph_id
filename parent_details.parent_sha256 user_id
ioc_source pattern_disposition user_name
ioc_type scenario
ioc_value severity
Devices - device.filter

Example: device.platform_name

agent_load_flags first_seen platform_name
agent_local_time hostname product_type
agent_version last_seen product_type_desc
bios_manufacturer local_ip release_group
bios_version mac_address reduced_functionality_mode
cid machine_domain serial_number
config_id_base major_version site_name
config_id_build minor_version status
config_id_platform modified_timestamp system_product_name
cpu_signature os_version system_manufacturer
device_id ou
external_ip platform_id
Miscellaneous
hostinfo.domain quarantined_files.id quarantined_files.sha256
hostinfo.active_directory_dn_display quarantined_files.paths quarantined_files.state

Usage

Service class example (PEP8 syntax)
from falconpy import Detects

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

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

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

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

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

PARAMS = {
    "offset": integer,
    "limit": integer,
    "sort": "string",
    "filter": "string",
    "q": "string"
}

response = falcon.command("QueryDetects", parameters=PARAMS)
print(response)

CrowdStrike Falcon

Clone this wiki locally