-
Notifications
You must be signed in to change notification settings - Fork 57
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
Perform actions when aqua scan detects security vulnerabilities with solutions #1147
Conversation
aquaJsonMap.resources.each { it -> | ||
(it as Map).vulnerabilities.each { vul -> | ||
Map vulnerability = vul as Map | ||
if ((vulnerability?.exploit_type as String)?.equalsIgnoreCase("remote") |
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.
Use constant for "remote" and "critical"
@@ -199,13 +215,28 @@ class ScanWithAquaStage extends Stage { | |||
[ title: "Messages", value: prepareMessageToBitbucket(messages), ] | |||
]) | |||
} | |||
if (actionableVulnerabilities?.size() > 0) { |
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.
Why not add a new message per actionableVulnerabilitie like: title: "Explotable vulnerability", value: Information about the vulnerability (using prepareMessageToBitbucket)
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.
We need this specific entry to be present in the data structure as a marker: {
"title": "Blocking",
"type": "TEXT",
"value": "Yes"
}
value: "Yes" | ||
]) | ||
} else { | ||
data.put("messages", [ |
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.
Try to avoid duplicate parts. If "messages" is needed, add it and later add the information
|
||
bitbucket.createCodeInsightReport(data, context.repoName, context.gitCommit) | ||
} | ||
|
||
private createBitbucketCodeInsightReport(String messages) { | ||
String title = "Aqua Security" | ||
String details = "There was some problems with Aqua:" | ||
String details = "There were some problems with Aqua" |
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.
…solutions (#1147) Fail pipeline in case of remote critical with solution vulnerabilities.
…solutions (#1147) Fail pipeline in case of remote critical with solution vulnerabilities.
Actions performed: