From b7e2b13e2a0edae32ada955174b57317a4f892e2 Mon Sep 17 00:00:00 2001 From: Kasem Alem Date: Tue, 19 Nov 2024 14:51:43 +0200 Subject: [PATCH] feat(STONEINTG-1072): refactoring clamav-db to avoild uploading file Signed-off-by: Kasem Alem --- clamav/Dockerfile | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/clamav/Dockerfile b/clamav/Dockerfile index 2412c01..fc977bf 100644 --- a/clamav/Dockerfile +++ b/clamav/Dockerfile @@ -1,9 +1,31 @@ FROM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227.1726694542 +FROM quay.io/enterprise-contract/ec-cli:snapshot@sha256:dc7d404596385e7d3c624ec0492524a1d57efe2b0c10cf0ec2158d49c0290a83 AS ec-cli + +ENV POLICY_PATH="/project" +# Install required packages RUN rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ microdnf -y --setopt=tsflags=nodocs install \ clamav \ clamd \ - clamav-update && \ - microdnf clean all -COPY whitelist.ign2 /var/lib/clamav/whitelist.ign2 + clamav-update \ + jq \ + tar \ + skopeo \ + && microdnf clean all + +COPY ../test/utils.sh /utils.sh + +# Update ClamAV virus definitions RUN freshclam + +COPY clamav/whitelist.ign2 /var/lib/clamav/whitelist.ign2 + +COPY policies $POLICY_PATH +COPY test/conftest.sh $POLICY_PATH + +# Download and install oc +RUN ARCH="$(uname -m)" && \ + curl -fsSL https://mirror.openshift.com/pub/openshift-v4/"$ARCH"/clients/ocp/stable/openshift-client-linux.tar.gz --output oc.tar.gz && \ + cp oc.tar.gz /usr/bin/oc && \ + tar -xzvf oc.tar.gz -C /usr/bin && \ + rm oc.tar.gz