Skip to content

Better documentation for S3 driver IAM permissions #1391

Closed

Description

@BrianBland

As mentioned in #492, the s3 driver requires the following minimal permission scope to operate correctly when configured to use the bucket mybucket at the root:

    {
        "Effect": "Allow",
        "Action": "s3:ListAllMyBuckets",
        "Resource": "arn:aws:s3:::*"
    },
    {
        "Effect": "Allow",
        "Action": [
            "s3:ListBucket",
            "s3:GetBucketLocation"
        ],
        "Resource": "arn:aws:s3:::mybucket"
    },
    {
        "Effect": "Allow",
        "Action": [
            "s3:PutObject",
            "s3:GetObject",
            "s3:DeleteObject"
        ],
        "Resource": "arn:aws:s3:::mybucket/*"
    }

This should be added to the s3 driver documentation, as well as further information regarding a more limited scope when using a bucket "root directory" prefix.

Activity

  1. changed the title [-]Better documentation for s3 driver IAM permissions[/-] [+]Better documentation for S3 driver IAM permissions[/+] on Jan 26, 2016
  2. danielwhatmuff commented on Mar 3, 2016

    @danielwhatmuff

    Just a note for the docs, when running the distribution/registry container on RHEL 7.2 you have to explicitly pass any proxy environment variables like this:

    docker run -d -p 5000:5000 -e 'HTTPS_PROXY=http://blah:port' -e 'HTTP_PROXY=http://blah:port' -e 'http_proxy=http://blah:port' -e https_proxy='http://blah:port' -v /tmp/config.yml:/etc/docker/registry/config.yml docker.io/distribution/registry

    It won't pick them up from the host, so even if you can aws s3 cp from the host via the proxy, it won't push images up to s3. It will just hang and give you no help.

  3. drewrobb commented on Mar 31, 2016

    @drewrobb

    Hi, as of 2.4.0 some additional permissions are needed as the client now uses multipart uploads. This is what worked for me:

        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "s3:ListAllMyBuckets"
            ],
            "Resource": "arn:aws:s3:::*"
          },
          {
            "Effect": "Allow",
            "Action": [
              "s3:ListBucket",
              "s3:GetBucketLocation",
              "s3:ListBucketMultipartUploads"
            ],
            "Resource": "arn:aws:s3:::mybucket"
          },
          {
            "Effect": "Allow",
            "Action": [
              "s3:PutObject",
              "s3:GetObject",
              "s3:DeleteObject",
              "s3:ListMultipartUploadParts"
            ],
            "Resource": "arn:aws:s3:::mybucket/*"
          }
        ]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions