Skip to main content

Tool to run compliance control checks as unit tests

Project description

OS Compatibility Python Compatibility pre-commit Code validation Upload Python Package

auditree-framework

Tool to run compliance control checks as unit tests and build up a body of evidence.

This framework gives you the tools you need to create an auditable body of evidence, and is designed to be "DevSecOps" friendly. Collection & validation of evidence is modelled as python unit tests, evidence is stored & versioned in a git repository, notifications can be configured to send to Slack, create issues, contact PagerDuty, or just write files into git. The goal is to enable the digital transformation of compliance activities, and make these everyday operational tasks for the team managing the system.

Installation

Prerequisites

  • Supported for execution on OSX and LINUX.
  • Supported for execution with Python 3.6 and above.

If you haven't already you need to generate a new ssh key for your Github account as per this guide

Check out the code

git clone git@github.com:ComplianceAsCode/auditree-framework
cd auditree-framework

For users

python3 -m venv venv
. venv/bin/activate
make install

For developers

python3 -m venv venv
. venv/bin/activate
make develop

Code style and formatting

This repository uses yapf for code formatting and flake8 for code styling. It also uses pre-commit hooks that are integrated into the development process and the CI. When you run make develop you are ensuring that the pre-commit hooks are installed and updated to their latest versions for this repository. This ensures that all delivered code has been properly formatted and passes the linter rules. See the pre-commit configuration file for details on yapf and flake8 configurations.

Since yapf and flake8 are installed as part of the pre-commit hooks, running yapf and flake8 manually must be done through pre-commit. See examples below:

make code-format
make code-lint

...will run yapf and flake8 on the entire repo and is equivalent to:

pre-commit run yapf --all-files
pre-commit run flake8 --all-files

...and when looking to limit execution to a subset of files do similar to:

pre-commit run yapf --files compliance/*
pre-commit run flake8 --files compliance/*

Unit tests

To run the frameworks test suite, use:

make test

Build Documentation

Documentation sources live in doc-source, and are also auto-generated from the source codes doc strings. The auto-generated documentation (compliance*rst, modules.rst) is ignored by git & should not be modified directly - make changes in the python code.

To build the documentation locally run:

make docs

This will update the files in doc with the latest documentation. These files should not be modified by hand.

Try it

Successfully complete the steps below and you should be able to find your local evidence locker in your $TMPDIR/compliance folder. There you will find a raw folder that contains all of the raw evidence fetched by the fetchers found in the demo/demo_examples/fetchers folder along with a reports folder that contains the reports generated by the checks found in the demo/demo_examples/checks folder.

$ touch ~/.credentials
  • Set up your environment:
cd demo
python -m venv
. ./venv/bin/activate
pip install -r requirements.txt
  • Run the fetchers:
compliance --fetch --evidence local -C auditree_demo.json -v
  • Run the checks:
compliance --check demo.arboretum.accred,demo.custom.accred --evidence local -C auditree_demo.json -v

Contribute

Help us to improve the Auditree framework. See CONTRIBUTING.

Ecosystem

We are building a set of common fetchers/checks in Arboretum. If you have a library of checks, please let us know & we'll link here.

We have a data gathering and reporting tool called Harvest which lets you process your evidence locker and generate reports over the data held.

We have a tool called Prune which lets you mark evidence as no longer being collected, in a suitably tracked manner.

We have a tool called Plant which lets you add evidence to evidence lockers without the use of fetchers or checks.

Project details


Download files

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

Source Distribution

auditree-framework-1.19.1.tar.gz (58.8 kB view details)

Uploaded Source

Built Distribution

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

auditree_framework-1.19.1-py2.py3-none-any.whl (73.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file auditree-framework-1.19.1.tar.gz.

File metadata

  • Download URL: auditree-framework-1.19.1.tar.gz
  • Upload date:
  • Size: 58.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for auditree-framework-1.19.1.tar.gz
Algorithm Hash digest
SHA256 a664551e4c401d0f937ea3ad1537d2bb819109f180e92eb43131b6019c0e6f26
MD5 bcb3b4901b197e7dc3d9a81e5747f5e3
BLAKE2b-256 0585a43b04cf258692c8124c9d5621a3550012083c88676b41c8ac8bdf42e772

See more details on using hashes here.

File details

Details for the file auditree_framework-1.19.1-py2.py3-none-any.whl.

File metadata

  • Download URL: auditree_framework-1.19.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 73.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.5

File hashes

Hashes for auditree_framework-1.19.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 82e96199c23b7cd0c3abd674b9dc43b8df0e6c35dd941c0b29a670062dd76de8
MD5 e0d1554e0f8f485ff5ea646f4934f2d6
BLAKE2b-256 bd44f5f414df97f9d98a4439b575373d93a92c88599bf4e6ffc3c215d232f7e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page