{"id":13641602,"url":"https://github.com/enclaive/enclaive-docker-nginx-sgx","last_synced_at":"2026-01-22T15:14:58.210Z","repository":{"id":38820944,"uuid":"460458491","full_name":"enclaive/enclaive-docker-nginx-sgx","owner":"enclaive","description":"SGX-ready Enclaive Docker Image for Nginx","archived":false,"fork":false,"pushed_at":"2022-09-14T15:24:43.000Z","size":18919,"stargazers_count":31,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-03T01:24:04.552Z","etag":null,"topics":["cloud","cloudsecurity","confidential-computing","container","docker","docker-image","kubernetes","nginx","sgx","sgx-enclave","zero-trust","zero-trust-cloud"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/enclaive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-02-17T13:58:54.000Z","updated_at":"2024-07-20T19:18:39.000Z","dependencies_parsed_at":"2023-01-17T18:01:04.585Z","dependency_job_id":null,"html_url":"https://github.com/enclaive/enclaive-docker-nginx-sgx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enclaive%2Fenclaive-docker-nginx-sgx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enclaive%2Fenclaive-docker-nginx-sgx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enclaive%2Fenclaive-docker-nginx-sgx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enclaive%2Fenclaive-docker-nginx-sgx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enclaive","download_url":"https://codeload.github.com/enclaive/enclaive-docker-nginx-sgx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223827464,"owners_count":17209795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud","cloudsecurity","confidential-computing","container","docker","docker-image","kubernetes","nginx","sgx","sgx-enclave","zero-trust","zero-trust-cloud"],"created_at":"2024-08-02T01:01:22.156Z","updated_at":"2026-01-22T15:14:58.205Z","avatar_url":"https://github.com/enclaive.png","language":"C","funding_links":[],"categories":["Network"],"sub_categories":["Library OSes and SDKs"],"readme":"\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ctable\u003e\n    \u003ctr\u003e \n      \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://enclaive.io/products/nginx\"\u003e\n          \u003cimg alt=\"nodejs-sgx\" height=64px src=\"https://raw.githubusercontent.com/devicons/devicon/master/icons/nginx/nginx-original.svg\"\u003e\n        \u003c/a\u003e\n        \u003cbr\u003eNginx-SGX\u003c/td\u003e     \n      \u003c/td\u003e  \n    \u003c/tr\u003e\n    \u003c/table\u003e\n\n\n  \u003ch2 align=\"center\"\u003eSGX-ready NGINX open source server\u003c/h2\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003ch3\u003epacked by \u003ca href=\"https://enclaive.io\"\u003eenclaive\u003c/a\u003e\u003c/h3\u003e\n    \u003c/br\u003e\n    #intelsgx # confidentialcompute #dont-trust-a-cloud\n    \u003cbr /\u003e\n    \u003ca href=\"#contributing\"\u003eContribute\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/enclaive/enclaive-docker-nginx-sgx/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/enclaive/enclaive-docker-nginx-sgx/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\u003c!-- INTRODCUTION --\u003e\n## What is NGINX and SGX?\n\n\u003e NGINX Open Source is a web server that can be also used as a reverse proxy, load balancer, and HTTP cache. Recommended for high-demanding sites due to its ability to provide faster content.\n\n[Overview of NGINX](http://nginx.org/)\n\n\u003e Intel Security Guard Extension (SGX) delivers advanced hardware and RAM security encryption features, so called enclaves, in order to isolate code and data that are specific to each application. When data and application code run in an enclave additional security, privacy and trust guarantees are given, making the container an ideal choice for (untrusted) cloud environments.\n\n[Overview of Intel SGX](https://www.intel.com/content/www/us/en/developer/tools/software-guard-extensions/overview.html)\n\nApplication code executing within an Intel SGX enclave:\n\n- Remains protected even when the BIOS, VMM, OS, and drivers are compromised, implying that an attacker with full execution control over the platform can be kept at bay\n- Benefits from memory protections that thwart memory bus snooping, memory tampering and “cold boot” attacks on images retained in RAM\n- At no moment in time data, program code and protocol messages are leaked or de-anonymized\n- Reduces the trusted computing base of its parent application to the smallest possible footprint\n\n\u003c!-- WHY --\u003e\n## Why use NGINX-SGX (instead of \"vanilla\" NGINX) images?\nFollowing benefits come for free with NGINX-SGX :\n\n- \"Small step for a dev, giant leap for a zero-trust infrastructure\"\n- All business benefits from the migration to a (public) cloud without sacraficing on-premise infrastracture trust\n- Hardened security against kernel-space exploits, malicious and accidental privilege [insider](https://www.ibm.com/topics/insider-threats) attacks, [UEFI firmware](https://thehackernews.com/2022/02/dozens-of-security-flaws-discovered-in.html) exploits and other \"root\" attacks using the corruption of the application to infiltrate your network and system\n- Run on any hosting environment irrespectivably of geo-location and comply with privacy export regulation, such as [Schrem-II](https://www.europarl.europa.eu/RegData/etudes/ATAG/2020/652073/EPRS_ATA(2020)652073_EN.pdf)\n- GDPR/CCPA compliant processing (\"data in use\") of user data in the cloud as data is anonymized thanks to the enclave\n\n\u003c!-- TL;TD --\u003e \n## TL;DR\n\n```sh\ndocker pull enclaive/nginx-sgx\ndocker-compose up -d\n```\n**Warning**: This quick setup is only intended for development environments. You are encouraged to change the insecure default credentials and check out the available configuration options in the [build](#build-the-image) section for a more secure deployment.\n\n\n\u003c!-- DEPLOY IN THE CLOUD --\u003e\n## How to deploy NGINX-SGX in a zero-trust cloud?\n\nThe following cloud infrastractures are SGX-ready out of the box\n* [Microsoft Azure Confidential Cloud](https://azure.microsoft.com/en-us/solutions/confidential-compute/) \n* [OVH Cloud](https://docs.ovh.com/ie/en/dedicated/enable-and-use-intel-sgx/)\n* [Alibaba Cloud](https://www.alibabacloud.com/blog/alibaba-cloud-released-industrys-first-trusted-and-virtualized-instance-with-support-for-sgx-2-0-and-tpm_596821) \n\nConfidential compute is a fast growing space. Cloud providers continiously add confidential compute capabilities to their portfolio. Please [contact](#contact) us if the infrastracture provider of your preferred choice is missing.\n\n\u003c!-- GETTING STARTED --\u003e\n## Getting started\n### Platform requirements\n\nCheck for *Intel Security Guard Extension (SGX)* presence by running the following\n```\ngrep sgx /proc/cpuinfo\n```\nAlternatively have a thorough look at Intel's [processor list](https://www.intel.com/content/www/us/en/support/articles/000028173/processors.html). (We remark that macbooks with CPUs transitioned to Intel are unlikely supported. If you find a configuration, please [contact](#contact) us know.)\n\nNote that in addition to SGX the hardware module must support FSGSBASE. FSGSBASE is an architecture extension that allows applications to directly write to the FS and GS segment registers. This allows fast switching to different threads in user applications, as well as providing an additional address register for application use. If your kernel version is 5.9 or higher, then the FSGSBASE feature is already supported and you can skip this step.\n\nThere are several options to proceed\n* If: No SGX-ready hardware \u003c/br\u003e \n[Azure Confidential Compute](https://azure.microsoft.com/en-us/solutions/confidential-compute/\") cloud offers VMs with SGX support. Prices are fair and have been recently reduced to support the [developer community](https://azure.microsoft.com/en-us/updates/announcing-price-reductions-for-azure-confidential-computing/). First-time users get $200 USD [free](https://azure.microsoft.com/en-us/free/) credit. Other cloud provider like [OVH](https://docs.ovh.com/ie/en/dedicated/enable-and-use-intel-sgx/) or [Alibaba](https://www.alibabacloud.com/blog/alibaba-cloud-released-industrys-first-trusted-and-virtualized-instance-with-support-for-sgx-2-0-and-tpm_596821) cloud have similar offerings.\n* Elif: Virtualization \u003cbr\u003e\n  Ubuntu 21.04 (Kernel 5.11) provides the driver off-the-shelf. Read the [release](https://ubuntu.com/blog/whats-new-in-security-for-ubuntu-21-04). Go to [download](https://ubuntu.com/download/desktop) page.\n* Elif: Kernel 5.9 or higher \u003cbr\u003e\nInstall the DCAP drivers from the Intel SGX [repo](https://github.com/intel/linux-sgx-driver)\n\n  ```sh\n  sudo apt update\n  sudo apt -y install dkms\n  wget https://download.01.org/intel-sgx/sgx-linux/2.13.3/linux/distro/ubuntu20.04-server/sgx_linux_x64_driver_1.41.bin -O sgx_linux_x64_driver.bin\n  chmod +x sgx_linux_x64_driver.bin\n  sudo ./sgx_linux_x64_driver.bin\n\n  sudo apt -y install clang-10 libssl-dev gdb libsgx-enclave-common libsgx-quote-ex libprotobuf17 libsgx-dcap-ql libsgx-dcap-ql-dev az-dcap-client open-enclave\n  ```\n\n* Else: Kernel older than version 5.9 \u003c/br\u003e\n  Upgrade to Kernel 5.11 or higher. Follow the instructions [here](https://ubuntuhandbook.org/index.php/2021/02/linux-kernel-5-11released-install-ubuntu-linux-mint/).   \n\n### Software requirements\nInstall the docker engine\n```sh\n sudo apt-get update\n sudo apt-get install docker-ce docker-ce-cli containerd.io\n sudo usermod -aG docker $USER    # manage docker as non-root user (obsolete as of docker 19.3) \n```\nUse `docker run hello-world` to check if you can run docker (without sudo).\n\n\u003c!-- GET THIS IMAGE --\u003e\n### Get this image\n\nThe recommended way to get the enclaive NGINX-SGX Open Source Docker Image is to pull the prebuilt image from the [Docker Hub Registry](https://hub.docker.com/r/enclaive/nginx-sgx).\n\n```console\ndocker pull enclaive/nginx-sgx:latest\n```\n\nTo use a specific version, you can pull a versioned tag. You can view the\n[list of available versions](https://hub.docker.com/r/enclaive/nginx-sgx/tags/)\nin the Docker Hub Registry.\n\n```console\ndocker pull enclaive/nginx-sgx:[TAG]\n```\n\n\u003c!-- BUILD THE IMAGE --\u003e\n## Build the image\nIf you wish, you can also build the image yourself.\n\n```console\ndocker build -t enclaive/nginx-sgx:latest 'https://github.com/enclaive/enclaive-docker-nginx-sgx.git#master'\n```\n\u003c!-- HOSTING --\u003e\n### Hosting a static website\n\nThis NGINX-SGX Open Source repo exposes the folder at `/html`. Content mounted from this folder is served by the default catch-all server block. \n\n### Use as an anonymous Reverse Proxy\n\nThe `module-sgx` provides a variable `$sgx_add_x_forwarded_for` similar to the original `$proxy_add_x_forwarded_for` variable provided by the standard `proxy` module of `nginx`: [proxy_add_x_forwarded_for](https://nginx.org/en/docs/http/ngx_http_proxy_module.html#var_proxy_add_x_forwarded_for). Example usage can be seen in the `/api/` location configured in `conf/nginx.conf`.\n\n### Configure network ports\nEdit `conf/nginx.conf` to eanble the ports the server should listen to. Default ports are 80 and 443 for non-secured and TLS-secured communication, respectively.\n```\nlisten 80;\nlisten 443 ssl;\n```\n\n\u003c!-- ACCESSING --\u003e\n### Accessing your server from the host\n\nTo access your web server from your host machine you can ask Docker to map a random port on your host to ports `80` and `443` exposed in the container.\n\n```console\ndocker run --name nginx-sgx -p 80:80 -p 443:443 \\  \n    --device=/dev/sgx_enclave \\ \n    -v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket \\ \n    enclaive/nginx-sgx:latest\n```\nAccess your web server in the browser by navigating to `https://localhost` and `http://localhost` for a SSL/TLS secured and non-secure community, respectively.\n\nRun `docker port` to determine the random ports Docker assigned.\n\n```console\ndocker port nginx-sgx\n80/tcp -\u003e 0.0.0.0:32769\n```\n\nYou can also manually specify the ports you want forwarded from your host to the container.\n\n```console\ndocker run -p 9000:80 -p9443:443 \\\n    --device=/dev/sgx_enclave    \\\n    -v /var/run/aesmd/aesm.socket:/var/run/aesmd/aesm.socket \\\n     enclaive/nginx-sgx:latest\n```\n\nAccess your web server in the browser by navigating to `https://localhost:9443` (SSL/TLS) and `http://localhost:9443` (non-secured).\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003c!-- SUPPORT --\u003e\n## Support\n\nDon't forget to give the project a star! Spread the word on social media! Thanks again!\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the Apache License 2.0 License. See `LICENSE` for more information.\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nenclaive.io - [@enclaive_io](https://twitter.com/enclaive_io) - contact@enclaive.io - [https://enclaive.io](https://enclaive.io)\n\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\nThis project greatly celebrates all contributions from the gramine team. Special shout out to [Dmitrii Kuvaiskii](https://github.com/dimakuv) from Intel for his support. \n\n* [Gramine Project](https://github.com/gramineproject)\n* [Intel SGX](https://github.com/intel/linux-sgx-driver)\n* [NGINX](https://www.nginx.org)\n\n\n## Trademarks \n\nThis software listing is packaged by enclaive.io. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenclaive%2Fenclaive-docker-nginx-sgx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenclaive%2Fenclaive-docker-nginx-sgx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenclaive%2Fenclaive-docker-nginx-sgx/lists"}