-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[libbeat] fix: aws & openstack metadata conflict in add_cloud_metadata processor #41636
[libbeat] fix: aws & openstack metadata conflict in add_cloud_metadata processor #41636
Conversation
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
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.
Thanks for working on this issue! Can we document this new logic around priorityProviders in the doc please?
adcdc7d
to
cbb6a96
Compare
Thank you, I added documentation :) |
@Kavindu-Dodan with this change could we end up having the opposite problem, where OpenStack is misidentified as AWS? |
This shouldn't happen as priority is given for cloud provider SDK based metadata fetchers (AWS & Azure 1), where they should fail if configurations are not set (ex:- AWS credential profile/env vars). Footnotes |
libbeat/processors/add_cloud_metadata/docs/add_cloud_metadata.asciidoc
Outdated
Show resolved
Hide resolved
5b6ab95
to
f416516
Compare
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
Signed-off-by: Kavindu Dodanduwa <[email protected]>
f416516
to
69c70b2
Compare
…a processor (#41636) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <[email protected]> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <[email protected]> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <[email protected]> * documentation Signed-off-by: Kavindu Dodanduwa <[email protected]> * review changes Signed-off-by: Kavindu Dodanduwa <[email protected]> --------- Signed-off-by: Kavindu Dodanduwa <[email protected]> (cherry picked from commit 6d4e641) # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go
…a processor (#41636) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <[email protected]> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <[email protected]> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <[email protected]> * documentation Signed-off-by: Kavindu Dodanduwa <[email protected]> * review changes Signed-off-by: Kavindu Dodanduwa <[email protected]> --------- Signed-off-by: Kavindu Dodanduwa <[email protected]> (cherry picked from commit 6d4e641)
…a processor (#41636) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <[email protected]> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <[email protected]> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <[email protected]> * documentation Signed-off-by: Kavindu Dodanduwa <[email protected]> * review changes Signed-off-by: Kavindu Dodanduwa <[email protected]> --------- Signed-off-by: Kavindu Dodanduwa <[email protected]> (cherry picked from commit 6d4e641) # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go
…a processor (#41636) (#41815) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <[email protected]> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <[email protected]> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <[email protected]> * documentation Signed-off-by: Kavindu Dodanduwa <[email protected]> * review changes Signed-off-by: Kavindu Dodanduwa <[email protected]> --------- Signed-off-by: Kavindu Dodanduwa <[email protected]> (cherry picked from commit 6d4e641) Co-authored-by: Kavindu Dodanduwa <[email protected]>
…a processor (#41636) (#41814) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <[email protected]> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <[email protected]> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <[email protected]> * documentation Signed-off-by: Kavindu Dodanduwa <[email protected]> * review changes Signed-off-by: Kavindu Dodanduwa <[email protected]> --------- Signed-off-by: Kavindu Dodanduwa <[email protected]> (cherry picked from commit 6d4e641) # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go Co-authored-by: Kavindu Dodanduwa <[email protected]>
Proposed commit message
This PR fixes incorrect recognition of EC2/AWS cloud provider as Openstack. The root cause was the common metadata endpoints used by both AWS SDK & Openstack logic. And this happened when IMDSv2 is disabled in AWS.
I attempted to migrate Openstack logic to another metadata implementation. However, I did not manage to create a fully functioning setup to validate the implementation. Hence, this PR focuses on a priority-based solution where priority is given for SDK-backed metadata fetching over HTTP endpoints.
Current priory providers are - aws/ec2 & azure
Note - I have done a minor refactoring to rename
Local
struct property toDefaultEnabled
to make intention clearerChecklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.How to test this PR locally
You need a local copy and an EC2 instance to validate the fix.
Related issues
Screenshots
-IMDSv2 disabled