Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
4ed303c
empty commit
davdhacs Feb 18, 2026
6860629
chore: Migrate all Scanner Dockerfiles to ubi9-micro base images
janisz Apr 14, 2026
fb55c40
fix: Remove coreutils package from ubi9-micro Dockerfiles
janisz Apr 15, 2026
0b60a3f
fix: Add rpms.lock.yaml to allowed-large-files list
janisz Apr 15, 2026
eeb62fa
fix: Create /var/lib/postgresql directory in scanner-db images
janisz Apr 17, 2026
4a10c15
chore: Remove redundant bash installation from ubi9-micro Dockerfiles
janisz Apr 17, 2026
2aef6d7
chore: Remove redundant util-linux installation from Dockerfiles
janisz Apr 17, 2026
20e6fcc
chore: Remove bash and util-linux from rpms.in.yaml
janisz Apr 17, 2026
a26a3fa
refactor: Simplify scanner-db Dockerfiles to use postgres base image
janisz Apr 17, 2026
6d2fdde
chore: Regenerate rpms.lock.yaml after removing bash and util-linux
janisz Apr 17, 2026
5d4e3c4
Revert "refactor: Simplify scanner-db Dockerfiles to use postgres bas…
janisz Apr 17, 2026
d099e0b
fix: Remove bash and util-linux from konflux.Dockerfile
janisz Apr 21, 2026
703624d
fix: Add missing rpm package and improve entrypoint robustness
janisz Apr 22, 2026
7b1dd2b
chore: Regenerate rpms.lock.yaml after adding rpm package
janisz Apr 23, 2026
05ab071
fix: Use sclorg postgres base image for scanner-db to fix timezone data
janisz Apr 23, 2026
e20a133
fix: Fix ARG placement in scanner-db Dockerfile
janisz Apr 23, 2026
8d94ba1
fix: Move PG_VERSION ARG to global scope in Dockerfile
janisz Apr 23, 2026
c84cd72
fix: Fix postgresql.conf path in Dockerfile.slim
janisz Apr 23, 2026
de37629
fix: Copy postgresql.conf to rhel/ directory for Dockerfile.slim buil…
janisz Apr 23, 2026
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
4 changes: 3 additions & 1 deletion .tekton/scanner-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
value: |
[
{ "type": "gomod", "path": "." },
{ "type": "rpm", "path": "." }
{ "type": "rpm" }
]
- name: build-source-image
value: 'true'
Expand All @@ -58,6 +58,8 @@ spec:
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"
- name: ACTIVATION_KEY
value: subscription-manager-activation-key-prod

workspaces:
- name: git-auth
Expand Down
8 changes: 6 additions & 2 deletions .tekton/scanner-db-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ spec:
value: 'true'
- name: hermetic
value: "true"
# No dependencies are required for scanner-db image.
- name: prefetch-input
value: ''
value: |
[
{ "type": "rpm" }
]
- name: build-source-image
value: 'true'
- name: build-target-stage
Expand All @@ -55,6 +57,8 @@ spec:
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"
- name: ACTIVATION_KEY
value: subscription-manager-activation-key-prod

workspaces:
- name: git-auth
Expand Down
8 changes: 6 additions & 2 deletions .tekton/scanner-db-slim-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,11 @@ spec:
value: 'true'
- name: hermetic
value: "true"
# No dependencies are required for scanner-db-slim image.
- name: prefetch-input
value: ''
value: |
[
{ "type": "rpm" }
]
- name: build-source-image
value: 'true'
- name: build-target-stage
Expand All @@ -55,6 +57,8 @@ spec:
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"
- name: ACTIVATION_KEY
value: subscription-manager-activation-key-prod

workspaces:
- name: git-auth
Expand Down
4 changes: 3 additions & 1 deletion .tekton/scanner-slim-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spec:
value: |
[
{ "type": "gomod", "path": "." },
{ "type": "rpm", "path": "." }
{ "type": "rpm" }
]
- name: build-source-image
value: 'true'
Expand All @@ -58,6 +58,8 @@ spec:
value:
# X.Y in the cpe label must be adjusted for every version stream.
- "cpe=cpe:/a:redhat:advanced_cluster_security:X.Y::el9"
- name: ACTIVATION_KEY
value: subscription-manager-activation-key-prod

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

ARG PG_VERSION=15
ARG BASE_REGISTRY=registry.access.redhat.com
ARG BASE_IMAGE=ubi9-minimal
ARG BASE_TAG=latest
Expand All @@ -12,12 +9,9 @@ COPY bundle.tar.gz /
WORKDIR /bundle
RUN microdnf install -y tar gzip && tar -zxf /bundle.tar.gz

FROM ${RPMS_REGISTRY}/${RPMS_BASE_IMAGE}:${RPMS_BASE_TAG} AS postgres_rpms

COPY scripts/download.sh /download.sh
RUN /download.sh
FROM quay.io/sclorg/postgresql-${PG_VERSION}-c9s:latest

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS base
USER root

ARG LABEL_VERSION
ARG LABEL_RELEASE
Expand All @@ -32,47 +26,23 @@ LABEL name="scanner-db" \
release="${LABEL_RELEASE}" \
quay.expires-after="${QUAY_TAG_EXPIRATION}"

ENV PG_MAJOR=15
ENV PATH="$PATH:/usr/pgsql-$PG_MAJOR/bin/" \
PGDATA="/var/lib/postgresql/data/pgdata"
ENV LANG="en_US.utf8"

COPY signatures/PGDG-RPM-GPG-KEY-RHEL /
COPY scripts/docker-entrypoint.sh /usr/local/bin/
COPY --from=extracted_bundle /bundle/etc/postgresql.conf /bundle/etc/pg_hba.conf /etc/
COPY --from=postgres_rpms /rpms/postgres.rpm /rpms/postgres-libs.rpm /rpms/postgres-server.rpm /rpms/postgres-contrib.rpm /tmp/

RUN microdnf upgrade -y --nobest && \
microdnf install -y shadow-utils && \
groupadd -g 70 postgres && \
adduser postgres -u 70 -g 70 -d /var/lib/postgresql -s /bin/sh && \
rpm --import PGDG-RPM-GPG-KEY-RHEL && \
microdnf install -y \
ca-certificates \
glibc-langpack-en \
glibc-locale-source \
libicu \
libxslt \
lz4 \
perl-libs \
python3 \
systemd-sysv \
zstd \
&& \
if [[ $(awk -F'=' '/VERSION_ID/{ gsub(/"/,""); print substr($2,1,1)}' /etc/os-release) -gt 8 ]]; then \
microdnf install -y uuid; \
fi && \
rpm -i /tmp/postgres-libs.rpm /tmp/postgres-server.rpm /tmp/postgres.rpm /tmp/postgres-contrib.rpm && \
# The removal of /usr/share/zoneinfo from UBI minimal images is intentional.
# After building the image, the image is reduced in size as much as possible,
# and the /usr/share/zoneinfo directory is purged as it saves space
# in the final distribution of the image.
# https://access.redhat.com/solutions/5616681
microdnf reinstall -y tzdata && \
microdnf clean all && \
# (Optional) Remove line below to keep package management utilities
rpm -e --nodeps $(rpm -qa shadow-utils curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rm -rf /var/cache/dnf /var/cache/yum /tmp/postgres-libs.rpm /tmp/postgres-server.rpm /tmp/postgres.rpm /tmp/postgres-contrib.rpm && \
RUN dnf upgrade -y --nobest && \
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
mkdir -p /var/lib/postgresql && \
groupmod -g 70 postgres && \
usermod -u 70 postgres -d /var/lib/postgresql && \
chown -R postgres:postgres /var/lib/postgresql && \
chown -R postgres:postgres /var/run/postgresql && \
chown -R postgres /var/lib/pgsql && \
chown -R postgres /opt/app-root && \
dnf clean all && \
rpm --verbose -e --nodeps $(rpm -qa curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rm -rf /var/cache/dnf /var/cache/yum && \
mkdir /docker-entrypoint-initdb.d

# This is equivalent to postgres:postgres.
Expand Down
75 changes: 17 additions & 58 deletions image/db/rhel/Dockerfile.slim
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
ARG RPMS_REGISTRY=registry.access.redhat.com
ARG RPMS_BASE_IMAGE=ubi9
ARG RPMS_BASE_TAG=latest
ARG PG_VERSION=15
FROM quay.io/sclorg/postgresql-${PG_VERSION}-c9s:latest

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

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS extracted_bundle
COPY bundle.tar.gz /

WORKDIR /bundle
RUN microdnf install -y tar gzip && tar -zxf /bundle.tar.gz

FROM ${RPMS_REGISTRY}/${RPMS_BASE_IMAGE}:${RPMS_BASE_TAG} AS postgres_rpms

COPY scripts/download.sh /download.sh
RUN /download.sh

FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} AS base
USER root

ARG LABEL_VERSION
ARG LABEL_RELEASE
Expand All @@ -32,54 +16,29 @@ LABEL name="scanner-db-slim" \
release="${LABEL_RELEASE}" \
quay.expires-after="${QUAY_TAG_EXPIRATION}"

ENV PG_MAJOR=15
ENV PATH="$PATH:/usr/pgsql-$PG_MAJOR/bin/" \
PGDATA="/var/lib/postgresql/data/pgdata"
ENV LANG="en_US.utf8"
ENV ROX_SLIM_MODE="true"

COPY signatures/PGDG-RPM-GPG-KEY-RHEL /
COPY scripts/docker-entrypoint.sh /usr/local/bin/
COPY --from=extracted_bundle /bundle/etc/postgresql.conf /bundle/etc/pg_hba.conf /etc/
COPY --from=postgres_rpms /rpms/postgres.rpm /rpms/postgres-libs.rpm /rpms/postgres-server.rpm /rpms/postgres-contrib.rpm /tmp/
COPY postgresql.conf pg_hba.conf /etc/

RUN microdnf upgrade -y --nobest && \
microdnf install -y shadow-utils && \
groupadd -g 70 postgres && \
adduser postgres -u 70 -g 70 -d /var/lib/postgresql -s /bin/sh && \
rpm --import PGDG-RPM-GPG-KEY-RHEL && \
microdnf install -y \
ca-certificates \
glibc-langpack-en \
glibc-locale-source \
libicu \
libxslt \
lz4 \
perl-libs \
python3 \
systemd-sysv \
zstd \
&& \
if [[ $(awk -F'=' '/VERSION_ID/{ gsub(/"/,""); print substr($2,1,1)}' /etc/os-release) -gt 8 ]]; then \
microdnf install -y uuid; \
fi && \
rpm -i /tmp/postgres-libs.rpm /tmp/postgres-server.rpm /tmp/postgres.rpm /tmp/postgres-contrib.rpm && \
# The removal of /usr/share/zoneinfo from UBI minimal images is intentional.
# After building the image, the image is reduced in size as much as possible,
# and the /usr/share/zoneinfo directory is purged as it saves space
# in the final distribution of the image.
# https://access.redhat.com/solutions/5616681
microdnf reinstall -y tzdata && \
microdnf clean all && \
# (Optional) Remove line below to keep package management utilities
rpm -e --nodeps $(rpm -qa shadow-utils curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rm -rf /var/cache/dnf /var/cache/yum /tmp/postgres-libs.rpm /tmp/postgres-server.rpm /tmp/postgres.rpm /tmp/postgres-contrib.rpm && \
RUN dnf upgrade -y --nobest && \
localedef -f UTF-8 -i en_US en_US.UTF-8 && \
mkdir -p /var/lib/postgresql && \
groupmod -g 70 postgres && \
usermod -u 70 postgres -d /var/lib/postgresql && \
chown -R postgres:postgres /var/lib/postgresql && \
chown -R postgres:postgres /var/run/postgresql && \
chown -R postgres /var/lib/pgsql && \
chown -R postgres /opt/app-root && \
dnf clean all && \
rpm --verbose -e --nodeps $(rpm -qa curl '*rpm*' '*dnf*' '*libsolv*' '*hawkey*' 'yum*') && \
rm -rf /var/cache/dnf /var/cache/yum && \
mkdir /docker-entrypoint-initdb.d

# This is equivalent to postgres:postgres.
USER 70:70

ENV ROX_SLIM_MODE="true"

ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 5432
Expand Down
103 changes: 103 additions & 0 deletions image/db/rhel/pg_hba.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# PostgreSQL Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the PostgreSQL
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which PostgreSQL user names they can use, which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# plain TCP/IP socket.
#
# DATABASE can be "all", "sameuser", "samerole", "replication", a
# database name, or a comma-separated list thereof. The "all"
# keyword does not match "replication". Access to replication
# must be enabled in a separate record (see example below).
#
# USER can be "all", a user name, a group name prefixed with "+", or a
# comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names
# from a separate file.
#
# ADDRESS specifies the set of hosts the record matches. It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask. A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts. Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be "trust", "reject", "md5", "password", "scram-sha-256",
# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
# Note that "password" sends passwords in clear text; "md5" or
# "scram-sha-256" are preferred since they send encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE. The available options depend on the different
# authentication methods -- refer to the "Client Authentication"
# section in the documentation for a list of which options are
# available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other
# special characters must be quoted. Quoting one of the keywords
# "all", "sameuser", "samerole" or "replication" makes the name lose
# its special character, and just match a database or username with
# that name.
#
# This file is read on server startup and when the server receives a
# SIGHUP signal. If you edit the file on a running system, you have to
# SIGHUP the server for the changes to take effect, run "pg_ctl reload",
# or execute "SELECT pg_reload_conf()".
#
# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records. In that case you will also need to make PostgreSQL
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.

# CAUTION: Configuring the system for local "trust" authentication
# allows any local user to connect as any PostgreSQL user, including
# the database superuser. If you do not trust all your local users,
# use another authentication method.


# TYPE DATABASE USER ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all reject
host replication all 127.0.0.1/32 reject
host replication all ::1/128 reject

### STACKROX MODIFIED
# Reject all non ssl connections from IPs
hostnossl all all 0.0.0.0/0 reject
hostnossl all all ::0/0 reject

# Accept connections from ssl with password
hostssl all all 0.0.0.0/0 md5
hostssl all all ::0/0 md5
###
Loading