vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.4k stars 1.37k forks source link

[velero-plugin-for-aws] Server Side Encryption with Customer provided keys fails for s3 server with self-signed ca #7837

Closed arteonprifti closed 1 month ago

arteonprifti commented 1 month ago

What steps did you take and what happened: When trying to back up to a self-signed s3 server using the sse-c and giving the caCert the backup fails with

InvalidArgument: Requests specifying Server Side Encryption with Customer provided keys must be made over a secure connection.\n\tstatus code: 400

This seems to indicate that the server is not being called using https Trying without sse-c, the backup is successful. The same issue happens on v1.8.2 and v1.9.2 as well, with the same error.

Config:

    backupStorageLocation:
    - name: my-s3-location
      provider: aws
      default: true
      accessMode: ReadWrite
      caCert: ENTER-base64-CA
      config:
        region: ENTER-Region
        s3Url: https://ENTER-s3-url-here
        s3ForcePathStyle: "true"
        serverSideEncryption: AES256
        customerKeyEncryptionFile: "/credentials/backup_key"

Phase: Failed (run velero backup logs nginx-backup-5 for more information)

Namespaces: Included: ingress-nginx Excluded:

Resources: Included: * Excluded: Cluster-scoped: auto

Label selector:



**Environment:**

- Velero version (use `velero version`): v1.13.2
- Velero features (use `velero client config get features`): velero-plugin-for-aws
- Kubernetes version (use `kubectl version`):v1.28.6

**Vote on this issue!**

This is an invitation to the Velero community to vote on issues, you can see the project's [top voted issues listed here](https://github.com/vmware-tanzu/velero/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc).  
Use the "reaction smiley face" up to the right of this comment to vote.

- :+1: for "I would like to see this bug fixed as soon as possible"
- :-1: for "There are more important bugs to focus on right now"
blackpiglet commented 1 month ago

To me, this is related to how to use the SSE-c with the on-premise environment. What is the OSS backend in your environment?

I only find MinIO related document https://min.io/docs/minio/macos/administration/server-side-encryption/server-side-encryption-sse-c.html.

arteonprifti commented 1 month ago

Indeed, this was because of a misconfiguration of the s3 on premise. After fixing it, the error is gone. Thanks for the help