[8.x](backport #41636) [libbeat] fix: aws & openstack metadata conflict in add_cloud_metadata processor#41815
Merged
Kavindu-Dodan merged 1 commit into8.xfrom Nov 27, 2024
Merged
Conversation
…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)
Contributor
|
Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services) |
Kavindu-Dodan
approved these changes
Nov 27, 2024
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
This is an automatic backport of pull request #41636 done by [Mergify](https://mergify.com).