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

Access SSEKMS Bucket #1144

Open
vijenderpanda opened this issue Jun 22, 2022 · 1 comment
Open

Access SSEKMS Bucket #1144

vijenderpanda opened this issue Jun 22, 2022 · 1 comment

Comments

@vijenderpanda
Copy link

Hi Guys,

Currently i am facing issues with accessing bucket files , which is throwing me error 400.
Bucket is SSEKMS encrypted.

What extra settings i need to have in my settings.py file for the encrypted bucket.

Any fast response is appreciated.

Please helm me to solve this issue.

@jmbreiner
Copy link

I am also having this issues. I tried multiple regions and still get 400. I tried in postman and I was successful. I compared the http headers and Postman is passing the 'X-Amz-Content-Sha256' and 'Authorization' headers and django storages is not.

cURL Examples:

Django Storages -> Does not work:

curl 'https://my-bucket.amazonaws.com/static/admin/css/base.css'
-H 'Accept: text/css,/;q=0.1'
-H 'Accept-Language: en-US,en;q=0.9,fr;q=0.8,lb;q=0.7'
-H 'Cache-Control: no-cache'
-H 'Connection: keep-alive'
-H 'DNT: 1'
-H 'Pragma: no-cache'
-H 'Sec-Fetch-Dest: style'
-H 'Sec-Fetch-Mode: no-cors'
-H 'Sec-Fetch-Site: cross-site'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36'
-H 'sec-ch-ua: "Not_A Brand";v="99", "Google Chrome";v="109", "Chromium";v="109"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "macOS"'
--compressed

Postman -> Works:

curl --location --request GET 'https://my-bucket.s3.amazonaws.com/static/admin/css/base.css'
--header 'X-Amz-Content-Sha256: really-long-key'
--header 'X-Amz-Date: 20230122T050501Z'
--header 'Authorization: AWS4-HMAC-SHA256 Credential=key_id/20230122/us-east-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=really-long-string'

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

2 participants