Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cff-version: 1.2.0
title: 'CrowdStrike Foundry Sample App - Functions with 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: oss-questions@crowdstrike.com
repository-code: 'https://github.com/CrowdStrike/foundry-sample-functions-python'
url: 'https://www.crowdstrike.com'
abstract: >-
The CrowdStrike Foundry Sample App - Functions with Python
is a community-driven, open source project designed
to illustrate creating apps with CrowdStrike Foundry.
keywords:
- crowdstrike
- oauth2
- crowdstrike-foundry
- python
- windows
- linux
- mac
license: MIT
139 changes: 139 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
![CrowdStrike Falcon](/images/cs-logo.png?raw=true)

[![CrowdStrike Subreddit](https://img.shields.io/badge/-r%2Fcrowdstrike-white?logo=reddit&labelColor=gray&link=https%3A%2F%2Freddit.com%2Fr%2Fcrowdstrike)](https://reddit.com/r/crowdstrike)

# Foundry Community Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
oss-conduct@crowdstrike.com or https://crowdstrike.ethicspoint.com/.

All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.


---

<p align="center"><img src="/images/cs-logo-footer.png"><br/><img width="300px" src="/images/alliance-team.png"></p>
<h3><p align="center">WE STOP BREACHES</p></h3>
75 changes: 75 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
![CrowdStrike Falcon](/images/cs-logo.png?raw=true)

[![CrowdStrike Subreddit](https://img.shields.io/badge/-r%2Fcrowdstrike-white?logo=reddit&labelColor=gray&link=https%3A%2F%2Freddit.com%2Fr%2Fcrowdstrike)](https://reddit.com/r/crowdstrike)

# Contributing to this repository

![Hollywood Adversaries](/images/hollywood-adversaries.jpg?raw=true)

Please review this document for details regarding getting started with your first contribution, packages you'll need to install as a developer, and our Pull Request process. If you have any questions, please let us know by posting your question as an [issue](https://github.com/CrowdStrike/foundry-sample-functions-python/issues).

> **Before you begin**: Have you read the [Code of Conduct](CODE_OF_CONDUCT.md)?
> The Code of Conduct helps us establish community norms and how they'll be enforced.

## Issues

Issues are very valuable to this project.

- Ideas are a valuable source of contributions others can make
- Problems show where this project is lacking
- With a question you show where contributors can improve the user
experience

Thank you for creating them.

## Pull Requests

Pull requests are a great way to get your ideas into this repository.

When deciding if we merge in a pull request we look at the following
things:

### Does it state intent

You should be clear which problem you're trying to solve with your
contribution.

For example:

> Add link to code of conduct in README.md

Doesn't tell me anything about why you're doing that

> Add link to code of conduct in README.md because users don't always
> look in the CONTRIBUTING.md

Tells us the problem that you have found, and the pull request shows us
the action you have taken to solve it.

### Is it of good quality

- There are no spelling mistakes
- It reads well
- For english language contributions: Has a good score on
[Grammarly](https://www.grammarly.com) or [Hemingway
App](https://www.hemingwayapp.com/)

### Does it move this repository closer to our vision for the repository

The aim of this repository is:

- To provide a sample for Falcon Foundry so users can learn from it
- The content is usable by someone who hasn't written something like
this before
- Foster a culture of respect and gratitude in the open source
community.

### Does it follow the contributor covenant

This repository has a [code of conduct](CODE_OF_CONDUCT.md), we will
remove things that do not respect it.

---

<p align="center"><img src="/images/cs-logo-footer.png"><br/><img width="300px" src="/images/turbine-panda.png"></p>
<h3><p align="center">WE STOP BREACHES</p></h3>
117 changes: 117 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,118 @@
![CrowdStrike Falcon](/images/cs-logo.png?raw=true)

# Functions with Python sample Foundry app

The Functions with Python sample Foundry app is a community-driven, open source project which serves as an example of an app which can be built using CrowdStrike's Foundry ecosystem. `foundry-sample-functions-python` is an open source project, not a CrowdStrike product. As such, it carries no formal support, expressed or implied.

This app is one of several App Templates included in Foundry that you can use to jumpstart your development. It comes complete with a set of preconfigured capabilities aligned to its business purpose. Deploy this app from the Templates page with a single click in the Foundry UI, create an app from this template using the Foundry CLI, or download it as a zip and import it.

> [!IMPORTANT]
> To view documentation and deploy this sample app, you need access to the Falcon console.

## Description

The Functions with Python sample Foundry app shows how to use Python functions with FalconPy, workflows, API integrations, collections, and UI extensions.

## Prerequisites

* The Foundry CLI (instructions below).
* Python 3.9+ (needed if running the app's functions locally). See [Python For Beginners](https://www.python.org/about/gettingstarted/) for installation instructions.

### Install the Foundry CLI

You can install the Foundry CLI with Scoop on Windows or Homebrew on Linux/macOS.

**Windows**:

Install [Scoop](https://scoop.sh/). Then, add the Foundry CLI bucket and install the Foundry CLI.

```shell
scoop bucket add foundry https://github.com/crowdstrike/scoop-foundry-cli.git
scoop install foundry
```

Or, you can download the [latest Windows zip file](https://assets.foundry.crowdstrike.com/cli/latest/foundry_Windows_x86_64.zip), expand it, and add the install directory to your PATH environment variable.

**Linux and macOS**:

Install [Homebrew](https://docs.brew.sh/Installation). Then, add the Foundry CLI repository to the list of formulae that Homebrew uses and install the CLI:

```shell
brew tap crowdstrike/foundry-cli
brew install crowdstrike/foundry-cli/foundry
```

Run `foundry version` to verify it's installed correctly.

## Getting Started

Clone this sample to your local system, or [download as a zip file](https://github.com/CrowdStrike/foundry-sample-functions-python/archive/refs/heads/main.zip) and import it into Foundry.

```shell
git clone https://github.com/CrowdStrike/foundry-sample-functions-python
cd foundry-sample-functions-python
```

Log in to Foundry:

```shell
foundry login
```

Select the following permissions:

- [ ] Create and run RTR scripts
- [x] Create, execute and test workflow templates
- [x] Create, run and view API integrations
- [ ] Create, edit, delete, and list queries

Deploy the app:

```shell
foundry apps deploy
```

> [!TIP]
> If you get an error that the name already exists, change the name to something unique to your CID in `manifest.yml`.

Once the deployment has finished, you can release the app:

```shell
foundry apps release
```

Next, go to **Foundry** > **App catalog**, find your app, and install it. Go to **Fusion SOAR** > **Workflows** to see the test workflows from this app.

## About this sample app

<!-- Intro below should match app_docs/README.md -->

This sample is designed to show how to use Python Functions in Falcon Foundry. It contains a few capabilities:

1. Python functions:

- **hello**: Simple greeting service
- **host-details**: Uses FalconPy to get Host details
- **servicenow**: Uses FalconPy to invoke an API Integration
- **log-event**: Uses FalconPy to store data in a collection

2. Test workflows to invoke each function.
3. A UI extension on **Endpoint security** > **Endpoint detections** that can be used to call the `hello` function.

See this sample's [App docs README](app_docs/README.md) for configuration and usage information.

## Technical Implementation

- Built on CrowdStrike's Foundry Function framework
- Written in Python with dependencies including:
- [crowdstrike-foundry-function](https://github.com/CrowdStrike/foundry-fn-python) and [FalconPy](https://falconpy.io/) for CrowdStrike API integration

## Foundry resources

- Foundry documentation: [US-1](https://falcon.crowdstrike.com/documentation/category/c3d64B8e/falcon-foundry) | [US-2](https://falcon.us-2.crowdstrike.com/documentation/category/c3d64B8e/falcon-foundry) | [EU](https://falcon.eu-1.crowdstrike.com/documentation/category/c3d64B8e/falcon-foundry)
- Foundry learning resources: [US-1](https://falcon.crowdstrike.com/foundry/learn) | [US-2](https://falcon.us-2.crowdstrike.com/foundry/learn) | [EU](https://falcon.eu-1.crowdstrike.com/foundry/learn)

---

<p align="center"><img src="/images/cs-logo-footer.png"><br/><img width="300px" src="/images/adversary-goblin-panda.png"></p>
<h3><p align="center">WE STOP BREACHES</p></h3>
24 changes: 24 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
![CrowdStrike Falcon](/images/cs-logo.png?raw=true)

# Security Policy

This document outlines security policy and procedures for the CrowdStrike `foundry-sample-functions-python` project.

## Reporting a potential security vulnerability

We have multiple avenues to receive security-related vulnerability reports.
As mentioned in [SUPPORT](https://github.com/CrowdStrike/foundry-sample-functions-python/blob/main/SUPPORT.md), this project is generally not a supported CrowdStrike project.

Please report suspected security vulnerabilities by:

+ Submitting
a [bug](https://github.com/CrowdStrike/foundry-sample-functions-python/issues/new?assignees=&labels=bug+%3Abug%3A&template=bug_report.md&title=%5B+BUG+%5D+...).
+ Submitting a [pull request](https://github.com/CrowdStrike/foundry-sample-functions-python/pulls) to potentially resolve the issue. (New
contributors: please review the content
located [here](https://github.com/CrowdStrike/foundry-sample-functions-python/blob/main/CONTRIBUTING.md).)
+ Sending an email to __oss-security@crowdstrike.com__.

---

<p align="center"><img src="/images/cs-logo-footer.png"><br/><img width="300px" src="/images/adversary-goblin-panda.png"></p>
<h3><p align="center">WE STOP BREACHES</p></h3>
Loading