- Tag AWS instances.
- Create a specialized AWS IAM role.
- Create an Auth0 rule.
- Test your configuration.
Prérequis
- You’ll need an Amazon Web Services (AWS) account for which you are an administrator.
- ConfigureR AWS pour la SSO
- Set up some AWS VM Instances. For the example in this guide, we use three separate instances.
Instances de balises AWS
Add tags to your AWS resources. Follow instructions in Amazon Elastic Compute Cloud User Guide for Linux Instances: Adding and Deleting Tags on an Individual Resource. You should have created three instances. Add the following tags:Instance | Balises |
---|---|
1 | Clé : CostCenter , Valeur : marketing .Clé : Project , Valeur : website . |
2 | Clé: CostCenter , Valeur : engineering .Clé : Project , Valeur : management_dashboard . |
3 | Clé : CostCenter , Valeur : marketing .Clé : Project , Valeur : community_site . |
Create a specialized AWS IAM role
Create an IAM role using the AWS SAML you set up during the prerequisites. Follow the instructions in AWS Identity and Access Management User Guide: Creating a Role for SAML 2.0 Federation (Console). While setting up your role, make sure you use the following parameters:Paramètre | Description et exemple de valeur |
---|---|
Fournisseur SAML | Nom du fournisseur d’identité que vous avez créé dans les prérequis, par exemple auth0SamlProvider . Sélectionnez Allow programmatic and AWS Management Console access (Autoriser l’accès programmatique et l’accès à la console de gestion AWS). |
VirtualMachineAccessByCostCenter
.
Paramètre | Description |
---|---|
Nom du rôle | Nom descriptif de votre rôle, tel que AccessByCostCenter . |
Description du rôle | Description de l’objectif pour lequel votre rôle est utilisé. |
Create an Auth0 rule
Pour mapper le rôle AWS et les étiquettes à un utilisateur, vous devez créer une règle dans Auth0. Ces valeurs seront ensuite transmises aux assertions SAML dans le jeton. Pour l’exemple :Remplacez la valeur de la variable
awsAccount
avec celle de votre propre numéro de compte.Tester la configuration
You should now be able to log in to the AWS Console using an Auth0 user and test your implementation. To log in, you will need the login for the AWS Console. To find it:- Go to Dashboard > Applications > Applications and select the name of the Application to view.
- On the Addons tab, enable the SAML2 Web App add-on.
- On the Usage tab, locate Identity Provider Login URL.
- Go to the indicated URL.
- Once you have signed in, from EC2, select Instances. Click one of the instances tagged with a
CostCenter
ofmarketing
, and click Actions > Instance State > Stop. Notice that the action completes successfully. - Click the instance tagged with a
CostCenter
ofengineering
, and click Actions > Instance State > Stop. Notice that the action fails with an error.