AWS IAM Identity Center を利用し、アクセスポータル経由で AWS アカウントにログインしている際の最大セッション時間

記事タイトルとURLをコピーする

こんにちは。🐱
3月に技術課からカスタマーサクセス課に移動になっていた山本です。
表題の件が気になっていたので調べました。

訂正 (2023 年 6 月 9 日)

以下、誤った記載をしていました。申し訳ございません。

AWS IAM Identity Center を利用し、アクセスポータル経由で AWS アカウントにログインしている際の最大セッション時間は、以下のうち、短い方の時間になります。

  1. アクセスポータルの最大セッション時間の残り時間
  2. ログインに用いた、許可セットの最大セッション時間の残り時間

訂正後:

AWS IAM Identity Center を利用し、アクセスポータル経由で AWS アカウントにログインしている際の最大セッション時間は、以下の時間になります。

  1. ログインに用いた、許可セットの最大セッション時間の残り時間

アクセスポータルの最大セッション時間は、AWS アカウントのログイン時間には干渉しません。大変申し訳ありません。

設定可能範囲

以下、それぞれの設定可能範囲です。

  1. アクセスポータルの最大セッション時間。AWS アクセスポータルにログインした際の最大セッション時間はデフォルト 8 時間、最小 15分、最大 7 日間です。(参考資料1)。ID ソースとして外部 ID プロバイダー (IdP) を使用している場合、AWSアクセスポータルセッションの期間は IdP または IAM ID Center で設定した期間のうち短い方になります。(ドキュメントより)
  2. 許可セットの最大セッション時間。アクセスポータルから許可セットを使用し、AWS アカウントにログインする際の最大セッション時間は、デフォルト 1 時間、最大 12 時間です。(参考資料2) マネジメントコンソールにログインした場合にも、AWS CLI をご利用の場合にも、この値を適用します。AWS CLI の場合はセッション作成時にセッション期間を指定できるので、許可セットの最大セッション時間をさらに制限することもできます。

以下は例です。

例1: (訂正後)

AWSマネジメントコンソールまたはAWS CLI を使用します。
アクセスポータルの最大セッション時間 を 8 時間に設定していたとします。
許可セットの最大セッション時間 を 12 時間に設定していたとします。 アクセスポータルにログインしてから 3 時間後に、許可セットを使用しAWSアカウントにログインした場合、残りのセッション時間は 5時間 12 時間です

例2: (訂正後)

AWSマネジメントコンソールまたはAWS CLI を使用します。
アクセスポータルの最大セッション時間 を 8 時間に設定していたとします。
許可セットの最大セッション時間 を 1 時間に設定していたとします。 アクセスポータルにログインしてから 3 時間後に、許可セットを使用しAWSアカウントにログインした場合、残りのセッション時間は 1時間です

例3: (訂正後)

AWS CLI を使用します。
アクセスポータルの最大セッション時間 を 8 時間に設定していたとします。
許可セットの最大セッション時間 を 1 時間に設定していたとします。 AWS CLI でセッション作成時にセッション期間を 900 秒 (15 分)にしていたとします。 アクセスポータルにログインしてから 3 時間後に、許可セットを使用しAWSアカウントにログインした場合、残りのセッション時間は 900 秒 (15 分)です

参考資料

資料3 は、AWS IAM Identity Center を利用していないケースも含めて網羅した表があるので、大変わかりやすいです。

By default, the duration of a AWS access portal session, which is the maximum length of time that a user can be signed into the AWS access portal without re-authenticating into the portal, is eight hours. You can specify a different duration, from a minimum of 15 minutes to a maximum of seven days.

When you create a new permission set, the session duration is set to 1 hour (in seconds) by default. The minimum session duration is 1 hour, and can be set to a maximum of 12 hours. IAM Identity Center automatically creates IAM roles in each assigned account for each permission set, and configures these roles with a maximum session duration of 12 hours.

² This setting can have a value from 1 hour to 12 hours. For details about modifying the maximum session duration setting, see Modifying a role. This setting determines the maximum session duration that you can request when you get the role credentials. For example, when you use the AssumeRole* API operations to assume a role, you can specify a session length using the DurationSeconds parameter. Use this parameter to specify the length of the role session from 900 seconds (15 minutes) up to the maximum session duration setting for the role. IAM users who switch roles in the console are granted the maximum session duration, or the remaining time in their user session, whichever is less. Assume that you set a maximum duration of 5 hours on a role. An IAM user that has been signed into the console for 10 hours (out of the default maximum of 12) switches to the role. The available role session duration is 2 hours. To learn how to view the maximum value for your role, see View the maximum session duration setting for a role later in this page.

余談

夏が近いですね。涼しい地域に登山に行きたいです。

山本 哲也 (記事一覧)

カスタマーサクセス部のエンジニア(一応)

好きなサービス:ECS、ALB

趣味:トレラン、サウナ、音楽鑑賞(J-Pops)、お笑い鑑賞(ラランド)