Lens Starboard Extension — Kube Security

Jerry(이정훈)
6 min readFeb 20, 2021

--

Kube 가 아닌 일반 인프라 환경에서도 ‘보안’ 하면 항상 어려운 것, 귀찮은 것이라는 인식이 있다. 그 이유로 평소에는 무엇이 보안 취약점인지 잘 모르고 있다 보안 점검 할 때만 지적을 받는게 문제 중 하나이다. (Application 운영하기도 힘들어 죽겠는데 무슨..)

Starboard는 통합 보안 Dashboard를 제공하여 모니터링 Dashboard 보듯이 보안 관련 사항을 자주 확인 할 수 있는 오픈소스 보안 툴이다.

현재 보안 상황을 바로 알 수 있으므로 바로 보안 개선이 가능한 것이 가장 큰 장점이다. 그리고 오픈 소스라 진입 장벽도 낮다. 무엇보다 Lens(최애 Kube Tool 중 하나인) Extension을 지원하므로 아주 편리하다.

Lens Screenshot

전체 POD Namespace Image Scan 자동 실시

위와 같이 Lens와 통합되어 VulnerabilityReports(Trivy), ConfigAuditReports(Polaris), CISKubeBenchReports(예정)를 같이 제공한다.

Lens Starboard Extension 소개 동영상

VulerabilityReport(이미지 취약점 스캔)는 기존 설치된 모든 Namespace Kube POD의 이미지 취약점 스캔이 간단하게 가능하다. 이미지 당 거의 10s 이내로 아주 빠르다.

starboard-operator Helm Chart 설치시 아래 targetNamespaces 설정을 “ “ (모든 namespace)로 변경하면 전체 namespace에 대하여 Scan 실시한다.

Helm 로그 메시지

(중간 로그 생략)
Inspect created VulnerabilityReports by:
kubectl get vulnerabilityreports --all-namespacesInspect the work log of starboard-operator by:kubectl logs -n starboard-operator deployment/starboard-operator(Helm 설치 완료)

설치가 끝나면 바로 이미지 Scan 작업을 실행하는데, Job Type으로 실행하고 작업은 바로바로 terminated 된다.

[spkr@erdia22 helm (spkcluster:starboard-operator)]$ k get pod -w
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
scan-vulnerabilityreport-5cdff7d65d-99fml 0/1 Init:0/1 0 7s 10.10.100.51 dia03 <none> <none>
scan-vulnerabilityreport-f88f746c7-2qb8s 0/1 Init:0/1 0 7s 10.10.100.55 dia03 <none> <none>
starboard-operator-6969764c5-rdlhp 1/1 Running 0 40s 10.10.100.38 dia03 <none> <none>
scan-vulnerabilityreport-5cdff7d65d-99fml 0/1 PodInitializing 0 8s 10.10.100.51 dia03 <none> <none>
scan-vulnerabilityreport-f88f746c7-2qb8s 0/1 PodInitializing 0 8s 10.10.100.55 dia03 <none> <none>
scan-vulnerabilityreport-f88f746c7-2qb8s 1/1 Running 0 9s 10.10.100.55 dia03 <none> <none>
scan-vulnerabilityreport-5cdff7d65d-99fml 1/1 Running 0 9s 10.10.100.51 dia03 <none> <none>
scan-vulnerabilityreport-5cdff7d65d-99fml 0/1 Completed 0 13s 10.10.100.51 dia03 <none> <none>
scan-vulnerabilityreport-5cdff7d65d-99fml 0/1 Terminating 0 13s 10.10.100.51 dia03 <none> <none>
scan-vulnerabilityreport-5cdff7d65d-99fml 0/1 Terminating 0 13s 10.10.100.51 dia03 <none> <none>
scan-vulnerabilityreport-f88f746c7-2qb8s 0/1 Completed 0 19s 10.10.100.55 dia03 <none> <none>
scan-vulnerabilityreport-f88f746c7-2qb8s 0/1 Terminating 0 19s 10.10.100.55 dia03 <none> <none>
scan-vulnerabilityreport-f88f746c7-2qb8s 0/1 Terminating 0 19s 10.10.100.55 dia03 <none> <none>

의아하게 각 벤더의 공식 이미지 중 critical 취약점이 많다는 것이다. nginx 경우

Critical 1ea, High 33ea

GitLab 이미지도 마찬가지

Critical 2ea

두번째 장점은 신규 POD 생성 시 해당 이미지를 자동으로 스캔 실시이다. 물론, 이미지 레포에서 이미지 스캔 작업을 먼저 하겠지만 Helm으로 외부 이미지를 사용 하는 경우 별도의 설정없이 자동으로 스캔을 실시하므로 편리하다. 잘 사용하고 있는 Lens 기능이 좀 더 편리하게 되어 가고 있다.

보안 관련 기능도 오픈 소스로 제공되는 Tool들이 많아 좀 더 자주 사용 할 수 있어 도움이 된다.

--

--

Jerry(이정훈)
Jerry(이정훈)

Written by Jerry(이정훈)

DevOps/Automation Engineer 60살까지 콘솔 잡는 엔지니어를 목표로 느리게 생각하고 있습니다.

No responses yet