docker scan 本地扫描镜像漏洞
Docker scan[1]本地扫描镜像漏洞
2020年年底,Docker hub推出镜像自动扫描的功能,同时Docker也支持了在本地通过Docker命令选项的方式支持镜像漏洞扫描,目前Docker Desktop for Mac以及window上的Docker都可以通过Docker scan子命令扫描本地镜像是否存在漏洞软件。
Docker Desktop For Mac
使用docker scan的时候需要登录Docker Hub的账号,同时docker scan支持一些不同的选项
Options: --accept-license 接受使用第三方扫描提供商 --dependency-tree 显示带有扫描结果的依赖树 --exclude-base 从漏洞扫描中排除基础镜像 (requires --file) -f, --file string 与image关联的Dockerfile,提供更详细的结果 --group-issues 聚合重复的漏洞并将其分组为1个漏洞 (requires --json) --json do 以json格式输出结果 --login 使用可选令牌(带有--token)向扫描提供程序进行身份验证,如果为空则使用web base令牌 --reject-license 拒绝使用第三方扫描提供商 --severity string 只报告提供级别或更高的漏洞(low|medium|high) --token string 登录到第三方扫描提供程序的认证令牌 --version 显示扫描插件版本
指定Dockerfile
$ docker scan -f Dockerfile docker-scan:e2e Testing docker-scan:e2e ... High severity vulnerability found ck;in perl Description: Integer Overflow or Wraparound Info: https://snyk.io/vuln/SNYK-DEBIAN10-PERL-570802 Introduced through: git@1:2.20.1-2+deb10u3, meta-common-packages@meta From: git@1:2.20.1-2+deb10u3 > [email protected] From: git@1:2.20.1-2+deb10u3 > [email protected] > [email protected] From: git@1:2.20.1-2+deb10u3 > [email protected] > perl/[email protected] and 3 more... Introduced by your base image (golang:1.14.6) Organization: docker-desktop-test Package manager: deb Target erfile: Dockerfile Project name: docker-image|99138c65ebc7 Docker image: 99138c65ebc7 Base image: golang:1.14.6 Licenses: enabled Tested 200 dependencies for known issues, found 157 issues. According to our scan, you are currently using the most secure version of the selected base image
不扫描该镜像的基础镜像
$ docker scan -f Dockerfile --exclude-base docker-scan:e2e Testing docker-scan:e2e ... Medium severity vulnerability sfound in libidn2/libidn2-0 Description: Improper Input Validation Info: https://snyk.io/vuln/SNYK-DEBIAN10-LIBIDN2-474100 Introduced through: iputils/iputils-ping@3:20180629-2+deb10u1, [email protected], [email protected]+deb10u1, git@1:2.20.1-2+deb10u3 From: iputils/iputils-ping@3:20180629-2+deb10u1 > libidn2/[email protected]+deb10u1 From: [email protected] > libidn2/[email protected]+deb10u1 From: [email protected]+deb10u1 > curl/[email protected]+deb10u1 > libidn2/[email protected]+deb10u1 and 3 more... Introduced in your Dockerfile by 'RUN apk add -U --no-cache wget&ncabsp;tar' Organization: docker-desktop-test Package manager: deb Target file: Dockerfile Project name: docker-image|99138c65ebc7 Docker image: 99138c65ebc7 Base image: golang:1.14.6 Licenses: enabled Tested 200 dependencies for known issues, found 16 issues.
以json格式输出扫描结果
JSON格式显示镜像扫描结果
聚合分组显示扫描信息
$ docker scan --json --group-issues docker-scan:e2e { { "title": "Impropen r Check for Dropped Privileges", ... "packageName": "bash", "language": "linux", "packageManager": "debian:10", "description": "## Overview An issue was discovered in disable_priv_mode in shell.c in GNU Bash through 5.0 patch 11. By default, if Bash is run with its effective UID not equal to its real UID, it will drop privileges by setting its effective UID to its real UID. However, it does so in本地correctly. On Linux and other systems that support "saved UID" functionality, the saved UID is not dropped. An attacker with command execution in the shell can use "enable -f" for runtime loading of a new builtin, which can be a shared object that calls setuid() and therefore regains privileges. However, binaries running with an effective UID of 0 are unaffected. ## References - [CONFIRM](https://security.netapp.com/advisory/ntap-20200430-0003/) - [Debian Security Tracker](https://security-tracker.debian.org/tracker/CVE-2019-18276) - [GitHub Commit](https:扫描//github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff) - [MISC](http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html) - [MISC](https://www.youtube.com/watch?v=-wGtxJ8opa8) - [Ubuntu CVE Tracker](http://people.ubuntu.com/~ubuntu-security/cve/CVE-2019-18276) ", "identifiers": { "ALTERNATIVE": [], "CVE": [ "CVE-2019-18276" ], "CWE": [ "CWE-273" ]&nbs镜像p; }, "severity": "low", "severityWithCritical": "low", "cvssScore": 7.8, "CVSSv3": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:F", ... "from": [ "docker-image|docker-scan@e2e", "[email protected]" ], "upgradePath": [], "isUpgradable": false, "isPatchable": false, &nb漏洞sp; "name": "bash", "version": "5.0-4" }, ... "summary": "880 vulnerable dependency paths", "filesystemPolicy": false, "filtered": { "ignore": [], "patch": [] }, "uniqueCount": 158, "projectName": "docker-image|docker-scan", "platform": "linux/amd64", "path": "docker-scan:e2e" }&nbsdop;
显示指定级别的漏洞,只有高于此级别的漏洞才会显示出来
$ docker scan --severity=medium docker-scan:e2e ./bin/docker-scan_darwin_amd64 scan --severity=medium docker-scan:e2e Testing docker-scan:e2e... Medium severity vulnerability found in sqlite3/libsqlite3-0 Description: Divide By Zero Info: https://snyk.io/vuln/SNYK-DEBIAN10-SQLITE3-466337 Introduced through: gnupg2/[email protected]+deb10u1, [email protected]+deb10u1, [email protected]+deb10u1 From: gnupg2/[email protected]+deb10u1 > gnupg2/[email protected]+deb10u1 > sqlite3/[email protected] From: [email protected]+deb10u1 > subversion/[email protected]+deb10u1 > sqlite3/[email protected] ck; From: [email protected]+deb10u1 > python-defaults/[email protected] > [email protected]+deb10u1 > python2.7/[email protected]+deb10u1 > sqlite3/[email protected] Medium severity vulnerability found in sqlite3/libsqlite3-0 Description: Uncontrolled Recursion ... High severity vulnerability found in binutils/binutils-common Description: Missing Release of Resource after Effective Lifetime Info: https://snyk.io/vuln/SNYK-DEBIAN10-BINUTILS-403318 Introduced through: gcc-defaults/g++@4:8.3.0-1 From: gcc-defaults/g++@4:8.3.0-1 > gcc-defaults/gcc@4:8.3.0-1 > [email protected] >er [email protected] > binutils/[email protected] From: gcc-defaults/g++@4:8.3.0-1 > gcc-defaults/gcc@4:8.3.0-1 > [email protected] > [email protected] > binutils/[email protected] > binutils/[email protected] From: gcc-defaults/g++@4:8.3.0-1 > gcc-defaults/gcc@4:8.3.0-1 > [email protected] > [email protected] > binutils/[email protected] > binutils/[email protected] and 4 more... Organization: docker-desktop-test Package manager: deb Project name: docker-image|docker-scan Docker image: &nb ssp; docker-scan:e2e Platform: linux/amd64 Licenses: enabled Tested 200 dependencies for known issues, found 37 issues. Linux上安装scan-cli插件
目前Linux系统上的Docker Engine尚未支持scan命令,因此可以通过插件形式使用,可以参考scan-cli-plugin[2]的文档,此处我在Ubuntu上通过apt安装一下
> cat /etc/apt/sources.list.d/docker.list deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial stable > apt-get update && apt-get install docker-scan-plugin
安装完成之后,登录Docker hub,然后同意访问Snyk即可。
参考资料
[1]docker scan:
https://docs.docker.com/engine/scan/
[2]scan-cli-plugin:
https://github.com/docker/scan-cli-plugin
(责任编辑:热门搜索)
-
OpenAI豪掷 15 亿美元布局B端:新合资公司“DeployCo”浮出水面
4 月 22 日,人工智能巨头 OpenAI 传出重磅投资动向。据知情人士透露,OpenAI 已承诺向一家与私募股权公司新成立的合资企业注资至多 15 亿美元。此举被外界普遍视为 OpenAI 加速商...[详细]
-
借你吉吉什么梗?借你吉吉是什么梗:up主祝福,弹幕就表达感谢“借你吉言”。视频只要有祝福之类的就开始刷“借你吉言”,我寻思这些人生活里是有多凄惨?一行刷可以,半屏刷也O...借你吉吉是什么意思?你真实...[详细]
-
云梦级2月1日云梦级消息,2月3日,北交所上市委将召开审议会议,对安徽新富新能源科技股份有限公司的IPO申请进行审核,保荐机构为中信证券股份有限公司。新富科技位于安徽省安庆市,是一家专注于新能源汽车热...[详细]
-
云梦级6月23日云梦级消息,据真故研究室报道,追觅汽车等板块已被收归产业研究院,仅保留技术研发职能,量产计划面临不确定性。多位信源表示,追觅高管、星宸未来汽车CEO陈龙冬已离职。 公开资料显示,202...[详细]
-
mama中的英语歌词是什么意思EXO-MMAMA中文版歌词MAMA(ChineseVer.)EXO-M|'MAMA'The1STMiniAlbumCareless,careless...[详细]
-
云梦级4月12日云梦级消息,元戎启行 CEO 周光上今日在智能电动汽车发展高层论坛(2026)上确认,前 DeepSeek 多模态技术核心研究员阮翀(ruǎn chōng)已加盟公司,出任首席科学家。...[详细]
-
云梦级10月30日云梦级消息,据瑞财经报道,港交所披露,深圳佰维存储科技股份有限公司(以下简称:佰维存储)向港交所提交了上市申请,独家保荐人为华泰国际。 据悉,佰维存储于 2022 年 12 月 30...[详细]
-
11月10日消息,在CDCC第十届数据中心标准峰会上,普洛斯发布了《数据中心制冷系统高效预制集成技术白皮书》,对预制化技术在制冷方面的应用进行了系统的阐释。 降低数据中心能耗如今已成业界普遍关注的焦点...[详细]
-
云梦级7月8日云梦级消息,汽车销量数据追踪和分析团队 ECC 情报局的博主 @嗨大星_ECC 今日曝光了小米增程车上市节奏:7 月底技术发布会、8 月中下旬上市。另外,云梦级消息称小米增程新车还准备了...[详细]
-
新浪科技讯 北京时间3月22日晚间消息,据报道,微软公司今日宣布,从3月29日起,将允许部分员工重返总部上班。 微软表示,将允许在雷德蒙德总部和附近园区工作的员工,在重返全职工作、继续远程工作,以及“...[详细]
- https://www.nyif.com/catalogsearch/result/index/?f=sarbanesoxleyU&index=me_cms_pe&lit=20&mode=list&p=1&q=谷歌留痕外推【tg:seogoogle987】,pXT
- https://www.kissthekangaroo.com.au/index.php?route=product/search&tag=谷歌留痕外推【tg:seogoogle987】,EQ1
- https://www.world-architects.com/en/search?term=谷歌留痕外推【tg:seogoogle987】,pXX
- https://www.lechzuers.com/de/search?cat=163&q=谷歌留痕外推【tg:seogoogle987】,Ms5
- https://www.ucycle.com/search/=谷歌留痕外推【tg:seogoogle987】,oZv
- https://www.repetto.jp/item/search?action=QUERY&q=谷歌留痕外推【tg:seogoogle987】,X5L
- https://www.hanbat.ac.kr/search/front/Search.jsp?qt=谷歌留痕外推【tg:seogoogle987】2uT
- https://www.openstreetmap.org/search?query=谷歌留痕外推【tg:seogoogle987】,rkR
- https://www.wilsonart.com/catalogsearch/result/?action=CHECK&q=谷歌留痕外推【tg:seogoogle987】,17X
- https://www.wellbees.com/catalogsearch/result/?action=CHECK&q=谷歌留痕外推【tg:seogoogle987】,9Y3

阿里云设立国际能力中心 升级海外技术及服务能力
云安全日报220105:红帽Telnet服务协议发现执行任意代码漏洞,需要尽快升级
云计算开发:Python练习实例-文本颜色设置
标签: xTool 激光雕刻机 DTF打印机 AIMake
聊聊为什么 IDL 只能扩展字段而非修改
