### Install MarbleRun CLI for Current User Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.1/getting-started/quickstart.md Downloads and installs the MarbleRun CLI to the user's local bin directory (~/.local/bin). This allows interaction with MarbleRun deployments without requiring root privileges. ```bash wget -P ~/.local/bin https://github.com/edgelesssys/marblerun/releases/latest/download/marblerun chmod +x ~/.local/bin/marblerun ``` -------------------------------- ### Install and Check MarbleRun Coordinator Source: https://github.com/edgelesssys/marblerun/blob/master/samples/gramine-redis/README.md Installs the MarbleRun Coordinator on the Kubernetes cluster and checks its readiness. This is a prerequisite for deploying applications with MarbleRun. ```bash marblerun install marblerun check ``` -------------------------------- ### Globally Install MarbleRun CLI (Requires Root) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.1/getting-started/quickstart.md Installs the MarbleRun CLI to a system-wide location (/usr/local/bin/marblerun), requiring root privileges. This makes the CLI available to all users on the system. ```bash sudo wget -O /usr/local/bin/marblerun https://github.com/edgelesssys/marblerun/releases/latest/download/marblerun sudo chmod +x /usr/local/bin/marblerun ``` -------------------------------- ### Install MarbleRun CLI using AppImage Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/installation.md Installs the MarbleRun CLI using an AppImage, suitable for x86-64 Linux distributions with glibc v2.29+. The AppImage includes the necessary quote provider. ```bash wget https://github.com/edgelesssys/marblerun/releases/latest/download/marblerun-x86_64.AppImage sudo install marblerun-x86_64.AppImage /usr/local/bin/marblerun ``` -------------------------------- ### Verify Kubernetes Installation with kubectl Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/installation.md This command checks if kubectl is installed and configured correctly, verifying both client and server versions. It's a prerequisite for installing MarbleRun. ```bash kubectl version --short ``` -------------------------------- ### Verify MarbleRun CLI Installation Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/installation.md This command verifies that the MarbleRun CLI has been installed successfully and is accessible. It should produce output indicating the CLI is running. ```bash marblerun ``` -------------------------------- ### Download Quote Provider Configuration Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/installation.md This command downloads the default quote provider configuration file from a GitHub repository and saves it to `/etc/sgx_default_qcnl.conf`. This file is crucial for the CLI to retrieve attestation report collaterals. ```bash wget -qO- https://raw.githubusercontent.com/intel/SGXDataCenterAttestationPrimitives/master/QuoteGeneration/qcnl/linux/sgx_default_qcnl.conf | sudo tee /etc/sgx_default_qcnl.conf > /dev/null ``` -------------------------------- ### Build TLS-Enabled Redis CLI Source: https://github.com/edgelesssys/marblerun/blob/master/samples/gramine-redis/README.md Downloads, builds, and installs a TLS-supported version of the Redis CLI. This ensures the client can securely connect to the Redis server. ```bash wget http://download.redis.io/redis-stable.tar.gz tar xzf redis-stable.tar.gz && cd redis-stable make BUILD_TLS=yes && cp src/redis-cli /usr/local/bin ``` -------------------------------- ### Install MarbleRun Control Plane (Simulation Mode) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.1/getting-started/quickstart-simulation.md Installs the MarbleRun Coordinator control plane with the simulation flag enabled. This flag emulates SGX hardware, allowing testing without physical SGX requirements. The command generates necessary Kubernetes manifests for the control plane components. ```bash marblerun install --simulation ``` -------------------------------- ### Install emojivoto Demo App (Simulation Mode) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/quickstart.md Installs the emojivoto demo application using Helm in simulation mode. It uses the './kubernetes/nosgx_values.yaml' configuration file and deploys into the 'emojivoto' namespace. ```bash helm install -f ./kubernetes/nosgx_values.yaml emojivoto ./kubernetes --create-namespace -n emojivoto ``` -------------------------------- ### Build Gramine Example Application Source: https://github.com/edgelesssys/marblerun/blob/master/samples/gramine-hello/README.md Commands to build the Gramine "Hello World!" example. It involves generating an enclave key and then executing the make command. The output includes a measurement that needs to be set as the UniqueID in the manifest.json. ```shell openssl genrsa -3 -out enclave-key.pem 3072 make ``` -------------------------------- ### Install MarbleRun Control Plane (SGX Mode) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.5/getting-started/quickstart.md Installs the MarbleRun Coordinator control plane with SGX hardware enabled. This command generates Kubernetes manifests for the Coordinator and admission controller deployments. It assumes a working SGX DCAP environment. ```bash marblerun install ``` -------------------------------- ### Install emojivoto Demo App (SGX Mode) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/quickstart.md Installs the emojivoto demo application using Helm in SGX mode. It requires Helm version v3.2.0 or higher and uses the './kubernetes/sgx_values.yaml' configuration file to deploy into the 'emojivoto' namespace. ```bash helm install -f ./kubernetes/sgx_values.yaml emojivoto ./kubernetes --create-namespace -n emojivoto ``` -------------------------------- ### Build Gramine Nginx Example with SGX Source: https://github.com/edgelesssys/marblerun/blob/master/samples/gramine-nginx/README.md Commands to generate an enclave key and build the Gramine Nginx example with SGX support. This is a prerequisite for running the example with MarbleRun. ```sh openssl genrsa -3 -out enclave-key.pem 3072 make SGX=1 ``` -------------------------------- ### Monitor Redis Server Startup Source: https://github.com/edgelesssys/marblerun/blob/master/samples/gramine-redis/README.md Retrieves the logs for the main Redis pod to monitor its startup process and confirm it's ready to accept connections. This helps in verifying the deployment. ```bash kubectl logs redis-main-0 -n redis ``` -------------------------------- ### Deploy Redis using Helm Source: https://github.com/edgelesssys/marblerun/blob/master/samples/gramine-redis/README.md Deploys a Redis instance on the Kubernetes cluster using Helm, with a specified values file and namespace. This command initiates the Redis server deployment. ```bash helm install -f ./kubernetes/values.yaml redis ./kubernetes --create-namespace -n redis ``` -------------------------------- ### marblerun install Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.4/reference/cli.md Installs MarbleRun on a Kubernetes cluster. This command allows for various configurations including simulation mode and custom PCCS setup. ```APIDOC ## POST /cli/install ### Description Installs MarbleRun on a Kubernetes cluster. This command allows for various configurations including simulation mode and custom PCCS setup. ### Method POST ### Endpoint /cli/install ### Parameters #### Query Parameters - **simulation** (boolean) - Optional - Set MarbleRun to start in simulation mode. - **dcapPccsUrl** (string) - Optional - Provisioning Certificate Caching Service (PCCS) server address. Defaults to Azure PCCS. - **dcapSecureCert** (string) - Optional - To accept insecure HTTPS certificate from the PCCS, set this option to FALSE. Defaults to TRUE. - **clientServerPort** (integer) - Optional - Set the client server port. Needs to be configured to the same port as in your client tool stack. Default: 4433. - **meshServerPort** (integer) - Optional - Set the mesh server port. Needs to be configured to the same port as in the data-plane marbles. Default: 2001. - **domain** (string) - Optional - Sets the CNAME for the Coordinator certificate. Default: "localhost". - **resourceKey** (string) - Optional - Resource providing SGX, different depending on used device plugin. Use this to set tolerations/resources if your device plugin is not supported by MarbleRun. - **version** (string) - Optional - Version of the Coordinator to install, latest by default. - **enterpriseAccessToken** (string) - Optional - Access token for Enterprise Coordinator. Leave empty for default installation. - **marblerunChartPath** (string) - Optional - Path to MarbleRun helm chart. - **disableAutoInjection** (boolean) - Optional - Install MarbleRun without auto-injection webhook. - **wait** (boolean) - Optional - Wait for MarbleRun installation to complete before returning. ### Request Example ```json { "simulation": true, "dcapPccsUrl": "https://pccs.example.com/sgx/certification/v4/", "dcapSecureCert": "FALSE" } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message of the installation process. #### Response Example ```json { "message": "MarbleRun installed successfully." } ``` ``` -------------------------------- ### GET /edgelesssys/marblerun/certificate Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.1/reference/cli.md Retrieves the certificate of the MarbleRun Coordinator. ```APIDOC ## GET /edgelesssys/marblerun/certificate ### Description Retrieves the certificate of the MarbleRun Coordinator. ### Method GET ### Endpoint /edgelesssys/marblerun/certificate ### Parameters #### Query Parameters - **--accepted-tcb-statuses** (string array) - Optional - Comma-separated list of user accepted TCB statuses. - **--era-config** (string) - Optional - Path to remote attestation config file in json format. - **-i, --insecure** (boolean) - Optional - Set to skip quote verification, needed when running in simulation mode. ### Request Example (No specific request example provided in the source text. This command likely doesn't require a specific request body or path parameters beyond the base endpoint.) ### Response #### Success Response (200) - **certificate** (string) - The PEM encoded certificate of the MarbleRun Coordinator. #### Response Example (No specific response example provided in the source text.) ``` -------------------------------- ### Install MarbleRun CLI and Quote Provider on Ubuntu 22.04 Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/installation.md Installs the MarbleRun CLI and the SGX DCAP quote provider on Ubuntu 22.04. It downloads the CLI executable and configures the system's package sources for the quote provider. ```bash # install CLI wget https://github.com/edgelesssys/marblerun/releases/latest/download/marblerun-ubuntu-22.04 sudo install marblerun-ubuntu-22.04 /usr/local/bin/marblerun # install quote provider wget -qO- https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo tee /etc/apt/keyrings/intel-sgx-keyring.asc > /dev/null echo "deb [signed-by=/etc/apt/keyrings/intel-sgx-keyring.asc arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/intel-sgx.list sudo apt update sudo apt install libsgx-dcap-default-qpl ``` -------------------------------- ### Manifest Request and Response Examples Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.8/reference/coordinator.md Examples of request and response bodies for setting a manifest. The request body is a JSON object containing configuration details, and the response body includes a status and potentially recovery keys. ```json { "manifest": "eyJQYWNrYWdlcyI6e30sIk1hcmJsZXMiOnt9fQo=" } ``` ```json { "status": "success", "data": { "recoveryKeys": { "recoveryKey1": "ZW5jcnlwdGVkUmVjb3ZlcnlTZWNyZXQxCg==", "recoveryKey2": "ZW5jcnlwdGVkUmVjb3ZlcnlTZWNyZXQyCg==" } } } ``` ```json { "Packages": { "package1": {}, "package2": {} }, "Marbles": { "marble1": {}, "marble2": {} }, "Secrets": {}, "Users": {}, "Roles": {}, "TLS": {}, "RecoveryKeys": { "recoveryKey1": "-----BEGIN PUBLIC KEY-----\nMIIBpTANBgk...", "recoveryKey2": "-----BEGIN PUBLIC KEY-----\nMIIBpTANBgk..." } } ``` -------------------------------- ### Install MarbleRun CLI and Quote Provider on Ubuntu 20.04 Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/getting-started/installation.md Installs the MarbleRun CLI and the SGX DCAP quote provider on Ubuntu 20.04. It downloads the CLI executable and configures the system's package sources for the quote provider. ```bash # install CLI wget https://github.com/edgelesssys/marblerun/releases/latest/download/marblerun-ubuntu-20.04 sudo install marblerun-ubuntu-20.04 /usr/local/bin/marblerun # install quote provider sudo mkdir -p /etc/apt/keyrings wget -qO- https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo tee /etc/apt/keyrings/intel-sgx-keyring.asc > /dev/null echo "deb [signed-by=/etc/apt/keyrings/intel-sgx-keyring.asc arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/intel-sgx.list sudo apt update sudo apt install libsgx-dcap-default-qpl ``` -------------------------------- ### Deploy emojivoto Application with Helm Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.3/getting-started/quickstart.md Installs the emojivoto demo application onto a Kubernetes cluster using Helm. Requires Helm version v3.2.0 or later. Supports deployment with SGX-specific values or simulation mode values. ```bash helm install -f ./kubernetes/sgx_values.yaml emojivoto ./kubernetes --create-namespace -n emojivoto ``` ```bash helm install -f ./kubernetes/nosgx_values.yaml emojivoto ./kubernetes --create-namespace -n emojivoto ``` -------------------------------- ### Installing Marblerun with DCAP PCCS URL via CLI Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/deployment/kubernetes.md This command installs or configures Marblerun using the command-line interface, specifying the DCAP PCCS URL and whether to use a secure certificate. This is an alternative to Helm installations for DCAP configuration. ```bash marblerun install --dcap-pccs-url --dcap-secure-cert ``` -------------------------------- ### Install MarbleRun using Helm Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.2/deployment/kubernetes.md Installs MarbleRun using Helm charts, with variations for clusters supporting SGX and those without. For installations with the marble-injector webhook enabled, cert-manager is a requirement. Key configurations include `coordinator.hostname`, `marbleInjector.start`, `marbleInjector.useCertManager`, `coordinator.resources`, `coordinator.simulation`, and `tolerations`. ```bash helm install marblerun edgeless/marblerun \ --create-namespace \ -n marblerun \ --set coordinator.hostname=mycluster.uksouth.cloudapp.azure.com \ --set marbleInjector.start=true \ --set marbleInjector.useCertManager=true ``` ```bash helm install marblerun edgeless/marblerun \ --create-namespace \ -n marblerun \ --set coordinator.resources=null \ --set coordinator.simulation=1 \ --set tolerations=null \ --set coordinator.hostname=mycluster.uksouth.cloudapp.azure.com \ --set marbleInjector.start=true \ --set marbleInjector.useCertManager=true ``` -------------------------------- ### Create and Use REST API Client in Go Source: https://context7.com/edgelesssys/marblerun/llms.txt This Go code demonstrates how to create an authenticated HTTP client for the Coordinator's REST API. It includes steps for verifying the coordinator's certificate, initializing the client, making a GET request to the status endpoint, and parsing the JSON response. Dependencies include the 'context', 'crypto/x509', 'encoding/json', 'fmt', 'log', 'net/http', and Marblerun's 'api' and 'api/rest' packages. ```go package main import ( "context" "crypto/x509" "encoding/json" "fmt" "log" "net/http" "github.com/edgelesssys/marblerun/api" "github.com/edgelesssys/marblerun/api/rest" ) func main() { ctx := context.Background() coordinatorAddr := "coordinator.example.com:4433" // Verify and get root certificate opts := api.VerifyOptions{ UniqueID: "your-mrenclave", SignerID: "your-mrsigner", } rootCert, _, _, err := api.VerifyCoordinator(ctx, coordinatorAddr, opts) if err != nil { log.Fatalf("Failed to verify: %v", err) } // Create authenticated REST client client, err := rest.NewClient(coordinatorAddr, rootCert, nil) if err != nil { log.Fatalf("Failed to create client: %v", err) } // Get status using REST API statusData, err := client.Get(ctx, rest.V2API+rest.StatusEndpoint, http.NoBody) if err != nil { log.Fatalf("GET request failed: %v", err) } var status struct { Code int `json:"code"` Message string `json:"message"` } if err := json.Unmarshal(statusData, &status); err != nil { log.Fatalf("Failed to parse response: %v", err) } fmt.Printf("Status Code: %d\n", status.Code) fmt.Printf("Status Message: %s\n", status.Message) // Available API endpoints: // - rest.V2API + rest.QuoteEndpoint (/api/v2/quote) // - rest.V2API + rest.ManifestEndpoint (/api/v2/manifest) // - rest.V2API + rest.StatusEndpoint (/api/v2/status) // - rest.V2API + rest.RecoverEndpoint (/api/v2/recover) // - rest.V2API + rest.SecretEndpoint (/api/v2/secrets) // - rest.V2API + rest.UpdateEndpoint (/api/v2/update) // - rest.V2API + rest.SignQuoteEndpoint (/api/v2/sign-quote) } ``` -------------------------------- ### Install Marblerun with Custom DCAP Configuration (CLI) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.1/deployment/kubernetes.md Shows how to install Marblerun using the command-line interface, specifying custom DCAP configurations such as the QPL (Quote Generation Library) and PCCS URL. This allows for integration with non-Azure PCCS services. Requires the Marblerun CLI to be installed. ```bash marblerun install --dcap-qpl intel --dcap-pccs-url --dcap-secure-cert ``` -------------------------------- ### Configure Gramine Entrypoint and Arguments Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/building-marbles/gramine.md Sets the Gramine application's entry point to 'premain-libos' and specifies the actual application name in argv0. It also adds 'premain-libos' to the list of trusted files within the Gramine manifest. This configuration ensures the MarbleRun premain executable is used to bootstrap the application. ```toml libos.entrypoint = "file:premain-libos" # argv0 needs to contain the name of your executable loader.argv = ["hello"] # add the premain to the list of trusted files sgx.trusted_files = [ # ... "file:premain-libos" ] ``` -------------------------------- ### Install Generic SGX System Dependency (Ubuntu 20.04) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.1/reference/cli.md Installs the Intel libsgx-dcap-default-qpl library, which facilitates SGX quote verification on generic SGX systems. This script adds the Intel SGX repository and installs the required library. ```bash sudo apt-key adv --fetch-keys https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key sudo add-apt-repository 'https://download.01.org/intel-sgx/sgx_repo/ubuntu main' sudo apt update sudo apt install -y libsgx-dcap-default-qpl ``` -------------------------------- ### Install Marblerun with Custom DCAP Configuration (Helm) Source: https://github.com/edgelesssys/marblerun/blob/master/docs/versioned_docs/version-1.1/deployment/kubernetes.md Illustrates how to install Marblerun using Helm, configuring custom DCAP settings including the PCCS URL and whether to use a secure certificate. This method is suitable for declarative deployments and integration into existing Helm-managed infrastructure. Requires Helm to be installed. ```yaml helm install marblerun edgeless/marblerun \ --create-namespace \ -n marblerun \ --set coordinator.hostname=mycluster.uksouth.cloudapp.azure.com \ --set dcap.qpl=intel \ --set dcap.pccsUrl= \ --set dcap.useSecureCert= ``` -------------------------------- ### Run Gramine Application in MarbleRun Source: https://github.com/edgelesssys/marblerun/blob/master/samples/gramine-hello/README.md Executes the Gramine application within MarbleRun. It requires setting the `EDG_MARBLE_TYPE` environment variable to the name defined in the manifest (e.g., 'hello') and then running the Gramine application using `gramine-sgx`. ```shell EDG_MARBLE_TYPE=hello gramine-sgx hello ``` -------------------------------- ### Install MarbleRun with CLI Source: https://github.com/edgelesssys/marblerun/blob/master/docs/docs/deployment/kubernetes.md Installs MarbleRun using its command-line interface. This command pulls the latest Helm chart and manages its installation. It supports clusters with or without SGX support by optionally including the `--simulation` flag. The `--domain` parameter configures the Coordinator's TLS certificate CommonName. ```bash marblerun install --domain=mycluster.uksouth.cloudapp.azure.com ``` ```bash marblerun install --domain=mycluster.uksouth.cloudapp.azure.com --simulation ```