Skip to content

Instantly share code, notes, and snippets.

@xeptore
Created April 6, 2021 06:22
Show Gist options
  • Save xeptore/53f3b0c81d7f9eaeb972ce86d9e7b7f4 to your computer and use it in GitHub Desktop.
Save xeptore/53f3b0c81d7f9eaeb972ce86d9e7b7f4 to your computer and use it in GitHub Desktop.
GitLab Runner (Shared) Cache Amazon S3 Bucket Policy

GitLab Runner (Shared) Cache Amazon S3 Bucket Policy

{
  "Version":"2012-10-17",
  "Statement":[
    {
      "Sid":"seems-it-doesnt-matter-much-except-the-uniqueness",
      "Effect":"Allow",
      "Action":[
        "s3:PutObject",
        "s3:GetObject",
        "s3:ListBucket",
        "s3:DeleteObject"
      ],
      "Resource":[
        "arn:aws:s3:::<target-bucket-name>/*",
        "arn:aws:s3:::<target-bucket-name>"
      ],
      "Condition":{
        "IpAddress":{
          "aws:SourceIp":"<add-custom-allowed-source-ip-address>"
        }
      }
    }
  ]
}
  • Replace the <target-bucket-name> with your target bucket name
  • Set requester IP address in place of <add-custom-allowed-source-ip-address> if you'd like to (or remove the key (aws:SourceIp) at all to allow any source IP address to issue the request)

Current Versions:

  • GitLab Runner (gitlab-runner --version):
    Version:      13.10.0
    Git revision: 54944146
    Git branch:   13-10-stable
    GO version:   go1.13.8
    Built:        2021-03-21T09:13:32+0000
    OS/Arch:      linux/amd64
  • GitLab.com version: 13.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment