Review IAM Identity Center permission-set session duration

Limit AWS account session duration according to the sensitivity of the permissions and the time needed for the work.

Description

session_duration on an IAM Identity Center permission set sets the lifetime of console and CLI sessions in assigned AWS accounts. The AWS access portal has a separate sign-in duration.

Potential impact

A longer session gives someone more time to use stolen temporary credentials or a session left open on a shared device.

Remediation

Choose the shortest practical duration for sensitive permissions, from one hour (the default and minimum) to 12 hours. Verify the updated permission set has been provisioned to the assigned accounts. Manage MFA and emergency session revocation separately.

Examples

The excerpts reference an Identity Center instance data source. Configure permission policies and account assignments separately.

Before

hcl
resource "aws_ssoadmin_permission_set" "example" {
  name             = "Example"
  description      = "An example"
  instance_arn     = tolist(data.aws_ssoadmin_instances.main.arns)[0]
  relay_state      = "https://s3.console.aws.amazon.com/s3/home?region=us-east-1#"
  session_duration = "PT2H"
}

After

hcl
resource "aws_ssoadmin_permission_set" "example" {
  name             = "Example"
  description      = "An example"
  instance_arn     = tolist(data.aws_ssoadmin_instances.main.arns)[0]
  relay_state      = "https://s3.console.aws.amazon.com/s3/home?region=us-east-1#"
  session_duration = "PT1H"
}

Changing PT2H to PT1H shortens new account sessions from two hours to one. Existing sessions and portal sign-in do not end immediately.

References