elastic / cloudbeat

Analyzing Cloud Security Posture
Other
37 stars 43 forks source link

Add support for namespace suffixes #2291

Closed kubasobon closed 4 days ago

kubasobon commented 1 week ago

Summary of your changes

This pull request allows Cloudbeat to publish events to non-default namespaces. For example, findings are sent to the logs-cloud_security_posture.findings-{namespace} Data Stream. Until now, the {namespace} always defaulted to default, regardless of Agent Policy. After merging this change, Cloudbeat will respect the Agent Policy and set publish events to the appropriate stream.

Screenshot/Data

CSPM using non-default namespace Screenshot 2024-06-25 at 13 26 35 Screenshot 2024-06-25 at 13 25 40
Non-default Data Streams present when running modified cloudbeat Screenshot 2024-06-25 at 13 07 23
Findings published to the new Data Stream successfully Screenshot 2024-06-25 at 13 08 39

EDIT:

Vulnerabilities published to the new Data Stream successfully Screenshot 2024-06-25 at 16 57 24

Related Issues

Closes https://github.com/elastic/cloudbeat/issues/2289

Checklist

mergify[bot] commented 1 week ago

This pull request does not have a backport label. Could you fix it @kubasobon? 🙏 To fixup this pull request, you need to add the backport labels for the needed branches, such as:

github-actions[bot] commented 1 week ago

:bar_chart: Allure Report - :green_heart: No failures were reported.

Result Count
🟥 Failed 0
🟩 Passed 359
⬜ Skipped 33
kfirpeled commented 4 days ago

It would be best to approach #fleet or find some documentation regardless beats and how send events to datastreams and reading the agent policy. I'm not familiar with the best practices