guides/Security-Audit.md

Security Audit

Core includes a security audit gate in the test workflow.

Commands

Run the full security suite:

composer test-security

Run dependency audit only:

composer audit-security-deps

Run code audit only:

composer audit-security-code

What is checked

1) Dependency vulnerabilities

Note: if the local Composer binary does not support audit, the dependency audit command is skipped with an explicit message. CI uses composer:v2, where audit support is expected.

2) Code-level security patterns

tools/security-audit.php scans tracked PHP files under:

Rules:

Output format:

RULE_ID path/to/file.php:line message

The command exits non-zero when non-allowlisted findings are present.

Allowlist policy

Allowlist file: tools/security-audit.allowlist.json

Entry format:

{
  "rule": "SEC001",
  "path": "tools/serve-docs.php",
  "line": 46,
  "reason": "Docs utility launches local commands."
}

Supported keys:

Guidelines:

CI integration

Security audit is enforced in:

Step: