-
Notifications
You must be signed in to change notification settings - Fork 10
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
Handle ignored cves #5804
Handle ignored cves #5804
Conversation
FestiveKyle
commented
Oct 11, 2024
•
edited
Loading
edited
- Exclude ignored CVEs from AdditionalFindings (frontend only)
- Exclude ignored CVEs from CSV export
- Log action to every verified org with claim to domain
- Log as an "UPDATE" action with updated properties of "name: , "oldValue": "ignored", "newValue": "unignored"
// Log activity for super admin logging | ||
await logActivity({ | ||
transaction, | ||
collections, | ||
query, | ||
initiatedBy: { | ||
id: user._key, | ||
userName: user.userName, | ||
role: 'super_admin', | ||
}, | ||
action: 'update', | ||
target: { | ||
resource: domain.domain, | ||
resourceType: 'domain', | ||
updatedProperties: [ | ||
{ | ||
name: ignoredCve, | ||
oldValue: 'unignored', | ||
newValue: 'ignored', | ||
}, | ||
], | ||
}, | ||
}) | ||
} catch (err) { | ||
console.error( | ||
`Database error occurred when user: "${userKey}" attempted to ignore CVE "${ignoredCve}" on domain "${domainId}" during activity logs, error: ${err}`, | ||
) | ||
} |
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.
Super admins will be able to see the other logs generated. Not sure we need this.
// Log activity for super admin logging | ||
await logActivity({ | ||
transaction, | ||
collections, | ||
query, | ||
initiatedBy: { | ||
id: user._key, | ||
userName: user.userName, | ||
role: 'super_admin', | ||
}, | ||
action: 'update', | ||
target: { | ||
resource: domain.domain, | ||
resourceType: 'domain', | ||
updatedProperties: [ | ||
{ | ||
name: ignoredCve, | ||
oldValue: 'ignored', | ||
newValue: 'unignored', | ||
}, | ||
], | ||
}, | ||
}) | ||
} catch (err) { | ||
console.error( | ||
`Database error occurred when user: "${userKey}" attempted to unignore CVE "${ignoredCve}" on domain "${domainId}" during activity logs, error: ${err}`, | ||
) | ||
} |
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.
Supers can see other logs, not sure this is needed
frontend/src/guidance/IgnoredCves.js
Outdated
</Text> | ||
) : ( | ||
<SimpleGrid columns={8}> | ||
{undetectedIgnoredCves && |
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.
empty or null array already checked for
ignoredCves: PropTypes.array.isRequired, | ||
undetectedIgnoredCves: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired, | ||
detectedIgnoredCves: PropTypes.object.isRequired, | ||
setActiveCveHandler: PropTypes.func.isRequired, |
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.
is it better to import the whole object or the individual prop types? if no performance/memory advantage this is fine
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 don't think there would be any performance loss either way. We already have these separated and the undetectedIgnoredCves
are just strings since we aren't getting the vuln level from the api.