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

Investigate Ways to Security-Harden the Docker Container #107

Open
MarkKoz opened this issue Apr 8, 2021 · 2 comments
Open

Investigate Ways to Security-Harden the Docker Container #107

MarkKoz opened this issue Apr 8, 2021 · 2 comments
Labels
area: CI Related to continuous intergration and deployment priority: 3 - low status: planning Discussing details type: feature New feature or request

Comments

@MarkKoz
Copy link
Member

MarkKoz commented Apr 8, 2021

While Docker's defaults are supposedly pretty good, maybe we could do better. Specific areas of focus are likely seccomp and capabilities. @Akarys42 borugh up a whitepaper, which, while relatively old, may still offer some insights.

gvisor also sounds great, but it's unclear whether it implements the kernel features necessary for nsjail to work. Furthermore, even if it could, our deployment environment currently doesn't support it. According to @jb3, it specifically needs support for containerd.

The biggest pain point is that snekbox needs to create parent cgroups for nsjail and therefore requires running the container in privileged mode. I've investigated ways to avoid this in the past, but was unsuccessful in finding any alternatives.

@MarkKoz MarkKoz added type: feature New feature or request status: planning Discussing details area: CI Related to continuous intergration and deployment priority: 3 - low labels Apr 8, 2021
@jb3
Copy link
Member

jb3 commented Apr 8, 2021

Re: gVisor.

The limitations for gVisor means that we would likely have to subject the entire snekbox deployment to gVisor filters, since the Kubernetes guide[1] is for placing entire pods into the gVisor realm.

As of now, they only provide instructions for running with containerd, and even then it's unclear whether this would be compatible with the managed Kubernetes instances hosted by Linode (as of now it's unclear whether Linode will switch to containerd or CRI-O for subsequent Kubernetes versions, and even if it is the former then switching to the gVisor shim probably won't be possible.)

I'll keep my eyes peeled on this area though.

[1] https://gvisor.dev/docs/user_guide/quick_start/kubernetes/

@MarkKoz
Copy link
Member Author

MarkKoz commented Dec 22, 2021

https://github.com/python-discord/snekbox-deploy has scripts to deploy Snekbox onto a Debian VM. It was originally created because we thought that #126 could only be fixed by using --cgroupns host, which is not configurable on our managed k8s cluster. While a proper fix has been found for that issue, there may still be merit to using this scripts to move away from k8s. It could let us finally use gVisor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: CI Related to continuous intergration and deployment priority: 3 - low status: planning Discussing details type: feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants