技能安全审核员
- 作者仓库星标 14,101
- 许可证 Complete terms in LICENSE.txt
- 作者仓库 eigent
- 领域
- 安全
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @eigent-ai · Complete terms in LICENSE.txt
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需手动接入
- 是否需要外部接口密钥
- 需要 · Vendor-specific
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js · Python
- 检测到的文件与系统行为
-
- 只读
- 命令执行
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
python scripts/scan_project.py /path/to/project
# Security Auditor Guide
## Overview
This guide covers security auditing workflows for source code, dependencies, and configurations. For detailed vulnerability patterns and detection rules, see references/vulnerability-patterns.md. For secrets detection patterns, see references/secrets-patterns.md.
## Quick Start
Run the bundled scan script against a project directory:
```bash
python scripts/scan_project.py /path/to/project
```
This performs a lightweight scan for common issues: hardcoded secrets, dangerous function calls, and insecure patterns. For deeper analysis, follow the workflows below.
### Testing the scripts
```bash
python scripts/scan_project.py /path/to/some/project --format text
python scripts/scan_secrets.py /path/to/some/project --format text
```
## Audit Workflow
### 1. Reconnaissance
Before auditing, understand the project:
```bash
# Identify languages, frameworks, and entry points
find . -type f -name "*.py" -o -name "*.js" -o -name "*.ts" -o -name "*.go" -o -name "*.java" | head -20
cat package.json pyproject.toml requirements.txt go.mod pom.xml 2>/dev/null
```
Key questions:
- What frameworks are used? (Express, Django, Flask, Spring, etc.)
- Where are the entry points? (routes, controllers, API handlers)
- How is authentication handled?
- What external services are called?
- Is user input accepted? Where?
### 2. Secrets Detection
Scan for hardcoded credentials, API keys, and tokens. See references/secrets-patterns.md for the full pattern list.
```bash
python scripts/scan_secrets.py /path/to/project
```
Common patterns to check:
- API keys and tokens in source files
- Database connection strings with embedded passwords
- Private keys or certificates committed to the repo
- `.env` files or config files with plaintext secrets
- Secrets in CI/CD configuration files
### 3. Vulnerability Scanning
#### OWASP Top 10 Checklist
| # | Category | What to Look For |
|---|----------|-----------------|
| A01 | Broken Access Control | Missing auth checks, IDOR, privilege escalation |
| A02 | Cryptographic Failures | Weak algorithms, plaintext storage, missing TLS |
| A03 | Injection | SQL, NoSQL, OS command, LDAP, XSS |
| A04 | Insecure Design | Missing rate limits, business logic flaws |
| A05 | Security Misconfiguration | Debug mode, default credentials, verbose errors |
| A06 | Vulnerable Components | Outdated dependencies with known CVEs |
| A07 | Auth Failures | Weak passwords, missing MFA, session issues |
| A08 | Data Integrity Failures | Insecure deserialization, unsigned updates |
| A09 | Logging Failures | Missing audit logs, sensitive data in logs |
| A10 | SSRF | Unvalidated URLs in server-side requests |
#### Language-Specific Checks
**Python**
```python
# Dangerous: SQL injection
cursor.execute(f"SELECT * FROM users WHERE id = {user_id}")
# Safe: Parameterized query
cursor.execute("SELECT * FROM users WHERE id = %s", (user_id,))
# Dangerous: Command injection
os.system(f"ping {hostname}")
# Safe: Use subprocess with list args
subprocess.run(["ping", hostname], capture_output=True)
# Dangerous: Path traversal
open(f"/data/{user_input}")
# Safe: Validate and resolve path
path = pathlib.Path("/data") / user_input
path.resolve().relative_to(pathlib.Path("/data").resolve())
```
**JavaScript/TypeScript**
```javascript
// Dangerous: XSS via innerHTML
element.innerHTML = userInput;
// Safe: Use textContent or sanitize
element.textContent = userInput;
// Dangerous: Prototype pollution
Object.assign(target, JSON.parse(userInput));
// Safe: Validate input structure
const parsed = JSON.parse(userInput);
if (typeof parsed !== 'object' || Array.isArray(parsed)) throw new Error();
const sanitized = Object.fromEntries(
Object.entries(parsed).filter(([k]) => !k.startsWith('__'))
);
// Dangerous: eval or Function constructor
eval(userInput);
// Safe: Never use eval with user input
```
**Go**
```go
// Dangerous: SQL injection
db.Query("SELECT * FROM users WHERE id = " + id)
// Safe: Parameterized query
db.Query("SELECT * FROM users WHERE id = $1", id)
// Dangerous: Path traversal
http.ServeFile(w, r, filepath.Join(baseDir, r.URL.Path))
// Safe: Clean and validate path
cleaned := filepath.Clean(r.URL.Path)
full := filepath.Join(baseDir, cleaned)
if !strings.HasPrefix(full, baseDir) { http.Error(...) }
```
### 4. Dependency Audit
Check for known vulnerabilities in project dependencies:
```bash
# Python
pip audit
safety check -r requirements.txt
# Node.js
npm audit
npx auditjs ossi
# Go
govulncheck ./...
# General (if Trivy is available)
trivy fs --scanners vuln /path/to/project
```
Review the output and categorize by severity (critical, high, medium, low). Critical and high severity findings should be addressed before deployment.
### 5. Configuration Review
Check for insecure defaults in configuration files:
```yaml
# Common misconfigurations to flag:
DEBUG: true # Debug mode in production
ALLOWED_HOSTS: ["*"] # Unrestricted host access
CORS_ALLOW_ALL_ORIGINS: true # Open CORS policy
SECRET_KEY: "default" # Default or weak secret key
SSL_VERIFY: false # Disabled TLS verification
```
Check infrastructure configs:
- Dockerfiles: Running as root, exposing unnecessary ports
- CI/CD: Secrets in plaintext, overly permissive permissions
- Cloud configs: Public S3 buckets, open security groups
### 6. Authentication and Authorization Review
Key areas to verify:
- Password hashing uses strong algorithms (bcrypt, argon2, scrypt)
- Sessions have appropriate timeouts and rotation
- JWT tokens are validated properly (algorithm, expiry, signature)
- API endpoints enforce authorization checks
- Role-based access control is consistently applied
- Rate limiting is in place for login and sensitive endpoints
## Report Format
When generating a security audit report, use this structure:
```markdown
# Security Audit Report
## Summary
- **Project**: [name]
- **Date**: [date]
- **Scope**: [what was audited]
- **Risk Level**: [Critical/High/Medium/Low]
## Findings
### [SEVERITY] Finding Title
- **Category**: [OWASP category]
- **Location**: [file:line]
- **Description**: [what the issue is]
- **Impact**: [what could happen if exploited]
- **Recommendation**: [how to fix]
## Statistics
- Total findings: [count]
- Critical: [count] | High: [count] | Medium: [count] | Low: [count]
```
## Next Steps
- For detailed vulnerability patterns and code examples, see references/vulnerability-patterns.md
- For secrets detection regex patterns, see references/secrets-patterns.md
章节与文件索引
按说明文件中的顺序排列。
概述
快速入门
1. 侦察
2. 秘密检测
3. 漏洞扫描
文件/命令 -> .env · references/vulnerability-patterns.md. · references/secrets-patterns.md. · scripts/scan_project.py · path/to/project · path/to/some/project · scripts/scan_secrets.py · package.js
内容校验值 -> 907199c5c548
当前原文的自动摘译,尚未人工审校。
概述
本指南涵盖源代码、依赖项和配置的安全审核工作流程。详细的漏洞模式和检测规则请参见references/vulnerability-patterns.md。有关秘密检测模式,请参阅references/secrets-patterns.md。
快速入门
针对项目目录运行捆绑的扫描脚本:这会对常见问题执行轻量级扫描:硬编码机密、危险函数调用和不安全模式。要进行更深入的分析,请遵循以下工作流程。
1. 侦察
在审计之前,先了解项目: 关键问题: 使用什么框架? (Express、Django、Flask、Spring 等)入口点在哪里? (路由、控制器、API 处理程序)如何处理身份验证?
2. 秘密检测
扫描硬编码凭据、API 密钥和令牌。有关完整模式列表,请参阅references/secrets-patterns.md。要检查的常见模式: 源文件中的 API 密钥和令牌 带有嵌入密码的数据库连接字符串 提交给存储库的私钥或证书
3. 漏洞扫描
OWASP 十大清单 · 类别 · 寻找什么 A01 · 访问控制损坏 · 缺少身份验证检查、IDOR、权限升级 A02 · 加密故障 · 弱算法、明文存储、缺少 TLS A03 · 注入 · SQL、NoSQL、操作系统命令、LDAP、XSS