Skip to content

[wiz] Add Filters to Retrieve all Types of Vulnerabilities - #14664

Merged
efd6 merged 6 commits into
elastic:mainfrom
mohitjha-elastic:wiz-3.7.0
Aug 6, 2025
Merged

[wiz] Add Filters to Retrieve all Types of Vulnerabilities#14664
efd6 merged 6 commits into
elastic:mainfrom
mohitjha-elastic:wiz-3.7.0

Conversation

@mohitjha-elastic

@mohitjha-elastic mohitjha-elastic commented Jul 23, 2025

Copy link
Copy Markdown
Contributor

Proposed commit message

wiz: add filters to retrieve all types of vulnerabilities in the vulnerability dataset

This change introduces filters to the vulnerability dataset, allowing
retrieval of all types of vulnerabilities. It enhances the dataset's
flexibility by ensuring comprehensive coverage across different
vulnerability categories.

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

How to test this PR locally

  • Clone integrations repo.
  • Install elastic package locally.
  • Start elastic stack using elastic-package.
  • Move to integrations/packages/wiz directory.
  • Run the following command to run tests.

elastic-package test -v

Related Issue

@mohitjha-elastic mohitjha-elastic self-assigned this Jul 23, 2025
@mohitjha-elastic
mohitjha-elastic requested a review from a team as a code owner July 23, 2025 07:24
@mohitjha-elastic mohitjha-elastic added enhancement New feature or request Integration:wiz Wiz Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Jul 23, 2025
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

"first": state.batch_size,
"after": state.?end_cursor.value.orValue(null),
"filterBy": {
"status": ["RESOLVED", "OPEN", "REJECTED", "IN_PROGRESS"],

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.

I'm wondering whether we want this to be configurable?

cc @maxcold

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.

We typically fetch all types of data that could potentially be useful, allowing users to apply Kibana filters later based on their needs. However, I understand this approach might lead to unnecessary index space consumption for users who are not interested in viewing resolved vulnerabilities.

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.

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.

after talking with @nick-alayil we think the best way forward is to make it configurable with OPEN being the default to keep the existing behaviour. Thanks for flagging it @efd6 !

@efd6 efd6 Jul 28, 2025

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.

@mohitjha-elastic Please add a manifest entry to allow this to be configurable.

@maxcold What kind of configuration would you prefer? The story around this kind of option is not a happy one; we either have a set of four booleans which do not show obvious grouping in the UI, 2^4 menu options, or multi-text (which allows typo-based misconfiguration) — or YAML. None of the available options are good.

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.

My $0.02. Can we've a simple toggle to control this configuration?

Default (toggle OFF): Active vulnerabilities only

  • Sends only "OPEN" status vulnerabilities
  • Covers majority of use cases since most teams primarily care about actionable items
  • Simple, obvious, can't be misconfigured

Toggle ON: All vulnerability statuses

  • Includes RESOLVED, OPEN, REJECTED, IN_PROGRESS
  • For users who want comprehensive data for reporting/analytics
  • Still just one boolean setting. Impossible to mess up

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.

That would work for me.

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.

Thanks! Added a toggle option to control this configuration-

image
@mohitjha-elastic
mohitjha-elastic requested a review from efd6 July 30, 2025 09:11
state.?include_all_vulnerability.orValue(false) ?
["RESOLVED", "OPEN", "REJECTED", "IN_PROGRESS"]
:
["OPEN"]

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.

btw I didn't find any docs in the Wiz partner portal that says that by default it queries only OPEN vulnerabilities. What concerns me is that we are changing the behaviour, as the query didn't have any status filter before, and we assumed that by default it filtered in only OPEN vulnerabilities. Do we know that for sure?

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.

@efd6 efd6 Jul 31, 2025

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.

I agree. This should not set the parameter in the case that the option is not selected.

I would suggest instead of using a boolean here, use

{{#if include_all_vulnerability}}
  want_status:
    - RESOLVED
    - OPEN
    - REJECTED
    - IN_PROGRESS
{{/if}}

in the state definition. And then here

?"status": state.?want_status,

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.

Thanks @efd6 @maxcold
The suggestions have been implemented.

@maxcold maxcold 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.

the logic in general looks good, but I'm not very good with CEL to check the exact implementation

@efd6 efd6 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.

Nit only. Othewise LGTM (waiting for opinion).

title: Include All Vulnerability Statuses
description: >-
Enable this toggle to fetch all types of vulnerabilities, including those with statuses RESOLVED, OPEN, REJECTED, and IN_PROGRESS.
By default, only active vulnerabilities with the OPEN status are retrieved.

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.

I would leave this as "By default, the API's default filter is used." This protects us from future changes in API behaviour.

/cc @maxcold for opinion.

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.

I agree with the suggestion, as the documentation does not explicitly mention that only open vulnerabilities are fetched by default.

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.

yes, let's not make guesses and have it as By default, the API's default filter is used. , thanks for checking!

@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @mohitjha-elastic

@efd6 efd6 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.

Will wait for @maxcold or @nick-alayil to comment on the documentation before merge.

@efd6
efd6 merged commit f0e9453 into elastic:main Aug 6, 2025
9 checks passed
@elastic-vault-github-plugin-prod

Copy link
Copy Markdown
Contributor

Package wiz - 3.7.0 containing this change is available at https://epr.elastic.co/package/wiz/3.7.0/

robester0403 pushed a commit to robester0403/integrations that referenced this pull request Aug 14, 2025
…4664)

This change introduces filters to the vulnerability dataset, allowing
retrieval of all types of vulnerabilities. It enhances the dataset's
flexibility by ensuring comprehensive coverage across different
vulnerability categories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Integration:wiz Wiz Team:SDE-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

5 participants