Skip to main content

A linter for security commit messages

Project description

SECOMlint

Linter to measure compliance against SECOM convention. SECOM is a convetion for making security commit messages more readable and structured. Check the CONFIG.md file to know how to configure the template in your repository.

Installation

pip install secomlint
python -m spacy download en_core_web_lg

Usage

secomlint --help
Usage: secomlint [OPTIONS]

  Linter to check compliance against SECOM (https://tqrg.github.io/secom/).

Options:
  --no-compliance        Show missing compliance.
  --is-body-informative  Checks body for security information.
  --score                Show compliance score.
  --config TEXT          Rule configuration file path name.
  --help                 Show this message and exit.

Run tool

git log -1 --pretty=%B | secomlint where git log -1 --pretty=%B gets the commit message of the local commit.

  • Check only the rules that are not in compliance: git log -1 --pretty=%B | secomlint --no-compliance
  • Calculate compliance score: git log -1 --pretty=%B | secomlint --no-compliance --score

Configuration

The linter has a default configuration that can be overridden with a .yml file using the following syntax:

rule_name:
    active: {true | false}
    type: {0 - warning | 1 - error}
    value: {string | regex}

An example would be:

header_starts_with_type:
  active: true
  type: 0
  value: 'fix'
metadata_has_detection:
  active: false

The rule header_starts_with_type is active, outputs warnings and checks if header starts with type fix.

The rule metadata_has_detection was deactivated.

git log -1 --pretty=%B | secomlint --config=config.yml

Check if your body is informative

It is important that the body of security commit messages are somehow informative; secomlint checks your body for security-related keywords.

git log -1 --pretty=%B | secomlint --is-body-informative
👍 Good to go! Extractor found the following security related words in the message's body:
   - protocols

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

secomlint-0.1.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

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

secomlint-0.1.0-py3-none-any.whl (27.1 kB view details)

Uploaded Python 3

File details

Details for the file secomlint-0.1.0.tar.gz.

File metadata

  • Download URL: secomlint-0.1.0.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for secomlint-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fad8fcd2c6107cc41358f8cf8ad4e144f67d1ef126a903200ad0e687c1b78b58
MD5 8d9b219a857f02d3ea84df6974274633
BLAKE2b-256 798e18d927006deadcf0937245594f269a387f77e31472417cd65d54d5fd6d98

See more details on using hashes here.

File details

Details for the file secomlint-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: secomlint-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for secomlint-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 658fd7959028054aded46bb3814d254d50c3ebb4dcf6fc1dcbc63f9547e684c3
MD5 ee8e0aa7c2558cea794c672e25caea7f
BLAKE2b-256 e4778b1305d551609a43ea8e85309da7e4df94986f95269ced93e0155eb7f56f

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