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

GetObject: invalid SSE headers are not handled properly #878

Closed
evgeniiz321 opened this issue Oct 26, 2023 · 3 comments
Closed

GetObject: invalid SSE headers are not handled properly #878

evgeniiz321 opened this issue Oct 26, 2023 · 3 comments
Labels
bug Something isn't working I4 No visible changes S4 Routine U3 Regular

Comments

@evgeniiz321
Copy link

evgeniiz321 commented Oct 26, 2023

test_sse_kms_read_declare

invalid headers:

    sse_kms_client_headers = {
        "x-amz-server-side-encryption": "aws:kms",
        "x-amz-server-side-encryption-aws-kms-key-id": "testkey-1",
    }

It is expected to return error (400 Bad Request) in this case, but s3 gw returns an object without any problems. Seems like this headers are not parsed at all.

Same for test_sse_kms_not_declared where this invalid tag doesn't cause errors:

    sse_kms_client_headers = {
        "x-amz-server-side-encryption-aws-kms-key-id": "testkey-2"
    }
@evgeniiz321 evgeniiz321 added bug Something isn't working triage labels Oct 26, 2023
@roman-khimov roman-khimov added this to the v0.30.1 milestone Oct 27, 2023
@roman-khimov roman-khimov added U3 Regular S4 Routine I4 No visible changes labels Dec 20, 2023
@smallhive
Copy link
Contributor

Right now headers are not supported by the gate:

  • x-amz-server-side-encryption
  • x-amz-server-side-encryption-aws-kms-key-id

There are a pack of supported headers:

  • x-amz-server-side-encryption-customer-algorithm - AES256 only
  • x-amz-server-side-encryption-customer-key
  • x-amz-server-side-encryption-customer-key-MD5

According to the docs

x-amz-server-side-encryption
The server-side encryption algorithm that was used when you store this object in Amazon S3 (for example, AES256, aws:kms, aws:kms:dsse).

we can try to add AES256 algo with x-amz-server-side-encryption as a similar implementation.

Also, according to docs

In AWS KMS, a symmetric encryption KMS key represents a 256-bit AES-GCM encryption key

we theoretically can try to add this implementation also, but we have to implement KMS service on our side.
It is required, because "x-amz-server-side-encryption-aws-kms-key-id" shows which key we should use for the encryption. Thus we have to manage them somehow

@roman-khimov roman-khimov removed this from the v0.30.1 milestone Feb 9, 2024
@roman-khimov
Copy link
Member

We can add this to documentation, if it's not there already.

@roman-khimov
Copy link
Member

Duplicates #193.

@roman-khimov roman-khimov closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 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 I4 No visible changes S4 Routine U3 Regular
Projects
None yet
Development

No branches or pull requests

3 participants