-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC: Add Audit Policies Support #637
Conversation
{ | ||
"name": "Vulnerable", | ||
"type": "error", | ||
"query": ":vulnerable" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the query specifies which packages are selected, but what defines how the results are presented?
Vulnerability output is perhaps a special case, but is the output just "error, nonzero packages showed up in the query!"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question - I believe the idea would be to use something like the above but I can put some potential examples of output in the RFC itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that it won't be nearly as useful if all i can do is control the exit code with a query that produces nonzero results. I suspect people will want to provide their own package that can be a function that receives the query results as an argument, and can do whatever it likes, as long as it returns an exit code, or something.
Hello! Where does the JSON go? If it's in a policies file, it feels like I could use it for npm-audit-resolver to specify what to ignore too. Do at me ;) |
@naugtur the original idea was to have these policies live in |
I think putting them in |
Yeah, I remember we iterated through all the options of "where to put audit specific information of which we'll need plenty" in the audit-resolver RFC reaching the conclusion that there's no existing file that would accommodate if well. Also, if these are running before a package is installed to help make a decision, I have a bunch of use-cases for them and there's very little requirements to put in this RFC that'd enable those use-cases. At least it seems so from my initial reading of the PR here. |
IMO adding more files is not good. We already have too many files, adding more will only decrease visibility / add the burden of additional knowledge. |
@bnb "too many files" is a subjective opinion - separate files allow you to have granular CODEOWNERS, as well, beyond being data that doesn't belong in a published package. The burden exists regardless because you still have to google for how to configure the package.json field. |
noting a combination of suggestions from the office hours: if there were a top-level package.json property like |
i'd be totally fine with a field that optionally points to a file so that the config is discoverable AND the contents don't have to live in package.json :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accepted/0000-npm-audit-policies.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accepted/0000-npm-audit-policies.md
Rendered RFC