A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND GitLab-CI and Docker Registry Oleg Fiksel Security Consultant @ CSPI GmbH oleg.fiksel@cspi.com | oleg@fiksel.info | Matrix: @oleg:fiksel.info FrOSCon 2017
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND A GENDA A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND Q & A
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND A BOUT ME ◮ Security Consultant @ CSPI 1 (former MODCOMP 2 ) ◮ Main topics ◮ Architecture ◮ Development cycle ◮ Perl Coding 1 About CSPi 2 Wikipedia: MODCOMP
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G OALS OF THIS TALK
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G OALS OF THIS TALK ◮ This is not a comparision of CI tools
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G OALS OF THIS TALK ◮ This is not a comparision of CI tools ◮ Provide an overview of dependencies needed to deploy GitLab-CI Community Edition and Docker Registry on-premise
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G OALS OF THIS TALK ◮ This is not a comparision of CI tools ◮ Provide an overview of dependencies needed to deploy GitLab-CI Community Edition and Docker Registry on-premise ◮ Disclamer: The means and methods presented are my own expirience
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G IT L AB 101
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS G IT L AB ?
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS G IT L AB ? ◮ Web-based Git repository manager and more...
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS G IT L AB ? ◮ Web-based Git repository manager and more... ◮ Started as a pet-project in 2011 and now has more then 150 employees
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS G IT L AB ? ◮ Web-based Git repository manager and more... ◮ Started as a pet-project in 2011 and now has more then 150 employees ◮ Introduced Pipelines (CI) in version 8.8 (2016-05-28)
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS G IT L AB ? ◮ Web-based Git repository manager and more... ◮ Started as a pet-project in 2011 and now has more then 150 employees ◮ Introduced Pipelines (CI) in version 8.8 (2016-05-28) ◮ GitLab is used by many organisations such as: IBM, Sony, NASA, Alibaba, SpaceX and CSPi
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS D OCKER ?
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS D OCKER ? client docker host registry docker daemon docker build containers images docker pull docker run ...
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING ◮ GitLab Server : git repository hosting service
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING ◮ GitLab Server : git repository hosting service ◮ GitLab-CI Runner : user-space daemon that executes build/tests
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING ◮ GitLab Server : git repository hosting service ◮ GitLab-CI Runner : user-space daemon that executes build/tests ◮ Artifacts : build results pushed into an internal GitLab storage
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING ◮ GitLab Server : git repository hosting service ◮ GitLab-CI Runner : user-space daemon that executes build/tests ◮ Artifacts : build results pushed into an internal GitLab storage ◮ GitLab Container Registry : integrated docker registry frontend
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING ◮ GitLab Server : git repository hosting service ◮ GitLab-CI Runner : user-space daemon that executes build/tests ◮ Artifacts : build results pushed into an internal GitLab storage ◮ GitLab Container Registry : integrated docker registry frontend ◮ Docker Registry : mandatory container registry service
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND D EPLOYING ON - PREMISE
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND C HECKLIST
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND C HECKLIST ◮ 2 VMs or Rancher/Kubernetes/Mesos cluster
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND C HECKLIST ◮ 2 VMs or Rancher/Kubernetes/Mesos cluster ◮ Reverse proxy/loadabalancer for SSL offload (optional) supporting HTTP 1.1 to the backend (! Lighttpd)
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND C HECKLIST ◮ 2 VMs or Rancher/Kubernetes/Mesos cluster ◮ Reverse proxy/loadabalancer for SSL offload (optional) supporting HTTP 1.1 to the backend (! Lighttpd) ◮ Direct internet connection (for pulling docker images)
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND C HECKLIST ◮ 2 VMs or Rancher/Kubernetes/Mesos cluster ◮ Reverse proxy/loadabalancer for SSL offload (optional) supporting HTTP 1.1 to the backend (! Lighttpd) ◮ Direct internet connection (for pulling docker images) ◮ SSL Certificates (own CA or official)
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND P ITFALLS
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND P ITFALLS Internal CA ◮
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND P ITFALLS Internal CA ◮ Forward proxy ◮
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND P ITFALLS Internal CA ◮ Forward proxy ◮ DNS split horizon (not handled in this talk) ◮
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G IT L AB -CI RUNNER ARCHITECTURE
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G IT L AB -CI RUNNER ARCHITECTURE GitLab-CI-Runner Shell Container GitLab-CI-Runner Container GitLab-CI Docker Container GitLab-CI-Runner GitLab-CI-Runner GitLab-CI-Runner
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND O N - PREMISE DEPLOYMENT ARCHITECTURE
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND O N - PREMISE DEPLOYMENT ARCHITECTURE hub.docker.com Pull (HTTPS) GitLab-CI Runner run GitLab pull/push git clone Docker Container GitLab-CI (HTTPS) Test, Build, etc Artifacts push (HTTPS) Docker registry (frontend) Auth read/write access auth token auth (HTTPS) (HTTPS) [separate CA] local Docker client S3 Azure Docker registry GCS (container) store blob push/pull (HTTPS) Swift
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND I NTERNAL CA
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND I NTERNAL CA Every GitLab HTTPS client must trust internal CA including:
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND I NTERNAL CA Every GitLab HTTPS client must trust internal CA including: ◮ gitlab-ci-runner
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND I NTERNAL CA Every GitLab HTTPS client must trust internal CA including: ◮ gitlab-ci-runner ◮ docker container building docker images
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND I NTERNAL CA ◮ Problem: docker images are pulled from docker hub and doesn’t trust intern CA.
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND I NTERNAL CA ◮ Problem: docker images are pulled from docker hub and doesn’t trust intern CA. ◮ Solution: extend all base images with internal CA and use them for building.
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND S WITCH D OCKER STORAGE BACKEND 1Source
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND S WITCH D OCKER STORAGE BACKEND By default, when using docker:dind, Docker uses the vfs storage driver which copies the filesystem on every run. This is a very disk-intensive operation which can be avoided if a different driver is used, for example overlay. 1 1Source
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND S WITCH D OCKER STORAGE BACKEND OS Setup:
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND S WITCH D OCKER STORAGE BACKEND OS Setup: ◮ add overlay to / etc / modules (Ubuntu 16.04)
A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND S WITCH D OCKER STORAGE BACKEND OS Setup: ◮ add overlay to / etc / modules (Ubuntu 16.04) ◮ modprobe overlay or reboot the system
Recommend
More recommend