
Kubernetes용 Trivy
Kubernetes를 위한 간단하고 포괄적인 취약점 스캐너
KubeTrivy는 Kubernetes를 위해 Trivy를 확장한 도구입니다.
KubeTrivy는 Kubernetes를 위한 간단하고 포괄적인 취약점 스캐너입니다.
KubeTrivy는 OS 패키지(Alpine, RHEL, CentOS 등)와 애플리케이션 의존성(Bundler, Composer, npm, yarn 등)의 취약점을 탐지합니다.
KubeTrivy는 사용하기 쉽습니다. 바이너리를 설치하기만 하면 바로 스캔할 수 있습니다. 스캔을 위해 필요한 것은 Kubernetes 상의 컨테이너 이미지 이름을 지정하는 것뿐입니다.
Trivy에 대해 알아보기
kubectl get vulnerability 또는 kubetrivy get ${resourceName}로 취약점 정보 가져오기$ brew tap masahiro331/kube-tirvy
$ brew install kube-trivy
$ kubetrivy -h
$ go get -u github.com/masahiro331/kube-trivy
$ kubetrivy -h
$ cat << EOS > crd.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: vulnerabilities.kubetrivy.io
spec:
group: kubetrivy.io
version: v1
names:
kind: Vulnerability
plural: vulnerabilities
scope: Namespaced
additionalPrinterColumns:
- name: UNKNOWN
type: integer
description: The total of vulnerabilities launched by the kubetrivy
JSONPath: .spec.statistics.UNKNOWN
- name: LOW
type: integer
description: The total of vulnerabilities launched by the kubetrivy
JSONPath: .spec.statistics.LOW
- name: MEDIUM
type: integer
description: The total of vulnerabilities launched by the kubetrivy
JSONPath: .spec.statistics.MEDIUM
- name: HIGH
type: integer
description: The total of vulnerabilities launched by the kubetrivy
JSONPath: .spec.statistics.HIGH
- name: CRITICAL
type: integer
description: The total of vulnerabilities launched by the kubetrivy
JSONPath: .spec.statistics.CRITICAL
EOS
$ kubectl apply -f crd.yaml
$ kubectl get vulnerability
$ kubetrivy -n default scan
$ kubetrivy -n default scan
$ kubectl get vulnerability -n default
$ kubetrivy -n default get ${resourceName}