供应链安全-镜像 Trivy kubesec_the first run cannot skip downloading db(2)

│ └── fanal.db
└── java-db
├── metadata.json
└── trivy-java.db

db等文件详细解析:镜像安全扫描工具Trivy深入实践 - 知乎

漏洞检测

[root@master trivy]# trivy image nginx:1.17.1 --skip-db-update --skip-java-db-update
2023-11-15T02:10:00.448-0500 INFO Vulnerability scanning is enabled
2023-11-15T02:10:00.448-0500 INFO Secret scanning is enabled
2023-11-15T02:10:00.448-0500 INFO If your scanning is slow, please try ‘–scanners vuln’ to disable secret scanning
2023-11-15T02:10:00.448-0500 INFO Please see also https://aquasecurity.github.io/trivy/v0.46/docs/scanner/secret/#recommendation for faster secret detection
2023-11-15T02:10:26.595-0500 INFO Detected OS: debian
2023-11-15T02:10:26.595-0500 INFO Detecting Debian vulnerabilities…
2023-11-15T02:10:26.625-0500 INFO Number of language-specific files: 0
2023-11-15T02:10:26.685-0500 WARN This OS version is no longer supported by the distribution: debian 9.9
2023-11-15T02:10:26.685-0500 WARN The vulnerability detection may be insufficient because security updates are not provided

nginx:1.17.1 (debian 9.9)

Total: 204 (UNKNOWN: 7, LOW: 40, MEDIUM: 52, HIGH: 74, CRITICAL: 31)

┌────────────────────────┬──────────────────┬──────────┬──────────────┬────────────────────────┬────────────────────────┬──────────────────────────────────────────────────────────────┐
│ Library │ Vulnerability │ Severity │ Status │ Installed Version │ Fixed Version │ Title │
├────────────────────────┼──────────────────┼──────────┼──────────────┼────────────────────────┼────────────────────────┼──────────────────────────────────────────────────────────────┤
│ apt │ CVE-2020-27350 │ MEDIUM │ fixed │ 1.4.9 │ 1.4.11 │ apt: integer overflows and underflows while parsing .deb │
│ │ │ │ │ │ │ packages │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2020-27350 │
│ ├──────────────────┤ │ │ ├────────────────────────┼──────────────────────────────────────────────────────────────┤
│ │ CVE-2020-3810 │ │ │ │ 1.4.10 │ Missing input validation in the ar/tar implementations of │
│ │ │ │ │ │ │ APT before v … │
│ │ │ │ │ │ │ https://avd.aquasec.com/nvd/cve-2020-3810 │

漏洞解析

CVE-2016-2779 漏洞编号(可以进行通过编号去修复漏洞)

HIGH 级别

1:2.29.2-1+deb9u1 目前的版本

Title 其中网址打开就是漏洞介绍和修复方式

常用命令

跳过拉取漏洞数据库

–skip-update=true

查看命令帮助

trivy -h

容器镜像扫描

trivy image nginx
trivy image -i nginx.tar

打印指定 (高危,严重)

trivy image -s HIGH,nginx
trivy image -s HIGH,CRITICAL nginx

JSON 格式输出并保存到文件

trivy image nginx -f json -o ./output.json

trivy image nginx:1.18.0
trivy image --severity CRITICAL nginx:1.18.0
trivy image --severity CRITICAL, HIGH nginx:1.18.0
trivy image --ignore-unfixed nginx:1.18.0

Scanning image tarball

docker save nginx:1.18.0 > nginx.tar
trivy image --input archive.tar

Scan and output results to file

trivy image --output python_alpine.txt python:3.10.0a4-alpine
trivy image --severity HIGH --output /root/python.txt python:3.10.0a4-alpine

Scan image tarball

trivy image --input alpine.tar --format json --output /root/alpine.json

kubesec 检测yaml文件安全配置

kubesec:是一个针对K8s资源清单文件进行安全配置评估的工具,根据安全配置

https://kubesec.io/
https://github.com/controlplaneio/kubesec

注:因为网络问题,所以手动下载检测文件

通过容器更方便,避免网络问题

命令示例

kubesec scan -h

–schema-location 是本地json检测文件

主要是因为网络问题,所以建议自行下载后通过这个参数指定

[root@master kubesec]# kubesec scan deploy.yaml --schema-location deployment-apps-v1.json
[
{
“object”: “Deployment/web.default”,
“valid”: true,
“fileName”: “deploy.yaml”,
“message”: “Passed with a score of 0 points”,
“score”: 0,
“scoring”: {
“advise”: [
{
“id”: “ApparmorAny”,
“selector”: “.metadata .annotations .“container.apparmor.security.beta.kubernetes.io/nginx””,
“reason”: “Well defined AppArmor policies may provide greater protection from unknown threats. WARNING: NOT PRODUCTION READY”,
“points”: 3
},
{

自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。

深知大多数网络安全工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年网络安全全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上网络安全知识点,真正体系化!

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加VX:vip204888 (备注网络安全获取)
img

真正体系化!**

由于文件比较大,这里只是将部分目录大纲截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且后续会持续更新

如果你觉得这些内容对你有帮助,可以添加VX:vip204888 (备注网络安全获取)
[外链图片转存中…(img-6goOYFKQ-1712608608156)]

  • 8
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值