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

[Bug]: AWS S3 user's policy configuration gives me 403 #564

Closed
Hamza-Megahed opened this issue Mar 28, 2024 · 3 comments
Closed

[Bug]: AWS S3 user's policy configuration gives me 403 #564

Hamza-Megahed opened this issue Mar 28, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Hamza-Megahed
Copy link
Contributor

Hamza-Megahed commented Mar 28, 2024

What happened?

Followed the steps in S3 setup guide for user's policy configuration in https://github.com/remotely-save/remotely-save/blob/master/docs/remote_services/s3_general/s3_user_policy.md but hit An error occurred (AccessDenied) when calling the ListObjectsV2 operation: Access Denied

This policy fixed it for me:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ObsidianObjects",
            "Effect": "Allow",
            "Action": [
                "s3:HeadObject",
                "s3:ListBucket",
                "s3:PutObject",
                "s3:CopyObject",
                "s3:UploadPart",
                "s3:UploadPartCopy",
                "s3:ListMultipartUploads",
                "s3:AbortMultipartUpload",
                "s3:CompleteMultipartUpload",
                "s3:ListObjects",
                "s3:ListObjectsV2",
                "s3:ListParts",
                "s3:GetObject",
                "s3:GetObjectAttributes",
                "s3:DeleteObject",
                "s3:DeleteObjects"
            ],
            "Resource": [
                "arn:aws:s3:::my-bucket",
                "arn:aws:s3:::my-bucket/*"
            ]
        }
    ]
}

I added s3:ListBucket because it's required by ListObjectsV2 according to official manual https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html , then added arn:aws:s3:::my-bucket to apply the policy to the bucket itself

@Hamza-Megahed Hamza-Megahed added the bug Something isn't working label Mar 28, 2024
@fyears
Copy link
Member

fyears commented Mar 28, 2024

thanks for reporting! and i will update the doc according to your description. i don't use official aws personally so no way to get the full picture...

so it seems that that difference is "arn:aws:s3:::my-bucket",?

@Hamza-Megahed
Copy link
Contributor Author

Hamza-Megahed commented Mar 28, 2024

I added s3:ListBucket because it's required by ListObjectsV2 according to AWS official manual https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html , then added arn:aws:s3:::my-bucket to apply the policy to the bucket itself

fyears pushed a commit that referenced this issue Mar 30, 2024
fix AWS S3 user's policy configuration issue #564
@fyears
Copy link
Member

fyears commented Mar 30, 2024

thx

@fyears fyears closed this as completed Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants