Skip to content

Quarantine

jshcodes edited this page Oct 21, 2021 · 16 revisions

CrowdStrike Falcon Twitter URL

Using the Quarantine service collection

Uber class support Service class support Documentation Version

Table of Contents

Operation ID Description
ActionUpdateCount
PEP 8 action_update_count
Returns count of potentially affected quarantined files for each action.
GetAggregateFiles
PEP 8 get_aggregate_files
Get quarantine file aggregates as specified via json in request body.
GetQuarantineFiles
PEP 8 get_quarantine_files
Get quarantine file metadata for specified ids.
UpdateQuarantinedDetectsByIds
PEP 8 update_quarantined_detects_by_id
Apply action by quarantine file ids
QueryQuarantineFiles
PEP 8 query_quarantine_files
Get quarantine file ids that match the provided filter criteria.
UpdateQfByQuery
PEP 8 update_quarantined_detects_by_query
Apply quarantine file actions by query.

ActionUpdateCount

Returns count of potentially affected quarantined files for each action.

PEP8 method name

action_update_count

Content-Type

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

Keyword Arguments

Name Service Uber Type Datatype Description
filter
Service Class Support

Uber Class Support
query string The filter expression that should be used to filter results. FQL syntax.
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 Quarantine

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

response = falcon.action_update_count(filter="string")
print(response)
Service class example (Operation ID syntax)
from falconpy import Quarantine

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

response = falcon.ActionUpdateCount(filter="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 = {
    "filter": "string"
}

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

GetAggregateFiles

Get quarantine file aggregates as specified via json in request body.

PEP8 method name

get_aggregate_files

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 Quarantine

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

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

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

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

date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

response = falcon.GetAggregateFiles(date_ranges=date_ranges,
                                    field="string",
                                    filter="string",
                                    interval="string",
                                    min_doc_count=integer,
                                    missing="string",
                                    name="string",
                                    q="string",
                                    ranges=ranges,
                                    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"
                    )
date_ranges = [
    {
        "from": "2021-05-15T14:55:21.892315096Z",
        "to": "2021-05-17T13:42:16.493180643Z"
    }
]

ranges = [
    {
        "From": 1,
        "To": 100
    }
]

BODY = {
    "date_ranges": date_ranges,
    "field": "string",
    "filter": "string",
    "interval": "string",
    "min_doc_count": 0,
    "missing": "string",
    "name": "string",
    "q": "string",
    "ranges": ranges,
    "size": 0,
    "sort": "string",
    "time_zone": "string",
    "type": "string"
}

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

GetQuarantineFiles

Get quarantine file metadata for specified ids.

PEP8 method name

get_quarantine_files

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
query string or list of strings List of Quarantine IDs to retrieve.

Usage

Service class example (PEP8 syntax)
from falconpy import Quarantine

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

falcon = Quarantine(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.GetQuarantineFiles(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("GetQuarantineFiles", body=BODY)
print(response)

UpdateQuarantinedDetectsByIds

Apply action by quarantine file ids

PEP8 method name

update_quarantined_detects_by_id

Content-Type

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

Keyword Arguments

Name Service Uber Type Datatype Description
action
Service Class Support

Uber Class Support
query string Action to perform against the quarantined file.

Allowed values:
  • delete
  • release
  • unrelease
body
Service Class Support

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

Uber Class Support
query string Comment to list along with action taken.
ids
Service Class Support

Uber Class Support
query string or list of strings List of Quarantine IDs to update.

Usage

Service class example (PEP8 syntax)
from falconpy import Quarantine

falcon = Quarantine(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_quarantined_detects_by_id(action="string",
                                                   comment="string",
                                                   ids=id_list
                                                   )
print(response)
Service class example (Operation ID syntax)
from falconpy import Quarantine

falcon = Quarantine(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.UpdateQuarantinedDetectsByIds(action="string",
                                                comment="string",
                                                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 = {
    "action": "string",
    "comment": "string",
    "ids": id_list
}

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

QueryQuarantineFiles

Get quarantine file ids that match the provided filter criteria.

PEP8 method name

query_quarantine_files

Content-Type

  • Produces: application/json

Keyword Arguments

Name Service Uber Type Datatype Description
filter
Service Class Support

Uber Class Support
query string FQL query specifying the filter parameters.

Special value * means to not filter on anything.

Filter term criteria:
  • status
  • adversary_id
  • device.device_id
  • device.country
  • device.hostname
  • behaviors.behavior_id
  • behaviors.ioc_type
  • behaviors.ioc_value
  • behaviors.username
  • behaviors.tree_root_hash
Filter range criteria:
  • max_severity
  • max_confidence
  • first_behavior
  • last_behavior
limit
Service Class Support

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

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

Uber Class Support
query string Match phrase_prefix query criteria, included fields:
  • _all (all filter string fields)
  • sha256
  • state
  • paths.path
  • paths.state
  • hostname
  • username
  • date_updated
  • date_created
sort
Service Class Support

Uber Class Support
query string Possible order by fields:
  • hostname
  • username
  • date_updated
  • date_created
  • paths.path
  • state
  • paths.state
Example: date_created|asc.

Sort order: asc or desc.
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 Quarantine

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

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

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

response = falcon.QueryQuarantineFiles(offset="string",
                                       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": "string",
    "limit": integer,
    "sort": "string",
    "filter": "string",
    "q": "string"
}

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

UpdateQfByQuery

Apply quarantine file actions by query.

PEP8 method name

update_quarantined_detects_by_query

Content-Type

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

Keyword Arguments

Name Service Uber Type Datatype Description
action
Service Class Support

Uber Class Support
query string Action to perform against the quarantined file.

Allowed values:
  • delete
  • release
  • unrelease
body
Service Class Support

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

Uber Class Support
query string Comment to list along with action taken.
filter
Service Class Support

Uber Class Support
query string or list of strings Filter string to use to match to quarantine records. FQL syntax
q
Service Class Support

Uber Class Support
query string Match phrase_prefix query criteria, included fields:
  • _all (all filter string fields)
  • sha256
  • state
  • paths.path
  • paths.state
  • hostname
  • username
  • date_updated
  • date_created

Usage

Service class example (PEP8 syntax)
from falconpy import Quarantine

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

response = falcon.update_quarantined_detects_by_query(action="string",
                                                      comment="string",
                                                      filter="string",
                                                      q="string"
                                                      )
print(response)
Service class example (Operation ID syntax)
from falconpy import Quarantine

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

response = falcon.UpdateQfByQuery(action="string",
                                  comment="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"
                    )

BODY = {
    "action": "string",
    "comment": "string",
    "filter": "string",
    "q": "string"
}

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

CrowdStrike Falcon

Clone this wiki locally