Metadata-Version: 2.1
Name: precli
Version: 0.5.3
Summary: Static analysis security tool command line
Home-page: https://github.com/securesauce/precli
Download-URL: https://pypi.org/project/precli/#files
Author: Secure Sauce
Project-URL: Release notes, https://github.com/securesauce/precli/releases
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Requires-Python: >=3.12
License-File: LICENSE
Requires-Dist: cwe2==2.0.0
Requires-Dist: Pygments==2.17.2
Requires-Dist: rich==13.7.1
Requires-Dist: tree-sitter==0.21.3
Requires-Dist: tree-sitter-languages==1.10.2
Requires-Dist: ignorelib==0.3.0
Requires-Dist: requests==2.31.0
Requires-Dist: sarif-om==1.0.4
Requires-Dist: jschema-to-python==1.2.3
Requires-Dist: outdated==0.2.2

.. image:: https://raw.githubusercontent.com/securesauce/precli/main/logo/logo.png
    :alt: Precaution CLI

======

.. image:: https://github.com/securesauce/precli/actions/workflows/unit-test.yml/badge.svg?branch=main
    :target: https://github.com/securesauce/precli/actions/workflows/unit-test.yml
    :alt: 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):

.. code-block:: console

    pip install precli

Run precli on a single test example:

.. code-block:: console

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

Example result:

.. code-block:: console

    ⛔️ 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

