-
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
Refactor asset inventory #2879
Refactor asset inventory #2879
Conversation
This pull request does not have a backport label. Could you fix it @romulets? 🙏
|
772c717
to
7ace239
Compare
7ace239
to
5af16e3
Compare
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.
LGTM
type AssetEvent struct { | ||
Asset Asset | ||
Network *AssetNetwork | ||
Cloud *AssetCloud | ||
Host *AssetHost | ||
IAM *AssetIAM | ||
ResourcePolicies []AssetResourcePolicy | ||
Entity Entity | ||
Event Event | ||
Network *Network | ||
Cloud *Cloud | ||
Host *Host | ||
User *User | ||
Labels map[string]string | ||
RawAttributes *any |
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.
there's an ecs
package in beats
maybe we can use that instead of defining known types ourselves?
not really related to this PR, we can do this separately if deemed worthy
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 did use it, but the problem is that don't define json fields only ecs, have a look at the definition https://github.com/elastic/beats/blob/main/libbeat/ecs/host.go
Once I used this module we were publishing the Go Lang fields name instead of proper ecs fields
inventory.WithCloud(inventory.Cloud{ | ||
Provider: inventory.AzureCloudProvider, | ||
AccountID: item.TenantId, | ||
ServiceName: "Azure", |
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.
maybe use inventory.AssetClassification
to make a more specific ServiceName
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.
There is no given guidance on what to add here. I might mimic AWS for consistency when I'm going over ECS fields in the next PR.
This pull request is now in conflicts. Could you fix it? 🙏
|
5af16e3
to
eca77ed
Compare
8d74ac7
to
c58a61e
Compare
(cherry picked from commit cbadcb7) # Conflicts: # internal/inventory/awsfetcher/fetcher_lambda.go # tests/product/tests/data/aws_asset_inventory/test_cases.py # tests/product/tests/test_azure_asset_inventory.py
Summary of your changes
sub_category
sub_type
category
type
asset
toentity
asset.raw
toAttributes
asset.tags
tolabels
host
user
cloud
network
Screenshot/Data
Related Issues