Skip to content
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

[Cloud Security] implement cloud_security_finding data stream for Wiz #10790

Merged

Conversation

maxcold
Copy link
Contributor

@maxcold maxcold commented Aug 14, 2024

Proposed commit message

Implements a new data stream for Wiz, with Cloud Configuration Finding data.

Fixes:

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.

Author's Checklist

  • update Readme
  • figure out rule.evidence (not mapped in native)
  • do we need preview version?
  • decide if we need dashboard
  • [ ]

How to test this PR locally

Running tests captured in the docs https://www.elastic.co/guide/en/integrations-developer/current/testing-and-validation.html

To test locally:

  1. checkout the branch of this PR
  2. build the Wiz package with elastic-package build
  3. Run the stack with elastic-package stack up -d -v
  4. Access Kibana on https://localhost:5601/ and install version of Wiz defined in the PR. Enable the new Cloud Configuration Finding data stream. For the Wiz credentials reach out to @maxcold

Related issues

Screenshots

@maxcold maxcold added the enhancement New feature or request label Aug 19, 2024
@elasticmachine
Copy link

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@maxcold maxcold marked this pull request as ready for review August 19, 2024 15:53
@maxcold maxcold requested a review from a team as a code owner August 19, 2024 15:53
@kcreddy
Copy link
Contributor

kcreddy commented Aug 22, 2024

@maxcold, would you be able to add a dashboard for this new datastream to improve integration quality and also add to screenshots?

The CI seems to be failing on outdated README.
I usually run: elastic-package format && elastic-package lint && elastic-package check && elastic-package build to update it.

@maxcold maxcold requested a review from kcreddy August 23, 2024 15:00
@elasticmachine
Copy link

💚 Build Succeeded

History

value: wiz.cloud_configuration_finding
- name: '@timestamp'
type: date
description: Event timestamp.
Copy link
Contributor

Choose a reason for hiding this comment

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

Most of the fields here are part of the ECS schema, I saw that also other integration mapped it manually but what is the reason for not using the ECS schema?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CohenIdo this is a good question. I indeed took it from the wiz.vulnerability data stream. @kcreddy do you happen to know why to map these fields manually? Is it only because the ecs@mappings were not there when the integration was first introduced?

Btw now when I think about it, we need to make data_stream.namespace the type keyword to support namespaces in our latest transform. Otherwise, the data from different namespaces would fail to be indexed in the latest index as per elastic/kibana#162889 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@CohenIdo the fact that we need data_stream.namespace to be just keyword brings up a question for the vulnerability data stream you work on, how to migrate from constant_keyword to just keyword as it will be a breaking change of the field mapping

Copy link
Contributor Author

Choose a reason for hiding this comment

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

actually, I think we should have constant_keyword in the original mapping but add keyword to the latest index mapping when working on the latest data stream. This way we should avoid validation error for the data_stream.namespace here on the original data stream

Copy link
Contributor

Choose a reason for hiding this comment

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

This is because the package expects these required fields to be defined, otherwise it fails in elastic-package build
https://github.com/elastic/package-spec/blob/main/code/go/internal/validator/semantic/validate_required_fields.go#L16-L25

@maxcold maxcold merged commit e453788 into elastic:main Aug 26, 2024
5 checks passed
@maxcold maxcold deleted the csp-implement-wiz-cloud-configuration-finding branch August 26, 2024 10:55
@elasticmachine
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Relates to a Kibana dashboard bug, enhancement, or modification. enhancement New feature or request Integration:wiz Wiz Team:Cloud Security Label for the Cloud Security team [elastic/cloud-security-posture] Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants