-
Notifications
You must be signed in to change notification settings - Fork 220
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
Stratus Does Not Use Instance Profile On EC2 #367
Comments
First of all, great to hear you're using the programmatic interface - and thank you for the very clear report! From the docs, it looks like provider configuration takes precedence over environment variables, so setting
|
For background, these flags were introduced to speed up the Terraform provisioning. But I 100% agree that there should be a way to have Stratus work when using instance roles |
Hey @christophetd thanks so much for the swift reply. We tried setting the variable How best do you suggest we proceed with getting Stratus to work with instance roles? |
I ran a few tests, and setting See
Based on this, I believe it would take more time only when no credentials are configured at all when Terraform is run (i.e., trying to fall back to IMDS and timing out). But since we perform an authentication check before running Terraform, this should literally have 0 impact. So we're good to go to remove this flag! Great catch. PR appreciated, otherwise I will look into fixing it in the coming weeks! |
Great, thank you! I'll raise one for you today :) |
I've raised #368 🙂 |
Will be released shortly as part of v2.5.7. Thanks for the contribution! |
What is not working?
When trying to run Stratus Red Team in an EC2 Instance, we found that it wasn’t able to leverage the instance credentials allocated to the instance. It gives us the following error:
We are calling Stratus programmatically as follows:
When we try to run Stratus as a binary on the EC2 instance to execute the same technique, we run into the same error message:
This is because both the binary and the SDK are leveraging the same terraform configuration for the AWS provider:
When we unset the
skip_metadata_api_check
above, Terraform was able to run just fine using the assigned instance profile.We noticed that the change was introduced very early here.
These changes specifically stop terraform (and thereby Stratus) from being able to discover the instance profile and use it on an EC2 instance.
Our questions for you:
What OS are you using?
20.04.1-Ubuntu
What is your Stratus Red Team version?
stratus version
2.5.6
Files in $HOME/.stratus-red-team?
ls -lahR
The text was updated successfully, but these errors were encountered: