-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Google Cloud Log parser plugin #4923
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one additional comment but otherwise lgtm.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4923 +/- ##
==========================================
+ Coverage 85.05% 85.08% +0.02%
==========================================
Files 431 431
Lines 38648 38765 +117
==========================================
+ Hits 32873 32982 +109
- Misses 5775 5783 +8 ☔ View full report in Codecov by Sentry. |
"""Extracts compute.instances.insert information. | ||
|
||
Args: | ||
request (dict): JSON dictionary of the `protoPayload.request` field. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the sudden argument name change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method only processes information in the request
field i.e. protoPayload.request
. To add clarity, I renamed the method to _ParseComputeRequest
.
""" | ||
status = self._GetJSONValue(proto_payload, 'status') | ||
if not status: | ||
event_data.status_code = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why an empty string and not None?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Attributes with value None
are ignored by Timesketch. An empty string is assigned to ensure it appears in Timesketch, and Timesketch analyzers (in future) can utilize the field for successful operation filtering.
# `protoPayload.status.code` field. | ||
# | ||
# Empty `code` and `message` fields indicate the operation was successful. | ||
status_code = str(self._GetJSONValue(status, 'code', '')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the explicit call to str()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done to avoid type issues in OpenSearch. The value protoPayload.status.code
is of type integer or empty.
request (dict): JSON dictionary of the `protoPayload.request` field. | ||
event_data (GCPLogEventData): event data. | ||
""" | ||
# Source images are useful for investigation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: comment add no value to explain the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to explain the variable.
@sydp were things remaining that should be changed from your perspective? |
Nothing further from me, thanks. |
Google Cloud audit logs parser update
Description:
Updating Google Cloud audit log parser plugin (
gcp_log.py
) to extract attributes useful for investigation.Some of the attributes extracted by the plugin are listed below:
Notes:
All contributions to Plaso undergo code review.
This makes sure that the code has appropriate test coverage and conforms to the
Plaso style guide.
One of the maintainers will examine your code, and may request changes. Check off the items below in
order, and then a maintainer will review your code.
Checklist: