Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create AWS access key that only allow s3

I want to create an AWS access key that only allow s3. That means the key can't be used with any other service. Is it possible? How?

like image 358
Phương Nguyễn Avatar asked Dec 26 '22 10:12

Phương Nguyễn


1 Answers

Is it possible ??

Yes. You can use AWS Identity and Access Management (IAM)

Ideally you should never give your admin/main account credentials for anything other than creating different IAM.

So create different users with needed securities, and create access keys for them and use it.

HOW ??

You can directly create from AWS Console IAM

 {
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:ListAllMyBuckets"],
      "Resource": "arn:aws:s3:::*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:GetBucketLocation"
      ],
      "Resource": "arn:aws:s3:::bucket-name"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:PutObject",
        "s3:GetObject",
        "s3:DeleteObject"
      ],
      "Resource": "arn:aws:s3:::bucket-name/*"
    }
  ]
}

or if you S3Browser please follow this

like image 80
Ratan Sharma Avatar answered Jan 13 '23 00:01

Ratan Sharma