Repository navigation
feat(audit): leave the advisories out of deps-audit with NO_ADVISORIES=1 - #374
Merged
Merged
Conversation
Signed-off-by: ernolf <raphael.gradenwitz@googlemail.com>
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.
Closes #373
A run whose output is public can now take the abandoned packages and the licences from
deps-auditwithout showing a vulnerability. Make handsNO_ADVISORIES=1to both halves asDEPS_AUDIT_NO_ADVISORIES.--no-advisoriesinARGScounts the same, so the composer half also leaves the advisories out when only the analyser option is given. Inlib/deps-audit.phpthe output ofcomposer auditkeeps onlyabandoned.why-notandshowdo not run, and bit 1 of the exit code is cleared, sobuild/deps-audit/composer.jsonholds nothing about an advisory. The analyser ignores advisories in acomposer.jsonthat an earlier run left there, and it does not run the npm audit.The
[ok]findingdeps-auditwould mark every app without a vulnerable package, so in this mode it is replaced byadvisories-unchecked, which is the same for every app. A composer audit that does not answer still givesaudit-unavailable, now worded for the abandoned packages. The summary line of the report and its closing text say that the advisories were not checked. The help, themake helpline and the skill describe the option.Tested on a fixture with a
composer.lock, abuild/deps-audit/composer.jsonholding one advisory and one abandoned package, and apackage-lock.json. With--no-advisoriesand withDEPS_AUDIT_NO_ADVISORIES=1, the report and the JSON name no advisory, CVE or vulnerable package. The fixture still giveslicence-incompatible,abandoned-dependency,licence-summaryandadvisories-unchecked, and the JSON has"advisories": false. Without the option the same fixture reportsvulnerable-dependencyas before.lib/deps-audit.phpwas run on PHP 8.4 against a composer stub that reports an advisory and an abandoned package. WithDEPS_AUDIT_NO_ADVISORIES=1its output holds onlyabandoned, exit code 2 and no fixes. Without it, the output is unchanged.