2回答
- 新しい順
- 投票が多い順
- コメントが多い順
1
The condition you want is ssm:SessionDocumentAccessCheck. See: Controlling user permissions for SSH connections through Session Manager. Something like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ssm:StartSession",
"Resource": [
"arn:aws:ec2:region:account-id:instance/*",
"arn:aws:ssm:*:*:document/AWS-StartSSHSession"
]
},
{
"Effect": "Deny",
"Action": "ssm:StartSession",
"NotResource": "arn:aws:ssm:*:*:document/AWS-StartSSHSession"
}
]
}
0
It appeared that the solution that @Kentrad provided didn't worked for me fully as i wanted, but what did worked for me is :
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ssm:StartSession",
"Resource": [
"arn:aws:ec2:eu-north-1:<accountid>:instance/*",
"arn:aws:ssm:*:*:document/AWS-StartSSHSession"
],
"Condition": {
"BoolIfExists": {
"ssm:SessionDocumentAccessCheck": "true"
}
}
}
]
}
I found this solution mainly here https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-sessiondocumentaccesscheck.html
回答済み 2年前
関連するコンテンツ
- AWS公式更新しました 3年前
- AWS公式更新しました 1年前
- AWS公式更新しました 10ヶ月前
Thank you very much Kentrad !