Check for unintentional security exemptions.
Project description
Check Exemptions
Check for unintentional security exemptions vs exceptions buried in code. An exception is meant to be temporary, an exemption is permanent. Some SAST tools do not support the reporting or management of exceptions.
This tool currently supports inline checkov exceptions, and diffs the timestamp when each line was committed to the current date. If the exception timestamp exceeds the defined allowed_days the scan will fail.
Install
Run pip install chkexmpt to install chkexmpt.
NOTE: requires python >= 3.8 Tested on 3.8 and 3.12
Usage
Run chkexmpt to search all sub-directories for files containing security exceptions.
Output
The output with a single failure would look similar to the example below.
2024-08-09 12:04:37-07:00, abc1234c, Eric Hoffmann
/home/user1/src/eks-cluster/cluster.tf
cluster.tf,2,#checkov:skip=CKV_TF_1:Ensure Terraform module sources use a commit hash
To add an approved_exemption for that exception, add the last line to the approved_exemptions list in the .chkexmpt.yml config.
Configuration
A config file in the current directory or ~/.chkexmpt.yml can override default values. Supported attributes are listed below.
allowed_days: <integer>
directory_path: "/Full/path/to/code/directory"
dryrun: true|false
ignore_paths:
- "file/paths"
approved_exemptions:
- "<fileName>,<lineNumber>,<lineComment>"
An example .chkexmpt.yml could look like
allowed_days: 30
directory_path: "/home/user1/src/project-name"
dryrun: true
ignore_paths:
- ".terraform"
approved_exemptions:
- "cluster.tf,2,#checkov:skip=CKV_TF_1:Ensure Terraform module sources use a commit hash"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chkexmpt-0.2.0.tar.gz.
File metadata
- Download URL: chkexmpt-0.2.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5b361034128fd5f3a20f8c0e17c4f9ce955d38290b23e3b585605e6527e086b
|
|
| MD5 |
1a1a2bb9004a8233292eff93b71f20c4
|
|
| BLAKE2b-256 |
56378db6619ec3430069ff9a77bfd79176c7089bb47c4ba20dfe6679dc780f76
|
File details
Details for the file chkexmpt-0.2.0-py3-none-any.whl.
File metadata
- Download URL: chkexmpt-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
507d78096439f5c14cd6448ddefcc5061f5c2c86b95557ee708fcbc1b9629fbd
|
|
| MD5 |
11aae2dbe7c535fb8bd32615d483199d
|
|
| BLAKE2b-256 |
73f3cdcb3cc84d9d5f4bf84dc5ba1823cf180507ee853178e9c0787ca15c06ac
|