一个用于扫描 Kubernetes 资源镜像的 Trivy 插件
$ trivy plugin install github.com/aquasecurity/trivy-plugin-kubectl
$ trivy kubectl -h
Usage: trivy kubectl [-h,--help] TYPE NAME [TRIVY OPTION]
A Trivy plugin that scans the images of a kubernetes resource.
Options:
-h, --help Show usage.
Examples:
# Scan a Pod
trivy kubectl pod mypod
# Scan a Deployment
trivy kubectl deployment mydeployment -n mynamespace
# Scan a Job and filter by severity
trivy kubectl job myjob -n mynamespace -- --severity CRITICAL
Trivy 的选项需要在 -- 之后传递。
# Scan a Pod
$ trivy kubectl pod mypod
# Scan a Deployment
$ trivy kubectl deployment mydeployment -n mynamespace
# Scan a Job and filter by severity
$ trivy kubectl job myjob -n mynamespace -- --severity CRITICAL