Skip to main content

awsfindingsmanagerlib

Rule-based Python library for managing and suppressing findings in AWS Security Hub and its integrated services

Full documentation, including rule syntax and code examples, is available here.

Features

  • Rules map directly onto the get_findings/batch_update_findings boto3 API, so anything the Security Hub API supports as a filter or update is available without extra abstraction.
  • A Manager lets you set shared defaults (filters, updates, note handling) once and have individual rules override only what differs.
  • Regex matching on string fields (ExtraFeatures.RegexStringFilters), not natively supported by the API, is layered on top.
  • JSON-formatted suppression notes (ExtraFeatures.NoteTextConfig) merge into existing JSON-formatted note metadata, e.g. to coexist with a ticketing system's own note fields.
  • Ready-made AWS Lambda handlers (awsfindingsmanagerlib[lambda]) for running suppression on a schedule, or as an event-driven pipeline reacting to new findings and to rules-file changes.

Installation

uv add awsfindingsmanagerlib
# or, with the AWS Lambda handlers:
uv add 'awsfindingsmanagerlib[lambda]'
pip install awsfindingsmanagerlib
# or
pip install 'awsfindingsmanagerlib[lambda]'

Quick start

from pathlib import Path

import boto3
import yaml

from awsfindingsmanagerlib import Rule


with Path("rules.yaml").open() as file:
    rules = yaml.safe_load(file)["Rules"]

client = boto3.client("securityhub")

rule = Rule(**rules[0], client=client)
rule.get_and_update()

See the documentation for the full rule syntax, the Manager API for managing many rules at once, and how to run awsfindingsmanagerlib as an AWS Lambda.

Upgrading

Coming from 1.x? Version 2.0 is a rewrite with a different rules schema and Python API. See UPGRADING.md.

Developing further

Development flow as Paleofuturistic Python

Prerequisite: uv

Setup

  • Fork and clone this repository.
  • Download additional dependencies: uv sync --all-extras --dev
  • Optional: validate the setup with uv run python -m unittest

Workflow

  • Download dependencies (if you need any): uv add some_lib_you_need
  • Develop (optional, tinker: uvx --with-editable . ptpython)
  • QA:
    • Format: uv run ruff format
    • Lint: uv run ruff check
    • Type check: uv run mypy
    • Test: uv run python -m unittest
  • Build (to validate it works): uv build
  • Review documentation updates: uv run mkdocs serve
  • Make a pull request.

Metadata

Release files for awsfindingsmanagerlib 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for awsfindingsmanagerlib 2.0.0
File Size Uploaded Provenance
awsfindingsmanagerlib-2.0.0.tar.gz 21.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for awsfindingsmanagerlib 2.0.0
File Interpreter ABI Platform
awsfindingsmanagerlib-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 52.4 kB

Release files / awsfindingsmanagerlib-2.0.0.tar.gz

Download URL awsfindingsmanagerlib-2.0.0.tar.gz
Size 21.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ff088b307c136cb29a8cbb60253ecf7b39e08f42da80815eade6e9abc866971f
BLAKE2b-256 checksum
How to use checksums
ab5a61aa5a63d209c0a39374c5a88114bdffbc52a404f11320efa0ffc975428a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / awsfindingsmanagerlib-2.0.0-py3-none-any.whl

Download URL awsfindingsmanagerlib-2.0.0-py3-none-any.whl
Size 31.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca7ffe5bc4f534624b63682866dcb0a07ed70329e5390ad1df30b26315299575
BLAKE2b-256 checksum
How to use checksums
a69dacd75eac1312361ee5c48b160be716e43171b5d00163409a7ae1f1b7f3d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.0 {"installer":{"name":"uv","version":"0.13.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for awsfindingsmanagerlib 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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