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

[ERROR]: Configure S3 Access by IAM Role = Contains Incorrect Policy #2809

Open
1 task done
colinbjohnson opened this issue Sep 19, 2024 · 0 comments
Open
1 task done

Comments

@colinbjohnson
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues.

Issue

The policy given here https://milvus.io/docs/s3.md#Associate-an-IAM-role-with-a-Kubernetes-service-account is not correct - there is no reason to apply a s3:ListBucket statement to a resource named arn:aws:s3:::<bucket-name>/* - the s3:ListBucket only needs to be applied to a bucket itself. The current policy is shown below:

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

Suggestion

The policy below is actually the correct policy:

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

Anything else?

I'll submit a PR with the corrected policy.

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