fix: align NVIDIA Docker file#137
Conversation
|
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
Greptile SummaryThis PR upgrades the NVIDIA DOCA base image from version 3.1.0 to 3.2.1 in the SR-IOV network config daemon Dockerfile and improves tar extraction safety. Key Changes:
Context: Previous review comments identified the security vulnerability introduced by bypassing GPG verification. The developer's approach acknowledges this is temporary alignment with the beta3 state, with plans to address it in beta.4. However, this represents a security compromise that allows unsigned/unverified packages to be installed. Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Dev as Developer
participant DockerBuild as Docker Build
participant GoBuilder as Go Builder Stage
participant APT as APT Package Manager
participant DOCA as DOCA Repository (GPG Issue)
participant MFT as MFT Download
participant RuntimeImage as Runtime Image
Dev->>DockerBuild: Build with Dockerfile.sriov-network-config-daemon.nvidia
DockerBuild->>GoBuilder: Stage 1: Build Go binary
GoBuilder->>GoBuilder: make _build-sriov-network-config-daemon
GoBuilder-->>DockerBuild: Binary ready
DockerBuild->>RuntimeImage: Stage 2: FROM DOCA 3.2.1-base-rt-host
RuntimeImage->>APT: apt-get update -o Acquire::AllowInsecureRepositories=true
APT->>DOCA: Request package metadata (GPG key missing)
DOCA-->>APT: Repository metadata without valid signature
APT->>RuntimeImage: Allow insecure repos (bypass GPG verification)
RuntimeImage->>APT: apt-get install --allow-unauthenticated packages
APT->>DOCA: Request hwdata, pciutils, curl, mstflint
DOCA-->>APT: Unsigned packages (GPG verification skipped)
APT->>RuntimeImage: Install packages without signature verification
RuntimeImage->>MFT: curl -fsSL MFT tarball
MFT-->>RuntimeImage: MFT tarball
RuntimeImage->>RuntimeImage: tar -xz --no-same-owner (ownership preserved safely)
RuntimeImage->>RuntimeImage: Install MFT, symlink mstconfig/mstfwreset
DockerBuild->>RuntimeImage: Copy binary and sources
RuntimeImage-->>DockerBuild: Container image ready
|
| RUN apt-get update -o Acquire::AllowInsecureRepositories=true || true && \ | ||
| apt-get install -y --allow-unauthenticated hwdata pciutils curl mstflint && \ | ||
| apt-get clean && rm -rf /var/lib/apt/lists/* |
There was a problem hiding this comment.
Using --allow-unauthenticated and -o Acquire::AllowInsecureRepositories=true introduces a security vulnerability by bypassing package signature verification. This allows packages from potentially compromised repositories to be installed without validation.
Consider:
- Adding the missing GPG key properly:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A024F6F0E6D6A281 - Contacting NVIDIA to resolve the GPG signing issue in their DOCA 3.2.1 repositories
- Temporarily pinning to DOCA 3.1.0 until the GPG issue is resolved
| RUN apt-get update && apt-get install -y hwdata pciutils curl mstflint && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
| # DOCA repositories have a GPG issue, so we need to allow insecure repositories. | ||
| # GPG error: https://linux.mellanox.com/public/repo/doca/3.2.1/ubuntu22.04/x86_64 ./ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A024F6F0E6D6A281 | ||
| RUN apt-get update -o Acquire::AllowInsecureRepositories=true || true && \ |
There was a problem hiding this comment.
The || true here will hide any actual errors from apt-get update, not just the GPG warning. If the update fails for legitimate reasons (network issues, repository unavailable), the build will continue silently and potentially install outdated packages.
There was a problem hiding this comment.
Currently this is aligned with what we had in beta3.
Do you want me to change it?
There was a problem hiding this comment.
If this might hide future errors while building image, it might be good to remove || true. Lets add this in beta.4
Signed-off-by: Fred Rolland <frolland@nvidia.com>
7873892 to
fad2356
Compare
No description provided.