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

Using AWS cloudGoat with aws-vault #250

Open
mbunde opened this issue Mar 6, 2024 · 4 comments
Open

Using AWS cloudGoat with aws-vault #250

mbunde opened this issue Mar 6, 2024 · 4 comments

Comments

@mbunde
Copy link

mbunde commented Mar 6, 2024

Is it possible that when setting the profile in CloudGoat, it can reference profiles created in aws-vault?
if this is possible, kindly guide the command structure in linux to achieve the same

@andrew-aiken
Copy link
Contributor

From quickly looking at aws-vault you would need to export your temporary credentials locally.

Something like this also might work, just set the profile to default or whatever aws-vaults uses

aws-vault exec USERNAME -- ./cloudgoat.py create vulnerable_lambda

@mbunde
Copy link
Author

mbunde commented Mar 7, 2024

it runs perfectly but fails at this during terrafrom plan face

[cloudgoat] terraform init completed with no error code.

Planning failed. Terraform encountered an error while generating this plan.


│ Error: No valid credential sources found

│ with provider["registry.terraform.io/hashicorp/aws"],
│ on provider.tf line 1, in provider "aws":
│ 1: provider "aws" {

│ Please see https://registry.terraform.io/providers/hashicorp/aws
│ for more information about providing credentials.

│ Error: A Profile was specified along with the environment variables "AWS_ACCESS_KEY_ID" and
│ "AWS_SECRET_ACCESS_KEY". The Profile is now used instead of the environment variable credentials.

@andrew-aiken
Copy link
Contributor

Ahh looks like aws-vault does not write to the ~/.aws/credentials
What might need to be done it get the temporary credentials and put them in that file so CloudGoat can use the profile from the config file.

Something like this

aws-vault exec USERNAME -- env | grep AWS

vim ~/.aws/credentials
---

[cloudgoat]
aws_access_key_id = ASIA...
aws_secret_access_key = .....
aws_session_token = .........

---

./cloudgoat.py config profile

./cloudgoat.py create vulnerable_lambda

@andrew-aiken
Copy link
Contributor

@mbunde Did this solve your issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants