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

Not able to retrieve metadata from AWS EC2 instance #4275

Open
ilija-lazoroski opened this issue Aug 14, 2024 · 0 comments
Open

Not able to retrieve metadata from AWS EC2 instance #4275

ilija-lazoroski opened this issue Aug 14, 2024 · 0 comments
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island.

Comments

@ilija-lazoroski
Copy link
Contributor

Describe the bug

When running an Monkey Island on AWS EC2 instance we are not able to retrieve the metadata. In order to read the AWS Instance metadata we need to send a token along with the request to receive the metadata. The related code is in aws_metadata.py

More info: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html

To Reproduce

Steps to reproduce the behavior:

  1. Create AWS EC2 instance
  2. Run the Monkey Island on the instance
  3. See that the Run on AWS button is not showing
  4. Check the logs and see the following log:
2024-08-06 09:31:52,356 - DEBUG - connectionpool.py:473 - _make_request() - [http://ip:80](http://ip/) "GET /latest/meta-data/instance-id HTTP/1.1" 401 343
2024-08-06 09:31:52,358 - DEBUG - aws_metadata.py:31 - fetch_aws_instance_metadata() - Failed init of AWSInstance while getting metadata: 401 Client Error: Unauthorized for url: http://ip/latest/meta-data/instance-id

Expected behavior

Add a function to retrieve the token before requesting the aws metadata

@ilija-lazoroski ilija-lazoroski added the Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island. label Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error, flaw, misbehavior or failure in the Monkey or Monkey Island.
Projects
None yet
Development

No branches or pull requests

1 participant