Skip to content

API Integrations

Joshua Hiller edited this page Jul 15, 2024 · 2 revisions

CrowdStrike Falcon CrowdStrike Subreddit

Using the API Integrations service collection

Uber class support Service class support Documentation Version Page Updated

Table of Contents

Operation ID Description
GetCombinedPluginConfigs
PEP8 get_plugin_configs
Queries for config resources and returns details
ExecuteCommand
PEP8 execute_command
Execute a command.

Passing credentials

WARNING

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.

GetCombinedPluginConfigs

Queries for config resources and returns details

PEP8 method name

get_plugin_configs

Endpoint

Method Route
GET /plugins/combined/configs/v1

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
filter Service Class Support Uber Class Support query string Filter items using a query in Falcon Query Language (FQL).
limit Service Class Support Uber Class Support query integer The number of items to return in this response (default: 100, max: 500). Use with the offset parameter to manage pagination of results.
offset Service Class Support Uber Class Support query integer The first item to return, where 0 is the latest item. Use with the limit parameter to manage pagination of results.
parameters Service Class Support Uber Class Support query dictionary Full query string parameters payload as a dictionary. Not required when using other keywords.
sort Service Class Support Uber Class Support query string Sort items using their properties.

Usage

Service class example (PEP8 syntax)
from falconpy import APIIntegrations

falcon = APIIntegrations(client_id=CLIENT_ID,
                         client_secret=CLIENT_SECRET
                         )

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

falcon = APIIntegrations(client_id=CLIENT_ID,
                         client_secret=CLIENT_SECRET
                         )

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

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

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

Back to Table of Contents

ExecuteCommand

Execute a command.

PEP8 method name

execute_command

Endpoint

Method Route
POST /plugins/entities/execute/v1

Content-Type

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

Keyword Arguments

Name Service Uber Type Data type Description
body Service Class Support Uber Class Support body dictionary Full body payload as a dictionary. Not required when using other keywords.
config_auth_type Service Class Support No Uber Class Support body string Configuration authorization type for plugin to execute. Only application for security scheme plugins. If not provided, execution will use the default authorization type.
config_id Service Class Support No Uber Class Support body string Configuration ID. If omitted, the oldest configuration ID will be used.
definition_id Service Class Support No Uber Class Support body string ID of the definition containing the operation to execute.
id Service Class Support No Uber Class Support body string ID of the specific plugin to execute provided in "definition_name.operation_name" format.
operation_id Service Class Support No Uber Class Support body string The specific operation to execute.
description Service Class Support No Uber Class Support body string Command description.
version Service Class Support No Uber Class Support body integer The version of the definition to execute.

Usage

Service class example (PEP8 syntax)
from falconpy import APIIntegrations

falcon = APIIntegrations(client_id=CLIENT_ID,
                         client_secret=CLIENT_SECRET
                         )

response = falcon.execute_command(config_auth_type="string",
                                  config_id="string",
                                  definition_id="string",
                                  id="string",
                                  operation_id="string",
                                  description="string",
                                  version=integer
                                  )

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

falcon = APIIntegrations(client_id=CLIENT_ID,
                         client_secret=CLIENT_SECRET
                         )

response = falcon.ExecuteCommand(config_auth_type="string",
                                 config_id="string",
                                 definition_id="string",
                                 id="string",
                                 operation_id="string",
                                 description="string",
                                 version=integer
                                 )
print(response)
Uber class example
from falconpy import APIHarnessV2

falcon = APIHarnessV2(client_id=CLIENT_ID,
                      client_secret=CLIENT_SECRET
                      )

body_payload = {
    "resources": [
        {
        "config_auth_type": "string",
        "config_id": "string",
        "definition_id": "string",
        "id": "string",
        "operation_id": "string",
        "request": {
            "description": "string"
        },
        "version": integer
        }
    ]
}

response = falcon.command("ExecuteCommand", body=body_payload)

print(response)

Back to Table of Contents

CrowdStrike Falcon

Clone this wiki locally