AWS Identity Center Assumed Role Principals

0

I am attempting to author an IAM Role Trust Policy that only permits sts:AssumeRole permissions for a role managed by the AWS IAM Identity Center. I have read through this document describing the Principal ARN that should be used in the Trust Policy, but am pretty confident that the documented PrincipalArn is incorrect. The documented format of the ARN is:

arn:aws:iam::$ACCOUNT_ID:role/aws-reserved/sso.amazonaws.com/$IDENTITY_CENTER_REGION/AWSReservedSSO_$PERMISSION_SET_NAME_*

However, when I use that exact format and attempt to assume the role I get AccessDenied errors. I AM however able to get it to work if I remove the $IDENTITY_CENTER_REGION component from the PrincipalArn and use the following format:

arn:aws:iam::$ACCOUNT_ID:role/aws-reserved/sso.amazonaws.com/AWSReservedSSO_$PERMISSION_SET_NAME_*

I see others have had similar difficulties getting this to work.

Is the documented ARN format incorrect? Or is there some configuration step I may have missed that leads to this difference?

Thanks for the help!

demandé il y a un mois225 vues
1 réponse
1
Réponse acceptée

Hello.

In my environment, I was able to perform AssumeRole with the following trust policy.
My IAM Identity Center uses Tokyo as the region.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::$ACCOUNT_ID:role/aws-reserved/sso.amazonaws.com/ap-northeast-1/AWSReservedSSO_AWSAdministratorAccess_xxxxxxx"
            },
            "Action": "sts:AssumeRole"
        }
    ]
}

What region are you using with IAM Identity Center?
According to the AWS blog below, it seems that there is no need for a region code in the case of us-east-1.
https://aws.amazon.com/jp/blogs/containers/a-quick-path-to-amazon-eks-single-sign-on-using-aws-sso/

Note: If you configure SSO in a Region other than us-east-1, add the Region after “sso.amazonaws.com”. For example, for us-east-2, “…/sso.amazonaws.com/us-east-2/…”.

profile picture
EXPERT
répondu il y a un mois
profile picture
EXPERT
vérifié il y a 25 jours
  • Wow. Excellent find. I am indeed in us-east-1. Strange that it's inconsistent across regions. Thank you!!

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions