
k8s 클러스터를 위한 오픈소스 런타임 스캐너로, CIS Kubernetes Benchmark 사양에 따라 보안 감사 점검을 수행합니다.
Kube-Beacon은 배포된 쿠버네티스 클러스터에서 감사 검사를 수행하고 보안 보고서를 출력하는 오픈 소스 감사 스캐너입니다.
감사 테스트는 CIS Kubernetes Benchmark specification의 전체 구현입니다.
새로운 기능!! 이제 감사 결과를 사용자 플러그인(Go 플러그인 사용)을 통해 웹훅으로 활용할 수 있습니다.

git clone https://github.com/chen-keinan/kube-beacon
cd kube-beacon
make build
플래그 없이 kube-eacon을 실행하면 모든 테스트를 실행합니다.
./kube-beacon
플래그와 함께 kube-beacon을 실행하여 필요한 테스트만 실행합니다.
Usage: kube-Beacon [--version] [--help] <command> [<args>]
Available commands are:
-r , --report : run audit tests and generate failure report
-i , --include: execute only specific audit test, example -i=1.2.3,1.4.5
-e , --exclude: ignore specific audit tests, example -e=1.2.3,1.4.5
-n , --node: execute audit tests on specific node, example -n=master,-n=worker
-s , --spec: execute specific audit tests spec, example -s=gke, default=k8s
-v , --version: execute specific audit tests spec version, example -v=1.1.0,default=1.6.0
테스트를 실행하고 실패 테스트 보고서를 생성합니다.
./kube-beacon -r
kube-beacon을 k8s 클러스터의 파드로 실행
role=cluster-admin으로 클러스터 역할 바인딩 추가
kubectl create clusterrolebinding default-admin --clusterrole cluster-admin --serviceaccount=default:default
cd jobs
kubectl apply -f k8s.yaml
kubectl apply -f gke.yaml
kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default kube-beacon-sc8g9 0/1 Completed 0 111s
kube-system event-exporter-gke-8489df9489-skcvv 2/2 Running 0 7m24s
kube-system fluentd-gke-7d5sl 2/2 Running 0 7m6s
kube-system fluentd-gke-f6q5d 2/2 Running 0 6m59s
kubectl logs kube-beacon-sc8g9
kubectl delete clusterrolebinding default-admin
kubectl delete -f k8s.yaml
Kube-Beacon은 사용자 플러그인을 위한 후크를 제공합니다 예제 :
go build -buildmode=plugin -o=~/<plugin folder>/bench_plugin.so /<plugin folder>/bench_plugin.go
cp /<plugin folder>/bench_plugin.so ~/.beacon/plugins/compile/bench_plugin.so
참고: 플러그인과 바이너리는 동일한 Linux 환경에서 컴파일되어야 합니다.