Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If GitLab with a GitLab Runner shell executor is insecure, can GitLab SSH Runner be secure from MITM to use as a safe alternative, or use Docker?

I'm want to use GitLab to setup CI code testing for PHP. It says in the documentation, https://docs.gitlab.com/runner/, that the shell executor is not secure, https://docs.gitlab.com/runner/executors/shell.html, but also states that SSH is vulnerable to MITM attacks, https://docs.gitlab.com/runner/executors/ssh.html. What is recommended to use as a GitLab runner if these options are not secure options? I want to test PHP code w/ PHPUnit, https://phpunit.de/, and it which the above two options seem the most straightforward. In other words, is Docker the most common or recommended way to setup a GitLab CI Runner?

I'm using Ubuntu 18.04 locally, and also RHEL for GitLab testing code in a PHP7.2 environment.

like image 776
Darrell Ulm Avatar asked Nov 15 '25 23:11

Darrell Ulm


1 Answers

TLDR. Yes, Docker is the recommended option

The reason is that shell and ssh have the potential to break out of the Runner scope. Further this execution types could leave files, which have been created during your CI jobs. This is inherently solved using containers as these are deleted after each job. Another reason to use the Docker executor are the different feature sets, e.g. it allows you to define images in your gitlab-ci.yml in which your command is executed.

like image 200
secustor Avatar answered Nov 17 '25 20:11

secustor