Skip to content

Conversation

@hasnatbashir
Copy link
Contributor

@hasnatbashir hasnatbashir commented Aug 29, 2025

TODO: Update grype reference once merged

Fixes #644


func (o CveItem) GetCWEIDs() []string {
var cwes []string
var cwePattern = regexp.MustCompile(`^CWE-\d+$`)
Copy link
Contributor

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

@willmurphyscode willmurphyscode self-assigned this Oct 1, 2025
@willmurphyscode willmurphyscode changed the base branch from main to temp-pr-660 October 3, 2025 18:39
Copy link
Contributor

@willmurphyscode willmurphyscode left a 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.

@willmurphyscode willmurphyscode marked this pull request as ready for review October 4, 2025 10:28
@willmurphyscode willmurphyscode merged commit 54a243e into anchore:temp-pr-660 Oct 4, 2025
1 check passed
willmurphyscode pushed a commit that referenced this pull request Oct 6, 2025
* 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]>
willmurphyscode added a commit that referenced this pull request Oct 6, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants