Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/operator-framework/operator-registry

go 1.26.3
go 1.26.5

require (
github.com/akrylysov/pogreb v0.10.2
Expand Down
2 changes: 1 addition & 1 deletion upstream-builder.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.26-alpine AS builder
FROM golang:1.26.5-alpine AS builder

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 5 \
  'upstream-builder\.Dockerfile|docker build|docker run|podman build|podman run|image:.*builder' .

Repository: operator-framework/operator-registry

Length of output: 10999


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== upstream-builder.Dockerfile =="
cat -n upstream-builder.Dockerfile

echo
echo "== Makefile relevant section =="
sed -n '80,100p' Makefile | cat -n

echo
echo "== targeted references =="
rg -n "\bsanity-container\b|upstream-builder\.Dockerfile|-f upstream-builder\.Dockerfile|registry serve" .

Repository: operator-framework/operator-registry

Length of output: 2587


Run the runtime image as non-root.

The builder stage is build-only, but the final stage served by make sanity-check runs as the default root user. Add a USER after populating /build, /bin, and /etc/nsswitch.conf, and ensure those paths remain writable/owned correctly during setup if needed.

🧰 Tools
🪛 Trivy (0.72.0)

[error] 1-1: Image user should not be 'root'

Specify at least 1 USER command in Dockerfile with non-root user as argument

Rule: DS-0002

Learn more

(IaC/Dockerfile)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@upstream-builder.Dockerfile` at line 1, Update the final runtime stage of
upstream-builder.Dockerfile to run as a non-root user by adding a USER directive
after /build, /bin, and /etc/nsswitch.conf are populated. Ensure the required
runtime paths are owned or writable by that user during image setup, while
leaving the build-only builder stage unchanged.

Source: Linters/SAST tools


RUN apk update && apk add build-base git mercurial bash linux-headers
WORKDIR /build
Expand Down
Loading