/
Offline 환경에서 GitLab 환경 구성 이슈

Offline 환경에서 GitLab 환경 구성 이슈

Ultimate 라이선스 이용시 사용해야 할 스캐닝 기능

  • NodeJs 로 Project 를 생성, pipeline 테스트를 진행했을 때의 내용입니다.

GitLab

Ref. template

Stage

Comment

GitLab

Ref. template

Stage

Comment

Build

Jobs/Build.gitlab-ci.yml

build

  • Template project 에서만 사용 검토 중… (사용 미정)

  • gitlab container registry 는 사용하지 않음

    • Harbor private registry 를 설치하여 이미지를 관리

  • build/build.sh 에서 생성한 이미지를 gitlab container registry 로 push 처리하는 로직 존재 → docker push 시 에러발생 → 실패

Build Test

Jobs/Test.gitlab-ci.yml

test

  • Template project 에서만 사용 검토 중… (사용 미정)

  • NodeJs 기준, offline 상에서 stage 실행 시 특정 site 를 접속하려다 실패

Code Quality

Jobs/Code-Quality.gitlab-ci.yml

test

  • Harbor 에 저장되어 있는 이미지가 아닌 “codeclimate/codeclimate:0.85.15” 이미지를 사용

    • online 상 stage 실행 시, Harbor 에 있는 이미지가 아닌 이하 이미지를 참조

      • codeclimate/codeclimate:0.85.15

      • codeclimate/codeclimate-rubocop:latest

      • codeclimate/codeclimate-coffeelint:latest

      • codeclimate/codeclimate-csslint:latest

      • codeclimate/codeclimate-fixme:latest

      • docker rmi codeclimate/codeclimate-duplication:latest

      • docker rmi codeclimate/codeclimate-structure:latest

      • docker rmi codeclimate/codeclimate-eslint:latest

  • offline 상에서 stage 실행 시 실패

Deploy

Jobs/Deploy.gitlab-ci.yml

review, cleanup, staging, canary etc

  • 쿠버네티스 환경을 구축하지 못해 테스트 못함

Jobs/Deploy/ECS.gitlab-ci.yml

review

Browser Performance

Jobs/Browser-Performance-Testing.gitlab-ci.yml

performance

  • offline 상에서 stage 실행 시 실패

Dynamic Application Security Testing (DAST)

Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml

review, cleanup

  • 쿠버네티스 환경을 구축하지 못해 테스트 못함

Security/DAST.gitlab-ci.yml

dast

  • online 상에서는 성공

    • pipeline 조건 중, 쿠버네티스 등 체크항목을 주석처리하여 테스트 진행

Container Scanning

Security/Container-Scanning.gitlab-ci.yml

test

  • offline 상에서 stage 실행 시 실패

    • 에러 message : [klar] … > a Docker image value must be provieded

Dependency List

Dependency Scanning

Security/Dependency-Scanning.gitlab-ci.yml

test

  • offline 상에서 stage 실행 시 실패

License Compliance

Security/License-Scanning.gitlab-ci.yml

test

  • online / offline 상에서 stage 실행 시 성공

Static Application Security Testing (SAST)

Security/SAST.gitlab-ci.yml

test

  • 테스트 진행중

Application Security

Security/Secret-Detection.gitlab-ci.yml

test

  • local 파일로 설정 시 yml 문법 에러 발생

    • “artifacts: secret_detection” 관련 keyword 에러

 

이슈 사항

GitLab을 인터넷 연결이 안되는 내부망 내에서 사용하기 위해 다음과 같은 환경을 구성했습니다.

  • GitLab의 Container Registry를 비활성화

  • 사설 Docker Registry(Harbor)를 설치 후 필요한 도커 이미지를 모두 push함

이러한 환경에 대한 GitLab의 조언을 구했을 때 일반적인 Offline 환경에서도 가능하다는 답변을 받았습니다.(169739번 request)

환경 구성 후 NodeJS로 단순한 GitLab 프로젝트를 구성 후 실행하면 다음과 같은 결과가 있었습니다.

  • 인터넷 연결 시 : 파이프라인의 모든 job 성공

  • 인터넷 연결 해제 시 : 대부분의 job이 실패

위의 결과에 대해 GitLab Support Center에 재문의를 하였고(169739 request), 다음과 같은 답변을 받았습니다.

  • 프로젝트에서 구성된 파이프 라인의 종속성이 있을 경우, 일부 단계가 실패할 수 있음

  • 예를 들어 codeclimate/codeclimate:0.85.10가 harbor에 있음에도 로컬에서 사용할 수 없어 공식 Docker 저장소에 fullback을 시도 → 인테넛 액세스 불가로 작업 실패

  • 일부 CI 작업의 경우 현재 오프라인 사용에 대한 지원이 제한됨 (https://gitlab.com/gitlab-org/ci-cd/codequality/-/merge_requests/13)

 

위의 내용과 관련된 이슈를 담당자 분께 전달했고, local 환경에서 사용할 수 있는 방안에 대한 확인 요청을 받았습니다. 만약 위의 이슈가 해결되지 않는다면 GitLab Ultimate을 사용할 수 없는 상황입니다.

세부적인 요구 사항은 다음과 같습니다.

  • GitLab의 사용 환경은 Offline 환경이며, 별도의 Docker Registry를 구성하여 사용할 예정

  • GitLab Auto DevOps에서 제공하는 모든 Scanning 및 검사 기능을 별도의 파이프라인에 구성하여 전체 기능을 사용해야 함

  • 특히 GitLab 프로젝트는 아래의 3가지 유형으로 구성될 예정이며 각 언어에 맞는 GitLab scanner 및 도커 이미지가 Offline 환경에서 동작해야 함

    • Java (Maven) Project

    • Python (PyPI) Project

    • NodeJS (NPM) Project

  • 위 3가지 종류의 프로젝트가 Offline 환경에서, GitLab이 제공하는 scanning 및 검사 기능을 모두 활용할 수 있어야 함

  • 이에 대한 환경 구성 가이드가 절대적으로 필요함

 

Related content

GitLab 패키지 수동 다운로드 및 설치 (GitLab 오프라인 설치)
GitLab 패키지 수동 다운로드 및 설치 (GitLab 오프라인 설치)
Read with this
Docker에 GitLab 설치
Docker에 GitLab 설치
More like this
GitLab
Read with this
NodeJS Project template
NodeJS Project template
More like this
GitLab 설치
Read with this
에이전트를 사용하여 GitLab Runner 설치
에이전트를 사용하여 GitLab Runner 설치
More like this