Skip to main content

CrowdStrike Falcon Twitter URL

Caracara Filters

PyPI OSS Lifecycle

A new filter system for Caracara.

Caracara's previous filter system was inflexible, and tailored too heavily toward the Hosts API module. This project aims to provide an FQL generator that is dialect-aware (i.e., contextual, based on the API module that the request will be sent to).

Basic Concepts

Instead of declaring each filter as a class, we now have them defined in a dictionary which is significantly easier to work with. Dynamic functionality is provided by storing (partial) functions into each filter.

Each filter derives from the 'default' / base filter, which is configured with identity transforms and validators that return the input value and True, respectively, and expects a string input. These settings can be overridden per-filter, and are enforced when a filter is added to the FQLGenerator object. We call this process rebasing, as each filter is rebased from a smaller dictionary over the top of the default filter, thus ensuring that all expected values will be present.

When a filter is created, the input goes through these processing stages:

  • Validation: the filter's input is passed into a validation function that always returns a bool. True means that the input is valid, and False will raise a ValueError exception. At this stage, we also validate the input type; incorrect input types will result in a TypeError.
  • Transformation: each filter value can be transformed from a human-defined input into something machine-readable, expected by the API. For example, relative timestamps (such as -30m) are transformed to a UTC ISO8601 timestamp ready for the Falcon API, and Containment Pending is rewritten to containment_pending as expected by the Hosts API.
  • Storage: the validated, transformed input is stored alongside the FQL property name and the operator (e.g., equality, >=, etc.), ready for FQL generation.

When FQL is generated, each of the filters are iterated over and converted to FQL individually, and then chained together with + to form an AND condition.

Limitations

We currently only support a limited subset of FQL. For example:

  • We can generate a condition like "all systems that run Windows or Linux, AND have an IP address in the range 192.168.0.0/16 OR 10.0.0.0/8".
  • We cannot generate a condition like "all systems that run Windows AND have an IP address in the 192.168.0.0/16 range, as well as all Linux systems in the 10.0.0.0/8 range".

The latter is out of scope as it requires chaining together multiple filters. You can effectively create this functionality for yourself by creating two FQL generators, wrapping their outputs in parentheses, and chaining them together with a '+'.join().

Download files

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

Source Distribution

caracara_filters-1.3.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

caracara_filters-1.3.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file caracara_filters-1.3.0.tar.gz.

File metadata

  • Download URL: caracara_filters-1.3.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for caracara_filters-1.3.0.tar.gz
Algorithm Hash digest
SHA256 a033a8febcd1cfdbee7febc42571ca653f5f8655de6ec3ea032d740c667e3685
MD5 0a1a510607eb90c3bd440abdbfabd8ad
BLAKE2b-256 38ef52556a87014ed1e81de24312ae70d4f3fabc089746cf207a049e289e5c31

See more details on using hashes here.

Provenance

The following attestation bundles were made for caracara_filters-1.3.0.tar.gz:

Publisher: release-deploy.yml on CrowdStrike/caracara-filters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file caracara_filters-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for caracara_filters-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 976e6d3be6f4b9d43f24b48e7c518c2ff70111141e8f4665c41a68990a9fe325
MD5 d542e7332e5b1e2f56797732b1cd8523
BLAKE2b-256 b1788cb632d8f1e363666011d45a2bd99eb9b378007af96338e165b24c159432

See more details on using hashes here.

Provenance

The following attestation bundles were made for caracara_filters-1.3.0-py3-none-any.whl:

Publisher: release-deploy.yml on CrowdStrike/caracara-filters

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 files

1.2.0

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page