成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

"docker scan"本地掃描鏡像漏洞

安全 云安全
2020年年底,Docker hub推出鏡像自動(dòng)掃描的功能,目前Docker Desktop for Mac以及window上的Docker都可以通過(guò)Docker scan子命令掃描本地鏡像是否存在漏洞軟件。

Docker scan[1]本地掃描鏡像漏洞

2020年年底,Docker hub推出鏡像自動(dòng)掃描的功能,同時(shí)Docker也支持了在本地通過(guò)Docker命令選項(xiàng)的方式支持鏡像漏洞掃描,目前Docker Desktop for Mac以及window上的Docker都可以通過(guò)Docker scan子命令掃描本地鏡像是否存在漏洞軟件。

Docker Desktop For Mac

使用docker scan的時(shí)候需要登錄Docker Hub的賬號(hào),同時(shí)docker scan支持一些不同的選項(xiàng)

  1. Options: 
  2.       --accept-license    接受使用第三方掃描提供商 
  3.       --dependency-tree   顯示帶有掃描結(jié)果的依賴樹 
  4.       --exclude-base      從漏洞掃描中排除基礎(chǔ)鏡像 (requires --file) 
  5.   -f, --file string       與image關(guān)聯(lián)的Dockerfile,提供更詳細(xì)的結(jié)果 
  6.       --group-issues      聚合重復(fù)的漏洞并將其分組為1個(gè)漏洞 (requires --json) 
  7.       --json              以json格式輸出結(jié)果 
  8.       --login             使用可選令牌(帶有--token)向掃描提供程序進(jìn)行身份驗(yàn)證,如果為空則使用web base令牌 
  9.       --reject-license    拒絕使用第三方掃描提供商 
  10.       --severity string   只報(bào)告提供級(jí)別或更高的漏洞(low|medium|high) 
  11.       --token string      登錄到第三方掃描提供程序的認(rèn)證令牌 
  12.       --version           顯示掃描插件版本 

指定Dockerfile

  1. $ docker scan -f Dockerfile docker-scan:e2e 
  2. Testing docker-scan:e2e 
  3. ... 
  4. ✗ High severity vulnerability found in perl 
  5.   Description: Integer Overflow or Wraparound 
  6.   Info: https://snyk.io/vuln/SNYK-DEBIAN10-PERL-570802 
  7.   Introduced through: git@1:2.20.1-2+deb10u3, meta-common-packages@meta 
  8.   From: git@1:2.20.1-2+deb10u3 > perl@5.28.1-6 
  9.   From: git@1:2.20.1-2+deb10u3 > liberror-perl@0.17027-2 > perl@5.28.1-6 
  10.   From: git@1:2.20.1-2+deb10u3 > perl@5.28.1-6 > perl/perl-modules-5.28@5.28.1-6 
  11.   and 3 more... 
  12.   Introduced by your base image (golang:1.14.6) 
  13.  
  14.  
  15.  
  16. Organization:      docker-desktop-test 
  17. Package manager:   deb 
  18. Target file:       Dockerfile 
  19. Project name:      docker-image|99138c65ebc7 
  20. Docker image:      99138c65ebc7 
  21. Base image:        golang:1.14.6 
  22. Licenses:          enabled 
  23.  
  24. Tested 200 dependencies for known issues, found 157 issues. 
  25.  
  26. According to our scan, you are currently using the most secure version of the selected base image 

不掃描該鏡像的基礎(chǔ)鏡像

  1. $ docker scan -f Dockerfile --exclude-base docker-scan:e2e 
  2. Testing docker-scan:e2e 
  3. ... 
  4. ✗ Medium severity vulnerability found in libidn2/libidn2-0 
  5.   Description: Improper Input Validation 
  6.   Info: https://snyk.io/vuln/SNYK-DEBIAN10-LIBIDN2-474100 
  7.   Introduced through: iputils/iputils-ping@3:20180629-2+deb10u1, wget@1.20.1-1.1, curl@7.64.0-4+deb10u1, git@1:2.20.1-2+deb10u3 
  8.   From: iputils/iputils-ping@3:20180629-2+deb10u1 > libidn2/libidn2-0@2.0.5-1+deb10u1 
  9.   From: wget@1.20.1-1.1 > libidn2/libidn2-0@2.0.5-1+deb10u1 
  10.   From: curl@7.64.0-4+deb10u1 > curl/libcurl4@7.64.0-4+deb10u1 > libidn2/libidn2-0@2.0.5-1+deb10u1 
  11.   and 3 more... 
  12.   Introduced in your Dockerfile by 'RUN apk add -U --no-cache wget tar' 
  13.  
  14.  
  15.  
  16. Organization:      docker-desktop-test 
  17. Package manager:   deb 
  18. Target file:       Dockerfile 
  19. Project name:      docker-image|99138c65ebc7 
  20. Docker image:      99138c65ebc7 
  21. Base image:        golang:1.14.6 
  22. Licenses:          enabled 
  23.  
  24. Tested 200 dependencies for known issues, found 16 issues. 

以json格式輸出掃描結(jié)果

 

JSON格式顯示鏡像掃描結(jié)果

聚合分組顯示掃描信息

  1. $ docker scan --json --group-issues docker-scan:e2e 
  2.     { 
  3.       "title""Improper Check for Dropped Privileges"
  4.       ... 
  5.       "packageName""bash"
  6.       "language""linux"
  7.       "packageManager""debian:10"
  8.       "description""## Overview\nAn 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.\n\n## References\n- [CONFIRM](https://security.netapp.com/advisory/ntap-20200430-0003/)\n- [Debian Security Tracker](https://security-tracker.debian.org/tracker/CVE-2019-18276)\n- [GitHub Commit](https://github.com/bminor/bash/commit/951bdaad7a18cc0dc1036bba86b18b90874d39ff)\n- [MISC](http://packetstormsecurity.com/files/155498/Bash-5.0-Patch-11-Privilege-Escalation.html)\n- [MISC](https://www.youtube.com/watch?v=-wGtxJ8opa8)\n- [Ubuntu CVE Tracker](http://people.ubuntu.com/~ubuntu-security/cve/CVE-2019-18276)\n"
  9.       "identifiers": { 
  10.         "ALTERNATIVE": [], 
  11.         "CVE": [ 
  12.           "CVE-2019-18276" 
  13.         ], 
  14.         "CWE": [ 
  15.           "CWE-273" 
  16.         ] 
  17.       }, 
  18.       "severity""low"
  19.       "severityWithCritical""low"
  20.       "cvssScore": 7.8, 
  21.       "CVSSv3""CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H/E:F"
  22.       ... 
  23.       "from": [ 
  24.         "docker-image|docker-scan@e2e"
  25.         "bash@5.0-4" 
  26.       ], 
  27.       "upgradePath": [], 
  28.       "isUpgradable"false
  29.       "isPatchable"false
  30.       "name""bash"
  31.       "version""5.0-4" 
  32.     }, 
  33.     ... 
  34.     "summary""880 vulnerable dependency paths"
  35.       "filesystemPolicy"false
  36.       "filtered": { 
  37.         "ignore": [], 
  38.         "patch": [] 
  39.       }, 
  40.       "uniqueCount": 158, 
  41.       "projectName""docker-image|docker-scan"
  42.       "platform""linux/amd64"
  43.       "path""docker-scan:e2e" 

顯示指定級(jí)別的漏洞,只有高于此級(jí)別的漏洞才會(huì)顯示出來(lái)

  1. $ docker scan --severity=medium docker-scan:e2e 
  2. ./bin/docker-scan_darwin_amd64 scan --severity=medium docker-scan:e2e 
  3.  
  4. Testing docker-scan:e2e... 
  5.  
  6. ✗ Medium severity vulnerability found in sqlite3/libsqlite3-0 
  7.  Description: Divide By Zero 
  8.  Info: https://snyk.io/vuln/SNYK-DEBIAN10-SQLITE3-466337 
  9.  Introduced through: gnupg2/gnupg@2.2.12-1+deb10u1, subversion@1.10.4-1+deb10u1, mercurial@4.8.2-1+deb10u1 
  10.  From: gnupg2/gnupg@2.2.12-1+deb10u1 > gnupg2/gpg@2.2.12-1+deb10u1 > sqlite3/libsqlite3-0@3.27.2-3 
  11.  From: subversion@1.10.4-1+deb10u1 > subversion/libsvn1@1.10.4-1+deb10u1 > sqlite3/libsqlite3-0@3.27.2-3 
  12.  From: mercurial@4.8.2-1+deb10u1 > python-defaults/python@2.7.16-1 > python2.7@2.7.16-2+deb10u1 > python2.7/libpython2.7-stdlib@2.7.16-2+deb10u1 > sqlite3/libsqlite3-0@3.27.2-3 
  13.  
  14. ✗ Medium severity vulnerability found in sqlite3/libsqlite3-0 
  15.  Description: Uncontrolled Recursion 
  16. ... 
  17. ✗ High severity vulnerability found in binutils/binutils-common 
  18.  Description: Missing Release of Resource after Effective Lifetime 
  19.  Info: https://snyk.io/vuln/SNYK-DEBIAN10-BINUTILS-403318 
  20.  Introduced through: gcc-defaults/g++@4:8.3.0-1 
  21.  From: gcc-defaults/g++@4:8.3.0-1 > gcc-defaults/gcc@4:8.3.0-1 > gcc-8@8.3.0-6 > binutils@2.31.1-16 > binutils/binutils-common@2.31.1-16 
  22.  From: gcc-defaults/g++@4:8.3.0-1 > gcc-defaults/gcc@4:8.3.0-1 > gcc-8@8.3.0-6 > binutils@2.31.1-16 > binutils/libbinutils@2.31.1-16 > binutils/binutils-common@2.31.1-16 
  23.  From: gcc-defaults/g++@4:8.3.0-1 > gcc-defaults/gcc@4:8.3.0-1 > gcc-8@8.3.0-6 > binutils@2.31.1-16 > binutils/binutils-x86-64-linux-gnu@2.31.1-16 > binutils/binutils-common@2.31.1-16 
  24.  and 4 more... 
  25.  
  26. Organization:      docker-desktop-test 
  27. Package manager:   deb 
  28. Project name:      docker-image|docker-scan 
  29. Docker image:      docker-scan:e2e 
  30. Platform:          linux/amd64 
  31. Licenses:          enabled 
  32.  
  33. Tested 200 dependencies for known issues, found 37 issues. 

Linux上安裝scan-cli插件

目前Linux系統(tǒng)上的Docker Engine尚未支持scan命令,因此可以通過(guò)插件形式使用,可以參考scan-cli-plugin[2]的文檔,此處我在Ubuntu上通過(guò)apt安裝一下

  1. > cat /etc/apt/sources.list.d/docker.list  
  2. deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial stable 
  3. > apt-get update && apt-get install docker-scan-plugin 

安裝完成之后,登錄Docker hub,然后同意訪問(wèn)Snyk即可。

參考資料

[1]docker scan:

https://docs.docker.com/engine/scan/

[2]scan-cli-plugin:

https://github.com/docker/scan-cli-plugin

本文轉(zhuǎn)載自微信公眾號(hào)「云原生生態(tài)圈」,可以通過(guò)以下二維碼關(guān)注。轉(zhuǎn)載本文請(qǐng)聯(lián)系云原生生態(tài)圈公眾號(hào)。

 

責(zé)任編輯:姜華 來(lái)源: 云原生生態(tài)圈
相關(guān)推薦

2010-12-31 13:35:39

2024-01-18 09:00:00

漏洞Docker工具

2023-02-01 15:00:45

2013-01-11 09:41:34

2010-09-17 16:16:28

2017-08-25 16:00:15

2010-09-17 15:36:24

2017-05-12 14:25:09

2013-05-20 11:54:55

2020-11-17 11:18:31

Docker

2023-11-01 12:19:32

Docker內(nèi)置工具

2018-06-05 08:58:38

Docker存儲(chǔ)容器

2010-09-25 10:25:23

2015-06-15 17:49:34

DockerDocker Hub漏洞

2014-12-08 09:01:53

2011-03-25 16:27:15

2011-03-25 16:28:46

漏洞掃描系統(tǒng)

2011-03-25 16:17:36

2016-10-07 19:23:05

2014-01-16 16:34:22

點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)

主站蜘蛛池模板: 狠狠骚 | 狠狠插天天干 | 欧美视频第二页 | 国产精品久久久久久模特 | 中文字幕一区二区三区在线视频 | 亚洲视频免费在线播放 | 国产区免费视频 | 久草成人 | 欧美日韩在线高清 | 成年人黄色一级片 | 久久精品国产一区二区三区不卡 | 97精品国产97久久久久久免费 | 亚洲精品日韩一区二区电影 | 日本激情一区二区 | 国产高清在线精品 | 日本网站在线看 | 国产日本精品视频 | 日日操夜夜干 | 久久在线 | 不卡一区二区三区四区 | 日韩欧美视频 | 99国产欧美 | 欧美片网站免费 | 毛片一区 | 五月激情婷婷网 | 中文一区二区 | 国产欧美一区二区三区在线看 | 久久久久久国产精品免费免费狐狸 | 欧美在线一区二区三区 | 国产一区| 成人在线免费视频 | 欧美日韩在线看 | 亚洲精品电影 | 午夜国产一级 | 99精品免费 | 日韩在线中文字幕 | 在线免费毛片 | 成人小视频在线观看 | 亚洲一区二区在线播放 | 成人在线一区二区 | 亚洲欧美日韩在线不卡 |