AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / coding / 问题 / 76920248
Accepted
xgretsch
xgretsch
Asked: 2023-08-17 17:36:35 +0800 CST2023-08-17 17:36:35 +0800 CST 2023-08-17 17:36:35 +0800 CST

如何追踪“docker scout cves”显示的漏洞来源

  • 772

我有一个基于 Ubuntu 23.04 的 docker 映像。除其他外,运行显示包中docker scout cves文件中的几个关键漏洞。(CVE-2023-24540 和 CVE-2023-24538)。stdlib 1.19.4pkg:golang/[email protected]

问题是,我完全不知道这个包是从哪里来的。我没有在我自己的代码中使用 go 语言。我在 中找不到该包dpkg.log。如果我手动运行所有apt命令,它不会出现在输出中。在 Docker Desktop 中运行受影响的包树时,我也看不到它——尽管很容易错过。

在漏洞消失之前,没有对我的 Dockerfile 进行二进制切割,任何人都可以解释一种系统方法来找出哪个命令导致安装此软件包吗?

附录:根据要求 - 这是一个包含所有安装命令但没有我自己的代码的 Dockerfile:

# Start with a base Ubuntu image
FROM ubuntu:23.04

ARG xdebug

# Prevent any prompts during installation
ENV DEBIAN_FRONTEND noninteractive

# Set up apt with any additional repositories we need
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:maxmind/ppa
RUN apt-get update --fix-missing
RUN apt upgrade -y

# Install Apache and various other packages.
RUN apt-get install -y apache2
RUN apt-get install -y vim cron geoipupdate git logrotate mysql-client openssh-server redis rsync supervisor unzip zip
RUN apt-get install -y python3-pip python3-dev python3-setuptools python3-numpy python3-pandas python3-yaml python3-click python3-dotenv python3-mysql.connector python3.tqdm
RUN apt-get install -y gcc make dnsutils ncdu lsof

# Configure any Apache modules that weren't in the default
RUN cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled
RUN cp /etc/apache2/mods-available/expires.load /etc/apache2/mods-enabled
RUN cp /etc/apache2/mods-available/authz_groupfile.load /etc/apache2/mods-enabled
RUN cp /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled/
RUN cp /etc/apache2/mods-available/ssl.load /etc/apache2/mods-enabled
RUN cp /etc/apache2/mods-available/socache_shmcb.load /etc/apache2/mods-enabled
RUN cp /etc/apache2/mods-available/ssl.conf /etc/apache2/mods-enabled

# Suppress Apache warning on being unable to determine the fully qualified domain name
RUN echo "ServerName localhost">>/etc/apache2/apache2.conf

# Install PHP and plumb into Apache
RUN apt-get update --fix-missing
RUN apt-get install -y php8.1 php8.1-curl php8.1-gd php8.1-gettext php8.1-gmp php8.1-iconv php8.1-imap php8.1-intl php8.1-mbstring php8.1-mysql php8.1-oauth php8.1-redis php8.1-xml php8.1-yaml php8.1-zip
RUN if [ "$xdebug" = "with" ] ; then apt-get install -y php8.1-xdebug ; fi
RUN apt-get install -y libapache2-mod-php8.1

# The bcmath extension seems to have problems when installed in line with the other PHP modules, as of 2022-07-18
RUN apt-get update --fix-missing
RUN apt-get install -y php8.1-bcmath

# Install locales
RUN apt-get install -y locales
RUN locale-gen en_GB
RUN locale-gen en_GB.UTF-8
RUN locale-gen de_DE
RUN locale-gen de_DE.UTF-8
RUN locale-gen es_ES
RUN locale-gen es_ES.UTF-8
RUN locale-gen fr_FR
RUN locale-gen fr_FR.UTF-8
RUN locale-gen it_IT
RUN locale-gen it_IT.UTF-8
RUN update-locale
docker
  • 1 1 个回答
  • 18 Views

1 个回答

  • Voted
  1. Best Answer
    Rick Rackow
    2023-08-17T19:18:19+08:002023-08-17T19:18:19+08:00

    从桌面视图来看,它比终端恕我直言。

    桌面视图

    如果您查看从 Dockerfile 构建的映像的视图,您可以在右侧看到这些小图标。绿色意味着一切都很好,不同色调的红色和黄色意味着该层引入了漏洞。

    漏洞桌面视图

    现在,如果您单击其中一个,它将在右侧(又称详细信息视图)向您显示其中引入了哪个漏洞:

    漏洞详情

    现在,在您的情况下,这有点困难,因为您在一层中添加了多个包。然而,在这种情况下,我们正在寻找基于 Go 的软件,因此在该层 ( ) 的列表中vim cron geoipupdate git logrotate mysql-client openssh-server redis rsync supervisor unzip zip应该只有geoipupdate. 在维护得更好的包上,您会在github 页面的安全选项卡下看到免责声明或其他内容,但这里显然不是这种情况。不过,如果您查看go.mod,您会发现它使用的 go 版本很容易受到攻击。对此的给定修复将是https://github.com/maxmind/geoipupdate/pull/251(并不是说我仍然需要修复测试,但现在足以展示。)

    终端

    在终端中,您可以--locations像这样使用该标志

    $ docker scout cves --locations cve-test:latest
    INFO New version 0.22.3 available (installed version is 0.20.0)
        ✓ SBOM of image already cached, 847 packages indexed
        ✗ Detected 7 vulnerable packages with a total of 32 vulnerabilities
    
       2C    10H     3M     0L  stdlib 1.19.4
    pkg:golang/[email protected]
    
    14: sha256:5d1e732cad3b228fd22501a92e270e61fd1e7a45faee63176660a3a77b63cab6
    /usr/bin/geoipupdate
    
        ✗ CRITICAL CVE-2023-24540
          https://scout.docker.com/v/CVE-2023-24540
          Affected range : <1.19.9
          Fixed version  : 1.19.9
    

    这样,它会打印出问题的根源,在这种情况下,它会再次向您指出同一个包。数字和哈希实际上是引入它的层。再次强调,一旦您之前查看过桌面输出,就会发现它更有意义。在那里您还可以看到问题是在第 14 层引入的。

    • 1

相关问题

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    使用 <font color="#xxx"> 突出显示 html 中的代码

    • 2 个回答
  • Marko Smith

    为什么在传递 {} 时重载解析更喜欢 std::nullptr_t 而不是类?

    • 1 个回答
  • Marko Smith

    您可以使用花括号初始化列表作为(默认)模板参数吗?

    • 2 个回答
  • Marko Smith

    为什么列表推导式在内部创建一个函数?

    • 1 个回答
  • Marko Smith

    我正在尝试仅使用海龟随机和数学模块来制作吃豆人游戏

    • 1 个回答
  • Marko Smith

    java.lang.NoSuchMethodError: 'void org.openqa.selenium.remote.http.ClientConfig.<init>(java.net.URI, java.time.Duration, java.time.Duratio

    • 3 个回答
  • Marko Smith

    为什么 'char -> int' 是提升,而 'char -> Short' 是转换(但不是提升)?

    • 4 个回答
  • Marko Smith

    为什么库中不调用全局变量的构造函数?

    • 1 个回答
  • Marko Smith

    std::common_reference_with 在元组上的行为不一致。哪个是对的?

    • 1 个回答
  • Marko Smith

    C++17 中 std::byte 只能按位运算?

    • 1 个回答
  • Martin Hope
    fbrereto 为什么在传递 {} 时重载解析更喜欢 std::nullptr_t 而不是类? 2023-12-21 00:31:04 +0800 CST
  • Martin Hope
    比尔盖子 您可以使用花括号初始化列表作为(默认)模板参数吗? 2023-12-17 10:02:06 +0800 CST
  • Martin Hope
    Amir reza Riahi 为什么列表推导式在内部创建一个函数? 2023-11-16 20:53:19 +0800 CST
  • Martin Hope
    Michael A fmt 格式 %H:%M:%S 不带小数 2023-11-11 01:13:05 +0800 CST
  • Martin Hope
    God I Hate Python C++20 的 std::views::filter 未正确过滤视图 2023-08-27 18:40:35 +0800 CST
  • Martin Hope
    LiDa Cute 为什么 'char -> int' 是提升,而 'char -> Short' 是转换(但不是提升)? 2023-08-24 20:46:59 +0800 CST
  • Martin Hope
    jabaa 为什么库中不调用全局变量的构造函数? 2023-08-18 07:15:20 +0800 CST
  • Martin Hope
    Panagiotis Syskakis std::common_reference_with 在元组上的行为不一致。哪个是对的? 2023-08-17 21:24:06 +0800 CST
  • Martin Hope
    Alex Guteniev 为什么编译器在这里错过矢量化? 2023-08-17 18:58:07 +0800 CST
  • Martin Hope
    wimalopaan C++17 中 std::byte 只能按位运算? 2023-08-17 17:13:58 +0800 CST

热门标签

python javascript c++ c# java typescript sql reactjs html

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve