Add Trivy copyleft licence scan - #41
Open
IanEdington wants to merge 1 commit into
Open
IanEdington wants to merge 1 commit into
IanEdington wants to merge 1 commit into
Conversation
Ports the licence gate from gpo/grassroots. The policy file is byte-identical so the two repos cannot drift on what is effectively a legal position; the only per-repo change is the install step, which is Composer here rather than pnpm. Trivy reads licence metadata from installed packages, not from lockfiles, so composer install has to run before the scan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the licence gate from gpo/grassroots#296 to canopy.
trivy.yamlis byte-identical to the grassroots copy. A licence policy is a legal position, so the two repos should not drift on it. The only per-repo change is the install step: Composer here, pnpm there. Trivy reads licence metadata from installed packages rather than from lockfiles, socomposer installhas to run before the scan.Read this before merging: the check will fail
Canopy's dependency tree contains GPL-2.0-or-later at the root of the product, not at the edges:
roots/wordpressroots/wordpress-no-content(WordPress core)roots/wordpress-core-installergpo/qomon-wp-plugin(first-party)The remaining 73 Composer packages are clean: MIT (46), BSD-3-Clause (26), Apache-2.0 (1). But
license.full: truealso inspects loose files, so onceweb/wpis on disk the scan will additionally pick up WordPress core's own GPL headers and every bundled third-party library, plus any Composer-managed theme or plugin.GPL-2.0-or-later sits in the policy's
restrictedlist, which is HIGH, so this gate is red on day one and cannot go green while canopy is a WordPress build. WordPress core is not removable.The policy exists because GPO offers a commercial grant alongside AGPL-3.0, and copyleft code cannot be relicensed. That premise does not hold for canopy: a WordPress site build is a derivative of GPL-2.0 core, so there is no proprietary track available to protect here no matter what this file says. This is a different claim from "the repo is already AGPL, so relax the rule" — canopy's copyleft is structural and load-bearing rather than incidental.
Three ways forward, none of which I picked unilaterally:
restrictedfor canopy only, with the reason stated in the file. The gate still catches AGPL and proprietary or non-commercial creep, which is the live risk for a WordPress deployment.scan.skip-dirsorlicense.ignoredentries for WordPress core and known GPL plugins. One policy file, but the exception hides in scan config instead of being stated, and the ignore list grows with every plugin added.Other things worth knowing
gpo/qomon-wp-pluginmay need a token.composer.jsonpulls it from a VCS repository atgithub.com/gpo/qomon-wp-plugin. I could not confirm its visibility from this session, socomposer installin Actions may needCOMPOSER_AUTHor a PAT. Grassroots already has a brokensecrets.ACTION_PAT; if the same secret is the answer here, this workflow inherits that problem.CLAUDE.mdsays no explanatory comments in config files.trivy.yamlcarries substantial comments. I kept them so the file stays byte-identical to grassroots; moving the rationale todocs/would guarantee the two copies drift. Worth a decision either way.workflow_callin agpo/.githubrepo, but the install step, the ecosystem, and now possibly the policy all differ between the two repos, so the shared portion is thin.gpo/.githubis also outside this session's repository scope.composer.jsondeclares"license": "AGPLv3", which is not valid SPDX. It should beAGPL-3.0-or-later. Same defect as grassroots' rootpackage.json. Not fixed here.UNKNOWNlicences are not gated, matching grassroots. The inventory step reports them so the exposure can be audited before deciding whether to gate.Verification
Trivy could not be installed in this session (the sandbox's network policy blocks GitHub release downloads and
get.trivy.dev), so the scan has not been run locally. The licence table above comes fromvendor/composer/installed.jsonafter a realcomposer install. CI on this PR is the first actual run.Generated by Claude Code