How can I supply federated users with an aws access key id/secret?

5.1k views Asked by At

We're using Auth0 to give (federated) users access to Auth0 (we've followed these instructions for setup: https://auth0.com/docs/integrations/aws#sso-with-the-aws-dashboard)

In Auth0 we've setup a simple rule system where the federated user's group membership maps to one of two different IAM roles, which gives the user either full access or read-only access (or no access at all) in the aws console.

However, I'm struggling to see how I can provide federated users with the means to get an access key id/secret linked to their account. Our wishlist is:

  1. The access key id/secret is unique per federated user, and as such is void if the federated user is deleted from the identity provider.
  2. I could manually provision a IAM role per federated user and link each user to his/her "personal" IAM role, but I'd obviously prefer not to.

All in all I guess I'd like there to be a "linked" IAM user representing each federated account.

So I guess my question is: How do allow my federated users access to personal access key id's in aws?

2

There are 2 answers

0
RobinGower On

Federated users require temporary access keys which you can grant with aws sts assume-role.

0
Kiruthika kanagarajan On

you can create your AWS Accesskey, Secret key & token for the federated users using AssumeRoleWithSAML-cli AssumeRolewithSAML-sdk

AWS CLI Example that will provide you an credentials for federated user:

aws sts assume-role-with-saml --role-arn arn:aws:iam::AccountNumber:role/ADFS-AWS-ADMIN --principal-arn arn:aws:iam::AccountNumber:saml-provider/idp001 --saml-assertion SAMLResponsePHNhbWxwOlJlc3BvbnNlIElEPSJfMTE2MDVkYzYtYWNjOS00NGFkLTgzM2QtZjdhMWM4NTVhMmJmIiBWZXJzaW9uPSIyLjAiIElzc3VlSW5zdGFudD0iMjAyMy0wMy0wNlQxNjoxNDowMi4wNjdaIiBEZXN0aW5hdGlvbj0iaHR0cHM6Ly9zaWduaW4uYXdzLmFtYXpvbi5jb20vc2FtbCIgQ29uc2VudD0idXJuOm9hc2lzOm5hbWVzOnRjOlNBTUw6Mi4wOmNvbnNlbnQ6dW5zcGVjaWZpZWQiIHhtbG5zOnNhbWxwPSJ1cm46b2FzaXM6bmSAMLResponseFtZXM6dGM6U0FNTDoyLjA6cHJvdG9jb2wiPjxJc3N1ZXIgeG1sbnM9InVybjpvYXNpczpuYW1lczp0YzpTQU1MOjIuMDphc3NlcnRpb24iP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