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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: update readme to add allowlist formats #253
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
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.
This section is a great start. IMO, it leans a bit too much towards examples compared to definitions and reasoning when to use each allowlist option. The example section captures quite some of the examples you've described. Here's my attempt, let me know what you think:
Allowlisting
Allowlists are a mechanism to suppress an advisory warning from the audit. A team may want to suppress an advisory when:
An allowlist may contain multiple allowlist records. There are three categories of allowlist record formats:
module
allowlist record (example:axios
, suppresses all advisories directly caused byaxios
, not transitive advisories)advisory
allowlist record (example:GHSA-42xw-2xvc-qx8m
, suppresses all instances of advisory based on the GitHub advisory identifier)path
allowlist record (example:GHSA-rp65-9cf3-cjxr|react-scripts>@svgr/webpack>@svgr/plugin-svgo>svgo>css-select>nth-check
, the specific and full advisory path with wildcard support)When
audit-ci
identifies new advisories at or above the configured level, the CI pipeline will fail.Advisories can be suppressed using several approaches. Each approach is useful in unique scenarios.
First, the most granular and secure approach, using paths. If in the future the same advisory arises with a different path, the pipeline will fail.
The next best approach is suppressing the advisories using advisory IDs. This approach may be useful if your team knows that the application is not (and will not be) affected by the advisory regardless of the path. Often, the same advisory can be present in many paths. Allowlisting by advisory ID is terser than the alternative of listing all paths.
The next approach is to allowlist the modules themselves. All current and future advisories are automatically suppressed when using module allowlist records. Compared to other suppression approaches, there's an increased risk of a new advisory impacting your application due to the broad suppression. Suppressing via a module allowlist record is often less useful than using path allowlist records + wildcards, as noted in the final approach.
Finally, wildcards can be used within path allowlist records. Wildcards are useful for trusted development-only dependencies such as
react-scripts
. Unlike the module allowlist record ofreact-scripts
, the path allowlist of*|react-scripts>*
suppresses transitive dependency advisories (dependencies of dependencies).Wildcard matching works by:
An allowlist record may include any number of wildcards such as
*|react-scripts>*>*>example>*