Skip to content

Commit 93ea23e

Browse files
rapid7_insightvm: avoid logging failure for empty HTTPJSON template value evaluation (#14746)
Template execution failures are expected when the template result is empty in pagination and cursor cases. So, avoid logging these as failures to prevent updating the health status to degraded. The changes been applied to the asset and vulnerability data streams.
1 parent 279466b commit 93ea23e

File tree

7 files changed

+52
-43
lines changed

7 files changed

+52
-43
lines changed

packages/rapid7_insightvm/changelog.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# newer versions go on top
2+
- version: "2.2.0"
3+
changes:
4+
- description: Avoid updating fleet health status to degraded when HTTPJSON template value evaluation is empty.
5+
type: enhancement
6+
link: https://github.com/elastic/integrations/pull/14746
27
- version: "2.1.0"
38
changes:
49
- description: Use `terminate` processor instead of `fail` processor to handle agent errors.

packages/rapid7_insightvm/data_stream/asset/agent/stream/httpjson.yml.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ response.pagination:
3636
target: url.params.comparisonTime
3737
value: '[[.last_response.url.params.Get "comparisonTime"]]'
3838
fail_on_template_error: true
39+
do_not_log_failure: true
3940
- set:
4041
target: url.params.cursor
4142
value: '[[if index .last_response.body.metadata "cursor"]][[.last_response.body.metadata.cursor]][[end]]'
4243
fail_on_template_error: true
44+
do_not_log_failure: true
4345
response.split:
4446
target: body.data
4547
ignore_empty_value: true

packages/rapid7_insightvm/data_stream/asset/sample_event.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
{
2-
"@timestamp": "2025-05-30T11:10:37.869Z",
2+
"@timestamp": "2025-07-30T12:27:26.931Z",
33
"agent": {
4-
"ephemeral_id": "6545769f-e426-4e1c-9549-44bd7f788ee4",
5-
"id": "afb159d9-5bc3-429a-b8a7-3cda969112a5",
6-
"name": "elastic-agent-88629",
4+
"ephemeral_id": "08d06867-8f75-4d09-a992-ee92a24ee1a3",
5+
"id": "0f0ccca8-57b9-43f3-9186-3c016c331f87",
6+
"name": "elastic-agent-58717",
77
"type": "filebeat",
8-
"version": "8.18.0"
8+
"version": "8.19.0"
99
},
1010
"data_stream": {
1111
"dataset": "rapid7_insightvm.asset",
12-
"namespace": "81787",
12+
"namespace": "17989",
1313
"type": "logs"
1414
},
1515
"ecs": {
1616
"version": "8.11.0"
1717
},
1818
"elastic_agent": {
19-
"id": "afb159d9-5bc3-429a-b8a7-3cda969112a5",
20-
"snapshot": false,
21-
"version": "8.18.0"
19+
"id": "0f0ccca8-57b9-43f3-9186-3c016c331f87",
20+
"snapshot": true,
21+
"version": "8.19.0"
2222
},
2323
"event": {
2424
"agent_id_status": "verified",
2525
"category": [
2626
"host"
2727
],
28-
"created": "2025-05-30T11:10:37.869Z",
28+
"created": "2025-07-30T12:27:26.931Z",
2929
"dataset": "rapid7_insightvm.asset",
30-
"ingested": "2025-05-30T11:10:40Z",
30+
"ingested": "2025-07-30T12:27:29Z",
3131
"kind": "state",
3232
"original": "{\"assessed_for_policies\":false,\"assessed_for_vulnerabilities\":true,\"critical_vulnerabilities\":0,\"exploits\":0,\"id\":\"452534235-25a7-40a3-9321-28ce0b5cc90e-default-asset-199\",\"ip\":\"10.1.0.128\",\"last_assessed_for_vulnerabilities\":\"2020-03-20T19:19:42.611Z\",\"last_scan_end\":\"2020-03-20T19:19:42.611Z\",\"last_scan_start\":\"2020-03-20T19:18:13.611Z\",\"malware_kits\":0,\"moderate_vulnerabilities\":2,\"new\":[],\"os_architecture\":\"x86_64\",\"os_description\":\"CentOS Linux 2.6.18\",\"os_family\":\"Linux\",\"os_name\":\"Linux\",\"os_system_name\":\"CentOS Linux\",\"os_type\":\"General\",\"os_vendor\":\"CentOS\",\"os_version\":\"2.6.18\",\"remediated\":[],\"risk_score\":0,\"severe_vulnerabilities\":0,\"tags\":[{\"name\":\"lab\",\"type\":\"SITE\"}],\"total_vulnerabilities\":2}",
3333
"type": [

packages/rapid7_insightvm/data_stream/vulnerability/agent/stream/httpjson.yml.hbs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ response.pagination:
3434
target: url.params.cursor
3535
value: '[[if index .last_response.body.metadata "cursor"]][[.last_response.body.metadata.cursor]][[end]]'
3636
fail_on_template_error: true
37+
do_not_log_failure: true
3738
response.split:
3839
target: body.data
3940
ignore_empty_value: true
4041
cursor:
4142
last_update_time:
4243
value: '[[.last_event.modified]]'
44+
ignore_empty_value: true
4345
tags:
4446
{{#if preserve_original_event}}
4547
- preserve_original_event

packages/rapid7_insightvm/data_stream/vulnerability/sample_event.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
{
22
"@timestamp": "2018-06-08T00:00:00.000Z",
33
"agent": {
4-
"ephemeral_id": "dbee2821-362a-4d7a-9e8e-0fcd816d4696",
5-
"id": "6a264171-bdc2-47a0-a131-9a515aa1c01f",
6-
"name": "elastic-agent-42291",
4+
"ephemeral_id": "488e5224-2624-4d2d-8117-39d02f6fe12d",
5+
"id": "d5820362-a217-44f6-aab2-d444704e9be3",
6+
"name": "elastic-agent-58088",
77
"type": "filebeat",
8-
"version": "8.18.0"
8+
"version": "8.19.0"
99
},
1010
"data_stream": {
1111
"dataset": "rapid7_insightvm.vulnerability",
12-
"namespace": "75615",
12+
"namespace": "55539",
1313
"type": "logs"
1414
},
1515
"ecs": {
1616
"version": "8.11.0"
1717
},
1818
"elastic_agent": {
19-
"id": "6a264171-bdc2-47a0-a131-9a515aa1c01f",
20-
"snapshot": false,
21-
"version": "8.18.0"
19+
"id": "d5820362-a217-44f6-aab2-d444704e9be3",
20+
"snapshot": true,
21+
"version": "8.19.0"
2222
},
2323
"event": {
2424
"agent_id_status": "verified",
2525
"category": [
2626
"vulnerability"
2727
],
28-
"created": "2025-05-30T11:12:58.134Z",
28+
"created": "2025-07-30T12:28:12.994Z",
2929
"dataset": "rapid7_insightvm.vulnerability",
3030
"id": "7-zip-cve-2008-6536",
31-
"ingested": "2025-05-30T11:13:00Z",
31+
"ingested": "2025-07-30T12:28:15Z",
3232
"kind": "event",
3333
"original": "{\"added\":\"2018-05-16T00:00:00Z\",\"categories\":\"7-Zip\",\"cves\":\"CVE-2008-6536\",\"cvss_v2_access_complexity\":\"low\",\"cvss_v2_access_vector\":\"network\",\"cvss_v2_authentication\":\"none\",\"cvss_v2_availability_impact\":\"complete\",\"cvss_v2_confidentiality_impact\":\"complete\",\"cvss_v2_exploit_score\":9.996799,\"cvss_v2_impact_score\":10.000845,\"cvss_v2_integrity_impact\":\"complete\",\"cvss_v2_score\":10,\"cvss_v2_vector\":\"AV:N/AC:L/Au:N/C:C/I:C/A:C\",\"cvss_v3_attack_complexity\":null,\"cvss_v3_attack_vector\":null,\"cvss_v3_availability_impact\":null,\"cvss_v3_confidentiality_impact\":null,\"cvss_v3_exploit_score\":0,\"cvss_v3_impact_score\":0,\"cvss_v3_integrity_impact\":null,\"cvss_v3_privileges_required\":null,\"cvss_v3_scope\":null,\"cvss_v3_score\":0,\"cvss_v3_user_interaction\":null,\"cvss_v3_vector\":null,\"denial_of_service\":false,\"description\":\"Unspecified vulnerability in 7-zip before 4.5.7 has unknown impact and remote attack vectors, as demonstrated by the PROTOS GENOME test suite for Archive Formats (c10).\",\"exploits\":[],\"id\":\"7-zip-cve-2008-6536\",\"links\":[{\"href\":\"http://www.securityfocus.com/bid/28285\",\"id\":\"28285\",\"rel\":\"advisory\",\"source\":\"bid\"},{\"href\":\"https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"id\":\"41247\",\"rel\":\"advisory\",\"source\":\"xf\"},{\"href\":\"http://nvd.nist.gov/vuln/detail/CVE-2008-6536\",\"id\":\"CVE-2008-6536\",\"rel\":\"advisory\",\"source\":\"cve\"},{\"href\":\"http://www.cert.fi/haavoittuvuudet/joint-advisory-archive-formats.html\",\"id\":\"http://www.cert.fi/haavoittuvuudet/joint-advisory-archive-formats.html\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.ee.oulu.fi/research/ouspg/protos/testing/c10/archive/\",\"id\":\"http://www.ee.oulu.fi/research/ouspg/protos/testing/c10/archive/\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.securityfocus.com/bid/28285\",\"id\":\"http://www.securityfocus.com/bid/28285\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.vupen.com/english/advisories/2008/0914/references\",\"id\":\"http://www.vupen.com/english/advisories/2008/0914/references\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.xerox.com/download/security/security-bulletin/16287-4d6b7b0c81f7b/cert_XRX13-003_v1.0.pdf\",\"id\":\"http://www.xerox.com/download/security/security-bulletin/16287-4d6b7b0c81f7b/cert_XRX13-003_v1.0.pdf\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"id\":\"https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"rel\":\"advisory\",\"source\":\"url\"}],\"malware_kits\":[],\"modified\":\"2018-06-08T00:00:00Z\",\"pci_cvss_score\":10,\"pci_fail\":true,\"pci_severity_score\":5,\"pci_special_notes\":\"\",\"pci_status\":\"fail\",\"published\":\"2009-03-29T00:00:00Z\",\"references\":\"bid:28285,xf:41247,cve:CVE-2008-6536,url:http://www.cert.fi/haavoittuvuudet/joint-advisory-archive-formats.html,url:http://www.ee.oulu.fi/research/ouspg/protos/testing/c10/archive/,url:http://www.securityfocus.com/bid/28285,url:http://www.vupen.com/english/advisories/2008/0914/references,url:http://www.xerox.com/download/security/security-bulletin/16287-4d6b7b0c81f7b/cert_XRX13-003_v1.0.pdf,url:https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"risk_score\":885.16,\"severity\":\"critical\",\"severity_score\":10,\"title\":\"7-Zip: CVE-2008-6536: Unspecified vulnerability in 7-zip before 4.5.7\"}",
3434
"risk_score": 885.16,

packages/rapid7_insightvm/docs/README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -69,35 +69,35 @@ An example event for `asset` looks as following:
6969

7070
```json
7171
{
72-
"@timestamp": "2025-05-30T11:10:37.869Z",
72+
"@timestamp": "2025-07-30T12:27:26.931Z",
7373
"agent": {
74-
"ephemeral_id": "6545769f-e426-4e1c-9549-44bd7f788ee4",
75-
"id": "afb159d9-5bc3-429a-b8a7-3cda969112a5",
76-
"name": "elastic-agent-88629",
74+
"ephemeral_id": "08d06867-8f75-4d09-a992-ee92a24ee1a3",
75+
"id": "0f0ccca8-57b9-43f3-9186-3c016c331f87",
76+
"name": "elastic-agent-58717",
7777
"type": "filebeat",
78-
"version": "8.18.0"
78+
"version": "8.19.0"
7979
},
8080
"data_stream": {
8181
"dataset": "rapid7_insightvm.asset",
82-
"namespace": "81787",
82+
"namespace": "17989",
8383
"type": "logs"
8484
},
8585
"ecs": {
8686
"version": "8.11.0"
8787
},
8888
"elastic_agent": {
89-
"id": "afb159d9-5bc3-429a-b8a7-3cda969112a5",
90-
"snapshot": false,
91-
"version": "8.18.0"
89+
"id": "0f0ccca8-57b9-43f3-9186-3c016c331f87",
90+
"snapshot": true,
91+
"version": "8.19.0"
9292
},
9393
"event": {
9494
"agent_id_status": "verified",
9595
"category": [
9696
"host"
9797
],
98-
"created": "2025-05-30T11:10:37.869Z",
98+
"created": "2025-07-30T12:27:26.931Z",
9999
"dataset": "rapid7_insightvm.asset",
100-
"ingested": "2025-05-30T11:10:40Z",
100+
"ingested": "2025-07-30T12:27:29Z",
101101
"kind": "state",
102102
"original": "{\"assessed_for_policies\":false,\"assessed_for_vulnerabilities\":true,\"critical_vulnerabilities\":0,\"exploits\":0,\"id\":\"452534235-25a7-40a3-9321-28ce0b5cc90e-default-asset-199\",\"ip\":\"10.1.0.128\",\"last_assessed_for_vulnerabilities\":\"2020-03-20T19:19:42.611Z\",\"last_scan_end\":\"2020-03-20T19:19:42.611Z\",\"last_scan_start\":\"2020-03-20T19:18:13.611Z\",\"malware_kits\":0,\"moderate_vulnerabilities\":2,\"new\":[],\"os_architecture\":\"x86_64\",\"os_description\":\"CentOS Linux 2.6.18\",\"os_family\":\"Linux\",\"os_name\":\"Linux\",\"os_system_name\":\"CentOS Linux\",\"os_type\":\"General\",\"os_vendor\":\"CentOS\",\"os_version\":\"2.6.18\",\"remediated\":[],\"risk_score\":0,\"severe_vulnerabilities\":0,\"tags\":[{\"name\":\"lab\",\"type\":\"SITE\"}],\"total_vulnerabilities\":2}",
103103
"type": [
@@ -611,34 +611,34 @@ An example event for `vulnerability` looks as following:
611611
{
612612
"@timestamp": "2018-06-08T00:00:00.000Z",
613613
"agent": {
614-
"ephemeral_id": "dbee2821-362a-4d7a-9e8e-0fcd816d4696",
615-
"id": "6a264171-bdc2-47a0-a131-9a515aa1c01f",
616-
"name": "elastic-agent-42291",
614+
"ephemeral_id": "488e5224-2624-4d2d-8117-39d02f6fe12d",
615+
"id": "d5820362-a217-44f6-aab2-d444704e9be3",
616+
"name": "elastic-agent-58088",
617617
"type": "filebeat",
618-
"version": "8.18.0"
618+
"version": "8.19.0"
619619
},
620620
"data_stream": {
621621
"dataset": "rapid7_insightvm.vulnerability",
622-
"namespace": "75615",
622+
"namespace": "55539",
623623
"type": "logs"
624624
},
625625
"ecs": {
626626
"version": "8.11.0"
627627
},
628628
"elastic_agent": {
629-
"id": "6a264171-bdc2-47a0-a131-9a515aa1c01f",
630-
"snapshot": false,
631-
"version": "8.18.0"
629+
"id": "d5820362-a217-44f6-aab2-d444704e9be3",
630+
"snapshot": true,
631+
"version": "8.19.0"
632632
},
633633
"event": {
634634
"agent_id_status": "verified",
635635
"category": [
636636
"vulnerability"
637637
],
638-
"created": "2025-05-30T11:12:58.134Z",
638+
"created": "2025-07-30T12:28:12.994Z",
639639
"dataset": "rapid7_insightvm.vulnerability",
640640
"id": "7-zip-cve-2008-6536",
641-
"ingested": "2025-05-30T11:13:00Z",
641+
"ingested": "2025-07-30T12:28:15Z",
642642
"kind": "event",
643643
"original": "{\"added\":\"2018-05-16T00:00:00Z\",\"categories\":\"7-Zip\",\"cves\":\"CVE-2008-6536\",\"cvss_v2_access_complexity\":\"low\",\"cvss_v2_access_vector\":\"network\",\"cvss_v2_authentication\":\"none\",\"cvss_v2_availability_impact\":\"complete\",\"cvss_v2_confidentiality_impact\":\"complete\",\"cvss_v2_exploit_score\":9.996799,\"cvss_v2_impact_score\":10.000845,\"cvss_v2_integrity_impact\":\"complete\",\"cvss_v2_score\":10,\"cvss_v2_vector\":\"AV:N/AC:L/Au:N/C:C/I:C/A:C\",\"cvss_v3_attack_complexity\":null,\"cvss_v3_attack_vector\":null,\"cvss_v3_availability_impact\":null,\"cvss_v3_confidentiality_impact\":null,\"cvss_v3_exploit_score\":0,\"cvss_v3_impact_score\":0,\"cvss_v3_integrity_impact\":null,\"cvss_v3_privileges_required\":null,\"cvss_v3_scope\":null,\"cvss_v3_score\":0,\"cvss_v3_user_interaction\":null,\"cvss_v3_vector\":null,\"denial_of_service\":false,\"description\":\"Unspecified vulnerability in 7-zip before 4.5.7 has unknown impact and remote attack vectors, as demonstrated by the PROTOS GENOME test suite for Archive Formats (c10).\",\"exploits\":[],\"id\":\"7-zip-cve-2008-6536\",\"links\":[{\"href\":\"http://www.securityfocus.com/bid/28285\",\"id\":\"28285\",\"rel\":\"advisory\",\"source\":\"bid\"},{\"href\":\"https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"id\":\"41247\",\"rel\":\"advisory\",\"source\":\"xf\"},{\"href\":\"http://nvd.nist.gov/vuln/detail/CVE-2008-6536\",\"id\":\"CVE-2008-6536\",\"rel\":\"advisory\",\"source\":\"cve\"},{\"href\":\"http://www.cert.fi/haavoittuvuudet/joint-advisory-archive-formats.html\",\"id\":\"http://www.cert.fi/haavoittuvuudet/joint-advisory-archive-formats.html\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.ee.oulu.fi/research/ouspg/protos/testing/c10/archive/\",\"id\":\"http://www.ee.oulu.fi/research/ouspg/protos/testing/c10/archive/\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.securityfocus.com/bid/28285\",\"id\":\"http://www.securityfocus.com/bid/28285\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.vupen.com/english/advisories/2008/0914/references\",\"id\":\"http://www.vupen.com/english/advisories/2008/0914/references\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"http://www.xerox.com/download/security/security-bulletin/16287-4d6b7b0c81f7b/cert_XRX13-003_v1.0.pdf\",\"id\":\"http://www.xerox.com/download/security/security-bulletin/16287-4d6b7b0c81f7b/cert_XRX13-003_v1.0.pdf\",\"rel\":\"advisory\",\"source\":\"url\"},{\"href\":\"https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"id\":\"https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"rel\":\"advisory\",\"source\":\"url\"}],\"malware_kits\":[],\"modified\":\"2018-06-08T00:00:00Z\",\"pci_cvss_score\":10,\"pci_fail\":true,\"pci_severity_score\":5,\"pci_special_notes\":\"\",\"pci_status\":\"fail\",\"published\":\"2009-03-29T00:00:00Z\",\"references\":\"bid:28285,xf:41247,cve:CVE-2008-6536,url:http://www.cert.fi/haavoittuvuudet/joint-advisory-archive-formats.html,url:http://www.ee.oulu.fi/research/ouspg/protos/testing/c10/archive/,url:http://www.securityfocus.com/bid/28285,url:http://www.vupen.com/english/advisories/2008/0914/references,url:http://www.xerox.com/download/security/security-bulletin/16287-4d6b7b0c81f7b/cert_XRX13-003_v1.0.pdf,url:https://exchange.xforce.ibmcloud.com/vulnerabilities/41247\",\"risk_score\":885.16,\"severity\":\"critical\",\"severity_score\":10,\"title\":\"7-Zip: CVE-2008-6536: Unspecified vulnerability in 7-zip before 4.5.7\"}",
644644
"risk_score": 885.16,

packages/rapid7_insightvm/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
format_version: "3.4.0"
22
name: rapid7_insightvm
33
title: Rapid7 InsightVM
4-
version: "2.1.0"
4+
version: "2.2.0"
55
source:
66
license: "Elastic-2.0"
77
description: Collect logs from Rapid7 InsightVM with Elastic Agent.

0 commit comments

Comments
 (0)