Page MenuHomePhabricator

Run user-submitted code under gVisor
Open, LowPublic

Description

Wikifunctions relies on containers as the sole sandboxing mechanism for executing user-controlled code. This is unwise, because code running in containers still has access to the host kernel via syscalls, and can escape the container by exploiting vulnerabilities in the Linux kernel. gVisor provides an additional layer of protection by intercepting and monitoring all system calls made by the application in user space.

TODO:

  • Configure Beta Cluster instance of function-evaluator to run under GVisor.
  • Configure production instance of function-evaluator to run under GVisor.

Event Timeline

Change 839632 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-evaluator@master] [WIP] Install gVisor on our test and run images

https://gerrit.wikimedia.org/r/839632

Change 841574 had a related patch set uploaded (by Ori; author: Ori):

[operations/puppet@production] service::docker: allow runtime to be specified

https://gerrit.wikimedia.org/r/841574

Change 841575 had a related patch set uploaded (by Ori; author: Ori):

[operations/puppet@production] add profile::docker::gvisor

https://gerrit.wikimedia.org/r/841575

I've cherry-picked the two Puppet patches on the beta cluster. The mediawiki-function-evaluator service is now running under gVisor.

Change 839632 abandoned by Jforrester:

[mediawiki/services/function-evaluator@master] [WIP] Install gVisor on our test and run images

Reason:

https://gerrit.wikimedia.org/r/839632

Change 841575 merged by Giuseppe Lavagetto:

[operations/puppet@production] add profile::docker::gvisor

https://gerrit.wikimedia.org/r/841575

Change 841574 merged by Giuseppe Lavagetto:

[operations/puppet@production] service::docker: allow runtime to be specified

https://gerrit.wikimedia.org/r/841574

@Jdforrester-WMF : the Beta Cluster instance of the function-evaluator now runs under GVisor. Some additional work will be required to make the production instance of the function-evaluator run under GVisor. There is documentation here: https://gvisor.dev/docs/user_guide/quick_start/kubernetes/.

cmassaro subscribed.

Unassigning myself for now; it's not clear what there is to do on our end since we won't control the production environment.