Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure Connector bucket policy #156

Open
Shershebnev opened this issue Dec 4, 2023 · 0 comments
Open

Secure Connector bucket policy #156

Shershebnev opened this issue Dec 4, 2023 · 0 comments

Comments

@Shershebnev
Copy link

Shershebnev commented Dec 4, 2023

The policy here https://github.com/wandb/terraform-aws-wandb/blob/v2.7.0/modules/secure_storage_connector/main.tf#L48 should probably be split into two - I'm getting api error MalformedPolicy: Action does not apply to any resource(s) in statement due to some actions being applicable only on bucket or file level. I'm not sure if you accept PRs from outside of the company, but this worked for me:

    policy = jsonencode({
      "Version" : "2012-10-17",
      "Statement" : [
        {
          "Sid" : "WandbAccountAccessFiles",
          "Effect" : "Allow",
          "Principal" : { "AWS" : var.aws_principal_arn },
          "Action" : [
            "s3:GetObject*",
            "s3:AbortMultipartUpload",
            "s3:DeleteObject",
            "s3:PutObject",
          ],
          "Resource" : [
            "${module.file_storage.bucket_arn}/*",
          ]
        },
        {
          "Sid" : "WandbAccountAccessBucket",
          "Effect" : "Allow",
          "Principal" : { "AWS" : var.aws_principal_arn },
          "Action" : [
            "s3:GetEncryptionConfiguration",
            "s3:ListBucket",
            "s3:ListBucketMultipartUploads",
            "s3:ListBucketVersions",
            "s3:GetBucketCORS",
            "s3:GetBucketLocation",
            "s3:GetBucketVersioning"
          ],
          "Resource" : [
            "${module.file_storage.bucket_arn}",
          ]
        },
      ]
    })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant