security-testing by proffesor-for-testing/agentic-qe
npx skills add https://github.com/proffesor-for-testing/agentic-qe --skill security-testing<default_to_action> 进行安全测试或审计时:
快速安全检查:
关键成功因素:
---|---|---
1 | 失效的访问控制 | 用户 A 访问用户 B 的数据
2 | 加密机制失效 | 明文密码、HTTP
3 | 注入 | SQL/XSS/命令注入
4 | 不安全设计 | 速率限制、会话超时
5 | 安全配置错误 | 详细错误、暴露的 /admin
6 | 易受攻击的组件 | npm audit、过时的包
7 | 身份验证失败 | 弱密码、无 MFA
8 | 完整性失效 | 未签名的更新、恶意软件
9 | 日志记录失败 | 违规事件无审计跟踪
10 | SSRF | 服务器获取内部 URL
| 类型 | 工具 |
|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 用途 |
|---|
| SAST | SonarQube, Semgrep | 静态代码分析 |
| DAST | OWASP ZAP, Burp | 动态扫描 |
| 依赖项 | npm audit, Snyk | 依赖项漏洞 |
| 密钥 | git-secrets, TruffleHog | 密钥扫描 |
qe-security-scanner: 多层 SAST/DAST 扫描qe-api-contract-validator: API 安全测试qe-quality-analyzer: 安全代码审查// Horizontal escalation - User A accessing User B's data
test('user cannot access another user\'s order', async () => {
const userAToken = await login('userA');
const userBOrder = await createOrder('userB');
const response = await api.get(`/orders/${userBOrder.id}`, {
headers: { Authorization: `Bearer ${userAToken}` }
});
expect(response.status).toBe(403);
});
// Vertical escalation - Regular user accessing admin
test('regular user cannot access admin', async () => {
const userToken = await login('regularUser');
expect((await api.get('/admin/users', {
headers: { Authorization: `Bearer ${userToken}` }
})).status).toBe(403);
});
// SQL Injection
test('prevents SQL injection', async () => {
const malicious = "' OR '1'='1";
const response = await api.get(`/products?search=${malicious}`);
expect(response.body.length).toBeLessThan(100); // Not all products
});
// XSS
test('sanitizes HTML output', async () => {
const xss = '<script>alert("XSS")</script>';
await api.post('/comments', { text: xss });
const html = (await api.get('/comments')).body;
expect(html).toContain('<script>');
expect(html).not.toContain('<script>');
});
test('passwords are hashed', async () => {
await db.users.create({ email: 'test@example.com', password: 'MyPassword123' });
const user = await db.users.findByEmail('test@example.com');
expect(user.password).not.toBe('MyPassword123');
expect(user.password).toMatch(/^\$2[aby]\$\d{2}\$/); // bcrypt
});
test('no sensitive data in API response', async () => {
const response = await api.get('/users/me');
expect(response.body).not.toHaveProperty('password');
expect(response.body).not.toHaveProperty('ssn');
});
test('errors don\'t leak sensitive info', async () => {
const response = await api.post('/login', { email: 'nonexistent@test.com', password: 'wrong' });
expect(response.body.error).toBe('Invalid credentials'); // Generic message
});
test('sensitive endpoints not exposed', async () => {
const endpoints = ['/debug', '/.env', '/.git', '/admin'];
for (let ep of endpoints) {
expect((await fetch(`https://example.com${ep}`)).status).not.toBe(200);
}
});
test('rate limiting prevents brute force', async () => {
const responses = [];
for (let i = 0; i < 20; i++) {
responses.push(await api.post('/login', { email: 'test@example.com', password: 'wrong' }));
}
expect(responses.filter(r => r.status === 429).length).toBeGreaterThan(0);
});
# GitHub Actions
security-checks:
steps:
- name: Dependency audit
run: npm audit --audit-level=high
- name: SAST scan
run: npm run sast
- name: Secret scan
uses: trufflesecurity/trufflehog@main
- name: DAST scan
if: github.ref == 'refs/heads/main'
run: docker run owasp/zap2docker-stable zap-baseline.py -t https://staging.example.com
预提交钩子:
#!/bin/sh
git-secrets --scan
npm run lint:security
// Comprehensive multi-layer scan
await Task("Security Scan", {
target: 'src/',
layers: { sast: true, dast: true, dependencies: true, secrets: true },
severity: ['critical', 'high', 'medium']
}, "qe-security-scanner");
// OWASP Top 10 testing
await Task("OWASP Scan", {
categories: ['broken-access-control', 'injection', 'cryptographic-failures'],
depth: 'comprehensive'
}, "qe-security-scanner");
// Validate fix
await Task("Validate Fix", {
vulnerability: 'CVE-2024-12345',
expectedResolution: 'upgrade package to v2.0.0',
retestAfterFix: true
}, "qe-security-scanner");
aqe/security/
├── scans/* - 扫描结果
├── vulnerabilities/* - 发现的漏洞
├── fixes/* - 修复跟踪
└── compliance/* - 合规状态
const securityFleet = await FleetManager.coordinate({
strategy: 'security-testing',
agents: [
'qe-security-scanner',
'qe-api-contract-validator',
'qe-quality-analyzer',
'qe-deployment-readiness'
],
topology: 'parallel'
});
将管理界面隐藏在 /super-secret-admin → 使用适当的身份验证
JavaScript 验证可被绕过 → 始终进行服务器端验证
假设输入是安全的 → 对所有输入进行清理、验证、转义
代码中的 API 密钥 → 环境变量、密钥管理
有关 v3 智能体特定命令 (aqe security ...)、SAST/DAST 扫描代码、合规审计 (SOC2/GDPR/HIPAA)、密钥检测和安全门的信息,请参阅 references/compliance-agent-commands.md。
像攻击者一样思考: 你会尝试破坏什么?测试它。像防御者一样构建: 假设输入是恶意的,直到证明其安全。持续测试: 安全测试是持续进行的,而不是一次性的。
使用智能体: 智能体自动化漏洞扫描、跟踪修复并验证修复。使用智能体来大规模维护安全态势。
每次安全扫描后,将结果追加到此技能目录的 run-history.json 中:
node -e "
const fs = require('fs');
const h = JSON.parse(fs.readFileSync('.claude/skills/security-testing/run-history.json'));
h.runs.push({date: new Date().toISOString().split('T')[0], scan_types: ['sast','deps'], findings: {critical: 0, high: 0, medium: 0, low: 0}});
fs.writeFileSync('.claude/skills/security-testing/run-history.json', JSON.stringify(h, null, 2));
"
每次扫描前读取 run-history.json — 跟踪按严重性分类的发现数量随时间的变化。如果关键发现增加,则发出警报。
/code-review-quality 结合使用,进行质量 + 安全联合审查/pentest-validation 来证明可利用性/compliance-testing 满足法规要求npm audit 可能会报告开发依赖项的误报 — 使用 --omit=dev 过滤以获得与生产相关的结果npm audit --all 可捕获嵌套漏洞每周安装数
68
仓库
GitHub 星标
281
首次出现
2026年1月24日
安全审计
安装于
github-copilot65
codex65
gemini-cli65
opencode65
cursor64
amp63
<default_to_action> When testing security or conducting audits:
Quick Security Checks:
Critical Success Factors:
---|---|---
1 | Broken Access Control | User A accessing User B's data
2 | Cryptographic Failures | Plaintext passwords, HTTP
3 | Injection | SQL/XSS/command injection
4 | Insecure Design | Rate limiting, session timeout
5 | Security Misconfiguration | Verbose errors, exposed /admin
6 | Vulnerable Components | npm audit, outdated packages
7 | Auth Failures | Weak passwords, no MFA
8 | Integrity Failures | Unsigned updates, malware
9 | Logging Failures | No audit trail for breaches
10 | SSRF | Server fetching internal URLs
| Type | Tool | Purpose |
|---|---|---|
| SAST | SonarQube, Semgrep | Static code analysis |
| DAST | OWASP ZAP, Burp | Dynamic scanning |
| Deps | npm audit, Snyk | Dependency vulnerabilities |
| Secrets | git-secrets, TruffleHog | Secret scanning |
qe-security-scanner: Multi-layer SAST/DAST scanningqe-api-contract-validator: API security testingqe-quality-analyzer: Security code review// Horizontal escalation - User A accessing User B's data
test('user cannot access another user\'s order', async () => {
const userAToken = await login('userA');
const userBOrder = await createOrder('userB');
const response = await api.get(`/orders/${userBOrder.id}`, {
headers: { Authorization: `Bearer ${userAToken}` }
});
expect(response.status).toBe(403);
});
// Vertical escalation - Regular user accessing admin
test('regular user cannot access admin', async () => {
const userToken = await login('regularUser');
expect((await api.get('/admin/users', {
headers: { Authorization: `Bearer ${userToken}` }
})).status).toBe(403);
});
// SQL Injection
test('prevents SQL injection', async () => {
const malicious = "' OR '1'='1";
const response = await api.get(`/products?search=${malicious}`);
expect(response.body.length).toBeLessThan(100); // Not all products
});
// XSS
test('sanitizes HTML output', async () => {
const xss = '<script>alert("XSS")</script>';
await api.post('/comments', { text: xss });
const html = (await api.get('/comments')).body;
expect(html).toContain('<script>');
expect(html).not.toContain('<script>');
});
test('passwords are hashed', async () => {
await db.users.create({ email: 'test@example.com', password: 'MyPassword123' });
const user = await db.users.findByEmail('test@example.com');
expect(user.password).not.toBe('MyPassword123');
expect(user.password).toMatch(/^\$2[aby]\$\d{2}\$/); // bcrypt
});
test('no sensitive data in API response', async () => {
const response = await api.get('/users/me');
expect(response.body).not.toHaveProperty('password');
expect(response.body).not.toHaveProperty('ssn');
});
test('errors don\'t leak sensitive info', async () => {
const response = await api.post('/login', { email: 'nonexistent@test.com', password: 'wrong' });
expect(response.body.error).toBe('Invalid credentials'); // Generic message
});
test('sensitive endpoints not exposed', async () => {
const endpoints = ['/debug', '/.env', '/.git', '/admin'];
for (let ep of endpoints) {
expect((await fetch(`https://example.com${ep}`)).status).not.toBe(200);
}
});
test('rate limiting prevents brute force', async () => {
const responses = [];
for (let i = 0; i < 20; i++) {
responses.push(await api.post('/login', { email: 'test@example.com', password: 'wrong' }));
}
expect(responses.filter(r => r.status === 429).length).toBeGreaterThan(0);
});
# GitHub Actions
security-checks:
steps:
- name: Dependency audit
run: npm audit --audit-level=high
- name: SAST scan
run: npm run sast
- name: Secret scan
uses: trufflesecurity/trufflehog@main
- name: DAST scan
if: github.ref == 'refs/heads/main'
run: docker run owasp/zap2docker-stable zap-baseline.py -t https://staging.example.com
Pre-commit hooks:
#!/bin/sh
git-secrets --scan
npm run lint:security
// Comprehensive multi-layer scan
await Task("Security Scan", {
target: 'src/',
layers: { sast: true, dast: true, dependencies: true, secrets: true },
severity: ['critical', 'high', 'medium']
}, "qe-security-scanner");
// OWASP Top 10 testing
await Task("OWASP Scan", {
categories: ['broken-access-control', 'injection', 'cryptographic-failures'],
depth: 'comprehensive'
}, "qe-security-scanner");
// Validate fix
await Task("Validate Fix", {
vulnerability: 'CVE-2024-12345',
expectedResolution: 'upgrade package to v2.0.0',
retestAfterFix: true
}, "qe-security-scanner");
aqe/security/
├── scans/* - Scan results
├── vulnerabilities/* - Found vulnerabilities
├── fixes/* - Remediation tracking
└── compliance/* - Compliance status
const securityFleet = await FleetManager.coordinate({
strategy: 'security-testing',
agents: [
'qe-security-scanner',
'qe-api-contract-validator',
'qe-quality-analyzer',
'qe-deployment-readiness'
],
topology: 'parallel'
});
Hiding admin at /super-secret-admin → Use proper auth
JavaScript validation can be bypassed → Always validate server-side
Assuming input is safe → Sanitize, validate, escape all input
API keys in code → Environment variables, secret management
For v3 agent-specific commands (aqe security ...), SAST/DAST scanning code, compliance audits (SOC2/GDPR/HIPAA), secret detection, and security gates, see references/compliance-agent-commands.md.
Think like an attacker: What would you try to break? Test that. Build like a defender: Assume input is malicious until proven otherwise. Test continuously: Security testing is ongoing, not one-time.
With Agents: Agents automate vulnerability scanning, track remediation, and validate fixes. Use agents to maintain security posture at scale.
After each security scan, append results to run-history.json in this skill directory:
node -e "
const fs = require('fs');
const h = JSON.parse(fs.readFileSync('.claude/skills/security-testing/run-history.json'));
h.runs.push({date: new Date().toISOString().split('T')[0], scan_types: ['sast','deps'], findings: {critical: 0, high: 0, medium: 0, low: 0}});
fs.writeFileSync('.claude/skills/security-testing/run-history.json', JSON.stringify(h, null, 2));
"
Read run-history.json before each scan — track finding count by severity over time. Alert if critical findings increase.
/code-review-quality for combined quality + security review/pentest-validation to prove exploitability/compliance-testing for regulatory requirementsnpm audit may report false positives for dev dependencies — filter with --omit=dev for production-relevant resultsnpm audit --all catches nested vulnerabilitiesWeekly Installs
68
Repository
GitHub Stars
281
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubWarnSocketWarnSnykPass
Installed on
github-copilot65
codex65
gemini-cli65
opencode65
cursor64
amp63