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

AWS SDK writes mfa token challenge to STDOUT #7844

Open
christian-elsee opened this issue Jun 21, 2024 · 2 comments
Open

AWS SDK writes mfa token challenge to STDOUT #7844

christian-elsee opened this issue Jun 21, 2024 · 2 comments
Labels
kind/bug priority/backlog Not staffed at the moment. Help wanted.

Comments

@christian-elsee
Copy link

christian-elsee commented Jun 21, 2024

Hi, I am executing eksctl within the context of an assumed role.

$ AWS_PROFILE=AdministratorAccessRole aws sts get-caller-identity \
  | sed -E 's/[0-9]/1/g' \
  | jq -re '.UserId="FUBAR"'
{
  "UserId": "FUBAR",
  "Account": "111111111111",
  "Arn": "arn:aws:sts::111111111111:assumed-role/AdministratorAccessRole/cli"
}

The role obviously requires an MFA challenge for any operation that is not a sts get-caller-identity.

$ AWS_PROFILE=AdministratorAccessRole aws iam get-user --user-name christian \
  | jq -re 'true'
Enter MFA code for arn:aws:iam::123456789:mfa/Christian: 
true
~/Develop/github.com/christian-elsee/eks $ echo $?
0

When executing eksctl with a AWS_PROFILE that requires an MFA challenge, the challenge text is written to STDOUT. I am assuming its supposed to write to /dev/tty, but thats purely speculation.

$ AWS_PROFILE=AdministratorAccessRole dist/bin/eksctl create cluster \
  -f dist/cluster.yaml \
  --dry-run \
| tee dist/plan.yaml
Assume Role MFA token code: 592187
accessConfig:
  authenticationMode: API_AND_CONFIG_MAP
...

Looking at the first two lines from dist/plan.yaml, we see the challenge text.

<dist/plan.yaml sed -n 1,2p
Assume Role MFA token code: accessConfig:
  authenticationMode: API_AND_CONFIG_MAP

Not a big deal, but you know, annoying. I like to use the payload generated from a create cluster --dry-run as a terraformish plan. Cheers

Copy link
Contributor

Hello christian-elsee 👋 Thank you for opening an issue in eksctl project. The team will review the issue and aim to respond within 1-5 business days. Meanwhile, please read about the Contribution and Code of Conduct guidelines here. You can find out more information about eksctl on our website

Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the stale label Jul 22, 2024
@TiberiuGC TiberiuGC added priority/backlog Not staffed at the moment. Help wanted. and removed stale labels Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug priority/backlog Not staffed at the moment. Help wanted.
Projects
None yet
Development

No branches or pull requests

2 participants