madana-enclave

by MADANA

Helm chartv0.1.3App 1.0Verified publisher

A Helm chart for Kubernetes

About this chart

madana-enclave

The madana enclave chart is capable of deploying an sgx enclave environment using the sgx-lkl library OS. It can be provided with existing enclave environments via IPFS or via an existing persistent volume. These environments will then be prepared before the startup of the enclave process. Using kubernetes services, enclave ports can be made publicly accessable via NodePort, LoadBalancer or ClusterIP services.

Although it can be used as a standalone tool, the madana enclave chart is part of the Madana Core and Madana Node products. For a bigger picture how this all fits together, please consult the Madana Node Documentation.

Chart values

| Parameter | Description | Default | | - | - | - | | enclave.repository | Enclave container repository | registry.gitlab.com/madana-io/madana-enclave | | enclave.tag | Enclave container tag | latest production | | enclave.pullPolicy | Enclave container pull policy | IfNotPresent | | enclave.command | custom enclave run command, for examples see below | null | | enclave.pvc.storage | Persistent volume storage if IPFS or PVC upload is used | 15Gi | | enclave.resources | request and limit enclave resources | limits.kubernetes.azure.com/sgx_epc_mem_in_MiB: 1 | | enclave.service.ports | configure custom port forwarding, format: name: <port_name>port: <1-65535>protocol: TCP/UDP| [] | | enclave.service.type | Kubernetes service type, use e.g. NodePort, LoadBalancer, ClusterIP | NodePort | | env.IASSPID | IAS SPID needed for remote attestation | null | | env.WGPeers | wireguard public key, format: <your_wireguard_public_key>:10.0.2.2/32: | null | | env.reportNonce | to verify whether the attestation is current, a report nonce can be defined, which will then be part of the remote attestation | null | | ipfs.enabled | use IPFS to upload a custom enclave environment to your pod | false | | ipfs.imagePath | IPFS hash of your enclave environment, will be downloaded to /madana-node/environments/<imagePath> | null | | ipfs.timeout | IPFS fetch will fail after the specified time, if not set will continue to try indefinitely | none | | madanaNode.environmentVolume.enabled | alternatively if an enclave environment already exists in a pvc, it can be copied to the enclave storage on startup, its contents will be copied to /madana-node/environments/ | false | | madanaNode.environmentVolume.pvcName | the name of the pvc that the environment(s) should be copied from | null | | madanaNode.environmentVolume.subPath | only the specified subpath of the pvc will be copied (keeping folder structure) | null |

Note: kubernetes.azure.com/sgx_epc_mem_in_MiB must always be >= 1 otherwise the sgx device driver is not attached to the pod

Enclave run command

If not specified the enclave is started with its default image: SGXLKL_REMOTE_CONFIG=1 /sgx-lkl/build/sgx-lkl-run /sgx-lkl/sgxlkl-default-fs.img For a detailed list of available parameters you can start the enclave with /sgx-lkl/build/sgx-lkl-run --help && sleep infinity.

Examples

Show detailed list of available parameters for sgx-lkl-run command

$ helm install --set job=true --set enclave.command="/sgx-lkl/build/sgx-lkl-run --help" enc0 .
$ kubectl logs job/enc0-madana-enclave

Start enclave with IPFS Redis Environment, supplying the application configuration as startup parameter and forwarding enclave port 56789 as NodePort

$ helm install --set ipfs.enabled=true \
	--set ipfs.imagePath=QmbwDESqxRRByKNUe5YzdeniWxwAdw1RxxrKg55apYFccf \
	--set enclave.service.ports[0].name=redis \
	--set enclave.service.ports[0].port=56789 \
	--set enclave.service.ports[0].protocol=TCP \
	--set enclave.command="SGXLKL_REMOTE_CONFIG=0 /sgx-lkl/build/sgx-lkl-run \
--app=/madana-node/environments/QmbwDESqxRRByKNUe5YzdeniWxwAdw1RxxrKg55apYFccf/default.runconfig \
/madana-node/environments/QmbwDESqxRRByKNUe5YzdeniWxwAdw1RxxrKg55apYFccf/Redis.img" \
	enc0 \
	.

Disclaimer

The madana-enclaves and its implementations are still in heavy development. This means that there may be problems in our protocols, or there may be mistakes in our implementations. And -- though madana is not production-ready yet -- many people are already running madana-enclaves in their machines. So we take security vulnerabilities very seriously. If you discover a security issue, please bring it to our attention right away! If you find a vulnerability that may affect live deployments -- for example, by exposing a remote execution exploit -- please send your report privately to [email protected]. Please DO NOT file a public issue. If the issue is a protocol weakness that cannot be immediately exploited or something not yet deployed, just discuss it openly.

Deploy madana-enclave with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has madana-enclave on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmadana-enclave is pinned at v0.1.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply