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: 0 additions & 2 deletions .github/workflows/insights-scanner-image.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Publish insights-scanner image

on:
schedule:
- cron: "1 0 * * *"
push:
branches:
- 'main'
Expand Down
13 changes: 3 additions & 10 deletions insights-scanner/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ ARG UPSTREAM_REPO
ARG UPSTREAM_TAG
ARG GO_VER
FROM ${UPSTREAM_REPO:-uselagoon}/commons:${UPSTREAM_TAG:-latest} AS commons
FROM aquasec/trivy:0.68.2 AS trivy
FROM anchore/syft:v1.42.1 AS syft


FROM docker:28.5.2

Expand Down Expand Up @@ -38,15 +39,7 @@ RUN architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 |
&& curl -Lo /usr/bin/kubectl https://dl.k8s.io/release/$KUBECTL_VERSION/bin/linux/${architecture}/kubectl \
&& chmod +x /usr/bin/kubectl

COPY --from=trivy /usr/local/bin/trivy /usr/local/bin/trivy

# Here we want to pull the trivy java DB
# This needs to be rebuilt daily, since we would like to be able to avoid pulling the javaDB on every scan
# This will increase the overall size of the
ENV TRIVY_CACHE_DIR=/

RUN trivy image --cache-dir ${TRIVY_CACHE_DIR} --download-db-only && \
trivy image --cache-dir ${TRIVY_CACHE_DIR} --download-java-db-only
COPY --from=syft /syft /usr/local/bin/syft

WORKDIR /app

Expand Down
6 changes: 2 additions & 4 deletions insights-scanner/insights-scan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,10 @@ processImageInspect() {

processImageInspect

echo "Running sbom scan using trivy"
echo "Running sbom scan using syft"
echo "Image being scanned: ${IMAGE_FULL}"

# Setting JAVAOPT to skip the java db update, as the upstream image comes with a pre-populated database
JAVAOPT="--skip-java-db-update"
trivy image ${JAVAOPT} ${IMAGE_FULL} --format ${SBOM_OUTPUT} --skip-version-check | gzip > ${SBOM_OUTPUT_FILE}
syft -o cyclonedx-json ${IMAGE_FULL} | gzip > ${SBOM_OUTPUT_FILE}

FILESIZE=$(stat -c%s "$SBOM_OUTPUT_FILE")
echo "Size of ${SBOM_OUTPUT_FILE} = $FILESIZE bytes."
Expand Down
2 changes: 1 addition & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"patch"
],
"matchPackageNames": [
"aquasec/trivy",
"anchore/syft",
"docker"
]
}
Expand Down
Loading