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

mc client doesnt work when passing SSE-C key #5061

Closed
botcheddevil opened this issue Oct 15, 2024 · 7 comments
Closed

mc client doesnt work when passing SSE-C key #5061

botcheddevil opened this issue Oct 15, 2024 · 7 comments

Comments

@botcheddevil
Copy link

Expected behavior

.\mc.exe cp --enc-c "public/encrypted-file.txt=EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E=" D:\files\encrypted-file.txt myminio/public/encrypted-file.txt

Should upload and encrypted file.

Actual behavior

I get the following error:

mc.exe: SSE Error. SSE key is missing.

Steps to reproduce the behavior

  1. Setup minio in minikube k8s using values file

values-minio.yaml

mode: standalone
rootUser: "minio"
rootPassword: "minio123"
resources:
  requests:
    memory: 512Mi
persistence:
  enabled: true
  storageClass: "minio-retain-sc"
  accessMode: ReadWriteOnce
  size: 100Gi
existingClaim: ""
console:
  enabled: true
debug:
  enabled: true
log:
  level: debug
tls:
  enabled: true
  certSecret: minio-tls-cert-secret
  publicCrt: tls.crt
  privateKey: tls.key
.\minikube\minikube.exe start --mount --mount-string="D:\data:/minikube-host"
kubectl create ns minio-system
kubectl create -f .\charts\minio-storage-class.yaml
kubectl create -f .\charts\minio-pv.yaml
kubectl create secret tls minio-tls-cert-secret --cert=public.crt --key=private.key -n minio-system
helm install minio minio/minio --namespace minio-system -f .\charts\values-minio.yaml --debug --timeout 10m

mc --version

  • (paste output of mc --version)
mc version RELEASE.2024-10-08T09-37-26Z (commit-id=cf128de2cf42e763e7bd30c6df8b749fa94e0c10)
Runtime: go1.22.8 windows/amd64
Copyright (c) 2015-2024 MinIO, Inc.
License GNU AGPLv3 <https://www.gnu.org/licenses/agpl-3.0.html>

System information

Windows 10 on i9

@zveinn
Copy link
Contributor

zveinn commented Oct 15, 2024

you need to do `--sse-c="key"

@botcheddevil
Copy link
Author

Thank you for your response.

I tried the following variations none of them worked. Could you share the complete command?

.\mc.exe cp --sse-c="EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E=" D:\files\encrypted-file.txt myminio/public/encrypted-file.txt
mc.exe: Invalid command usage, flag provided but not defined: -sse-c

.\mc.exe cp --enc-c "--sse-c=EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E=" D:\files\encrypted-file.txt myminio/public/encrypted-file.txt
mc.exe: SSE Error. SSE key is missing.

.\mc.exe cp --enc-c "sse-c=EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E=" D:\files\encrypted-file.txt myminio/public/encrypted-file.txt

@zveinn
Copy link
Contributor

zveinn commented Oct 15, 2024

ohh..my bad
it's
--enc-c "alias/bucket/path=key"

@zveinn
Copy link
Contributor

zveinn commented Oct 15, 2024

.\mc.exe cp --enc-c "public/encrypted-file.txt=EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E=" D:\files\encrypted-file.txt myminio/public/encrypted-file.txt

should be
.\mc.exe cp --enc-c "myminio/public/encrypted-file.txt=EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E=" D:\files\encrypted-file.txt myminio/public/encrypted-file.txt

@klauspost
Copy link
Contributor

Did we loosen the "raw" base 64 requirement? If not, key should be EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E.

@botcheddevil
Copy link
Author

Yes that did work, dropping the trailing '=' thanks @klauspost @zveinn !!!

For posterity ->

.\mc.exe cp --enc-c "myminio/public/encrypted-file.txt=EACjrC0Hu8dZ0hAjZyA6TEFhC1QackD5Wk5K/ruZs3E" D:\files\encrypted-file.txt myminio/public/encrypted-file.txt

@zveinn
Copy link
Contributor

zveinn commented Oct 15, 2024

for future reference, you should also be able to use hex encoded keys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants