Security
security
Security rules — Bandit + secret-pattern detection.
SecurityPatternRule
dataclass
Bases: ProjectRule
Detect hardcoded secrets via regex patterns.
Source code in packages/axm-audit/src/axm_audit/core/rules/security.py
rule_id
property
Unique identifier for this rule.
check(project_path)
Check for hardcoded secrets in the project.
Source code in packages/axm-audit/src/axm_audit/core/rules/security.py
SecurityRule
dataclass
Bases: ProjectRule
Run Bandit and score based on vulnerability severity.
Scoring: 100 - (high_count * 15 + medium_count * 5), min 0.
Source code in packages/axm-audit/src/axm_audit/core/rules/security.py
rule_id
property
Unique identifier for this rule.
check(project_path)
Check project security with Bandit.
Source code in packages/axm-audit/src/axm_audit/core/rules/security.py
run_bandit(src_path, project_path)
Run Bandit and return parsed JSON output.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If bandit exits with rc >= 2 (error) and produces no parseable output. rc=0 means clean, rc=1 means issues found. |