Skip to content

Evaluate phpcs-security-audit integration for PHPStan-based security checks #267

@coisa

Description

@coisa

Problem

Security checks exist via composer audit, but source-code security pattern checks are not currently part of dev-tools automated analysis.

FloeDesignTechnologies/phpcs-security-audit can add static security pattern checks, and its adoption should be considered inside the planned static analysis strategy.

Proposal

Evaluate integrating phpcs-security-audit as a PHPStan-oriented security extension (or complementary analysis step) aligned with PHPStan-first direction in issue #14.

Implementation direction:

  • Validate plugin installation and discovery path in the analysis stack.
  • Define one security profile focused on high-signal vulnerabilities.
  • Keep execution opt-in until baseline/noise profile is stable.
  • Report findings with consistent severity labeling.

Goals

  • Add security-oriented source analysis in addition to dependency-level audit.
  • Reuse existing analysis command shape and output contracts.
  • Keep compatibility with both ad-hoc and CI usage.

Expected Benefits

  • Immediate security hardening signal without building new tooling from scratch.
  • Better alignment between dependency security checks and source-level security checks.

Why Not (if skipped)

Non-goals

  • Replacing all existing ECS/PHPStan coverage.
  • Making the security check mandatory for every consumer.

Acceptance Criteria

Architectural / Isolation Criteria

  • MUST: Security check execution remains isolated from formatting/reporting logic.
  • MUST: Shared output contracts (--json / deterministic summaries) are preserved where applicable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions