Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(STONEINTG-1072): refactoring clamav-db to avoid uploading file #328

Merged
merged 1 commit into from
Nov 26, 2024
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 .github/workflows/clam-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
image: ${{ env.IMAGE_NAME }}
tags: ${{ env.NEW_TAG}} ${{ env.VERSION_MAJOR }} ${{ env.LATEST_TAG }}
archs: amd64,ppc64le
context: clamav/
context: .
containerfiles: |
./clamav/Dockerfile

Expand Down
31 changes: 28 additions & 3 deletions clamav/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
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

ENTRYPOINT ["/usr/bin/clamscan"]