ABAC with AWS IAM Identity Center: How to reference PrincipalTags in Customer Managed Policy

0

Hello,

I am in the process of transitioning from regular account-level IAM to using AWS IAM Identity Center. I have set up a Permission Set with a couple of Customer Managed Policies (CMPs) attached. My goal is to use Attribute-Based Access Control (ABAC) within a CMP to allow individual users to login to Redshift by calling redshift:GetClusterCredentials, but only when requesting credentials for the Redshift username that matches their AWS username.

I am trying to follow along with this checklist which says:

You can refer to the access control attributes in the permissions policy using the aws:PrincipalTag/key condition.

Similarly, this documentation seems to say that ABAC in Identity Center can be achieved by referencing the PrincipalTags in policy conditions.

So, I have created an attribute in Identity Center called "username" which has the value ${path:userName}. Then, I have written the following condition in one of the CMPs that allows a user to call redshift:GetClusterCredentials on a specific Redshift cluster/db resource:

 "Condition": {
                "StringEquals": {
                    "aws:PrincipalTag/username": "${redshift:DbUser}"
                }
            }

In the CLI, the request looks something like aws redshift get-cluster-credentials --db-user myusername --db-name mydbname --cluster-identifier myclusterid. With this example, the request should only succeed when the user making the request has the username myusername.

However, when I make the request, I get the following error:

when calling the GetClusterCredentials operation: User: arn:aws:sts::1234567890:assumed-role/AWSReservedSSO_MyPermissionSetName_xxxxxxxx/myusername is not authorized to perform: redshift:GetClusterCredentials on resource: arn:aws:redshift:my-region-1:1234567890:dbuser:myclusterid/myusername because no identity-based policy allows the redshift:GetClusterCredentials action

When I view the event log in CloudTrail, I can see that no PrincipalTags are getting passed along to the Identity Center-generated Role assumed by the user via Identity Center federation. It seems the only place where those PrincipalTags show up is in the initial AssumeRoleWithSAML event that occurs when a user initially logs into a specific AWS Account Console using Identity Center.

I have seen a couple of AWS blogs with examples of policies that reference PrincipalTags for ABAC with Identity Center federation (here and here), but both examples are before CMPs were rolled out as a feature in July of 2022. So I'm not sure exactly how those examples should translate for use in CMPs. What I'm currently doing obviously is not working.

So, my question is: how do you use ABAC to restrict individual user-level access to resources in AWS IAM Identity Center Customer Managed Policies? Any help here would be greatly appreciated.

1개 답변
0

Hi John,

Take a look at this link. It suggests that Identity Center will only be able to use attributes that are specifically passed as SAML Assertions (the other non-supported option in Identity Center is setting up the attributes within Identity Center) - at least when using Customer Managed Policies (CMPs). Since you're creating the attribute within Identity Center, the attribute will not be able to be used by Identity Center. Try configuring the attribute as a SAML Assertion from Okta and see if that works. Specifically, use this , the first option listed. And although this blog uses Secrets Manager, you can follow the instructions here to add a custom SAML Assertion in Okta.

AWS
AWS_Or
답변함 2달 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인