gitlab ci and docker registry
play

GitLab-CI and Docker Registry Oleg Fiksel Security Consultant @ - PowerPoint PPT Presentation

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


  1. 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

  2. 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

  3. 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

  4. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G OALS OF THIS TALK

  5. 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

  6. 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

  7. 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

  8. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G IT L AB 101

  9. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS G IT L AB ?

  10. 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...

  11. 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

  12. 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)

  13. 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

  14. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W HAT IS D OCKER ?

  15. 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 ...

  16. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING

  17. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND W ORDING ◮ GitLab Server : git repository hosting service

  18. 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

  19. 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

  20. 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

  21. 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

  22. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND D EPLOYING ON - PREMISE

  23. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND C HECKLIST

  24. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND C HECKLIST ◮ 2 VMs or Rancher/Kubernetes/Mesos cluster

  25. 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)

  26. 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)

  27. 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)

  28. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND P ITFALLS

  29. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND P ITFALLS Internal CA ◮

  30. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND P ITFALLS Internal CA ◮ Forward proxy ◮

  31. 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) ◮

  32. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND G IT L AB -CI RUNNER ARCHITECTURE

  33. 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

  34. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND O N - PREMISE DEPLOYMENT ARCHITECTURE

  35. 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

  36. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND I NTERNAL CA

  37. 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:

  38. 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

  39. 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

  40. 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.

  41. 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.

  42. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND S WITCH D OCKER STORAGE BACKEND 1Source

  43. 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

  44. A BOUT I NTRODUCTION GitLab 101 Deploying on-premise Known issues E ND S WITCH D OCKER STORAGE BACKEND OS Setup:

  45. 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)

  46. 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