containers / ocicrypt

Encryption libraries for Encrypted OCI Container images
Apache License 2.0
146 stars 33 forks source link

run ocicrypt keyprovider outside of container (or at least as the running user) on encrypt/decrypt #85

Open Dsolnik opened 1 year ago

Dsolnik commented 1 year ago

Hello!

When using ocicrypt, I believe at least, the key provider is executed inside of the container as root so $USER is root. Is there a way to disable this and run as the user making the request?

Thanks

Dsolnik commented 1 year ago

To reproduce this, make https://github.com/lumjjb/simple-ocicrypt-keyprovider print out the current user:

   currentUser, err := user.Current()
   if err != nil {
      log.Fatalf(err.Error())
   }
   username := currentUser.Username

   fmt.Printf("Username is: %s\n", username)