AWS S3 Policy

Trying to set up the S3 connector in Filestash? If you’re wondering how to configure your IAM policy, this guide will walk you through the essentials. The starting point is the IAM Policy page from the AWS Console. From there, you have two options:

  1. Use one of the AWS Managed Policies
  2. Create a Custom Policy with only the permissions you need

Option 1 - AWS Managed Policies

If you prefer simplicity and don’t mind broader permissions, you can use one of the AWS Managed Policies provided by Amazon. There is only 2 policies that are relevant to us:

AmazonS3FullAccess: grant read / write / delete access to all buckets and objects. The underlying policy is defined as:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:*",
                "s3-object-lambda:*"
            ],
            "Resource": "*"
        }
    ]
}

AmazonS3ReadOnlyAccess: grant read-only access. The underlying policy is defined as:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:Get*",
                "s3:List*",
                "s3:Describe*",
                "s3-object-lambda:Get*",
                "s3-object-lambda:List*"
            ],
            "Resource": "*"
        }
    ]
}

Option 2 - Custom Policies

If you want to enable only the minimum, here is the baseline:

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

Under the hood we use:

If you want to go one step ahead, you can reduce the amount of access by setting up the Resource key so your policy is restricted to a particular location and everything else is forbidden.

This is for the base use case of the default Filestash s3 connector. If you want to enable things like versioning, restoration of object stored on S3, metadata, reach out to support and we will guide you through the details of those use cases.