fix: GPG error on DOCA repository#136
fix: GPG error on DOCA repository#136rollandf merged 1 commit intoMellanox:network-operator-26.1.xfrom
Conversation
|
Thanks for your PR,
To skip the vendors CIs, Maintainers can use one of:
|
| # We have to ensure that pciutils is installed. These packages are needed for mstfwreset to succeed. | ||
| # xref pkg/vendors/mellanox/mellanox.go#L150 | ||
| RUN apt-get update && apt-get install -y hwdata pciutils curl mstflint && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
| RUN apt-get update -o Acquire::AllowInsecureRepositories=true || true && \ |
There was a problem hiding this comment.
@rollandf please add a commend why we need to add AllowInsecureRepositories=true
Greptile SummaryThis PR upgrades the DOCA base image from 3.1.0 to 3.2.1 and works around a GPG key issue in NVIDIA's DOCA repository by disabling cryptographic verification during package installation. Key changes:
Critical security concern: Confidence Score: 1/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Builder as Build Stage (golang:1.25)
participant DOCA as DOCA Base Image (3.2.1)
participant Apt as apt-get (DOCA repos)
participant Mellanox as Mellanox Downloads
participant Container as Final Container
Builder->>Builder: Build sriov-network-config-daemon binary
Note over DOCA,Apt: Base image from nvcr.io/nvidia/doca/doca:3.2.1-base-rt-host
DOCA->>Apt: apt-get update (with GPG bypass flags)
Note over Apt: -o Acquire::AllowInsecureRepositories=true
Note over Apt: Errors masked with || true
Apt-->>DOCA: Update package lists (no GPG verification)
DOCA->>Apt: apt-get install --allow-unauthenticated
Note over Apt: Installs: hwdata, pciutils, curl, mstflint
Apt-->>DOCA: Packages installed without cryptographic verification
DOCA->>Mellanox: Download MFT package via curl
Mellanox-->>DOCA: mft-4.33.0-169 tarball
DOCA->>DOCA: Extract with --no-same-owner flag
DOCA->>DOCA: Install MFT without kernel modules
DOCA->>DOCA: Replace mstconfig/mstfwreset with mlx symlinks
Builder->>Container: Copy daemon binary
DOCA->>Container: Copy bindata and sources
Container->>Container: Ready to run sriov-network-config-daemon
|
| 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.
logic: Disabling GPG verification (Acquire::AllowInsecureRepositories=true and --allow-unauthenticated) is a significant security risk. This allows installation of packages without cryptographic verification, making the build vulnerable to man-in-the-middle attacks and tampered packages.
The proper fix would be to:
- Import the DOCA repository's GPG key before running apt-get update
- Or contact NVIDIA to resolve the GPG key issues with their DOCA repository
Example proper fix:
RUN curl -fsSL https://path-to-doca-gpg-key.asc | apt-key add - && \
apt-get update && \
apt-get install -y hwdata pciutils curl mstflint && \
apt-get clean && rm -rf /var/lib/apt/lists/*
| # We have to ensure that pciutils is installed. These packages are needed for mstfwreset to succeed. | ||
| # xref pkg/vendors/mellanox/mellanox.go#L150 | ||
| RUN apt-get update && apt-get install -y hwdata pciutils curl mstflint && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
| RUN apt-get update -o Acquire::AllowInsecureRepositories=true || true && \ |
There was a problem hiding this comment.
logic: Using || true masks failures from apt-get update. If the update fails for reasons other than GPG errors, the build will continue silently and potentially install outdated or missing packages.
Signed-off-by: Fred Rolland <frolland@nvidia.com>
e5e5c9b
into
Mellanox:network-operator-26.1.x
No description provided.