Comprehensive security testing suite for the Scavenger platform using OWASP ZAP and custom security tests.
This directory contains security tests covering:
- SQL Injection vulnerabilities
- XSS (Cross-Site Scripting) vulnerabilities
- CSRF (Cross-Site Request Forgery) vulnerabilities
- Authentication/Authorization flaws
- Rate limiting enforcement
- API security
- Input validation
Base environment setup (Node.js, Docker, running services) is in the canonical guide:
Additional tools for this suite only:
- OWASP ZAP — optional, for automated scanning
- curl or Postman — for manual API probing
npm installnpm testnpm run test:integrationnpm run test:security- Test parameterized queries
- Test input sanitization
- Test prepared statements
- Test HTML encoding
- Test JavaScript context escaping
- Test attribute encoding
- Test CSRF token validation
- Test SameSite cookie attributes
- Test JWT token validation
- Test role-based access control
- Test session management
- Test password policies
- Test request rate limits
- Test IP-based throttling
- Test user-based throttling
- Test HTTPS enforcement
- Test API key validation
- Test CORS policies
- Test boundary conditions
- Test malformed input handling
npm run scan:zapThis runs OWASP ZAP in headless mode against the application.
- Start OWASP ZAP
- Configure proxy to localhost:8080
- Navigate through the application
- Run active scan
- Review findings
Test results are generated in:
./reports/security-tests.json- Detailed test results./reports/zap-report.html- OWASP ZAP scan report./reports/coverage.json- Security coverage metrics
Security tests run automatically on:
- Pull requests
- Commits to main branch
- Scheduled daily scans
See .github/workflows/security.yml for CI configuration.
For each security finding:
- Document the vulnerability
- Implement fix
- Add regression test
- Verify fix with security test
- Update documentation