Skip to content

Commit

Permalink
[Cloud Security] fix 'got types.Null, expected iterable type' error (#…
Browse files Browse the repository at this point in the history
…11098)

* fix 'got types.Null, expected iterable type' error

* Update packages/wiz/data_stream/audit/agent/stream/cel.yml.hbs

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>

* cr feedback: change to orValue(null)

---------

Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
  • Loading branch information
maxcold and efd6 authored Sep 13, 2024
1 parent 40666e8 commit 82311e2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions packages/wiz/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "1.9.0-preview02"
changes:
- description: Fix potential `got types.Null, expected iterable type` error.
type: bugfix
link: https://github.com/elastic/integrations/pull/11098
- version: "1.9.0-preview01"
changes:
- description: Add latest Transform to vulnerability data stream to support CDR
Expand Down
2 changes: 1 addition & 1 deletion packages/wiz/data_stream/audit/agent/stream/cel.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ program: |
}
}.encode_json()
).do_request().as(resp, resp.StatusCode == 200 ?
bytes(resp.Body).decode_json().as(body, has(body.?data.auditLogEntries.nodes) ?
bytes(resp.Body).decode_json().as(body, body.?data.auditLogEntries.nodes.orValue(null) != null ?
{
"events": body.data.auditLogEntries.nodes.map(e, {
"message": e.encode_json(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ program: |
}
}.encode_json()
).do_request().as(resp, resp.StatusCode == 200 ?
bytes(resp.Body).decode_json().as(body, has(body.?data.configurationFindings.nodes) ?
bytes(resp.Body).decode_json().as(body, body.?data.configurationFindings.nodes.orValue(null) != null ?
{
"events": body.data.configurationFindings.nodes.map(e, {
"message": e.encode_json(),
Expand Down
2 changes: 1 addition & 1 deletion packages/wiz/data_stream/issue/agent/stream/cel.yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ program: |
}
}.encode_json()
).do_request().as(resp, resp.StatusCode == 200 ?
bytes(resp.Body).decode_json().as(body, has(body.?data.issues.nodes) ?
bytes(resp.Body).decode_json().as(body, body.?data.issues.nodes.orValue(null) != null ?
{
"events": body.data.issues.nodes.map(e, {
"message": e.encode_json(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ program: |
}
}.encode_json()
).do_request().as(resp, resp.StatusCode == 200 ?
bytes(resp.Body).decode_json().as(body, has(body.?data.vulnerabilityFindings.nodes) ?
bytes(resp.Body).decode_json().as(body, body.?data.vulnerabilityFindings.nodes.orValue(null) != null ?
{
"events": body.data.vulnerabilityFindings.nodes.map(e, {
"message": e.encode_json(),
Expand Down
2 changes: 1 addition & 1 deletion packages/wiz/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 3.0.2
name: wiz
title: Wiz
version: "1.9.0-preview01"
version: "1.9.0-preview02"
description: Collect logs from Wiz with Elastic Agent.
type: integration
categories:
Expand Down

0 comments on commit 82311e2

Please sign in to comment.