CrowdStrike FalconPy Tools
Project description
FalconPy Tools
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
Built Distribution
File details
Details for the file crowdstrike-falconpy-tools-0.0.28.tar.gz
.
File metadata
- Download URL: crowdstrike-falconpy-tools-0.0.28.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 822edc24b33243c745dd7c118a4bbb0933de6943732abd2b334ccef1afdd4d15 |
|
MD5 | a0e430d9382de64a28bd05a481bc0766 |
|
BLAKE2b-256 | 57433c87e14c40764eddce603ee80d8a01d25099467cca68d91403d402b09f09 |
File details
Details for the file crowdstrike_falconpy_tools-0.0.28-py3-none-any.whl
.
File metadata
- Download URL: crowdstrike_falconpy_tools-0.0.28-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fb8ea3716309db2a27e0db06677c8d8c033f75fdc8f5fe294f28296da7b6fe5 |
|
MD5 | 0f49a7ddca7e7a6561351c43fd22b88b |
|
BLAKE2b-256 | cd5ec05a50435a73c0c0eb2b28552c8428a2b6afb34e66ba9b425749cdbb9913 |