performing-security-testing
Test automate security vulnerability testing covering OWASP Top 10, SQL injection, XSS, CSRF, and authentication issues. Use when performing security assessments, penetration tests, or vulnerability scans. Trigger with phrases like "scan for vulnerabilities", "test security", or "run penetration test".
- License 许可
- MIT
- 最近更新
- 2026-03-20
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- performing-security-testing
- author
- Jeremy Longshore <jeremy@intentsolutions.io>
- license
- MIT
- version
- 1.0.0
- description
- Test automate security vulnerability testing covering OWASP Top 10, SQL injection, XSS, CSRF, and authentication issues. Use when performing security assessments, penetration tests, or vulnerability scans. Trigger with phrases like "scan for vulnerabilities", "test security", or "run penetration test".
- allowed-tools
- Read, Write, Edit, Grep, Glob, Bash(test:security-*)
- compatible-with
- claude-code, codex, openclaw
02 资源文件 6
- 资产文件assets/nessus_scan_policy.xml3.7 KB
- 脚本assets/nmap_scan_template.sh3.1 KB
- 资产文件assets/README.md334 B
- 资产文件assets/report_template.md6.5 KB
- 参考文档references/README.md65 B
- 脚本scripts/README.md374 B
03 SKILL.md 正文
Security Test Scanner
Overview
Automate security vulnerability detection covering OWASP Top 10 categories including SQL injection, XSS, CSRF, broken authentication, and sensitive data exposure. Combines static analysis (source code scanning with Semgrep, Bandit, ESLint security plugins) with dynamic testing patterns (input fuzzing, header validation, authentication bypass checks).
Prerequisites
- Static analysis tools installed (Semgrep, ESLint with
eslint-plugin-security, Bandit for Python, or SpotBugs for Java) - Application running in a test environment (never scan production without explicit authorization)
- Written authorization to perform security testing on the target system
npm audit,pip-audit, ortrivyfor dependency vulnerability scanning- OWASP ZAP or Burp Suite for dynamic application security testing (optional)
Instructions
- Run dependency vulnerability scanning to identify known CVEs:
- Execute
npm audit --jsonorpip-audit --format jsonortrivy fs .. - Parse results and flag critical/high severity vulnerabilities.
- Check if vulnerable dependencies have available patches.
- Execute
- Perform static application security testing (SAST) on source code:
- Run Semgrep with OWASP rulesets:
semgrep --config=p/owasp-top-ten. - Execute language-specific scanners (Bandit for Python, ESLint security for JS).
- Scan for hardcoded secrets using
gitleaksortrufflehog.
- Run Semgrep with OWASP rulesets:
- Analyze code for injection vulnerabilities:
- Search for string concatenation in SQL queries (use Grep for patterns like
"SELECT.*" +). - Identify unsanitized user input flowing into
innerHTML,eval(), orexec(). - Check for command injection via
child_process.exec()oros.system()with user input.
- Search for string concatenation in SQL queries (use Grep for patterns like
- Validate authentication and authorization:
- Verify password hashing uses bcrypt, scrypt, or Argon2 (not MD5/SHA1).
- Check JWT token validation includes expiration, issuer, and audience claims.
- Ensure authorization checks exist on every protected endpoint.
- Test for common web vulnerabilities:
- CSRF: Verify anti-CSRF tokens on state-changing endpoints.
- CORS: Check
Access-Control-Allow-Originis not set to*on authenticated endpoints. - Security headers: Validate presence of
Content-Security-Policy,X-Frame-Options,Strict-Transport-Security.
- Generate a prioritized findings report with:
- CVSS score for each vulnerability.
- Affected file, line number, and code snippet.
- Specific remediation steps with code examples.
- Create regression tests for each finding to prevent reintroduction.
Output
- Security scan report in Markdown with findings sorted by severity
- Dependency vulnerability list with CVE IDs and available patches
- SAST findings with file paths, line numbers, and code context
- Remediation checklist with specific code fixes for each finding
- Security regression test file to prevent reintroduction of fixed vulnerabilities
Error Handling
| Error | Cause | Solution |
|---|---|---|
| False positive on SQL injection | ORM parameterized queries flagged as concatenation | Add Semgrep nosemgrep comments on verified safe patterns; tune rules to recognize the ORM |
| Secret scanner flags test fixtures | Test files contain example API keys or tokens | Add test directories to .gitleaksignore; use obviously fake values like test-key-000 |
| Dependency audit returns hundreds of results | Transitive dependencies with low-severity issues | Filter to direct dependencies first; focus on critical/high only; use npm audit --omit=dev |
| Scanner cannot reach application | Application not running or port mismatch | Start the application before dynamic scans; verify the base URL and port configuration |
| Rate limiting blocks scan | Too many requests from the scanner | Configure scan throttling; use authenticated sessions with higher rate limits |
Examples
Semgrep scan for OWASP Top 10:
semgrep --config=p/owasp-top-ten --json --output=security-results.json .
Checking for hardcoded secrets:
gitleaks detect --source=. --report-format=json --report-path=secrets-report.json
Security regression test (Jest):
describe('Security: XSS Prevention', () => {
it('escapes HTML entities in user-generated content', () => {
const input = '<script>alert("xss")</script>';
const rendered = renderUserComment(input);
expect(rendered).not.toContain('<script>');
expect(rendered).toContain('<script>');
});
it('rejects SQL injection in search parameter', async () => {
const response = await request(app)
.get('/api/search?q=\'; DROP TABLE users; --')
.expect(200); # HTTP 200 OK
expect(response.body.results).toBeDefined();
// Verify users table still exists
const users = await db.query('SELECT count(*) FROM users');
expect(users.rows[0].count).toBeGreaterThan(0);
});
});
Resources
- OWASP Top 10: https://owasp.org/www-project-top-ten/
- Semgrep rules registry: https://semgrep.dev/explore
- Bandit (Python SAST): https://bandit.readthedocs.io/
- Gitleaks secret detection: https://github.com/gitleaks/gitleaks
- npm audit documentation: https://docs.npmjs.com/cli/commands/npm-audit
- OWASP ASVS (Application Security Verification Standard): https://owasp.org/www-project-application-security-verification-standard/
04 同仓库更多 Skills
azure-apim-architecture
Analyzes and explains Azure API Management architecture decisions for enterprise API marketplace implementations using VNet Internal mode, Front Door, hybrid authentication, and multi-environment strategies. Use when discussing APIM component selection, network topology, cost optimization, or comparing alternatives like workspaces vs instances, VNet Internal vs External mode, or Front Door vs Application Gateway.
apiops-deployment
Guides deployment of Azure API Management infrastructure using Infrastructure as Code (Bicep/Terraform), CI/CD pipelines (GitHub Actions/Azure DevOps), and APIOps workflows. Use when deploying APIM, creating pipelines, or implementing dev→test→prod promotion strategies.
apim-policy-authoring
Creates production-ready Azure API Management policy XML for authentication (OAuth 2.0, JWT validation, subscription keys), rate limiting, CORS configuration, error handling, and API transformations. Use when implementing API security, access control, or request/response processing logic.
api-security-review
Reviews Azure API Management configurations for security vulnerabilities, OWASP API Security Top 10 compliance, VNet Internal mode validation, Private Link verification, and Azure Security Benchmark alignment. Use when performing security audits, pre-deployment validation, or compliance reviews.
jira-cli
Interact with Jira from the command line to create, list, view, edit, and transition issues, manage sprints and epics, and perform common Jira workflows. Use when the user asks about Jira tasks, tickets, issues, sprints, or needs to manage project work items.
calculator
Performs arbitrary-precision arithmetic calculations including addition, subtraction, multiplication, division, and exponents. Use when the user asks to calculate, compute, or evaluate math expressions, or when precise decimal arithmetic is needed to avoid floating-point errors.