Syntax
Description
Static security analysis for source code. Detects risky patterns, dangerous functions, and security misconfigurations across multiple languages.Options
Target directory or file to scan
Comma-separated list of languages to scan:
go, python, c, config. Default: scans all detected languages. Use config for YAML/JSON deployment security checks.Exit Codes
- 0: No security issues detected
- 2: Security issues found (fails in CI/CD)
Examples
Scan all code
Scan specific languages
Include configuration checks
Scan specific directory
CI/CD integration
JSON output for reporting
Detection Coverage
Python (python)
- PY_ENV_ACCESS: Reading environment variables with secrets
- PY_SUBPROCESS:
subprocess.callwithshell=True - PY_EVAL: Use of
eval()with untrusted input - PY_EXEC: Use of
exec()with dynamic code - PY_REMOTE_HTTP: HTTP requests to external endpoints
- PY_EXTERNAL_HTTP: Non-localhost HTTP (SSRF risk)
Go (go)
- GO_EXEC_COMMAND:
exec.Commandwith potential injection - GO_DANGEROUS_SHELL: Shell command execution patterns
- GO_NET_HTTP: External HTTP calls
- GO_ENV_READ: Environment variable access
- GO_SYSTEM_WRITE: Writing to system directories
- GO_EXTERNAL_HTTP: Non-localhost HTTP (SSRF risk)
C/C++ (c)
- C_SHELL_EXEC:
system(),popen(),exec*()usage - C_GETS: Unsafe
gets()function (buffer overflow) - C_UNSAFE_STRING:
strcpy,strcatwithout bounds checking - C_MEMCPY: Unbounded
memcpyoperations - C_RAW_SOCKET: Raw socket operations
Configuration (config)
- BIND_ALL_INTERFACES: Service binds to
0.0.0.0(security risk) - TRUST_PROXY_ENABLED: Express trust-proxy without auth
- AUTH_DISABLED: Authentication explicitly disabled
- DEBUG_MODE_PROD: Debug mode in production configs
Remediation Guidance
Each finding includes:- Code: Unique identifier (e.g.,
PY_SUBPROCESS) - Severity:
critical,high,medium,low - Description: What was detected
- Recommendation: How to fix it
Related Commands
- scan-secrets - Scan for exposed secrets
- audit - Full repository audit (includes code scan)
- validate - Validate shell scripts