Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Introduce a unified Policy config that covers advisories, abandoned, and malware#12804

Merged
Seldaek merged 30 commits into
composer:mainfrom
glaubinix:push-ymskopooqxzt
May 6, 2026
Merged

Introduce a unified Policy config that covers advisories, abandoned, and malware#12804
Seldaek merged 30 commits into
composer:mainfrom
glaubinix:push-ymskopooqxzt

Conversation

@glaubinix
Copy link
Copy Markdown
Collaborator

@glaubinix glaubinix commented Apr 16, 2026

Introducing a new policy config that covers what is currently known as audit and filter while keeping support for the existing audit config.

Changes in this PR

  • drops filter config and uses new policy config instead
  • unifies how ignore works across advisories, abandoned and malware
  • ignore-unreachable can now be configured separately for audit|update|install
  • drops default-lists as part of the Composer repository schema
  • drops unfiltered-packages as part of the repository config

Pending items that will be added via follow up PR

The new config format

Take a look at the changes to the composer-schema.json to see all possible values.

{
    "config": {
        "policy": {
            "advisories": {
                "block": true,
                "audit": "fail",
                "ignore": {
                    "vendor/package": "all advisories for this package ignored"
                },
                "ignore-id": {
                    "CVE-2024-1234": "not reachable in our app",
                    "GHSA-xxxx-yyyy": {"on-block": false, "reason": "mitigated by WAF"}
                },
                "ignore-severity": {
                    "low": "we accept low-severity risk"
                }
            },
            "malware": {
                "block": true,
                "block-scope": "all",
                "audit": "fail",
                "ignore": {
                    "vendor/false-positive": "verified safe, flagged by mistake"
                },
                "ignore-source": ["untrusted-repo-name"]
            },
            "abandoned": {
                "block": false,
                "audit": "fail",
                "ignore": {
                    "vendor/old-pkg": "replacement not ready yet",
                    "vendor/legacy-*": {"on-audit": false, "reason": "allow install but keep reporting"},
                    "vendor/pinned": {"constraint": "^2.0", "reason": "only v2 still in use"}
                }
            },
            "company-policy": {
                "sources": [
                    {"type": "url", "url": "https://example.com/policy-filter.json"},
                    {"type": "url", "url": "https://security-team.example.com/extra-rules.json"}
                ],
                "block": true,
                "audit": "fail",
                "ignore": {
                    "vendor/internal-fork": "maintained internally"
                }
            },
            "ignore-unreachable": ["install", "update"]
        }
    }
}

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

API Surface Changes

If any of the additions below are not intended as public API, mark them with @internal in the docblock.

Modified API Surface

Properties

  • Composer\Config::defaultConfig
    @@ -7,3 +7,3 @@
         'audit' => ['ignore' => [], 'abandoned' => Auditor::ABANDONED_FAIL],
    -    'filter' => true,
    +    'policy' => true,
         'notify-on-install' => true,

@glaubinix glaubinix force-pushed the push-ymskopooqxzt branch 4 times, most recently from e502860 to d0dae2c Compare April 29, 2026 10:24
Comment thread doc/06-config.md
Comment thread doc/06-config.md
Comment thread doc/06-config.md Outdated
Comment thread doc/06-config.md Outdated
Comment thread src/Composer/Command/CreateProjectCommand.php Outdated
Comment thread src/Composer/Config.php
@glaubinix glaubinix force-pushed the push-ymskopooqxzt branch from 2ceac19 to 0ea02d0 Compare May 4, 2026 09:47
Comment thread src/Composer/Policy/PolicyConfig.php
@Seldaek Seldaek merged commit e8ff2da into composer:main May 6, 2026
21 of 22 checks passed
@Seldaek
Copy link
Copy Markdown
Member

Seldaek commented May 6, 2026

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants