api-mitmproxy
Interactive HTTPS proxy for API security testing with traffic interception, modification, and replay capabilities. Supports…
Python security vulnerability detection using Bandit SAST with CWE and OWASP mapping. Use when: (1) Scanning Python code for security vulnerabilities and anti-patterns, (2) Identifying hardcoded secrets, SQL injection, command injection, and insecure APIs, (3) Generating
Claude Code
$ npx -y skills add AgentSecOps/SecOpsAgentKit --skill sast-bandit --agent claude-code
Codex
$ npx skills add AgentSecOps/SecOpsAgentKit --skill sast-bandit -a codex -y
Cursor
$ npx skills add AgentSecOps/SecOpsAgentKit --skill sast-bandit -a cursor -y
Gemini CLI
$ npx skills add AgentSecOps/SecOpsAgentKit --skill sast-bandit -a gemini-cli -y
GitHub Copilot
$ npx skills add AgentSecOps/SecOpsAgentKit --skill sast-bandit -a github-copilot -y
OpenCode
$ npx skills add AgentSecOps/SecOpsAgentKit --skill sast-bandit -a opencode -y
Windsurf
$ npx skills add AgentSecOps/SecOpsAgentKit --skill sast-bandit -a windsurf -y
name: sast-bandit description: > Python security vulnerability detection using Bandit SAST with CWE and OWASP mapping. Use when: (1) Scanning Python code for security vulnerabilities and anti-patterns, (2) Identifying hardcoded secrets, SQL injection, command injection, and insecure APIs, (3) Generating security reports with severity classifications for CI/CD pipelines, (4) Providing remediation guidance with security framework references, (5) Enforcing Python security best practices in development workflows. version: 0.1.0 maintainer: SirAppSec category: appsec tags: [sast, bandit, python, vulnerability-scanning, owasp, cwe, security-linting] frameworks: [OWASP, CWE] dependencies: python: ">=3.8" packages: [bandit] references: - https://github.com/PyCQA/bandit - https://bandit.readthedocs.io/ - https://owasp.org/www-project-top-ten/
Bandit is a security-focused static analysis tool for Python that identifies common security vulnerabilities and coding anti-patterns. It parses Python code into Abstract Syntax Trees (AST) and executes security plugins to detect issues like hardcoded credentials, SQL injection, command injection, weak cryptography, and insecure API usage. Bandit provides actionable reports with severity classifications aligned to industry security standards.
Scan a Python file or directory for security vulnerabilities:
# Install Bandit pip install bandit # Scan single file bandit suspicious_file.py # Scan entire directory recursively bandit -r /path/to/python/project # Generate JSON report bandit -r project/ -f json -o bandit_report.json # Scan with custom config bandit -r project/ -c .bandit.yaml
Install Bandit via pip:
pip install bandit
Create a configuration file `.bandit` or `.bandit.yaml` to customize scans:
# .bandit.yaml exclude_dirs: - /tests/ - /venv/ - /.venv/ - /node_modules/ skips: - B101 # Skip assert_used checks in test files tests: - B201 # Flask app run with debug=True - B301 # Pickle usage - B601 # Shell injection - B602 # Shell=True in subprocess
Run Bandit against Python codebase:
# Basic scan with severity threshold bandit -r . -ll # Report only medium/high severity # Comprehensive scan with detailed output bandit -r . -f json -o report.json -v # Scan with confidence filtering bandit -r . -i # Show only high confidence findings # Exclude specific tests bandit -r . -s B101,B601
Bandit reports findings with:
Example output:
>> Issue: [B105:hardcoded_password_string] Possible hardcoded password: 'admin123' Severity: Medium Confidence: Medium CWE: CWE-259 (Use of Hard-coded Password) Location: app/config.py:12
Focus remediation efforts using this priority matrix:
1. **Critical**: HIGH severity + HIGH confidence 2. **High**: HIGH severity OR MEDIUM severity + HIGH confidence 3. **Medium**: MEDIUM severity + MEDIUM confidence 4. **Low**: LOW severity OR LOW confidence
For each finding, consult the bundled `references/remediation_guide.md` for secure coding patterns. Common remediation strategies:
Add Bandit to CI/CD pipelines to enforce security gates:
# .github/workflows/security-scan.yml
name: Security Scan
on: [push, pull_request]
jobs:
bandit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Bandit
run: pip install bandit
- name: Run Bandit
run: bandit -r . -f json -o bandit-report.json
- name: Check for high severity issues
run: bandit -r . -ll -f txt || exit 1Use the bundled script `scripts/bandit_analyzer.py` for enhanced reporting with OWASP mapping.
An assortment of security operations skills for AI coding agents. A collaborative approach to shift-left security using Claude Code skills.
Interactive HTTPS proxy for API security testing with traffic interception, modification, and replay capabilities. Supports…
API specification linting and security validation using Stoplight's Spectral with support for OpenAPI, AsyncAPI, and Arazzo…
Fast web fuzzer for DAST testing with directory enumeration, parameter fuzzing, and virtual host discovery. Written in Go for…
Fast, template-based vulnerability scanning using ProjectDiscovery's Nuclei with extensive community templates covering CVEs,…
Dynamic application security testing (DAST) using OWASP ZAP (Zed Attack Proxy) with passive and active scanning, API testing, and…
Static application security testing (SAST) using Semgrep for vulnerability detection, security code review, and secure coding…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…