1. Local env: Ubuntu CLI, terraform

2. Error messages: sts get caller identity error, "signature does not match"

 

2.1 with terraform

soyi@SOYI /mnt/c/Users/SOYI/tf-test/fundamental-aws-infra/terraform $ terraform init

Initializing the backend...
Initializing modules...
╷
│ Error: error configuring S3 Backend: error validating provider credentials: error calling sts:GetCallerIdentity: SignatureDoesNotMatch: Signature expired: 20230807T110917Z is now earlier than 20230808T053756Z (20230808T055256Z - 15 min.)
│       status code: 403, request id: 557xxxx-xxxx-xxxx-xxxx-7b40xxxxxxxxx
│
│
╵

 

2.2 check aws sts command (same error)

soyi@SOYI /mnt/c/Users/SOYI/tf-test/fundamental-aws-infra/terraform $ aws sts get-caller-identity

An error occurred (SignatureDoesNotMatch) when calling the GetCallerIdentity operation: Signature expired: 20230807T110934Z is now earlier than 20230808T053813Z (20230808T055313Z - 15 min.)

 

3. resolve: 

3.1 check the aws configure credentials first

3.2 if 3.1 is ok, then synchronize the ntpdate if the env is Ubuntu like -

# run following command if it's Ubuntu
$ sudo ntpdate ntp.ubuntu.com
 8 Aug 14:55:29 ntpdate[1292]: step time server 91.189.91.157 offset +67418.817306 sec
 
# the result means it's done.

# if ntpdate command is not found, then install ntp as below.
sudo apt install ntp && ntpdate -y

[2022 년 6월 기준]

 

MFA 설정을 한 IAM 계정을 사용 중, 기변으로 인해 등록된 디바이스를 바꿀때

필요한 권한을 할당받은 상태에서 설정함에도 "개체 이미 존재" (MFA Device entity at the same path and name already exists) 에러가 발생하면서 MFA 토큰 추가 화면으로 넘어가지 않는 경우가 있다.

말그대로 이미 생성되어있어서 마주하는 에러지만, 이미 삭제 후 유저에게 재등록하도록 가이드를 한 경우에도 발생할 수 있다.

확인결과, 가상 MFA 디바이스 설정 버튼을 통해 MFA 디바이스 등록 진행 중, 아직 실제로 등록을 완료하지 못한 초기 안내 화면에서도 엔터티는 자동으로 생성되어, 실제로 등록을 끝마치치 않은 상태에서도 자꾸 엔터티가 생겨 해당 에러를 마주하는 것으로 보인다.

해당 경우에는 AWS CLI로 엔터티가 생기는지 확인하고, 생성된 엔터티를 바로 지운다음 등록화면 재 진입시 에러가 사라지고 QR코드 등록 화면으로 넘어가지는 것을 확인할 수 있었다.

 

 

MFA Device error

 

AWS CLI로 특정 유저의 mfa 엔터티 확인

$ aws iam list-virtual-mfa-devices | grep testuser
            "SerialNumber": "arn:aws:iam::265919665173:mfa/testuser"

 

AWS CLI로 delete-virtual-mfa-device 명령어를 통해 해당 엔터티 삭제 후, list-virtual-mfa-devices 를 하여 삭제된 것을 확인하였다. 그다음에 다시 MFA 디바이스 설정 버튼으로 설정 초기화면에 넘어가면 바로 엔터티가 다시 생성된 것을 확인하였다.

$ aws iam delete-virtual-mfa-device --serial-number arn:aws:iam::265919665173:mfa/testuser
$ aws iam list-virtual-mfa-devices | grep testuser
$ aws iam list-virtual-mfa-devices | grep testuser
            "SerialNumber": "arn:aws:iam::265919665173:mfa/testuser"

 

유저가 디바이스 등록을 하기전에 생성된 엔터티를 삭제하면 해당 에러를 건너뛰고 QR코드 등록안내 화면으로 넘어가진다.

 

 

+ Recent posts