Skip to content

Conversation

@kcreddy
Copy link
Contributor

@kcreddy kcreddy commented Jan 22, 2025

Proposed commit message

Add show_igs API parameter as a UI option. Also optionally add fingerprint processor. By default, Qualys API only includes detection records with `Confirmed` and `Potential` vulnerabilities. With show_igs option users can enable Qualys API to fetch detections of type `Info` as well. Optionally adding fingerprint processor on event.original field so that any existing vulnerabilities in the current backing index will not be duplicated. I prefixed the document _id value with the timestamp based on recommendations from the "Efficient Duplicate Prevention for Event-Based Data in Elasticsearch" blog post. References - https://qualysguard.qg2.apps.qualys.com/qwebhelp/fo_portal/api_doc/assets/index.htm#t=host_lists%2Fhost_detection.htm - https://www.elastic.co/blog/efficient-duplicate-prevention-for-event-based-data-in-elasticsearch. 

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

  1. Updated system tests with show_igs=1 should run successfully.
    Run: cd packages/qualys_vmdr && elastic-package stack down && elastic-package build && elastic-package stack up --version=8.13.0 -d -v && eval "$(elastic-package stack shellinit)" && elastic-package test system --generate -v --data-streams=asset_host_detection
    Returns:

    2025/01/22 22:22:53 DEBUG found 0 hits in logs-qualys_vmdr.asset_host_detection-71011 data stream 2025/01/22 22:22:54 DEBUG found 4 hits in logs-qualys_vmdr.asset_host_detection-71011 data stream 2025/01/22 22:22:58 DEBUG found 4 hits in logs-qualys_vmdr.asset_host_detection-71011 data stream ...... 2025/01/22 22:23:01 DEBUG assert hit count expected 4, observed 4 ...... --- Test results for package: qualys_vmdr - START --- ╭─────────────┬──────────────────────┬───────────┬───────────┬────────┬───────────────╮ │ PACKAGE │ DATA STREAM │ TEST TYPE │ TEST NAME │ RESULT │ TIME ELAPSED │ ├─────────────┼──────────────────────┼───────────┼───────────┼────────┼───────────────┤ │ qualys_vmdr │ asset_host_detection │ system │ default │ PASS │ 42.686733958s │ ╰─────────────┴──────────────────────┴───────────┴───────────┴────────┴───────────────╯ --- Test results for package: qualys_vmdr - END --- Done 
  2. Check tracer logs:
    a. Don't select Enable Information Gathered Detections UI option.
    Inside tracer logs, the request has:

    "url.query":"action=list&ids=879484319&show_igs=0&truncation_limit=1000" 

    b. Select Enable Information Gathered Detections UI option.
    Inside tracer logs, the request has:

    "url.query":"action=list&ids=879484319&show_igs=1&truncation_limit=1000" 

Screenshots

Screenshot 2025-01-23 at 12 54 28 PM
@kcreddy kcreddy marked this pull request as ready for review January 22, 2025 17:21
@kcreddy kcreddy requested a review from a team as a code owner January 22, 2025 17:21
@kcreddy kcreddy self-assigned this Jan 22, 2025
@kcreddy kcreddy added Integration:qualys_vmdr Qualys VMDR enhancement New feature or request Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] labels Jan 22, 2025
@elasticmachine
Copy link

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

produced by elastic-package

@elastic-vault-github-plugin-prod

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description: By default, Qualys API only includes detection records with `Confirmed` and `Potential` vulnerabilities. When this option is enabled, the Qualys API also sends detections of type `Info` along with `Confirmed` and `Potential` vulnerabilities.
description: By default, Qualys API only includes detection records with `Confirmed` and `Potential` vulnerabilities. When this option is enabled, the Qualys API sends detections of type `Info` in addition to `Confirmed` and `Potential` vulnerabilities.
Copy link
Contributor Author

@kcreddy kcreddy Jan 23, 2025

Choose a reason for hiding this comment

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

Updated as suggested in 1f0ea18

Copy link
Member

Choose a reason for hiding this comment

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

Deduplication paired with full syncs each period could make it more difficult to validate all assets and vulnerabilities were collected. Currently the validation process involves reviewing data written during the last sync window. If deduplication is implemented then you need to consider all data in the current backing index to account for vulnerabilities that were indexed during an earlier sync.

Users need to know that deduplication is enabled because it impacts how you should query the data for certain uses. My recommendation is to make deduplication an opt-in feature with an explanation of how it impacts ingestion. Specifically, each sync interval will ingest all detected vulnerabilities. However, if deduplication is enabled, any existing vulnerabilities in the current backing index will not be duplicated. The presence of a vulnerability in the backing index is determined by computing a checksum of the event contents and checking if that checksum already exists in Elasticsearch.

Copy link
Contributor Author

@kcreddy kcreddy Jan 23, 2025

Choose a reason for hiding this comment

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

That makes sense.
I added UI option to select Enable Data Deduplication (default: false) in 1f0ea18

Described the option in manifest.yml as suggested. Updated PR description.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-01-23 at 12 54 28 PM
@kcreddy kcreddy requested a review from andrewkroh January 23, 2025 07:22
@kcreddy kcreddy changed the title qualys_vmdr: Add "show_igs" UI option and fingerprint processor qualys_vmdr: Add "show_igs" and fingerprint processor UI options Jan 23, 2025
Copy link
Member

Choose a reason for hiding this comment

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

Why make this into a string rather than retain the boolean type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not intentional. Updated in 6c46311

@kcreddy kcreddy requested a review from andrewkroh January 24, 2025 05:16
@elasticmachine
Copy link

💚 Build Succeeded

History

  • 💚 Build #20834 succeeded 1f0ea18da4595c102a5079dc06b9c19c353c60ce
  • 💚 Build #20812 succeeded 856c230d2b3730ff67c309135993970870252a90

cc @kcreddy

@kcreddy kcreddy merged this pull request into elastic:main Jan 28, 2025
5 checks passed
@elastic-vault-github-plugin-prod

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

harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
…stic#12428) Add show_igs API parameter as a UI option. Also optionally add fingerprint processor. By default, Qualys API only includes detection records with `Confirmed` and `Potential` vulnerabilities. With show_igs option users can enable Qualys API to fetch detections of type `Info` as well. Optionally adding fingerprint processor on event.original field so that any existing vulnerabilities in the current backing index will not be duplicated. I prefixed the document _id value with the timestamp based on recommendations from the "Efficient Duplicate Prevention for Event-Based Data in Elasticsearch" blog post. References - https://qualysguard.qg2.apps.qualys.com/qwebhelp/fo_portal/api_doc/assets/index.htm#t=host_lists%2Fhost_detection.htm - https://www.elastic.co/blog/efficient-duplicate-prevention-for-event-based-data-in-elasticsearch.
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
…stic#12428) Add show_igs API parameter as a UI option. Also optionally add fingerprint processor. By default, Qualys API only includes detection records with `Confirmed` and `Potential` vulnerabilities. With show_igs option users can enable Qualys API to fetch detections of type `Info` as well. Optionally adding fingerprint processor on event.original field so that any existing vulnerabilities in the current backing index will not be duplicated. I prefixed the document _id value with the timestamp based on recommendations from the "Efficient Duplicate Prevention for Event-Based Data in Elasticsearch" blog post. References - https://qualysguard.qg2.apps.qualys.com/qwebhelp/fo_portal/api_doc/assets/index.htm#t=host_lists%2Fhost_detection.htm - https://www.elastic.co/blog/efficient-duplicate-prevention-for-event-based-data-in-elasticsearch.
@kcreddy kcreddy deleted the qualys-quality-impr branch February 7, 2025 09:31
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:qualys_vmdr Qualys VMDR Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations]

3 participants