sensor_download

CrowdStrike FalconPy CrowdStrike FalconPy CrowdStrike Subreddit

Sensor Download examples

The examples within this folder focus on leveraging CrowdStrike's Falcon Sensor Download API to list and retrieve versions of the CrowdStrike agent.

Sensor Download by Operating System or Version

This sample demonstrates how to list and download sensors by operating system and versions.

Running the program

In order to run this demonstration, you will need access to CrowdStrike API keys with the following scopes:

Service Collection
Scope

Sensor Download

READ

Execution syntax

This demonstration was developed to leverage easy to use command-line arguments.

Command line arguments

This program accepts the following command-line arguments.

Argument
Long Argument
Description

-h

--help

show help message and exit

-k KEY

--key KEY

CrowdStrike API Key

-s SECRET

--secret SECRET

CrowdStrike API Secret

-a

--all

Show all columns / Download all versions

-d

--download

Shortcut for --command download

-n NMINUS

--nminus NMINUS

Download previous version (n-1, n-2, 0 = current, 2 = n-2)

-c COMMAND

--command COMMAND

Command to perform. (list or download, defaults to list)

-o OS

--os OS

Sensor operating system

-v OSVER

--osver OSVER

Sensor operating system version

-f FILENAME

--filename FILENAME

Name to use for downloaded file

-t TABLE_FORMAT

--table_format TABLE_FORMAT

Table format to use for display.

-debug

--debug

Enable API debugging

-b

--base-url

GovCloud access to Crowdstrike API

Basic usage

The only required command line arguments are -k (CrowdStrike Falcon API Client ID) and -s (CrowdStrike Falcon API Client Secret).

The default command is "list" with no filters specified, which displays all sensor versions for all available operating systems.

Filtering by operating system

You can filter results by operating system with the -o argument.

Showing all available detail

Extended detail for the versions listed can be shown by using the -a argument.

Filtering by Operating System version

You can additionally filter by operating system version using the -v argument.

Downloading a sensor

Downloading is performed using the -d argument. (Defaults to Windows.)

Simple example

This example will download the latest sensor version for Windows.

Filtering by Operating System and Version

Filters described above are applied to select the appropriate version to download.

Activating Debugging

This example shows how you can activate debugging functionality when you run download_senor.py.

Allowing Access to GovCloud Users

This example shows how you GovCloud user can access sensor_download.py.

Specifying N-1 or N-2 versions.

You can specify the previous, or 2nd previous version to download by leveraging the -n argument.

Argument value
Result

0

Current

1

N-1 (previous)

2

N-2 (second previous)

Downloading all

You can download all available versions, or all versions for a specific Operating System using the -a argument. Passing the -n argument here will also be respected, and only download versions that are N-1 or N-2.

Command-line help

Command-line help is available via the -h argument.

Example source code

Source code for this example can be found here.

Last updated

Was this helpful?