-
Notifications
You must be signed in to change notification settings - Fork 157
Policy: missing apm.yml silently skips all policy and baseline checks #1056
Copy link
Copy link
Open
Labels
area/audit-policyapm-policy.yml schema, custom_checks, install-time enforcement.apm-policy.yml schema, custom_checks, install-time enforcement.priority/highShips in current or next milestoneShips in current or next milestonestatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.Something does not work as documented.
Metadata
Metadata
Assignees
Labels
area/audit-policyapm-policy.yml schema, custom_checks, install-time enforcement.apm-policy.yml schema, custom_checks, install-time enforcement.priority/highShips in current or next milestoneShips in current or next milestonestatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/securitySecure by default. Content scanning, lockfile integrity, MCP trust boundaries.Secure by default. Content scanning, lockfile integrity, MCP trust boundaries.type/bugSomething does not work as documented.Something does not work as documented.
Type
Projects
Status
Todo
Problem
When
apm.ymlis absent from a project, bothrun_policy_checks()andrun_baseline_checks()return a fully-passingCIAuditResultwith no checks appended. This meansapm audit --ciexits 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.ymlinstead of malforming it, achieving the same policy bypass.Current behaviour
run_policy_checks(): ifapm.ymldoesn't exist, returns emptyCIAuditResult(all-pass)run_baseline_checks()via_check_lockfile_exists(): ifapm.ymldoesn't exist, returnsCheckResult(name="lockfile-exists", passed=True, message="No apm.yml found -- nothing to check")Considerations
This is not identical to the malformed-YAML case:
apm.yml(non-APM projects, fresh repos)apm.ymlwould break all non-APM projects that runapm audit --ciHowever, for repos that previously had an
apm.yml, deletion is a bypass vector. Possible mitigations:apm.ymlis absent but.apm/directory orapm.lock.yamlexistsapm.ymlpresence (opt-in enforcement)apm.ymlpresence in lockfile metadataOrigin
Identified during APM Review Panel review of PR #1053 (fix for #936).
/cc @danielmeppiel