-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GCP] Fix check on gcp.audit.authorization_info[].granted (#7308)
* Fix check on gcp.audit.authorization_info[].granted When `gcp.audit.authorization_info[]` objects do not contain the `granted` attribute, the `if` statement fails. The updated `if` checks for null values and uses the `granted == true` syntax to avoid another error when there the `==` operator is not used: ``` Cannot invoke "Object.getClass()" because "value" is null ``` * Use `override` to avoid using a script expression * Add changelog
- Loading branch information
Showing
5 changed files
with
60 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/gcp/data_stream/audit/_dev/test/pipeline/test-sdh-3695.log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"insertId":"-abcdef","logName":"organizations/123456789098/logs/cloudaudit.googleapis.com%2Fdata_access","protoPayload":{"@type":"type.googleapis.com/google.cloud.audit.AuditLog","authenticationInfo":{"principalEmail":"joel.miller@contoso.com"},"authorizationInfo":[{"resourceAttributes":{}}],"methodName":"CloudResourceManagerOrganizationsV3Service-SearchOrganizations","request":{"@type":"type.googleapis.com/google.cloud.resourcemanager.v3.SearchOrganizationsRequest","pageSize":100},"requestMetadata":{"callerIp":"private","destinationAttributes":{},"requestAttributes":{}},"resourceName":"organizations/123456789098","serviceName":"cloudresourcemanager.googleapis.com","status":{}},"receiveTimestamp":"2023-08-02T11:20:31.13521906Z","resource":{"labels":{"organization_id":"123456789098"},"type":"organization"},"severity":"INFO","timestamp":"2023-08-02T11:20:30.734968Z"} |
50 changes: 50 additions & 0 deletions
50
packages/gcp/data_stream/audit/_dev/test/pipeline/test-sdh-3695.log-expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"expected": [ | ||
{ | ||
"@timestamp": "2023-08-02T11:20:30.734Z", | ||
"client": { | ||
"user": { | ||
"email": "joel.miller@contoso.com" | ||
} | ||
}, | ||
"cloud": { | ||
"provider": "gcp" | ||
}, | ||
"ecs": { | ||
"version": "8.8.0" | ||
}, | ||
"event": { | ||
"action": "CloudResourceManagerOrganizationsV3Service-SearchOrganizations", | ||
"category": [ | ||
"network", | ||
"configuration" | ||
], | ||
"id": "-abcdef", | ||
"kind": "event", | ||
"original": "{\"insertId\":\"-abcdef\",\"logName\":\"organizations/123456789098/logs/cloudaudit.googleapis.com%2Fdata_access\",\"protoPayload\":{\"@type\":\"type.googleapis.com/google.cloud.audit.AuditLog\",\"authenticationInfo\":{\"principalEmail\":\"joel.miller@contoso.com\"},\"authorizationInfo\":[{\"resourceAttributes\":{}}],\"methodName\":\"CloudResourceManagerOrganizationsV3Service-SearchOrganizations\",\"request\":{\"@type\":\"type.googleapis.com/google.cloud.resourcemanager.v3.SearchOrganizationsRequest\",\"pageSize\":100},\"requestMetadata\":{\"callerIp\":\"private\",\"destinationAttributes\":{},\"requestAttributes\":{}},\"resourceName\":\"organizations/123456789098\",\"serviceName\":\"cloudresourcemanager.googleapis.com\",\"status\":{}},\"receiveTimestamp\":\"2023-08-02T11:20:31.13521906Z\",\"resource\":{\"labels\":{\"organization_id\":\"123456789098\"},\"type\":\"organization\"},\"severity\":\"INFO\",\"timestamp\":\"2023-08-02T11:20:30.734968Z\"}", | ||
"outcome": "unknown", | ||
"provider": "data_access" | ||
}, | ||
"gcp": { | ||
"audit": { | ||
"request": { | ||
"@type": "type.googleapis.com/google.cloud.resourcemanager.v3.SearchOrganizationsRequest", | ||
"pageSize": 100 | ||
}, | ||
"resource_name": "organizations/123456789098", | ||
"type": "type.googleapis.com/google.cloud.audit.AuditLog" | ||
} | ||
}, | ||
"log": { | ||
"level": "INFO", | ||
"logger": "organizations/123456789098/logs/cloudaudit.googleapis.com%2Fdata_access" | ||
}, | ||
"service": { | ||
"name": "cloudresourcemanager.googleapis.com" | ||
}, | ||
"tags": [ | ||
"preserve_original_event" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters