(maybe dumb Q) Any way to avoid exposing drive encryption keys to a VPS (via ram or disk) using IncusOS?

I would like to migrate my basic 24/7 containers with private/sensitive data outside of my homelab to some low-cost VPS with low-performance nested virtualisation and disk encryption.

Containers are fairly lightweight, running alpine linux, serving below 1000 of data fetch requests per day, with only overhead for tailscale/wg vpn.

Just in case, I’m not trying to protect my data from targeted attack, it’s more to avoid data harvesting by unfavorite accident, like hack of VPS by someone else.

All my previous checks (though for proxmox and few other hypervisors) on how to do it in a way to 100% ensure no “external” snapshotting of hoster ram/disk for further keys extraction is possible lead to the typical conclusion that disk encryption key has to be stored on VPS anyway thus making the idea not possible.

Can IncusOS help me with that? Idk, fetching encryption keys from some other remote location upon boot (other than that VPS, mabe from my homelab or another VPS)? That may include mid-complex nested virtualisation.

Alternatively, I will be thankful for a proper solution to such a typical need.

What you want isn’t really possible.

Anyone with access to your VM (or physical system’s) memory will be able, given enough effort, to extract the LUKS encryption key that sits in memory. That key must be present in memory for the kernel to read and write to the encrypted storage, there’s no real way around it.

That’s the problem that Confidential Computing is trying to solve by letting you run a VM in an environment that provides hardware backed memory encryption along with attestation mechanisms so you can be confident that the environment has been fully setup in a safe way (as your hosting provider could be lying to you and pretend to have memory encryption).