您现在的位置是:热点 >>正文
docker scan 本地扫描镜像漏洞
热点7967694人已围观
简介...
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 ickn 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 file:er 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 found s 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 tacar' 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": "Improper Chn eck 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 incorrectly.本地 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://gith扫描ub.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" ] &nb镜像sp; }, "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" }
显do示指定级别的漏洞,只有高于此级别的漏洞才会显示出来
$ 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] &nbsckp;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] >&nbersp;[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
Tags:
相关文章
云计算核心技术Docker教程:Docker Compose 介绍
热点Compose 是一个用于定义和运行多容器 Docker 应用程序的工具。使用 Compose,您可以使用 YAML 文件来配置应用程序的服务。然后,使用一个命令,您可以从您的配置中创建并启动所有 服...
【热点】
阅读更多150亿参数,谷歌开源了史上超大视觉模型V-MoE的全部代码
热点还记得谷歌大脑团队去年 6 月份发布的 43 页论文《Scaling Vision with Sparse Mixture of Experts》吗?他们推出了史上最大规模的视觉模型 V-MoE,实现...
【热点】
阅读更多AI改进建筑施工安全的十种方式
热点根据美国国家设备注册局公布的数据,建筑盗窃造成的损失每年往往超过10亿美元。最新型号的设备、工具与用品的被盗可能性最高,追回的几率也最小。目前只有25%的被盗建筑设备能够被成功追回。再另上每年因事故及...
【热点】
阅读更多
热门文章
最新文章
友情链接
- 标签: 康师傅
- https://www.varian.com/en-au/search?cat=113&search=谷歌留痕软件【tg:seogoogle987】,yIP
- https://www.ushmm.org/search/results.php?q=谷歌留痕软件【tg:seogoogle987】,Fk5
- https://m.shoppinghow.kakao.com/m/search/q/谷歌留痕软件【tg:seogoogle987】ZVp
- https://5gaa.org/?token=6e2l7hjt2i26gzgctgwdrv7v0j6nxorq&s=谷歌留痕软件【tg:seogoogle987】HH6
- https://www.pearlstonecenter.org/search/谷歌留痕软件【tg:seogoogle987】,L4Y
- https://www.wheels24.gr/?action=CHECK&s=谷歌留痕软件【tg:seogoogle987】,onO
- https://www.tailoy.com.pe/catalogsearch/result/?q=谷歌留痕软件【tg:seogoogle987】,KwM
- https://www.vivaraise.fr/catalogsearch/result/?q=谷歌留痕软件【tg:seogoogle987】,Lnw
- https://www.duksung.ac.kr/search/front/Search.jsp?qt=谷歌留痕软件【tg:seogoogle987】9K2
- https://www.nyif.com/catalogsearch/result/?q=谷歌留痕软件【tg:seogoogle987】,xly
- https://www.tullygroup.us/?ID=hbkq8jFjrQlVRrwzEmvoUJJAY4e1Lfo5&s=谷歌留痕软件【tg:seogoogle987】,HYY
- https://www.teamlab.art/zh-hans/?submit=谷歌留痕软件【tg:seogoogle987】,caH
- https://www.randjleather.co.uk/index.php?route=product/search&tag=谷歌留痕软件【tg:seogoogle987】,2Le
- https://www.searcychamber.com/list/search?AsfnA=DtkTQzs&q=谷歌留痕软件【tg:seogoogle987】,3A3
- https://www.terramania.nl/catalogsearch/result/index/?q=谷歌留痕软件【tg:seogoogle987】,zkG
- https://www.rollingstone.it/?ID=DVMeu3AlmzZE1cuJ2FmgmO5TSCQRb3yh&s=谷歌留痕软件【tg:seogoogle987】,Y1C
- https://www.synonyms.com/antonyms/谷歌留痕软件【tg:seogoogle987】,oKf
- https://www.xvideos.com/tags/谷歌留痕软件【tg:seogoogle987】,QXA
- https://www.abbreviations.com/谷歌留痕软件【tg:seogoogle987】PPL
- https://www.ucycle.com/search/=谷歌留痕软件【tg:seogoogle987】,QYa
- https://www.roberthalf.com/us/en/jobs/all/谷歌留痕软件【tg:seogoogle987】HMq
- https://www.roblox.com/discover/?cat=107&Keyword=谷歌留痕软件【tg:seogoogle987】,iYf
- https://www.qidulp.com/search?query=谷歌留痕软件【tg:seogoogle987】,gpd
- https://www.unclefossil.com/search/谷歌留痕软件【tg:seogoogle987】,Ydl
- https://www.partilerdunyasi.com/index.php?route=product/search&tag=谷歌留痕软件【tg:seogoogle987】,zXN
- https://www.maafushidive.com?collections?vendors?q=谷歌留痕软件【tg:seogoogle987】,ulg
- https://www.reginatangoshoes.com/en/catalogsearch/result/index/?T=1686132113407&q=谷歌留痕软件【tg:seogoogle987】,o09
- https://www.wilsonart.com/catalogsearch/result/?action=CHECK&q=谷歌留痕软件【tg:seogoogle987】,Dqh
- https://www.nuovabai.it/catalogsearch/result/?action=SEARCH&q=谷歌留痕软件【tg:seogoogle987】,cgk
- https://www.oprny.com/search.php?search_query=谷歌留痕软件【tg:seogoogle987】,AtJ
- https://www.yidian51.com/taobao/谷歌留痕软件【tg:seogoogle987】,nJ8
- https://www.zalora.sg/catalog/?cat=112&q=谷歌留痕软件【tg:seogoogle987】,AMP
- https://www.hanbat.ac.kr/search/front/Search.jsp?qt=谷歌留痕软件【tg:seogoogle987】ehi
- https://www.tiktok.com/tag/谷歌留痕软件【tg:seogoogle987】,Uys
- https://www.sonepar.ch/fr/search?q=谷歌留痕软件【tg:seogoogle987】,lHd
- https://jihoon471.cafe24.com/product/search.html?banner_action=&keyword=谷歌留痕软件【tg:seogoogle987】4A9
- https://www.londontheatredirect.com/search/谷歌留痕软件【tg:seogoogle987】,TYR
- https://www.revere.org/search?action=SEARCH&q=谷歌留痕软件【tg:seogoogle987】,3So
- https://www.resilienz-akademie.com/?cat=71&s=谷歌留痕软件【tg:seogoogle987】,z5Z
- https://www.nextavenue.org/?action=QUERY&s=谷歌留痕软件【tg:seogoogle987】,xhp
- https://www.nytimes.com/search?dropmab=true&query=谷歌留痕软件【tg:seogoogle987】,cyV
- https://www.ons.gov.uk/search?q=谷歌留痕软件【tg:seogoogle987】,8OL
- https://www.impactpool.org/search/?type=79&q=谷歌留痕软件【tg:seogoogle987】asN
- https://www.quarterjacksurgery.co.uk/?AT=3rBy&s=谷歌留痕软件【tg:seogoogle987】,KuQ
- https://hsmoa.com/search?query=谷歌留痕软件【tg:seogoogle987】CdP
- https://www.kaskus.co.id/search?q=谷歌留痕软件【tg:seogoogle987】,Ggc
- https://www.kaiyueleather.com/search/谷歌留痕软件【tg:seogoogle987】,tnI
- https://www.totolink.vn/search/谷歌留痕软件【tg:seogoogle987】,ZpV
- https://www.spicebar.de/catalogsearch/result/?q=谷歌留痕软件【tg:seogoogle987】,ydA
- https://www.libros.unam.mx/catalogsearch/result/?cat=37&dir=asc&format=20&lit=20&manufacturer=3230&mode=list&order=year_edition&q=谷歌留痕软件【tg:seogoogle987】,oMD