Skip to content

Policy: missing apm.yml silently skips all policy and baseline checks #1056

@sergio-sisternes-epam

Description

@sergio-sisternes-epam

Problem

When apm.yml is absent from a project, both run_policy_checks() and run_baseline_checks() return a fully-passing CIAuditResult with no checks appended. This means apm audit --ci exits 0 with no warnings.

This was identified by the supply-chain-security expert during the review panel for PR #1053 (which fixes the malformed YAML bypass, #936). The threat model is similar: an attacker with write access could delete apm.yml instead of malforming it, achieving the same policy bypass.

Current behaviour

  • run_policy_checks(): if apm.yml doesn't exist, returns empty CIAuditResult (all-pass)
  • run_baseline_checks() via _check_lockfile_exists(): if apm.yml doesn't exist, returns CheckResult(name="lockfile-exists", passed=True, message="No apm.yml found -- nothing to check")

Considerations

This is not identical to the malformed-YAML case:

  • Many repos legitimately have no apm.yml (non-APM projects, fresh repos)
  • Failing on missing apm.yml would break all non-APM projects that run apm audit --ci
  • The original design intent appears to be: "no manifest = nothing to audit"

However, for repos that previously had an apm.yml, deletion is a bypass vector. Possible mitigations:

  • Warn (but don't fail) when apm.yml is absent but .apm/ directory or apm.lock.yaml exists
  • Org policy could require apm.yml presence (opt-in enforcement)
  • Track apm.yml presence in lockfile metadata

Origin

Identified during APM Review Panel review of PR #1053 (fix for #936).

/cc @danielmeppiel

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/audit-policyapm-policy.yml schema, custom_checks, install-time enforcement.priority/highShips in current or next milestonestatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions