aiguard-py
一行命令安装,一行命令审计 Python 代码安全漏洞
AI 驱动的代码审计工具,识别 SQL注入、命令注入、硬编码密码 等常见漏洞,每条带 CWE 编号 和 可执行的修复代码示例。
🚀 快速开始
# 1. 安装
pip install aiguard-py
# 2. 审计单个文件
aiguard test.py
# 3. 批量扫描整个项目
aiguard ./src
# 4. 生成 HTML 报告
aiguard test.py --output report.html
输出示例:
[高危] SQL注入 - 第20行
CWE: CWE-89
问题: 使用 f-string 拼接 SQL 查询,攻击者可注入恶意代码
修复建议: 使用参数化查询
---
错误写法: cursor.execute(f"SELECT * FROM users WHERE name = '{name}'")
正确写法: cursor.execute("SELECT * FROM users WHERE name = ?", (name,))
[高危] 命令注入 - 第7行
CWE: CWE-78
问题: os.system() 直接拼接用户输入
修复建议: 使用 subprocess.run() 传递参数列表
---
错误写法: os.system("rm -rf " + filename)
正确写法: subprocess.run(["rm", "-rf", filename])
Metadata
Release files for aiguard-py 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aiguard_py-0.5.0.tar.gz | 7.4 kB | Without provenance | Details for aiguard_py-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiguard_py-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for aiguard_py-0.5.0-py3-none-any.whl |
Total release size: 14.8 kB
Release files / aiguard_py-0.5.0.tar.gz
| Download URL | aiguard_py-0.5.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6cd62e6338c26f6841fdd96b7f2c47c6b6cfece8a0c38dbe8b0587c0e140f3e
|
|
BLAKE2b-256 checksum How to use checksums |
2ede186aae9326264717045a6c35a147c7477856fbf98aaf739ce4a4f35bf4ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Release files / aiguard_py-0.5.0-py3-none-any.whl
| Download URL | aiguard_py-0.5.0-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d1b6eff59f330d9ac90a0766c1295593293b087f5317e91554e79cb1dfd0702
|
|
BLAKE2b-256 checksum How to use checksums |
1c2dff7ed0f0fa45b6e1ce7d70e39d972a9bad4ef844bd11aead09e7ba5898b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.10
|
Security for aiguard-py 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.