Skip to main content

Precaution security static analysis command line

Project description

Precaution CLI
Build and Test

Precli is the core of the Precaution GitHub App and 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 precli (requires Python 3.12):

pip install precli

Run precli on a single test example:

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

Example result:

⛔️ Error on line 18 in tests/unit/rules/python/stdlib/hmac/examples/hmac_timing_attack.py
PY005: Observable Timing Discrepancy
Comparing digests with the '==' operator is vulnerable to timing attacks.
  17
❱ 18 print(digest == received_digest)
  19
Suggested fix: Use the 'hmac.compare_digest' function instead of the '==' operator to reduce the
vulnerability to timing attacks.
  17
❱ 18 print(hmac.compare_digest(digest, received_digest))
  19

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.5.12.tar.gz (297.0 kB view hashes)

Uploaded Source

Built Distribution

precli-0.5.12-py3-none-any.whl (130.8 kB view hashes)

Uploaded Python 3

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