Skip to content
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

[Security] Enable IMDSv2 support in Filebeat, Auditbeat and others #22101

Closed
kholia opened this issue Oct 22, 2020 · 5 comments · Fixed by #28285
Closed

[Security] Enable IMDSv2 support in Filebeat, Auditbeat and others #22101

kholia opened this issue Oct 22, 2020 · 5 comments · Fixed by #28285
Assignees
Labels
Team:Integrations Label for the Integrations team

Comments

@kholia
Copy link

kholia commented Oct 22, 2020

IMDSv2 adds defense in depth against open firewalls, reverse proxies, and SSRF vulnerabilities with enhancements to the EC2 Instance Metadata Service (IMDS).

https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/ has the details.

A bunch of projects (e.g. https://pypi.org/project/ec2-metadata/) have started using IMDSv2,

https://pypi.org/project/ec2-metadata/ says,

In November 2019, AWS released version 2 of the instance metadata service. It’s more secure against Server Side Request Forgery (SSRF) attacks. ec2-metadata now uses it exclusively. You can therefore consider disabling version 1, as per AWS’ guide.

Related: https://www.elastic.co/guide/en/beats/auditbeat/current/add-cloud-metadata.html. The The add_cloud_metadata processor should use IMDSv2 on AWS.

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Oct 22, 2020
@kholia kholia changed the title [Security] Enable IMDSv2 support in Fileat, Auditbeat and others [Security] Enable IMDSv2 support in Filebeat, Auditbeat and others Oct 22, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Oct 22, 2020
@jsoriano jsoriano added the Team:Integrations Label for the Integrations team label Apr 26, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations (Team:Integrations)

@martijnbakkerelastic
Copy link

Requesting for feedback on this request. Customer is currently working with a temporary workaround (IAMUSER) but is awaiting outlook to use IAMROLE. Current workaround is under Security vulnerability-exception, but this will expire this week and in order to request extension our customer Ikano Bank is requesting clarity on expected timelines when this is planned to be added. This will allow them to request an extension on the current Security exception in place.

The pending change prevents additional AWS sources to be incorporated in their service and is a blocker for further growth in their current implementation.

@martijnbakkerelastic martijnbakkerelastic changed the title [Security] Enable IMDSv2 support in Filebeat, Auditbeat and others [Response required] [Security] Enable IMDSv2 support in Filebeat, Auditbeat and others May 17, 2021
@emweric
Copy link

emweric commented May 17, 2021

@martijnbakkerelastic I think this is the issue with the IAM USER/ROLE #19393

@martijnbakkerelastic martijnbakkerelastic changed the title [Response required] [Security] Enable IMDSv2 support in Filebeat, Auditbeat and others [Security] Enable IMDSv2 support in Filebeat, Auditbeat and others May 26, 2021
@JPLachance
Copy link

Greetings!

AWS IMDSv2 was released in November 2019. One pandemic later, I don't consider myself as an early adopter of AWS IMDSv2.

We plan to completely get rid of IMDSv1 in our AWS EC2 fleet and at the moment, Filebeat is a blocker for our project.

I've looked at the code and identified that the function we need to update is here: https://github.com/elastic/beats/blob/master/libbeat/processors/add_cloud_metadata/provider_aws_ec2.go#L29

Based on the AWS documentation, we need to:

  • Add a PUT request on http://169.254.169.254/latest/api/token to get our token
  • Add the X-aws-ec2-metadata-token: $TOKEN header in our requests to use the token

Is there anything else I'm not seeing that could complicate things?

From what I understand, IMDSv2 is available on all EC2 instances out of the box, so this change would not be a breaking one.

So, could we push this feature on the beats roadmap?

Thank you very much!! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Integrations Label for the Integrations team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants