Skip to content

Commit

Permalink
Add more detail to the README (#253)
Browse files Browse the repository at this point in the history
Add a quick start section showing how to install and an example section
showing an example running precli against one of the test samples.

---------

Signed-off-by: Eric Brown <ericwb@users.noreply.github.com>
  • Loading branch information
ericwb authored Jan 30, 2024
1 parent 3c51d00 commit 0425d49
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# precli
# Precli - precaution command line interface

[![Build and Test](https://github.com/securesauce/precli/actions/workflows/unit-test.yml/badge.svg?branch=main)](https://github.com/securesauce/precli/actions/workflows/unit-test.yml)

Precaution command line interface
Precli is the core of the GitHub App [Precaution](https://github.com/marketplace/precaution) and also a command line interface to demonstate its functionality.

**Quick Start**
```bash
pip install precli
```

**Example**

```
$ precli tests/unit/rules/python/stdlib/examples/hmac_timing_attack.py
⛔️ Error on line 18 in tests/unit/rules/python/stdlib/examples/hmac_timing_attack.py
PY005: Observable Timing Discrepancy
Comparing digests with the '==' operator is vulnerable to timing attacks.
17
❱ 18 return 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 return hmac.compare_digest(digest, received_digest)
19
┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┓
┃ Files analyzed ┃ 1 ┃ Lines analyzed ┃ 18 ┃
┃ Files skipped ┃ 0 ┃ ┃ ┃
┣━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━╋━━━━━━━━━━━━━━━━━━━━━━╋━━━━━┫
┃ Errors ┃ 1 ┃ ┃ ┃
┃ Warnings ┃ 0 ┃ ┃ ┃
┃ Notes ┃ 0 ┃ ┃ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┻━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛
```

0 comments on commit 0425d49

Please sign in to comment.