-
Notifications
You must be signed in to change notification settings - Fork 27
add cwe ids from nvd weaknesses data #660
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
add cwe ids from nvd weaknesses data #660
Conversation
Signed-off-by: Hasnat Bashir <[email protected]>
Signed-off-by: Hasnat Bashir <[email protected]>
Signed-off-by: Hasnat Bashir <[email protected]>
Signed-off-by: Hasnat Bashir <[email protected]>
Signed-off-by: Hasnat Bashir <[email protected]>
pkg/provider/unmarshal/nvd/cve.go
Outdated
|
|
||
| func (o CveItem) GetCWEIDs() []string { | ||
| var cwes []string | ||
| var cwePattern = regexp.MustCompile(`^CWE-\d+$`) |
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 would only cause the program to crash if we are using user-provided input when generating the regex, since this is hardcoded it's safe to use MustCompile as a crash implies a programming error
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.
Approving for move into temp branch for quick fixup.
* add cwe ids from nvd weaknesses data Signed-off-by: Hasnat Bashir <[email protected]> * replaced MustCompile as it can cause program to crash Signed-off-by: Hasnat Bashir <[email protected]> * added cwe handle and updated nvd transformer to include cwe information Signed-off-by: Hasnat Bashir <[email protected]> * Update entry.go Signed-off-by: Hasnat Bashir <[email protected]> --------- Signed-off-by: Hasnat Bashir <[email protected]> Signed-off-by: Hasnat Bashir <[email protected]> Signed-off-by: Will Murphy <[email protected]>
* add cwe ids from nvd weaknesses data (#660) * add cwe ids from nvd weaknesses data Signed-off-by: Hasnat Bashir <[email protected]> * replaced MustCompile as it can cause program to crash Signed-off-by: Hasnat Bashir <[email protected]> * added cwe handle and updated nvd transformer to include cwe information Signed-off-by: Hasnat Bashir <[email protected]> * Update entry.go Signed-off-by: Hasnat Bashir <[email protected]> --------- Signed-off-by: Hasnat Bashir <[email protected]> Signed-off-by: Hasnat Bashir <[email protected]> Signed-off-by: Will Murphy <[email protected]> * only skip no-info and blank CWEs Signed-off-by: Will Murphy <[email protected]> * finish rename and lints Signed-off-by: Will Murphy <[email protected]> * refactor writer function to break it down Signed-off-by: Will Murphy <[email protected]> * pull in grype@main Signed-off-by: Will Murphy <[email protected]> * restore CWE validation Signed-off-by: Will Murphy <[email protected]> --------- Signed-off-by: Hasnat Bashir <[email protected]> Signed-off-by: Hasnat Bashir <[email protected]> Signed-off-by: Will Murphy <[email protected]> Co-authored-by: Hasnat Bashir <[email protected]>
TODO: Update grype reference once merged
Fixes #644