The AWS Management Console doesn’t go through a Gateway, so a console session lasts at most one hour.
Prerequisites
- The Admin role on the folder you’ll add the account to
- Permission to create IAM roles in the AWS account
- Your Infisical organization ID, which you can copy from Organization ID in your organization’s settings
- To connect through a Gateway, a Gateway on the latest version that can reach hosts under
amazonaws.comon port443, and the latest Infisical CLI for each person who connects
Create an IAM role
Each account assumes one IAM role. The role’s trust policy lets Infisical assume the role only when Infisical sends your organization ID as the external ID, so no other Infisical customer can get Infisical to assume it.1
In AWS, create an IAM role, such as Replace
infisical-pam-readonly, with the following trust policy:<infisical-aws-account-id> with the AWS account that Infisical runs in:2
Attach permission policies to the role. People who access the account get exactly these permissions in AWS.
Create an account
1
Go to Privileged Access Management > Accounts and select Add Account.
2
Select the Folder to add the account to and an AWS IAM Account Template, such as the default
aws-iam template, then select Next.3
Enter a Name for the account and the Role ARN of the role you created, such as
arn:aws:iam::123456789012:role/infisical-pam-readonly.4
Select Create.
Use a Gateway
To send an account’s CLI sessions through a Gateway, select a Gateway in the template’s system settings. To use a different Gateway for one account, override the Gateway on the account’s Advanced tab. The role’s credentials never leave the Gateway, but the role’s own permissions still apply. If the role can create access keys or assume other roles, a session can use those permissions to get credentials of its own.Session duration
A session lasts for the template’s maximum session duration, unless the person requests a shorter one. The template’s maximum can be 15 minutes to 24 hours. AWS limits the credentials that Infisical gets for the role to one hour. A session without a Gateway uses one set of credentials, so it ends after one hour at most. Through a Gateway, the Gateway gets new credentials before the old ones expire, so the session lasts as long as the template allows.Connect
To learn how to launch a session, see Connect to an account. In the browser, the session opens the AWS Management Console, signed in as the role. In the CLI, the command for the account is:- Without a Gateway
- Through a Gateway
The CLI writes temporary credentials to Press
~/.aws/credentials as a profile named infisical-pam/<folder>/<account>. Pass the profile to the AWS CLI, or set AWS_PROFILE to use it for every command:Ctrl+C to end the session. The CLI then removes the profile.