Skip to content

Commit

Permalink
Add read timeone when enabling the MFA
Browse files Browse the repository at this point in the history
  • Loading branch information
LozanoMatheus committed Sep 11, 2022
1 parent 9690099 commit f112596
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/add_mfa_on_cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function awsecure_cli_set_mfa_session_token() {
older|none)
awsecure_cli_log_info "Your MFA session token is older than ${AWSECURE_CLI_MFA_TOKEN_DURATION_SECOND}, renewing it."
echo "Please, inform your MFA code (e.g. 123 456): "
read -r AWSECURE_CLI_MFA_CODE_TMP
read -t 30 -r AWSECURE_CLI_MFA_CODE_TMP
local -r AWSECURE_CLI_MFA_CODE="${AWSECURE_CLI_MFA_CODE_TMP// /}"

local -r AWS_SESSION_TOKEN="$(${AWSECURE_CLI_AWS_BIN_FILEPATH} sts get-session-token --serial-number "${AWSECURE_CLI_MFA_AWS_ARN}" --token-code ${AWSECURE_CLI_MFA_CODE} --duration-second "${AWSECURE_CLI_MFA_TOKEN_DURATION_SECOND}" | jq -r '.Credentials.SessionToken')"
Expand Down

0 comments on commit f112596

Please sign in to comment.