Skip to main content

CrowdStrike FalconPy Tools

Project description

CrowdStrike Falcon Twitter URL

FalconPy Tools

Pylint Flake8 Bandit CodeQL Maintained

A collection of tools for interacting with the CrowdStrike Falcon API.

Basic usage example

The following example demonstrates using the Hosts Toolbox to retrieve a host AID, and then using the RTR Toolbox to initiate a session and execute ifconfig.

import os
from falconpytools.hosts import HostsToolbox, Host
from falconpytools.rtr import RTRToolbox, SingleTarget

# Open the RTR toolbox
rtr = RTRToolbox(os.environ["FALCON_CLIENT_ID"],
                 os.environ["FALCON_CLIENT_SECRET"],
                 verbose=True
                 )
# Open the Hosts toolbox
hosts = HostsToolbox(auth_object=rtr.api.rtr.auth_object,
                     verbose=True
                     )
# Lookup the AID for our search string
target_aid = hosts.host.find_host_aid(hostname="SEARCH-STRING")
# Retrieve the hostname
hostname = hosts.host.get_host(target_aid)[0]["hostname"]
# RTR Single Target helper
target = rtr.single_target
# Initialize a RTR session
target_session = target.connect_to_host(target_aid)
# Execute a RTR command
command_result = target.execute_command("ifconfig", target_session)
# Disconnect from the RTR session
target.disconnect_from_host(target_session)
# Output the results
print(command_result)

Installation

python3 -m pip install crowdstrike-falconpy-tools

Upgrading

python3 -m pip install crowdstrike-falconpy-tools --upgrade

Removal

python3 -m pip uninstall crowdstrike-falconpy-tools

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crowdstrike-falconpy-tools-0.0.28.tar.gz (8.8 kB view hashes)

Uploaded Source

Built Distribution

crowdstrike_falconpy_tools-0.0.28-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page