{"id":16783109,"url":"https://github.com/bengreenier/sgx-lkl-turtles","last_synced_at":"2025-03-16T21:45:08.160Z","repository":{"id":74695562,"uuid":"210388103","full_name":"bengreenier/sgx-lkl-turtles","owner":"bengreenier","description":"Docker-in-docker SGX-LKL sample of a Node hello world app. 🧙‍📦⚡","archived":false,"fork":false,"pushed_at":"2019-10-03T17:10:19.000Z","size":63,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-23T08:20:05.811Z","etag":null,"topics":["enclave","nodejs","sample","sgx-lkl","tee"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bengreenier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-23T15:20:49.000Z","updated_at":"2019-10-01T10:48:02.000Z","dependencies_parsed_at":"2023-02-25T09:00:26.833Z","dependency_job_id":null,"html_url":"https://github.com/bengreenier/sgx-lkl-turtles","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/bengreenier%2Fsgx-lkl-turtles","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengreenier%2Fsgx-lkl-turtles/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengreenier%2Fsgx-lkl-turtles/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bengreenier%2Fsgx-lkl-turtles/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bengreenier","download_url":"https://codeload.github.com/bengreenier/sgx-lkl-turtles/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243940063,"owners_count":20372044,"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":["enclave","nodejs","sample","sgx-lkl","tee"],"created_at":"2024-10-13T07:48:58.689Z","updated_at":"2025-03-16T21:45:08.155Z","avatar_url":"https://github.com/bengreenier.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SGX-LKL-Turtles\n\n\u003e 🚨 This project is an unsupported experiment.\n\nDocker-in-docker [SGX-LKL](https://github.com/lsds/sgx-lkl) sample of a Node [hello world app](./src). 🧙‍📦⚡\n\n![Project Header](./.github/header.png)\n\nI needed a sample to determine how Node apps might run inside SGX-LKL (in an enclave). I also wanted to try out\ndeveloping the release entirely inside a docker container. This requires docker-in-docker, to generate the SGX-LKL\nimage that will run on the enclave.\n\n## Getting started\n\n\u003e Note: This is currently configured to run using simulated mode (not against real enclave hardware). To modify it, specify `--build-arg MAKE_TARGET=\"\"` during docker build.\n\nTo run the sample on your own, just grab and run the runtime docker container from this repo's packages:\n\n```\n# Gets the container from github\n# Runs it in privileged mode\n# Forwards the docker daemon control socket\n\ndocker run -it --rm --privileged -v //var/run/docker.sock:/var/run/docker.sock bengreenier/sgx-lkl-turtles:latest-sim\n```\n\nYou should see:\n\n```\nCreating ./app.img from Dockerfile ./src/Dockerfile...\nBuilding Docker image...\nCreating and exporting Docker container...\nCreating disk image file...\nSuccesfully created ./app.img.\nCleaning up temporary files...\n[    SGX-LKL   ] No tap device specified, networking will not be available.\n[    SGX-LKL   ] Kernel command line: \"\"\n[    SGX-LKL   ] Adding entropy to entropy pool.\n[    SGX-LKL   ] wg0 has public key KNAL8UQFWViNDi1WtGNx4wqsH9BCQ9Xwv8UX7+Itw3Y=\n[    SGX-LKL   ] Set working directory /\n[    SGX-LKL   ] Calling application main\nHello world. I'm inside an enclave!\n    SGX-LKL   ] Set working directory /\n```\n\nNote that we've limited the [v8 max-old-space-size](https://stackoverflow.com/a/48392705) to `512MB` and adjusted the [SGXLKL_HEAP](https://github.com/lsds/sgx-lkl/blob/master/src/main/sgxlkl_run.c#L232) to `640MB`. This limits the possibilities of this sample app, but helps keep the runtime quite small.\n\n## Building yourself\n\nThis is super easy, and depends only on [Docker](https://hub.docker.com).\n\n```\n# This will take a while (~25m)\ndocker build -t sgx-lkl-turtles:dev .\n```\n\n### Configuration\n\nYou can modify the image during the build phase to target physical hardware, or simulated hardware (the default). \n\n| Hardware    | MAKE_TARGET       |\n| ----------- | ----------------- |\n| Physical    | `\"\"`              |\n| Simulated   | `\"sim DEBUG=true\"`|\n\nFor example:\n\n```\ndocker build --build-arg MAKE_TARGET=\"\" -t sgx-lkl-turtles:dev .\n```\n\nThat's it! 🎉\n\n## Credits\n\n+ This wouldn't be possible without the awesome [SGX-LKL Project](https://github.com/lsds/sgx-lkl).\n+ Icons made by [Pixel perfect](https://www.flaticon.com/authors/pixel-perfect) from [www.flaticon.com](https://www.flaticon.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengreenier%2Fsgx-lkl-turtles","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbengreenier%2Fsgx-lkl-turtles","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbengreenier%2Fsgx-lkl-turtles/lists"}