Skip to main content

Precaution security static analysis command line

Project description

Precaution CLI Build and Test Latest Version Python Versions PyPI - Downloads

Precli is the core of the Precaution App and Precaution Action. It also serves as a command line interface to demonstate its functionality. It is designed to do static code analysis of source code with a number of rules covering the standard library for the corresponding programming language.

If your needs go beyond the analysis of just the standard library, consider upgrading to Precaution Professional to get access to finding and fixing security vulnerabilities in third-party libraries. See https://www.securesauce.dev/ for more details.

Quick Start

To install:

pip install precli

Run precli on a single test example:

precli tests/unit/rules/python/stdlib/hmac/examples/hmac_timing_attack.py

Example code:

# level: ERROR
# start_line: 18
# end_line: 18
# start_column: 13
# end_column: 15
import hmac


received_digest = (
    b"\xe2\x93\x08\x19T8\xdc\x80\xef\x87\x90m\x1f\x9d\xf7\xf2"
    b"\xf5\x10>\xdbf\xa2\xaf\xf7x\xcdX\xdf"
)

key = b"my-super-duper-secret-key-string"
password = b"pass"
digest = hmac.digest(key, password, digest="sha224")

print(digest == received_digest)

Example result:

Example output

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

precli-0.7.7.tar.gz (383.8 kB view details)

Uploaded Source

Built Distribution

precli-0.7.7-py3-none-any.whl (167.7 kB view details)

Uploaded Python 3

File details

Details for the file precli-0.7.7.tar.gz.

File metadata

  • Download URL: precli-0.7.7.tar.gz
  • Upload date:
  • Size: 383.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for precli-0.7.7.tar.gz
Algorithm Hash digest
SHA256 7e0eed5c020991ba00ef12aafa4b6553d9017eca12a2ea86305a8b8670fede8f
MD5 29a21037cdb5652a8f32fcff0f3126cd
BLAKE2b-256 79b60c637f6632d10b6e51498b51b598008ccadf7af7ee58d3fe6c7aee2914f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for precli-0.7.7.tar.gz:

Publisher: publish-to-pypi.yml on securesauce/precli

Attestations:

File details

Details for the file precli-0.7.7-py3-none-any.whl.

File metadata

  • Download URL: precli-0.7.7-py3-none-any.whl
  • Upload date:
  • Size: 167.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for precli-0.7.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d37e9116e5c041f0d50c7de016f10c72e657940a329340a1f2ac42199e91377a
MD5 ddd09f9f2860ecd6dc423e9daae55e69
BLAKE2b-256 d0b79418f8c100d7acca12aa7d6647d5ee68c9f7892ea787a7a670ad578639db

See more details on using hashes here.

Provenance

The following attestation bundles were made for precli-0.7.7-py3-none-any.whl:

Publisher: publish-to-pypi.yml on securesauce/precli

Attestations:

Supported by

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