IAM policy only allowed from Cloudshell?

0

Is there a way to create an IAM policy which will only grant permissions when used FROM Cloudshell?

I have found that the string "exec-env/CloudShell" is in the userAgent, but could this be spoofed?

Example: a user could run 'aws rds' commands on Cloudshell, but not 'on prem' even with API keys.

ld57
질문됨 9달 전312회 조회
2개 답변
1

Recommended not to use 'UserAgent'.

This key should be used carefully. Since the aws:UserAgent value is provided by the caller in an HTTP header, 
unauthorized parties can use modified or custom browsers to provide any aws:UserAgent value that they 
choose. As a result, aws:UserAgent should not be used to prevent unauthorized parties from making 
direct AWS requests. You can use it to allow only specific client applications, and only after 
testing your policy.

I don't know of a way to restrict API calls to CloudShell environments.

profile pictureAWS
전문가
kentrad
답변함 9달 전
  • Ok thanks so userAgent can be spoofed easily.

0

You can find examples of IAM policies for CloudShell in this article Here is some basic example:

{
    "Version": "2012-10-17",
    "Statement": [{
        "Sid": "CloudShellUser",
        "Effect": "Allow",
        "Action": [
            "cloudshell:*"
        ],
        "Resource": "*"
    }]
}
답변함 9달 전
  • Sorry that's not my question. I know how to allow Cloudshell, the question is how to make IAM policies that only allow API usage FROM Cloudshell. For example, allow RDS API only from Cloudshell, not "on prem" shell and scripts.

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

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

질문 답변하기에 대한 가이드라인

관련 콘텐츠