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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With