[libbeat] fix: aws & openstack metadata conflict in add_cloud_metadata processor#41636
Conversation
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
kaiyan-sheng
left a comment
There was a problem hiding this comment.
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 <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co>
f416516 to
69c70b2
Compare
…a processor (#41636) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * documentation Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 6d4e641) # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go
…a processor (#41636) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * documentation Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 6d4e641)
…a processor (#41636) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * documentation Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (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 <kavindu.dodanduwa@elastic.co> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * documentation Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 6d4e641) Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
…a processor (#41636) (#41814) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * documentation Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 6d4e641) # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
…a processor (#41636) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * documentation Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 6d4e641)
…a processor (#41636) (#42606) * rename misleading variable Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * introduce provider priority Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> # Conflicts: # libbeat/processors/add_cloud_metadata/providers.go * isolate priority logic and add testing Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * documentation Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> * review changes Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> --------- Signed-off-by: Kavindu Dodanduwa <kavindu.dodanduwa@elastic.co> (cherry picked from commit 6d4e641) Co-authored-by: Kavindu Dodanduwa <Kavindu-Dodan@users.noreply.github.com>
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
Localstruct property toDefaultEnabledto make intention clearerChecklist
CHANGELOG.next.asciidocorCHANGELOG-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