securesauce/precli
GitHub: securesauce/precli
基于命令行的静态应用安全测试工具,通过分析源代码中标准库的使用方式来发现潜在安全漏洞。
Stars: 27 | Forks: 3
.. image:: https://raw.githubusercontent.com/securesauce/precli/main/images/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: 构建和测试
.. image:: https://img.shields.io/pypi/v/precli.svg
:target: https://pypi.org/project/precli/
:alt: 最新版本
.. image:: https://img.shields.io/pypi/pyversions/precli.svg
:target: https://pypi.org/project/precli/
:alt: Python 版本
.. image:: https://img.shields.io/pypi/dm/precli
:target: https://pypistats.org/packages/precli
# :alt: PyPI - 下载
Precli 是 `Precaution App `_ 和 `Precaution Action `_ 的核心。它也可以作为一个命令行界面来演示其功能。它旨在通过涵盖相应编程语言标准库的诸多规则,对源代码进行静态代码分析。
如果您的需求超出了仅对标准库的分析,请考虑升级到 Precaution Professional,以获取发现和修复第三方库中安全漏洞的功能。详情请参阅 https://www.securesauce.dev/。
## 快速开始
安装方式:
.. code-block:: console
```
pip install precli
```
在单个测试示例上运行 precli:
.. code-block:: console
```
precli tests/unit/rules/python/stdlib/hmac/examples/hmac_timing_attack.py
```
示例代码:
.. code-block:: python
```
# 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)
```
示例结果:
.. image:: https://raw.githubusercontent.com/securesauce/precli/main/images/example.gif
:alt: 示例输出
标签:CLI, DevSecOps, GitHub Action, mac时间攻击, PyPI, Python, SAST, StruQ, WiFi技术, 上游代理, 代码安全分析, 安全专业人员, 安全合规, 安全漏洞检测, 密码学安全, 无后门, 盲注攻击, 第三方库安全, 网络代理, 逆向工具, 错误基检测, 静态代码分析, 静态应用安全测试