Skip to content

[Cloud Security] [Findings Ingest Pipeline] Remove cloud.account.id and cloud.account.name empty fields from the latest findings document - #9470

Merged
opauloh merged 6 commits into
mainfrom
csp/handle-empty-cloud-account-fields
Apr 8, 2024
Merged

[Cloud Security] [Findings Ingest Pipeline] Remove cloud.account.id and cloud.account.name empty fields from the latest findings document#9470
opauloh merged 6 commits into
mainfrom
csp/handle-empty-cloud-account-fields

Conversation

@opauloh

@opauloh opauloh commented Mar 29, 2024

Copy link
Copy Markdown
Contributor

Summary

It fixes elastic/kibana#178904

This PR updates the Findings Ingest Pipeline to remove empty cloud.account.id and cloud.account.name fields in a Findings document. This fixes issues in Kibana when those fields are empty.

This PR also introduces Ingest Pipelines tests and adds tests to cover pipeline processors in a findings document. It can be tested following the documentation here

Screenshot

Pipeline Tests

image

Kibana Tests

Before changes:

Fields with empty cloud.account.name
image

Bug in group by cloud account visualization, result is hidden due to empty field #178904

image

After changes:

No more fields with empty cloud.account.name
image

Fields are instead missing (expected behaviour)
image

Group by cloud account visualization shows "No cloud account" (expected behaviour)
image

@opauloh opauloh changed the title Remove empty fields from the findings document Mar 29, 2024
@opauloh opauloh added the Team:Cloud Security Cloud Security team [elastic/cloud-security-posture] label Mar 29, 2024
@opauloh opauloh changed the title [Cloud Security] [Findings Ingest Pipeline] Remove all empty fields from the document Apr 4, 2024
@elasticmachine

Copy link
Copy Markdown

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@opauloh
opauloh marked this pull request as ready for review April 5, 2024 00:47
@opauloh
opauloh requested a review from a team as a code owner April 5, 2024 00:47
Comment thread packages/cloud_security_posture/changelog.yml Outdated

@seanrathier seanrathier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Look good to me! Just a nit in the change log.

description: 'Backward compatibility cloudbeat version < 8.8'
ignore_empty_value: true
if: ctx.orchestrator?.cluster?.id == null
- remove:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:aha moment
So the integration for cloud security posture handles the transformation of data collected from cloudbeat to the latest findings index.

:knowledge question
Is this rule in the ingestion pipeline removing the field from the document before it ends up the in the findings?
I am assuming this because the expected test results shows an empty object for the account

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So the integration for cloud security posture handles the transformation of data collected from cloudbeat to the latest findings index.

:knowledge question
Is this rule in the ingestion pipeline removing the field from the document before it ends up the in the findings?
I am assuming this because the expected test results shows an empty object for the account

Yes, and It's directly on the data stream index logs-cloud_security_posture.findings-* actually, (so it's before the transform runs to that aggregates the data into the logs-cloud_security_posture.findings_latest-* index.

The Ingest pipeline runs at the moment the data going to be inserted into the findings index

image

And how it's knows that it needs to run this pipeline for that index is defined with Index Templates, it's where the findings mappings are defined as well the default pipeline:

image image
@Omolola-Akinleye
Omolola-Akinleye self-requested a review April 5, 2024 17:31
Co-authored-by: seanrathier <sean.rathier@gmail.com>
@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

@elastic-sonarqube

Copy link
Copy Markdown
@opauloh
opauloh merged commit 77955fe into main Apr 8, 2024
@elasticmachine

Copy link
Copy Markdown

Package cloud_security_posture - 1.9.0-preview03 containing this change is available at https://epr.elastic.co/search?package=cloud_security_posture

@elasticmachine

Copy link
Copy Markdown

Package cloud_security_posture - 1.9.0 containing this change is available at https://epr.elastic.co/search?package=cloud_security_posture

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration:cloud_security_posture Security Posture Management Team:Cloud Security Cloud Security team [elastic/cloud-security-posture]

5 participants