扫描镜像以查找已知漏洞
翻译
原文:https://devopscube.com/cks-exam-guide-tips/#scan-images-for-known-vulnerabilities
- name: 翻译
desc: 原文:https://devopscube.com/cks-exam-guide-tips/#scan-images-for-known-vulnerabilities
bgColor: '#F0DFB1'
textColor: 'green'
1
2
3
4
2
3
4
# 扫描镜像以查找已知漏洞
Kubernetes CKS 考试文档中推荐我们使用 Aquasec trivy (opens new window)。您可以使用 Trivy 扫描镜像并查找漏洞。
Trivy | 使用 Trivy 进行漏洞扫描 (opens new window) |
译者加
# 扫描镜像
trivy image <镜像名称>
trivy image python:3.4-alpine # 示例
# 扫描文件
trivy fs <路径>
trivy fs /you/project/path/
trivy fs --scanners vuln,secret,misconfig /you/project/path/ # 只检测漏洞、凭据泄露 和 配置错误
# 扫描 k8s 集群(高版本 trivy 才有的功能)
trivy k8s <集群名称>
trivy k8s --report summary cluster # 扫描 cluster 集群并生成摘要报告
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
编辑 (opens new window)