Open ilija-lazoroski opened 1 month ago
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
aws_metadata.py
More info: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-retrieval.html
Steps to reproduce the behavior:
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
Add a function to retrieve the token before requesting the aws metadata
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:
Expected behavior
Add a function to retrieve the token before requesting the aws metadata