내용으로 건너뛰기

Support for programmatically terminating active sessions from permission sets

0

Currently it is only possible to terminate active sessions for permission sets via the UI. This prevents using necessary automations to ensure permission set assignments do not have a dangling session and are brought to least privilege. When we can get support for allowing a programmatic solution here?

Thanks!

질문됨 4달 전106회 조회
1개 답변
0

When working with IAM Identity Center (formerly AWS SSO), there currently isn't a direct API method to programmatically terminate active sessions for permission sets specifically.

For IAM roles, you can programmatically revoke active sessions by attaching the AWSRevokeOlderSessions policy to the role, which denies access to users who assumed the role before a specific time. This can be done through the AWS CLI or SDK.

For SSM sessions, you can programmatically terminate them using the ssm:TerminateSession action. You can create policies that allow users to terminate their own sessions by using policy variables like ${aws:userid} in the resource element:

{
"Effect": "Allow",
"Action": "ssm:TerminateSession",
"Resource": "arn:aws:ssm:*:*:session/${aws:userid}-*"
}

For IAM Identity Center users, you would use ${aws:userid} instead of ${aws:username} in your policies, as the latter isn't available for federated users.

Regarding automation for removing disabled users and their permission sets, you could implement a solution using AWS Lambda that periodically checks for disabled users in IAM Identity Center and programmatically removes their permission set assignments. However, this doesn't directly terminate active sessions.

AWS hasn't announced when programmatic termination of active sessions for permission sets will be supported. For now, you'll need to rely on the UI for this specific functionality or implement workarounds using existing APIs.
Sources
Policy variable for IAM Identity Center user | AWS re:Post
Removal of user and permission sets | AWS re:Post
Revoke IAM role temporary security credentials - AWS Identity and Access Management
End a session - AWS Systems Manager

답변함 4달 전
AWS
지원 엔지니어
검토됨 4달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠