Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not leak information from the host system #64

Closed
giordano opened this issue Nov 22, 2021 · 0 comments · Fixed by #65
Closed

Do not leak information from the host system #64

giordano opened this issue Nov 22, 2021 · 0 comments · Fixed by #65

Comments

@giordano
Copy link
Member

Sandbox.jl currently leaks some information from the host system. You can use the basic example in the README to start a shell:

using Sandbox

config = SandboxConfig(
    Dict("/" => Sandbox.alpine_rootfs());
    stdin=Base.stdin,
    stdout=Base.stdout,
    stderr=Base.stderr,
)
with_executor() do exe
    run(exe, config, `/bin/sh`)
end

and here run the commands uname -n and hostname: they'll show the hostname of the host system. Also, the command env will show some environment variables, not many, which include SUDO_COMMAND, SUDO_USER (in case you're using a privileged runner) and SHELL from the host system.

It'd be nice to not leak this information from the outside world inside the sandbox. For example, Elliot suggested we can optionally create a new UTS namespace to set the hostname: https://man7.org/linux/man-pages/man7/uts_namespaces.7.html, https://man7.org/linux/man-pages/man2/gethostname.2.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant