crowdstrike-falconpy

The CrowdStrike Falcon SDK for Python

https://github.com/crowdstrike/falconpy

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 47 committers (2.1%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.0%) to scientific vocabulary

Keywords

api crowdstrike crowdstrike-apis devsecops falcon falconpy oauth2 python python-3 python3 python310 python311 python312 python313 python37 python38 python39 sdk security security-automation

Keywords from Contributors

annotation transformation embedded sequences cameratrap energy-system-model energy-system charts data-management distributed
Last synced: 4 months ago · JSON representation ·

Repository

The CrowdStrike Falcon SDK for Python

Basic Info
  • Host: GitHub
  • Owner: CrowdStrike
  • License: unlicense
  • Language: Python
  • Default Branch: main
  • Homepage: https://www.falconpy.io
  • Size: 61.6 MB
Statistics
  • Stars: 426
  • Watchers: 15
  • Forks: 137
  • Open Issues: 15
  • Releases: 0
Topics
api crowdstrike crowdstrike-apis devsecops falcon falconpy oauth2 python python-3 python3 python310 python311 python312 python313 python37 python38 python39 sdk security security-automation
Created about 5 years ago · Last pushed 5 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Codeowners Security Support Authors

README.md

CrowdStrike FalconPy CrowdStrike FalconPy

CrowdStrike Subreddit

FalconPy - The CrowdStrike Falcon SDK for Python

Package Status PyPI Release date Repo status Commit activity GitHub forks

The FalconPy SDK contains a collection of Python classes that abstract CrowdStrike Falcon OAuth2 API interaction, removing duplicative code and allowing developers to focus on just the logic of their solution requirements.

Overview 🔎

There are many CrowdStrike Falcon API service collections collectively containing hundreds of individual operations, all of which are accessible to your project via FalconPy.

The CrowdStrike Falcon SDK for Python completely abstracts token management, while also supporting interaction with all CrowdStrike regions, custom connection and response timeouts, routing requests through a list of proxies, disabling SSL verification, and custom header configuration.

If the CrowdStrike APIs were rings of great power, that the Dark Lord Sauron gifted to the kings of dwarves, elves and men, then CrowdStrike's FalconPy would be the One Ring.

"One SDK to rule them all, One SDK to find them, One SDK to bring them all and in the darkness bind them."

Downloads Development Installs

Supported versions of Python

The CrowdStrike Falcon SDK for Python was developed for Python 3. Current versions of FalconPy provide support for Python versions 3.7 - 3.13. Every commit to the FalconPy code base is unit tested for functionality using all versions of Python the library currently supports.

[!NOTE] Developers working with Python version 3.6 will need to leverage versions of FalconPy less than 1.4.0.

PyPI - Implementation PyPI - Wheel PyPI - Python Version

Supported Operating Systems

The FalconPy SDK is unit tested on the following operating systems.

macOS Ubuntu Windows

FalconPy will also run on any of the following operating systems.

Amazon Linux CentOS Fedora RedHat Arch

Debian Kali Pop! OS SUSE openSUSE

Details regarding supported operating systems and Python versions, and project security and testing procedures can be found here.

Components

The FalconPy SDK provides two distinct methods for interacting with CrowdStrike's API.

| Service Classes | The Uber Class | | :-- | :-- | |
Service Classes | The Uber Class | | Each Service Class represents a single CrowdStrike API service collection providing an interface to the operations available within that service collection.| An all-in-one class that provides a singular interface for all operations in every CrowdStrike API service collection. |

Service Classes

Representing a single CrowdStrike Falcon API service collection, each Service Class has a method defined for every operation available within that service collection.

Available Service Classes

For each CrowdStrike Falcon API service collection, a matching Service Class is available in the FalconPy library. For a complete list of service collections and their related Service Class, please review the Operations by Collection page on falconpy.io.

Service Class benefits

  • Closely follows Python and OpenAPI best practice for code style and syntax. PEP-8 compliant.
  • Completely abstracts token management, automatically refreshing your token when it expires.
  • Interact with newly released API operations not yet available in the library via the override method.
  • Provides simple programmatic patterns for interacting with CrowdStrike Falcon APIs.
  • Supports cloud region autodiscovery for the CrowdStrike US-1, US-2 and EU-1 regions.
  • Supports dynamic configuration based upon the needs of your environment.
  • Supports CrowdStrike Falcon API parameter abstraction functionality.
  • Supports CrowdStrike Falcon API body payload abstraction functionality.

The Uber Class

Operating as a single harness for interacting with the entire CrowdStrike Falcon API, the Uber Class can access every available operation within every API service collection.

Uber Class benefits

  • Access every CrowdStrike Falcon API service collection with only one import and only one class.
  • Completely abstracts token management, automatically refreshing your token when it expires.
  • Interact with newly released API operations not yet available in the library via the override keyword.
  • Provides simple programmatic patterns for interacting with CrowdStrike Falcon APIs.
  • Supports cloud region autodiscovery for the CrowdStrike US-1, US-2 and EU-1 regions.
  • Supports CrowdStrike Falcon API parameter abstraction functionality.
  • Supports all environment configuration options supported by FalconPy Service Classes.

Comparing FalconPy class types

While the usage syntax varies slightly, the Uber Class provides the same performance and output as FalconPy Service Classes, and can perform all of the same operations. The Uber Class does not support body payload abstraction.

CrowdStrike Divider

Quick Start 💫

Stable releases of FalconPy are available on the Python Package Index. In a terminal, execute the following command:

shell python3 -m pip install crowdstrike-falconpy

Once installed, you can immediately begin using CrowdStrike functionality in your Python projects.

```python """CrowdStrike FalconPy Quick Start.""" import os from falconpy import Hosts

Use the API Clients and Keys page within your Falcon console to generate credentials.

You will need to assign the Hosts: READ scope to your client to run this example.

CrowdStrike does not recommend you hardcode credentials within source code.

Instead, provide these values as variables that are retrieved from the environment,

read from an encrypted file or secrets store, provided at runtime, etc.

hosts = Hosts(clientid=os.getenv("FALCONCLIENTID"), clientsecret=os.getenv("FALCONCLIENTSECRET") )

While this example retrieves credentials from the environment as the variables

"FALCONCLIENTID" and "FALCONCLIENTSECRET". Developers leveraging environment

authentication do not need to specify the clientid or clientsecret keywords.

hosts = Hosts()

SEARCH_FILTER = "hostname-search-string"

Retrieve a list of hosts that have a hostname that matches our search filter

hostssearchresult = hosts.querydevicesbyfilter(filter=f"hostname:'{SEARCHFILTER}*'")

Confirm we received a success response back from the CrowdStrike API

if hostssearchresult["statuscode"] == 200: hostsfound = hostssearchresult["body"]["resources"] # Confirm our search produced results if hostsfound: # Retrieve the details for all matches hostsdetail = hosts.getdevicedetails(ids=hostsfound)["body"]["resources"] for detail in hostsdetail: # Display the AID and hostname for this match aid = detail["deviceid"] hostname = detail["hostname"] print(f"{hostname} ({aid})") else: print("No hosts found matching that hostname within your Falcon tenant.") else: # Retrieve the details of the error response errordetail = hostssearchresult["body"]["errors"] for error in errordetail: # Display the API error detail errorcode = error["code"] errormessage = error["message"] print(f"[Error {errorcode}] {error_message}") ```

More samples

If you are interested in reviewing more examples of FalconPy usage, this repository also maintains a collection of samples to help get you started with integrating CrowdStrike Falcon into your DevOps processes.

Documentation and Support 📖

FalconPy is a community-driven, open source project designed to assist developers in leveraging the power of CrowdStrike APIs within their solutions. While not a formal CrowdStrike product, FalconPy is maintained by CrowdStrike and supported in partnership with the open source developer community.

Official Project Documentation: falconpy.io

Website Documentation Version

Extended documentation is also available via the wiki for this repository.

Issues and Questions

Is something going wrong? 🔥

GitHub Issues are used to report bugs and errors.

Report Issue

Have a question you can't find answered in the documentation?

Please submit usage questions to the Q&A section of our discussion board.

Discussions

Community forums

The discussion board for this repository also provides the community with means to communicate regarding enhancements ideas, integration examples and new releases.

Discussions

More information regarding FalconPy documentation and support can be found here.

Contribute to FalconPy ☕

Interested in being acknowledged as a member of an elite community of security-focused Python developers that stop breaches?

There are many ways you can contribute to the FalconPy project!

  • Providing feedback by opening a GitHub ticket. Even a fly-by "hey, this worked..." is appreciated and helps validate approaches. Ideas on improving the project are most welcome.
  • Documenting, blogging, or creating videos, of how you've used FalconPy. This type of content is invaluable and helps our community grow. Post these in the Show and Tell category of our discussion board.
  • Submit a sample demonstrating how you're using FalconPy by opening a pull request for inclusion in the Samples Library.
  • Fix a bug or implement a new feature. Check out our open issues on GitHub or our discussion board for inspiration.
  • Review pull requests by going through the queue of open pull requests on GitHub and giving feedback to the authors.

To get started, review the Code of Conduct for community guidelines, and the contribution guide for more detail regarding contributing to the CrowdStrike FalconPy project.



WE STOP BREACHES

Owner

  • Name: CrowdStrike
  • Login: CrowdStrike
  • Kind: organization
  • Email: github@crowdstrike.com
  • Location: United States of America

Citation (CITATION.cff)

cff-version: 1.2.0
title: 'FalconPy: The CrowdStrike Falcon SDK for Python'
message: >-
  If you use this software, and wish to cite the origins, 
  please use metadata from this file.
type: software
authors:
  - given-names: 
    family-names: CrowdStrike
    email: falconpy@crowdstrike.com
  - given-names: Joshua
    family-names: Hiller
    affiliation: CrowdStrike
  - given-names: Dixon
    family-names: Styres
    affiliation: CrowdStrike
  - given-names: Timothy
    family-names: Sullivan
    affiliation: CrowdStrike
  - given-names: Devin
    family-names: Cargill
    affiliation: CrowdStrike
repository-code: 'https://github.com/CrowdStrike/falconpy'
url: 'https://www.falconpy.io'
repository-artifact: 'https://pypi.org/project/crowdstrike-falconpy/'
abstract: >-
  The FalconPy SDK contains a collection of Python
  classes that abstract CrowdStrike Falcon OAuth2 API
  interaction, removing duplicative code and allowing
  developers to focus on just the logic of their
  solution requirements.
keywords:
  - crowdstrike
  - oauth2
  - crowdstrike-api
  - crowdstrike-falcon-api
  - python
  - windows
  - linux
  - mac
license: Unlicense

GitHub Events

Total
  • Create event: 10
  • Release event: 7
  • Issues event: 100
  • Watch event: 55
  • Delete event: 3
  • Issue comment event: 67
  • Push event: 251
  • Pull request review comment event: 7
  • Gollum event: 63
  • Pull request review event: 30
  • Pull request event: 61
  • Fork event: 25
Last Year
  • Create event: 10
  • Release event: 7
  • Issues event: 100
  • Watch event: 55
  • Delete event: 3
  • Issue comment event: 67
  • Push event: 251
  • Pull request review comment event: 7
  • Gollum event: 63
  • Pull request review event: 30
  • Pull request event: 61
  • Fork event: 25

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 1,710
  • Total Committers: 47
  • Avg Commits per committer: 36.383
  • Development Distribution Score (DDS): 0.094
Past Year
  • Commits: 385
  • Committers: 13
  • Avg Commits per committer: 29.615
  • Development Distribution Score (DDS): 0.127
Top Committers
Name Email Commits
Joshua Hiller j****r@c****m 1,549
dependabot[bot] 4****] 25
areino a****o 24
okewoma o****a@g****m 19
Shawn Wells s****s@g****m 12
alhumaw a****7@g****m 9
Chris Hammond c****d@c****m 6
David-M-Berry 1****y 4
snyk-bot s****t@s****o 4
Evan Stoner e****r@c****m 4
Ray Heffer u****t@c****o 4
Andrew Harris a****s@c****m 3
mwilco03 3****3 3
Griffin Ansel g****l@g****m 3
Šimon Lukašík i****k@f****g 3
Gage Schaffer g****r@b****g 2
Carlos Matos c****s@c****m 2
Kevin K. Kragh 8****s 2
exk200006 e****6@u****u 2
ffalor 3****r 2
wozboz p****l@p****e 2
micgoetz m****2@g****m 1
mccbryan3 4****3 1
Josh Lang j****g@c****m 1
Shubham Kumar s****r@c****o 1
nesies 1
jesko 5****s 1
falcon-pioupiou 4****u 1
davidt99 d****k@g****m 1
Taylor Trueblood 8****6 1
and 17 more...

Issues and Pull Requests

Last synced: 4 months ago

All Time
  • Total issues: 264
  • Total pull requests: 231
  • Average time to close issues: 24 days
  • Average time to close pull requests: 3 days
  • Total issue authors: 79
  • Total pull request authors: 32
  • Average comments per issue: 0.81
  • Average comments per pull request: 0.55
  • Merged pull requests: 185
  • Bot issues: 0
  • Bot pull requests: 18
Past Year
  • Issues: 58
  • Pull requests: 71
  • Average time to close issues: 20 days
  • Average time to close pull requests: 2 days
  • Issue authors: 37
  • Pull request authors: 10
  • Average comments per issue: 0.62
  • Average comments per pull request: 0.14
  • Merged pull requests: 57
  • Bot issues: 0
  • Bot pull requests: 6
Top Authors
Issue Authors
  • jshcodes (145)
  • NSH531 (15)
  • 59e5aaf4 (6)
  • Don-Swanson-Adobe (4)
  • crowdstrikedcs (4)
  • nesies (3)
  • carlosmmatos (3)
  • morcef (3)
  • dkang-firmus (2)
  • arne21a (2)
  • jbfuzier (2)
  • api-clobberer (2)
  • migul1 (2)
  • afroz1 (2)
  • aboese (2)
Pull Request Authors
  • jshcodes (129)
  • dependabot[bot] (18)
  • areino (10)
  • alhumaw (7)
  • redhatrises (7)
  • ffalor (6)
  • David-M-Berry (6)
  • exk200006 (4)
  • gansel51 (4)
  • Gage-BCCA (4)
  • okewoma (4)
  • ChristopherHammond13 (3)
  • jhhcs (2)
  • carlosmmatos (2)
  • i-shubham01 (2)
Top Labels
Issue Labels
enhancement :star2: (115) bug :bug: (75) documentation :book: (49) SDK usage (27) RTR (14) hosts (13) code samples (12) Falcon Intelligence (11) API usage (11) authentication (10) firewall (9) question :question: (9) uber (8) Horizon (8) invalid (8) spotlight (7) Discover (7) sensor download (6) ioa (6) detects (6) ngsiem (5) incidents (5) out of scope (5) container (5) investigating (4) intel (4) user management (3) zero trust (3) event streams (3) content update policies (3)
Pull Request Labels
code samples (60) documentation :book: (41) pipeline (36) package (31) unit testing (28) python (21) hosts (20) dependencies (19) enhancement :star2: (19) Horizon (15) authentication (15) Discover (14) Foundry (12) sensor download (12) Falcon Intelligence (11) container (11) bug :bug: (11) spotlight (9) intel (8) kubernetes (8) identity protection (7) alerts (7) SDK usage (7) RTR (7) Fusion (6) firewall (6) ngsiem (6) iocs (6) FileVantage (5) github_actions (5)

Packages

  • Total packages: 4
  • Total downloads:
    • pypi 741,149 last-month
  • Total docker downloads: 2,584
  • Total dependent packages: 6
    (may contain duplicates)
  • Total dependent repositories: 23
    (may contain duplicates)
  • Total versions: 392
  • Total maintainers: 2
pypi.org: crowdstrike-falconpy

The CrowdStrike Falcon SDK for Python

  • Homepage: https://github.com/CrowdStrike/falconpy
  • Documentation: https://www.falconpy.io
  • License: This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <https://unlicense.org>
  • Latest release: 1.5.4
    published 5 months ago
  • Versions: 117
  • Dependent Packages: 6
  • Dependent Repositories: 22
  • Downloads: 740,947 Last month
  • Docker Downloads: 2,584
Rankings
Downloads: 0.8%
Dependent packages count: 1.4%
Average: 2.8%
Docker downloads count: 2.9%
Dependent repos count: 3.1%
Stargazers count: 3.9%
Forks count: 4.5%
Maintainers (2)
Last synced: 4 months ago
proxy.golang.org: github.com/crowdstrike/falconpy
  • Versions: 96
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.3%
Average: 5.5%
Dependent repos count: 5.7%
Last synced: 4 months ago
proxy.golang.org: github.com/CrowdStrike/falconpy
  • Versions: 96
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 5.3%
Average: 5.5%
Dependent repos count: 5.7%
Last synced: 4 months ago
pypi.org: crowdstrike-falconpy-dev

The CrowdStrike Falcon SDK for Python

  • Homepage: https://github.com/CrowdStrike/falconpy
  • Documentation: https://www.falconpy.io
  • License: This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <https://unlicense.org>
  • Latest release: 1.5.4
    published 5 months ago
  • Versions: 83
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 202 Last month
Rankings
Stargazers count: 3.9%
Forks count: 4.5%
Dependent packages count: 10.0%
Average: 10.7%
Downloads: 13.5%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 4 months ago