{"id":19094572,"url":"https://github.com/coreboot/encapsulate","last_synced_at":"2025-02-22T08:22:51.841Z","repository":{"id":78928291,"uuid":"240454565","full_name":"coreboot/encapsulate","owner":"coreboot","description":null,"archived":false,"fork":false,"pushed_at":"2020-08-26T15:10:21.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-01-02T23:46:22.983Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coreboot.png","metadata":{"files":{"readme":"README.markdown","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-14T07:45:39.000Z","updated_at":"2023-07-07T05:47:38.000Z","dependencies_parsed_at":"2023-03-12T06:10:43.695Z","dependency_job_id":null,"html_url":"https://github.com/coreboot/encapsulate","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/coreboot%2Fencapsulate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreboot%2Fencapsulate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreboot%2Fencapsulate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coreboot%2Fencapsulate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coreboot","download_url":"https://codeload.github.com/coreboot/encapsulate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240144173,"owners_count":19754868,"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":[],"created_at":"2024-11-09T03:30:15.792Z","updated_at":"2025-02-22T08:22:51.820Z","avatar_url":"https://github.com/coreboot.png","language":"C","readme":"Encapsulate\n===========\n\nLinux utility to isolate a process and its children while providing a full environment easily.\nMakes use of Linux's namespace capabilities and is thus totally unportable. It also might\nrequire more Linux kernel options than you have enabled.\n\nUsage\n-----\n`encapsulate writable-subtree|tree2|tree3|... command args...`\n\nIsolation\n---------\nencapsulate:\n\n* detaches itself (and its children) from the system's mount point table, IPC table, process ID table and network stack instance,\n* mounts the current filesystem view to a temporary directory,\n* marks it read-only,\n* mounts the `writable-subtree`s (delimited by `|`) at its \"native\" location into the new directory hierarchy,\n* chroots to the newly mounted root directory,\n* chdirs to the current directory (but inside the chroot),\n* setuids back to the current user,\n* and finally calls `command` with `args`\n\nA separate process waits for all this to finish and deletes the temporary directory afterwards.\n\nThe result is that `command` runs in a system similar to the real one with a couple of exceptions. First, only files below\n`writable-subtree` are writable, everything else (including /tmp, unless that's the directory you choose) is read-only.\nSecond, `command` can't inspect many aspects of the system (such as currently running processes) or interact with processes\neasily. Third, network is blocked, so if `command` attempts to run a spam-bot, it will fail.\n\nExample\n-------\n`encapsulate /tmp|/home/foo bash`\n\nThis starts a shell with \"just the same\" filesystem view as normal, but with everything but /tmp and /home/foo (and their subdirectories) readonly.\nThe new view is mounted to a temporary directory, but that happens in a separate namespace, so this isn't visible to the host system except for an empty directory in /tmp.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreboot%2Fencapsulate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoreboot%2Fencapsulate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoreboot%2Fencapsulate/lists"}