-
Notifications
You must be signed in to change notification settings - Fork 42
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
[Asset Inventory][GCP] Populate related.entity
field for resources implemented so far
#2654
Conversation
This pull request does not have a backport label. Could you fix it @kubasobon? 🙏
|
…o gcp-related-entity
Finished for all types of resources we have implemented so far. |
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.
You went deeper on this than I first did. It's good to know that aws and azure doesn't cover this part.
if v, ok := fields["networkInterfaces"]; ok { | ||
for _, networkInterface := range v.GetListValue().GetValues() { | ||
networkInterfaceFields := networkInterface.GetStructValue().GetFields() | ||
ids = appendIfExists(ids, networkInterfaceFields, "network") |
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 do we need to have a map with the name of the 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.
I'm not entirely sure what you are asking about. Is it about "Why do we have to call ...GetFields()
, which returns a map, that we have to query further?"?
If so, then the answer is Google's SDK is made that way 🤷
ids = append(ids, binding.Members...) | ||
} | ||
default: | ||
f.logger.Warnf("cannot find related asset IDs for unsupported sub-type %q", subType) |
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.
Do we really need a warn here? It seems normal to me that some types doesn't have related entities
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.
True. I'll drop the warn
.
…` field for resources implemented so far (#2806) [Asset Inventory][GCP] Populate `related.entity` field for resources implemented so far (#2654) (cherry picked from commit daba272) Co-authored-by: Kuba Soboń <[email protected]>
Summary of your changes
Populate
related.entity
field for resources implemented so far.Screenshot/Data
Related Issues
Towards https://github.com/elastic/security-team/issues/10392
Checklist