Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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 .tekton/scanner-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
- name: extra-labels
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el8"
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"

workspaces:
- name: git-auth
Expand Down
2 changes: 1 addition & 1 deletion .tekton/scanner-db-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- name: extra-labels
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el8"
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"

workspaces:
- name: git-auth
Expand Down
2 changes: 1 addition & 1 deletion .tekton/scanner-db-slim-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ spec:
- name: extra-labels
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el8"
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"

workspaces:
- name: git-auth
Expand Down
2 changes: 1 addition & 1 deletion .tekton/scanner-slim-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ spec:
- name: extra-labels
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el8"
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"

workspaces:
- name: git-auth
Expand Down
4 changes: 2 additions & 2 deletions image/db/rhel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG RPMS_REGISTRY=registry.access.redhat.com
ARG RPMS_BASE_IMAGE=ubi8
ARG RPMS_BASE_IMAGE=ubi9
ARG RPMS_BASE_TAG=latest

ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi8-minimal
ARG BASE_IMAGE=ubi9-minimal
ARG BASE_TAG=latest

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS extracted_bundle
Expand Down
4 changes: 2 additions & 2 deletions image/db/rhel/Dockerfile.slim
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG RPMS_REGISTRY=registry.access.redhat.com
ARG RPMS_BASE_IMAGE=ubi8
ARG RPMS_BASE_IMAGE=ubi9
ARG RPMS_BASE_TAG=latest

ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi8-minimal
ARG BASE_IMAGE=ubi9-minimal
ARG BASE_TAG=latest

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS extracted_bundle
Expand Down
6 changes: 3 additions & 3 deletions image/db/rhel/konflux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.redhat.io/rhel8/postgresql-15:latest@sha256:7fdc65364d67e5d08f91956c368f1b43670383886049c7ce2b7591cc0a715f76 AS scanner-db-common
FROM registry.redhat.io/rhel9/postgresql-15:latest@sha256:cba1417b7e8a5b55289aa951c48dc940c72ebea5380045f32cd8faba41937f9b AS scanner-db-common

ARG SCANNER_TAG
RUN if [[ "$SCANNER_TAG" == "" ]]; then >&2 echo "error: required SCANNER_TAG arg is unset"; exit 6; fi
Expand Down Expand Up @@ -57,7 +57,7 @@ FROM scanner-db-common AS scanner-db-slim
LABEL \
com.redhat.component="rhacs-scanner-db-slim-container" \
io.k8s.display-name="scanner-db-slim" \
name="advanced-cluster-security/rhacs-scanner-db-slim-rhel8"
name="advanced-cluster-security/rhacs-scanner-db-slim-rhel9"

ENV ROX_SLIM_MODE="true"

Expand All @@ -67,7 +67,7 @@ FROM scanner-db-common AS scanner-db
LABEL \
com.redhat.component="rhacs-scanner-db-container" \
io.k8s.display-name="scanner-db" \
name="advanced-cluster-security/rhacs-scanner-db-rhel8"
name="advanced-cluster-security/rhacs-scanner-db-rhel9"

COPY --chown=0:0 .konflux/scanner-data/blob-pg-definitions.sql.gz \
/docker-entrypoint-initdb.d/definitions.sql.gz
2 changes: 1 addition & 1 deletion image/db/rhel/scripts/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail

# If this is updated, be sure to update PG_MAJOR in the Dockerfile and the signature file.
postgres_major=15
pg_rhel_major=8
pg_rhel_major=9

arch="$(uname -m)"
dnf_list_args=()
Expand Down
4 changes: 2 additions & 2 deletions image/scanner/rhel/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi8-minimal
ARG BASE_IMAGE=ubi9-minimal
ARG BASE_TAG=latest

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS extracted_bundle
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN microdnf upgrade -y --nobest && \
# by the script `save-dir-contents` during the image build. The directory
# contents are then restored by the script `restore-all-dir-contents`
# during the container start.
chown -R 65534:65534 /etc/pki/ca-trust /etc/ssl && /save-dir-contents /etc/pki/ca-trust /etc/ssl && \
chown -R 65534:65534 /etc/pki/ca-trust && /save-dir-contents /etc/pki/ca-trust/source && \
chmod +rx /scanner

ENV NVD_DEFINITIONS_DIR="/nvd_definitions"
Expand Down
4 changes: 2 additions & 2 deletions image/scanner/rhel/Dockerfile.slim
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi8-minimal
ARG BASE_IMAGE=ubi9-minimal
ARG BASE_TAG=latest

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS extracted_bundle
Expand Down Expand Up @@ -43,7 +43,7 @@ RUN microdnf upgrade -y --nobest && \
# by the script `save-dir-contents` during the image build. The directory
# contents are then restored by the script `restore-all-dir-contents`
# during the container start.
chown -R 65534:65534 /etc/pki /etc/ssl && /save-dir-contents /etc/pki/ca-trust /etc/ssl && \
chown -R 65534:65534 /etc/pki/ca-trust && /save-dir-contents /etc/pki/ca-trust/source && \
chmod +rx /scanner

ENV REPO_TO_CPE_DIR="/repo2cpe"
Expand Down
1 change: 0 additions & 1 deletion image/scanner/rhel/create-bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ cp "${INPUT_ROOT}/scripts/entrypoint.sh" "${OUTPUT_DIR}/scripts"
cp "${INPUT_ROOT}/scripts/import-additional-cas" "${OUTPUT_DIR}/scripts"
cp "${INPUT_ROOT}/scripts/restore-all-dir-contents" "${OUTPUT_DIR}/scripts"
cp "${INPUT_ROOT}/scripts/save-dir-contents" "${OUTPUT_DIR}/scripts"
cp "${INPUT_ROOT}/scripts/trust-root-ca" "${OUTPUT_DIR}/scripts"

# =============================================================================
# Add binaries and data files to be included in the Dockerfile here. This
Expand Down
14 changes: 7 additions & 7 deletions image/scanner/rhel/konflux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Compiling scanner binaries and staging repo2cpe and genesis manifests
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_8_golang_1.25@sha256:aa03597ee8c7594ffecef5cbb6a0f059d362259d2a41225617b27ec912a3d0d3 AS builder
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_golang_1.25@sha256:bd531796aacb86e4f97443797262680fbf36ca048717c00b6f4248465e1a7c0c AS builder

ARG SCANNER_TAG
RUN if [[ "$SCANNER_TAG" == "" ]]; then >&2 echo "error: required SCANNER_TAG arg is unset"; exit 6; fi
Expand Down Expand Up @@ -28,7 +28,7 @@ COPY .konflux/scanner-data/blob-genesis_manifests.json image/scanner/dump/genesi


# Common base for scanner slim and full
FROM registry.access.redhat.com/ubi8-minimal:latest@sha256:b880e16b888f47bc3fae64e67cd9776b24372f2e7ec2051f5a9386de6f5a75ac AS scanner-common
FROM registry.access.redhat.com/ubi9-minimal:latest@sha256:c7d44146f826037f6873d99da479299b889473492d3c1ab8af86f08af04ec8a0 AS scanner-common

ARG SCANNER_TAG

Expand Down Expand Up @@ -59,7 +59,7 @@ COPY --chown=65534:65534 --from=builder /src/image/scanner/dump/genesis_manifest

COPY LICENSE /licenses/LICENSE

RUN microdnf install xz && \
RUN microdnf install -y xz && \
microdnf clean all && \
# (Optional) Remove line below to keep package management utilities
# We don't uninstall rpm because scanner uses it to get packages installed in scanned images.
Expand All @@ -70,8 +70,8 @@ RUN microdnf install xz && \
# by the script `save-dir-contents` during the image build. The directory
# contents are then restored by the script `restore-all-dir-contents`
# during the container start.
chown -R 65534:65534 /etc/pki/ca-trust /etc/ssl && \
/save-dir-contents /etc/pki/ca-trust /etc/ssl
chown -R 65534:65534 /etc/pki/ca-trust && \
/save-dir-contents /etc/pki/ca-trust/source

# This is equivalent to nobody:nobody.
USER 65534:65534
Expand All @@ -85,7 +85,7 @@ FROM scanner-common AS scanner-slim
LABEL \
com.redhat.component="rhacs-scanner-slim-container" \
io.k8s.display-name="scanner-slim" \
name="advanced-cluster-security/rhacs-scanner-slim-rhel8"
name="advanced-cluster-security/rhacs-scanner-slim-rhel9"

ENV ROX_SLIM_MODE="true"

Expand All @@ -96,7 +96,7 @@ FROM scanner-common AS scanner
LABEL \
com.redhat.component="rhacs-scanner-container" \
io.k8s.display-name="scanner" \
name="advanced-cluster-security/rhacs-scanner-rhel8"
name="advanced-cluster-security/rhacs-scanner-rhel9"

ENV NVD_DEFINITIONS_DIR="/nvd_definitions"
ENV K8S_DEFINITIONS_DIR="/k8s_definitions"
Expand Down
1 change: 0 additions & 1 deletion image/scanner/scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ set -euo pipefail

/restore-all-dir-contents
/import-additional-cas
/trust-root-ca

exec /scanner
23 changes: 22 additions & 1 deletion image/scanner/scripts/import-additional-cas
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,37 @@ set -euo pipefail
# kubernetes secret volume mount process.
copy_existing () {
src=$1
echo "Looking for certificates in '$src'"
if [ -d "$src" ] && [ "$(ls -A -I "..*" "$src")" ]; then
cp -v -L "$src"/* /etc/pki/ca-trust/source/anchors
else
echo "No certificates found in $src"
fi
}

echo "Setting up CA trust store in container"

copy_existing /usr/local/share/ca-certificates

# Copy the custom trusted CA bundles injected by the Openshift Network Operator.
copy_existing /etc/pki/injected-ca-trust

update-ca-trust extract
# Copy the StackRox root CA if available (mounted by the operator).
# Only copy ca.pem — the mount also contains server cert and key which
# should not be added as trusted CA anchors.
CA_PATH="/run/secrets/stackrox.io/certs/ca.pem"
echo "Copying StackRox root CA from '${CA_PATH}'"
# For RHEL
cp "${CA_PATH}" /etc/pki/ca-trust/source/anchors/root-ca.pem

echo "Updating CA trust"
# Though /etc/pki/ca-trust/extracted is the default output, update-ca-trust
# will create the necessary directories with the required permissions if the `--output` flag is used.
# See https://bugzilla.redhat.com/show_bug.cgi?id=2241240 for background.
#
# tl,dr: update-ca-trust extract, when giving the `--output` flag behaves differently with respect
# to filesystem permissions and this is the behaviour we need for containerized environments.
update-ca-trust extract --output /etc/pki/ca-trust/extracted

echo "Done setting up CA trust store in container"
echo
3 changes: 2 additions & 1 deletion image/scanner/scripts/restore-all-dir-contents
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set -euo pipefail

[ -d /.init-dirs ] || exit 0

cp -rfP /.init-dirs/* /
# We use --no-clobber here because we don't need to re-copy files on container restarts.
cp --recursive --no-dereference --no-clobber /.init-dirs/* /
9 changes: 0 additions & 9 deletions image/scanner/scripts/trust-root-ca

This file was deleted.

2 changes: 1 addition & 1 deletion image/vulnerabilities/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi8-minimal
ARG BASE_IMAGE=ubi9-minimal
ARG BASE_TAG=latest

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
Expand Down
88 changes: 44 additions & 44 deletions rpms.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,69 @@ lockfileVendor: redhat
arches:
- arch: aarch64
packages:
- url: https://cdn.redhat.com/content/dist/rhel8/8/aarch64/baseos/os/Packages/x/xz-5.2.4-4.el8_6.aarch64.rpm
repoid: rhel-8-for-aarch64-baseos-rpms
size: 156276
checksum: sha256:342a2504cb34c9a5c1d43906f534cb1f3bf1de58ac517d575cff57053d04ab00
- url: https://cdn.redhat.com/content/dist/rhel9/9/aarch64/baseos/os/Packages/x/xz-5.2.5-8.el9_0.aarch64.rpm
repoid: rhel-9-for-aarch64-baseos-rpms
size: 235798
checksum: sha256:26ac21be6c1e396c7bcbaa9d4786e3275e996d9d78c01f75bbbc6962e6c9bef7
name: xz
evr: 5.2.4-4.el8_6
sourcerpm: xz-5.2.4-4.el8_6.src.rpm
evr: 5.2.5-8.el9_0
sourcerpm: xz-5.2.5-8.el9_0.src.rpm
source:
- url: https://cdn.redhat.com/content/dist/rhel8/8/aarch64/baseos/source/SRPMS/Packages/x/xz-5.2.4-4.el8_6.src.rpm
repoid: rhel-8-for-aarch64-baseos-source-rpms
size: 1077113
checksum: sha256:7914b320eefa2db6dad68e5f01e99f8e661072a1f13acb3d19cba8c1295ae40a
- url: https://cdn.redhat.com/content/dist/rhel9/9/aarch64/baseos/source/SRPMS/Packages/x/xz-5.2.5-8.el9_0.src.rpm
repoid: rhel-9-for-aarch64-baseos-source-rpms
size: 1168293
checksum: sha256:bce98f3a307e75a8ac28f909e29b41d64b15461fa9ddf0bf4ef3c2f6de946b46
name: xz
evr: 5.2.4-4.el8_6
evr: 5.2.5-8.el9_0
module_metadata: []
- arch: ppc64le
packages:
- url: https://cdn.redhat.com/content/dist/rhel8/8/ppc64le/baseos/os/Packages/x/xz-5.2.4-4.el8_6.ppc64le.rpm
repoid: rhel-8-for-ppc64le-baseos-rpms
size: 162264
checksum: sha256:80d2fc754452ae52b3b36504e5cceb5cd5435a97999351402ae7a28298592a01
- url: https://cdn.redhat.com/content/dist/rhel9/9/ppc64le/baseos/os/Packages/x/xz-5.2.5-8.el9_0.ppc64le.rpm
repoid: rhel-9-for-ppc64le-baseos-rpms
size: 243215
checksum: sha256:44cd014634f8a5cb83aff336500b0f2e3bec156a34e7da09e0ae6ef4b5e26467
name: xz
evr: 5.2.4-4.el8_6
sourcerpm: xz-5.2.4-4.el8_6.src.rpm
evr: 5.2.5-8.el9_0
sourcerpm: xz-5.2.5-8.el9_0.src.rpm
source:
- url: https://cdn.redhat.com/content/dist/rhel8/8/ppc64le/baseos/source/SRPMS/Packages/x/xz-5.2.4-4.el8_6.src.rpm
repoid: rhel-8-for-ppc64le-baseos-source-rpms
size: 1077113
checksum: sha256:7914b320eefa2db6dad68e5f01e99f8e661072a1f13acb3d19cba8c1295ae40a
- url: https://cdn.redhat.com/content/dist/rhel9/9/ppc64le/baseos/source/SRPMS/Packages/x/xz-5.2.5-8.el9_0.src.rpm
repoid: rhel-9-for-ppc64le-baseos-source-rpms
size: 1168293
checksum: sha256:bce98f3a307e75a8ac28f909e29b41d64b15461fa9ddf0bf4ef3c2f6de946b46
name: xz
evr: 5.2.4-4.el8_6
evr: 5.2.5-8.el9_0
module_metadata: []
- arch: s390x
packages:
- url: https://cdn.redhat.com/content/dist/rhel8/8/s390x/baseos/os/Packages/x/xz-5.2.4-4.el8_6.s390x.rpm
repoid: rhel-8-for-s390x-baseos-rpms
size: 155012
checksum: sha256:7fb678077d965dd6aeb09df28ce05cba9c22e4110d4b52f1ee43986beb87a5ff
- url: https://cdn.redhat.com/content/dist/rhel9/9/s390x/baseos/os/Packages/x/xz-5.2.5-8.el9_0.s390x.rpm
repoid: rhel-9-for-s390x-baseos-rpms
size: 234632
checksum: sha256:c06f44e6fb5a0a1fbf3c052d065b6336c3d17cedbc796260cf0c097b98326906
name: xz
evr: 5.2.4-4.el8_6
sourcerpm: xz-5.2.4-4.el8_6.src.rpm
evr: 5.2.5-8.el9_0
sourcerpm: xz-5.2.5-8.el9_0.src.rpm
source:
- url: https://cdn.redhat.com/content/dist/rhel8/8/s390x/baseos/source/SRPMS/Packages/x/xz-5.2.4-4.el8_6.src.rpm
repoid: rhel-8-for-s390x-baseos-source-rpms
size: 1077113
checksum: sha256:7914b320eefa2db6dad68e5f01e99f8e661072a1f13acb3d19cba8c1295ae40a
- url: https://cdn.redhat.com/content/dist/rhel9/9/s390x/baseos/source/SRPMS/Packages/x/xz-5.2.5-8.el9_0.src.rpm
repoid: rhel-9-for-s390x-baseos-source-rpms
size: 1168293
checksum: sha256:bce98f3a307e75a8ac28f909e29b41d64b15461fa9ddf0bf4ef3c2f6de946b46
name: xz
evr: 5.2.4-4.el8_6
evr: 5.2.5-8.el9_0
module_metadata: []
- arch: x86_64
packages:
- url: https://cdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/Packages/x/xz-5.2.4-4.el8_6.x86_64.rpm
repoid: rhel-8-for-x86_64-baseos-rpms
size: 156884
checksum: sha256:fa4ceb20dbf23e9408a6446fefc4b709bc85e0bc563ca423569bbe08ecee2c5e
- url: https://cdn.redhat.com/content/dist/rhel9/9/x86_64/baseos/os/Packages/x/xz-5.2.5-8.el9_0.x86_64.rpm
repoid: rhel-9-for-x86_64-baseos-rpms
size: 235693
checksum: sha256:f16d17c26a241400586ddc3d734ce863e3f19d433881ec640a47bedf0dafd07b
name: xz
evr: 5.2.4-4.el8_6
sourcerpm: xz-5.2.4-4.el8_6.src.rpm
evr: 5.2.5-8.el9_0
sourcerpm: xz-5.2.5-8.el9_0.src.rpm
source:
- url: https://cdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/source/SRPMS/Packages/x/xz-5.2.4-4.el8_6.src.rpm
repoid: rhel-8-for-x86_64-baseos-source-rpms
size: 1077113
checksum: sha256:7914b320eefa2db6dad68e5f01e99f8e661072a1f13acb3d19cba8c1295ae40a
- url: https://cdn.redhat.com/content/dist/rhel9/9/x86_64/baseos/source/SRPMS/Packages/x/xz-5.2.5-8.el9_0.src.rpm
repoid: rhel-9-for-x86_64-baseos-source-rpms
size: 1168293
checksum: sha256:bce98f3a307e75a8ac28f909e29b41d64b15461fa9ddf0bf4ef3c2f6de946b46
name: xz
evr: 5.2.4-4.el8_6
evr: 5.2.5-8.el9_0
module_metadata: []
13 changes: 7 additions & 6 deletions rpms.rhel.repo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[rhel-8-for-$basearch-baseos-rpms]
name = Red Hat Enterprise Linux 8 for $basearch - BaseOS (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel8/8/$basearch/baseos/os
[rhel-9-for-$basearch-baseos-rpms]
name = Red Hat Enterprise Linux 9 for $basearch - BaseOS (RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel9/9/$basearch/baseos/os
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Expand All @@ -12,9 +12,9 @@ sslverifystatus = 1
metadata_expire = 86400
enabled_metadata = 1

[rhel-8-for-$basearch-baseos-source-rpms]
name = Red Hat Enterprise Linux 8 for $basearch - BaseOS (Source RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel8/8/$basearch/baseos/source/SRPMS
[rhel-9-for-$basearch-baseos-source-rpms]
name = Red Hat Enterprise Linux 9 for $basearch - BaseOS (Source RPMs)
baseurl = https://cdn.redhat.com/content/dist/rhel9/9/$basearch/baseos/source/SRPMS
enabled = 1
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Expand All @@ -25,3 +25,4 @@ sslclientcert = $SSL_CLIENT_CERT
sslverifystatus = 1
metadata_expire = 86400
enabled_metadata = 0

Loading