Skip to content
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

fix: Scan job fails even though CVE is on ignore list #42

Merged
merged 1 commit into from
Oct 31, 2023
Merged

fix: Scan job fails even though CVE is on ignore list #42

merged 1 commit into from
Oct 31, 2023

Conversation

taro-kayo
Copy link
Contributor

fix: #23

When you ignore vulnerabilities in multiple severities, even though you ignore all vulnerabilities, scan job still fails.

@@ -247,12 +267,11 @@ const main = async () => {
console.log('=================')
console.log(`${total.toString().padStart(3, ' ')} Total ${getCount('total', ignoredCounts)}`)

const numFailingVulns =
failThreshold === 'informational' ? total - ignoredCounts.informational
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to deal with indeterminate.
indeterminate is included in the numFailingVulns only when failThreshold equals informational because total includes indeterminate.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen any indeterminate vulnerabilities, they might exist only in concept. Let's go with your approach for now -- we can revise the code later if there are issues.

failThreshold === 'informational' ? total - ignoredCounts.informational
: failThreshold === 'low' ? critical + high + medium + low - ignoredCounts.low
: failThreshold === 'medium' ? critical + high + medium - ignoredCounts.medium
: failThreshold === 'high' ? critical + high - ignoredCounts.high
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also subtract ignoredCounts.critical.

@taro-kayo taro-kayo marked this pull request as ready for review October 28, 2023 04:42
Copy link
Owner

@alexjurkiewicz alexjurkiewicz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested this, and I don't use this action currently, but it looks reasonable so I'm happy to merge and 🙏

Thanks for your contribution! <3

@@ -247,12 +267,11 @@ const main = async () => {
console.log('=================')
console.log(`${total.toString().padStart(3, ' ')} Total ${getCount('total', ignoredCounts)}`)

const numFailingVulns =
failThreshold === 'informational' ? total - ignoredCounts.informational
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen any indeterminate vulnerabilities, they might exist only in concept. Let's go with your approach for now -- we can revise the code later if there are issues.

@alexjurkiewicz alexjurkiewicz merged commit ac357ae into alexjurkiewicz:master Oct 31, 2023
@taro-kayo
Copy link
Contributor Author

@alexjurkiewicz
Thanks for merging.
I tested ac357ae, it worked as expected. 🎉
Can you please create a new tag that includes this change? 🙏

@alexjurkiewicz
Copy link
Owner

Tagged v2.0.1

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.

Scan job fails even though CVE is on ignore list
2 participants