Skip to content
Open
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 .ci-operator.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build_root_image:
name: release
namespace: openshift
tag: rhel-9-release-golang-1.25-openshift-4.22
tag: rhel-9-release-golang-1.26-openshift-5.0
4 changes: 2 additions & 2 deletions Dockerfile.daemon.openshift
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.25-openshift-4.22 AS builder
FROM registry.ci.openshift.org/ocp/builder:rhel-9-golang-1.26-openshift-5.0 AS builder

WORKDIR /go/src/github.com/openshift/ingress-node-firewall
COPY . .

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Security best practice: Copy specific files instead of entire context.

Line 4 copies the entire build context (. .), which violates the guideline to "COPY specific files, not entire context". This can inadvertently include sensitive files, secrets, or unnecessary data in the build cache.

Consider updating to copy only the necessary files and directories required by ./hack/build-daemon.sh. You may need to inspect the build script to determine the minimal required file set.

As per coding guidelines, "COPY specific files, not entire context" is required for container security.

🤖 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 `@Dockerfile.daemon.openshift` at line 4, Replace the insecure "COPY . ." in
Dockerfile.daemon.openshift with explicit COPY instructions that only copy the
files and directories required by the build script; inspect
./hack/build-daemon.sh to determine the minimal set (e.g., scripts, Dockerfile
fragments, configs, source directories) and add individual COPY lines for each
required path, and add/adjust a .dockerignore to exclude secrets and unnecessary
files so sensitive data and large unrelated context are not included in the
image/build cache.

Source: Coding guidelines

RUN ./hack/build-daemon.sh

FROM registry.ci.openshift.org/ocp/4.22:base-rhel9
FROM registry.ci.openshift.org/ocp/5.0:base-rhel9
COPY --from=builder /go/src/github.com/openshift/ingress-node-firewall/bin/daemon /usr/bin/
COPY --from=builder /go/src/github.com/openshift/ingress-node-firewall/bin/syslog /usr/bin/
CMD ["/usr/bin/daemon"]