-
Notifications
You must be signed in to change notification settings - Fork 456
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
qualys_vmdr: Improve support for Cloud Detection and Response (CDR) workflow #11999
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
💚 Build Succeeded
History
cc @kcreddy |
Quality Gate failedFailed conditions |
- resource.id | ||
- event.id | ||
- data_stream.namespace |
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.
@@ -1,4 +1,9 @@ | |||
# newer versions go on top | |||
- version: "6.0.0" | |||
changes: | |||
- description: Leverage Cloud Detection and Response (CDR) workflows in asset_host_detection data-stream. |
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.
- description: Leverage Cloud Detection and Response (CDR) workflows in asset_host_detection data-stream. | |
- description: Use Cloud Detection and Response (CDR) workflows in asset_host_detection data-stream. |
?
@@ -1066,6 +1142,70 @@ processors: | |||
tag: rename_qualys_vmdr_asset_host_detection_vulnerability_RESULTS_1 | |||
target_field: qualys_vmdr.asset_host_detection.vulnerability.results | |||
ignore_missing: true | |||
# The below 2 gsub processors facilitate `splitOnToken` in subsequent script processor which otherwise cannot split \n or \t. |
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.
# The below 2 gsub processors facilitate `splitOnToken` in subsequent script processor which otherwise cannot split \n or \t. | |
# The next two gsub processors facilitate `splitOnToken` in the subsequent script processor, which otherwise cannot split \n or \t. |
Do we know that ;
and |
do not otherwise appear in the text?
return; | ||
} | ||
def level = Long.parseLong(ctx.qualys_vmdr.asset_host_detection.knowledge_base.SEVERITY_LEVEL); | ||
if (['Potential Vulnerability', 'Vulnerability', 'Vulnerability or Potential Vulnerability'].contains(vuln_type)) { |
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.
Could this array be put in a params
array to avoid allocs?
if (level == 1){ | ||
ctx.qualys_vmdr.asset_host_detection.knowledge_base.SEVERITY_LEVEL = "Minimal"; | ||
} else if (level == 2) { | ||
ctx.qualys_vmdr.asset_host_detection.knowledge_base.SEVERITY_LEVEL = "Medium"; | ||
} else if (level == 3) { | ||
ctx.qualys_vmdr.asset_host_detection.knowledge_base.SEVERITY_LEVEL = "Serious"; | ||
} else if (level == 4) { | ||
ctx.qualys_vmdr.asset_host_detection.knowledge_base.SEVERITY_LEVEL = "Critical"; | ||
} else if (level == 5) { | ||
ctx.qualys_vmdr.asset_host_detection.knowledge_base.SEVERITY_LEVEL = "Urgent"; | ||
} |
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.
These are dense with a numeric index, so the assignment could be done from a params
array after bounds checking. Same below.
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.
Add a
- append:
field: tags
value: preserve_original_event
allow_duplicates: false
to the final on_failure
.
"Authorization": ["Basic "+(state.user+":"+state.password).base64()], | ||
} | ||
}).do_request().as(resp, resp.StatusCode == 200 ? | ||
resp.Body.as(xml, try(bytes(xml).decode_xml('qualys_api_2_0_ahd'), "decode_xml_error_ahd").as(ahd_body, |
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.
Since we are now on v8.16.0 this can be
resp.Body.as(xml, try(bytes(xml).decode_xml('qualys_api_2_0_ahd'), "decode_xml_error_ahd").as(ahd_body, | |
resp.Body.as(xml, try(xml.decode_xml('qualys_api_2_0_ahd'), "decode_xml_error_ahd").as(ahd_body, |
(body.?doc.HOST_LIST_VM_DETECTION_OUTPUT.RESPONSE.HOST_LIST.HOST.hasValue() | ||
} | ||
}).do_request().as(resp, resp.StatusCode == 200 ? | ||
resp.Body.as(xml, try(bytes(xml).decode_xml('qualys_api_2_0_kb'), "decode_xml_error_kb").as(kb_body, |
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.
resp.Body.as(xml, try(bytes(xml).decode_xml('qualys_api_2_0_kb'), "decode_xml_error_kb").as(kb_body, | |
resp.Body.as(xml, try(xml.decode_xml('qualys_api_2_0_kb'), "decode_xml_error_kb").as(kb_body, |
Proposed commit message
Add Qualys VMDR's Asset data to Elastic's Cloud Native Vulnerability Management (CNVM) workflow.
Ref: #11673
Note
To Reviewers:
Please refer to this guide: https://docs.elastic.dev/security-solution/cloud-security/cdr/3p-dev-guide which was used for proposed changes.
Checklist
changelog.yml
file.How to test this PR locally
Run:
cd packages/qualys_vmdr && elastic-package build && elastic-package stack up --version=8.16.0 -d -v && eval "$(elastic-package stack shellinit)" && elastic-package test pipeline --generate -v --data-streams=asset_host_detection
Returns success:
Run:
cd packages/qualys_vmdr && elastic-package build && elastic-package stack up --version=8.16.0 -d -v && eval "$(elastic-package stack shellinit)" && elastic-package test system --generate -v --data-streams=asset_host_detection
Returns success:
Related issues
Screenshots
Source
Destination
Transform