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".
What this skill does
# 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`, or `trivy` for dependency vulnerability scanning
- OWASP ZAP or Burp Suite for dynamic application security testing (optional)
## Instructions
1. Run dependency vulnerability scanning to identify known CVEs:
- Execute `npm audit --json` or `pip-audit --format json` or `trivy fs .`.
- Parse results and flag critical/high severity vulnerabilities.
- Check if vulnerable dependencies have available patches.
2. 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 `gitleaks` or `trufflehog`.
3. 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()`, or `exec()`.
- Check for command injection via `child_process.exec()` or `os.system()` with user input.
4. 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.
5. Test for common web vulnerabilities:
- CSRF: Verify anti-CSRF tokens on state-changing endpoints.
- CORS: Check `Access-Control-Allow-Origin` is not set to `*` on authenticated endpoints.
- Security headers: Validate presence of `Content-Security-Policy`, `X-Frame-Options`, `Strict-Transport-Security`.
6. Generate a prioritized findings report with:
- CVSS score for each vulnerability.
- Affected file, line number, and code snippet.
- Specific remediation steps with code examples.
7. 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:**
```bash
semgrep --config=p/owasp-top-ten --json --output=security-results.json .
```
**Checking for hardcoded secrets:**
```bash
gitleaks detect --source=. --report-format=json --report-path=secrets-report.json
```
**Security regression test (Jest):**
```typescript
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/
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.