CrowdStrike Falcon CrowdStrike Subreddit

Using the NGSIEM service collection

Uber class support Service class support Documentation Version Page Updated

Table of Contents

Operation IDDescription
UploadLookupV1
PEP8upload_file
Upload a lookup file to NGSIEM.
GetLookupV1
PEP8get_file
Download lookup file from NGSIEM.
GetLookupFromPackageWithNamespaceV1
PEP8get_file_from_package_with_namespace
Download lookup file in namespaced package from NGSIEM.
GetLookupFromPackageV1
PEP8get_file_from_package
Download lookup file in package from NGSIEM.
StartSearchV1
PEP8start_search
Initiate a NGSIEM search.
GetSearchStatusV1
PEP8get_search_status
Get status of a NGSIEM search.
StopSearchV1
PEP8stop_search
Stop a NGSIEM search.

UploadLookupV1

Upload a lookup file to NGSIEM.

PEP8 method name

upload_file

Endpoint

MethodRoute
POST/humio/api/v1/repositories/{repository}/files

Required Scope

ngsiem:write

Content-Type

  • Consumes: multipart/form-data

Keyword Arguments

NameServiceUberTypeData typeDescription
lookup_fileService Class SupportUber Class SupportformDatastringLocation of the file object to be uploaded.
repositoryService Class SupportUber Class SupportpathstringName of the repository.

Usage

Service class example (PEP8 syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.upload_file(lookup_file="string", repository="string")

print(response)
Service class example (Operation ID syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.UploadLookupV1(lookup_file="string", repository="string")

print(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

lookup_file = "string"

with open(lookup_file, "rb") as upload_file:
    file_extended = {"file": upload_file}
    response = falcon.command("UploadLookupV1", repository="string", files=file_extended)

print(response)

GetLookupV1

Download lookup file from NGSIEM.

PEP8 method name

get_file

Endpoint

MethodRoute
GET/humio/api/v1/repositories/{repository}/files/{filename}

Required Scope

ngsiem:read

Content-Type

  • Produces: application/octet-stream

Keyword Arguments

NameServiceUberTypeData typeDescription
repositoryService Class SupportUber Class SupportpathstringName of the repository.
filenameService Class SupportUber Class SupportpathstringName of the lookup file.

Usage

Service class example (PEP8 syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

with open("some_file.ext", "wb") as save_file:
    save_file.write(falcon.get_file(repository="string", name="string"))
Service class example (Operation ID syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

with open("some_file.ext", "wb") as save_file:
    save_file.write(falcon.GetLookupV1(repository="string", name="string"))
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

with open("some_file.ext", "wb") as save_file:
    save_file.write(falcon.command("GetLookupV1", repository="string", name="string"))

GetLookupFromPackageWithNamespaceV1

Download lookup file in namespaced package from NGSIEM.

PEP8 method name

get_file_from_package_with_namespace

Endpoint

MethodRoute
GET/humio/api/v1/repositories/{repository}/files/{namespace}/{package}/{filename}

Required Scope

ngsiem:read

Content-Type

  • Produces: application/octet-stream

Keyword Arguments

NameServiceUberTypeData typeDescription
repositoryService Class SupportUber Class SupportpathstringName of the repository.
namespaceService Class SupportUber Class SupportpathstringName of the namespace.
packageService Class SupportUber Class SupportpathstringName of the package.
filenameService Class SupportUber Class SupportpathstringName of the lookup file.

Usage

Service class example (PEP8 syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

with open("some_file.ext", "wb") as save_file:
    response = falcon.get_file_from_package_with_namespace(repository="string",
                                                           namespace="string",
                                                           package="string",
                                                           filename="string"
                                                           )
    save_file.write(response)
Service class example (Operation ID syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

with open("some_file.ext", "wb") as save_file:
    response = falcon.GetLookupFromPackageWithNamespaceV1()
    save_file.write(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

with open("some_file.ext", "wb") as save_file:
    response = falcon.command("GetLookupFromPackageWithNamespaceV1",
                              repository="string",
                              namespace="string",
                              package="string",
                              filename="string"
                              )
    save_file.write(response)

GetLookupFromPackageV1

Download lookup file in package from NGSIEM.

PEP8 method name

get_file_from_package

Endpoint

MethodRoute
GET/humio/api/v1/repositories/{repository}/files/{package}/{filename}

Required Scope

ngsiem:read

Content-Type

  • Produces: application/octet-stream

Keyword Arguments

NameServiceUberTypeData typeDescription
repositoryService Class SupportUber Class SupportpathstringName of the repository.
packageService Class SupportUber Class SupportpathstringName of the package.
filenameService Class SupportUber Class SupportpathstringName of the lookup file.

Usage

Service class example (PEP8 syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

with open("some_file.ext", "wb") as save_file:
    response = falcon.get_file_from_package(repository="string",
                                            package="string",
                                            filename="string"
                                            )
    save_file.write(response)
Service class example (Operation ID syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

with open("some_file.ext", "wb") as save_file:
    response = falcon.GetLookupFromPackageV1(repository="string",
                                             package="string",
                                             filename="string"
                                             )
    save_file.write(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

with open("some_file.ext", "wb") as save_file:
    response = falcon.command("GetLookupFromPackageV1",
                              repository="string",
                              package="string",
                              filename="string"
                              )
    save_file.write(response)

StartSearchV1

Initiate a NGSIEM search.

PEP8 method name

start_search

Endpoint

MethodRoute
POST/humio/api/v1/repositories/{repository}/queryjobs

Required Scope

ngsiem:write

Content-Type

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

Keyword Arguments

NameServiceUberTypeData typeDescription
allow_event_skippingService Class SupportUber Class SupportbodybooleanFlag indicating if event skipping is allowed.
argumentsService Class SupportUber Class SupportbodydictionarySearch arguments in JSON format.
aroundService Class SupportUber Class SupportbodydictionarySearch proximity arguments.
autobucket_countService Class SupportUber Class SupportbodyintegerNumber of events per bucket.
bodyService Class SupportUber Class SupportbodydictionaryFull body payload provided as a dictionary.
endService Class SupportUber Class SupportbodystringLast event limit.
ingest_endService Class SupportUber Class SupportbodyintegerIngest maximum.
ingest_startService Class SupportUber Class SupportbodyintegerIngest start.
is_liveService Class SupportUber Class SupportbodybooleanFlag indicating if this is a live search.
query_stringService Class SupportUber Class SupportbodystringSearch query string.
repositoryService Class SupportUber Class SupportpathstringName of the repository.
searchService Class SupportUber Class SupportbodydictionarySearch query to perform. Can be used in replace of other keywords.
startService Class SupportUber Class SupportbodystringSearch starting time range.
timezoneService Class SupportUber Class SupportbodystringTimezone applied to the search.
timezone_offset_minutesService Class SupportUber Class SupportbodyintegerTimezone offset.

Usage

Service class example (PEP8 syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.start_search(repository="string",
                               is_live=False,
                               start="1d",
                               query_string="#event_simpleName=*"
                               )
print(response)
Service class example (Operation ID syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.StartSearchV1(repository="string",
                                is_live=False,
                                start="1d",
                                query_string="#event_simpleName=*"
                                )
print(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

search_query = {
    "isLive" : False,
    "start" : "1d",
    "queryString" : "#event_simpleName=*"
}

response = falcon.command("StartSearchV1", repository="string", body=search_query)

print(response)

GetSearchStatusV1

Get status of a NGSIEM search.

PEP8 method name

get_search_status

Endpoint

MethodRoute
GET/humio/api/v1/repositories/{repository}/queryjobs/{id}

Required Scope

ngsiem:read

Content-Type

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

Keyword Arguments

NameServiceUberTypeData typeDescription
repositoryService Class SupportUber Class SupportpathstringName of the repository.
search_idService Class SupportUber Class SupportpathstringID of the query.

Usage

Service class example (PEP8 syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.get_search_status(repository="string", search_id="string")

print(response)
Service class example (Operation ID syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.GetSearchStatusV1(repository="string", search_id="string")

print(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

response = falcon.command("GetSearchStatusV1", repository="string", search_id="string")

print(response)

StopSearchV1

Stop a NGSIEM search.

PEP8 method name

stop_search

Endpoint

MethodRoute
DELETE/humio/api/v1/repositories/{repository}/queryjobs/{id}

Required Scope

ngsiem:write

Content-Type

  • Consumes: application/json

Keyword Arguments

NameServiceUberTypeData typeDescription
repositoryService Class SupportUber Class SupportpathstringName of the repository.
idService Class SupportUber Class SupportpathstringID of the query.

Usage

Service class example (PEP8 syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.stop_search(repository="string", id="string")

print(response)
Service class example (Operation ID syntax)
from falconpy import NGSIEM

# Do not hardcode API credentials!
falcon = NGSIEM(client_id=CLIENT_ID,
                client_secret=CLIENT_SECRET
                )

response = falcon.StopSearchV1(repository="string", id="string")

print(response)
Uber class example
from falconpy import APIHarnessV2

# Do not hardcode API credentials!
falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

response = falcon.command("StopSearchV1", repository="string", id="string")

print(response)