Skip to main content

manheim-c7n-tools

ReadTheDocs.org build status

Docker Hub Build Status

PyPI Version badge

Manheim's Cloud Custodian (c7n) wrapper package, policy generator, runner, and supporting tools.

This project provides common tooling, distributed as a Docker image, for managing Manheim's cloud-custodian (c7n) tooling, including c7n itself, c7n_mailer, and our custom components. This project/repository is intended to be used (generally via the generated Docker image) alongside a configuration repository of a specific layout, containing configuration for one or more AWS accounts.

For documentation on the upstream cloud-custodian project, please see https://cloudcustodian.io/docs/index.html and the source code at https://github.com/cloud-custodian/cloud-custodian.

Introduction and Goals

Cloud Custodian (a.k.a. c7n) is a flexible rules engine for reporting on and enforcing policy in AWS. Manheim has migrated from Netflix Janitor Monkey to Cloud Custodian for our tag enforcement, resource cleanup, cost reduction, and other policy needs. This project provides common tooling to allow us to deploy and manage c7n across multiple AWS accounts.

We're currently deploying all Cloud Custodian policies via AWS Lambda. The default is to run policies once per day, but other execution triggers are available including arbitrary timer triggers as well as CloudTrail, AWS Config and CloudWatch Events.

A description of the initial tooling that turned into this project can be found in this blog post.

.. _index.main_components:

Main Components

The following commands are available in the Docker container (or Python installation), generated as Python package entrypoints:

  • manheim-c7n-runner - A single entrypoint to wrap running one or more, or all, of the following steps (as well as custodian itself, c7n-mailer deploy, and Sphinx documentation build) in the proper order, in either run (real) or dryrun mode.
  • policygen - The python script to generate the actual custodian YML config files from a configuration repo/directory, as well as handling layering of mailer template files. Must be run from a config repository directory.
  • s3-archiver - Script to clean up custodian S3 buckets by moving logs from any deleted policies to an "archived-logs/" prefix.
  • dryrun-diff - Script to compare the number of resources matched per-policy, per-region between a dryrun and the last actual run of each policy, and write the results to a Markdown file (to be added as a comment on the PR). Optionally, a HTML report listing the affected resources in the dryrun can be generated when a jinja template is provided in the ./reporting-template directory.
  • errorscan - Script using boto3 to examine CloudWatch Metrics, Logs, and SQS Dead Letter Queue for cloud-custodian Lambda functions, and alert on any failed executions, dead letters, etc.
  • c7n's built-in mugc Lambda garbage collection. This is vendored-in to manheim-c7n-tools, as c7n provides it only as a non-executable Python source file in their git repo.
  • c7n's c7n-mailer installed as a dependency for convenience.

Installation and Usage

See Installation and Usage

Metadata

Release files for manheim-c7n-tools 1.4.3

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

Source distribution (sdist)

Source distribution for manheim-c7n-tools 1.4.3
File Size Uploaded Provenance Actions
manheim-c7n-tools-1.4.3.tar.gz 67.6 kB Without provenance Details for manheim-c7n-tools-1.4.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for manheim-c7n-tools 1.4.3
File Interpreter ABI Platform Actions
manheim_c7n_tools-1.4.3-py2.py3-none-any.whl Python 3, Python 2 none any Details for manheim_c7n_tools-1.4.3-py2.py3-none-any.whl

Total release size: 144.1 kB

Release files / manheim-c7n-tools-1.4.3.tar.gz

Download URL manheim-c7n-tools-1.4.3.tar.gz
Size 67.6 kB
Tags Source
SHA-256 checksum
How to use checksums
257e0aa6f42e256b2a6502ec6b52ee281658d03634d7a5d312613ac1c316ebe3
BLAKE2b-256 checksum
How to use checksums
c1f261325671ab89c09bc7ec18cc5bf379f698c2b861e93021f831a190ad6193
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / manheim_c7n_tools-1.4.3-py2.py3-none-any.whl

Download URL manheim_c7n_tools-1.4.3-py2.py3-none-any.whl
Size 76.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5db1770294fd5ebb264d33396b10566c246b80dcbae58d4d144a16046fe5cfbe
BLAKE2b-256 checksum
How to use checksums
b55101c539ebee9caed9f95d5f4f141eaafd910880a67d27bd3b5e8b57ddbfff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Security for manheim-c7n-tools 1.4.3

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

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