forked from immauss/openvas
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into development
- Loading branch information
Showing
40 changed files
with
427 additions
and
2,003 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
tmp/ | ||
ics-gsa/gsa | ||
ics-gsa/gsad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
# Environment variables for all | ||
FROM immauss/openvas:latest-slim AS final | ||
ENV LANG=C.UTF-8 | ||
ARG TAG | ||
ENV VER="$TAG" | ||
LABEL maintainer="[email protected]" \ | ||
version="$VER-full" \ | ||
url="https://hub.docker.com/r/immauss/openvas" \ | ||
source="https://github.com/immauss/openvas" | ||
# Pull and then Make sure we didn't just pull zero length files | ||
RUN curl -L --url https://www.immauss.com/openvas/latest.base.sql.xz -o /usr/lib/base.sql.xz && \ | ||
curl -L --url https://www.immauss.com/openvas/latest.var-lib.tar.xz -o /usr/lib/var-lib.tar.xz && \ | ||
bash -c " if [ $(ls -l /usr/lib/base.sql.xz | awk '{print $5}') -lt 1200 ]; then exit 1; fi " && \ | ||
bash -c " if [ $(ls -l /usr/lib/var-lib.tar.xz | awk '{print $5}') -lt 1200 ]; then exit 1; fi " | ||
|
||
# Add the archives. | ||
COPY base.sql.xz /usr/lib/base.sql.xz | ||
COPY var-lib.tar.xz /usr/lib/var-lib.tar.xz | ||
# packages to add to ovasbase | ||
#RUN apt-get update && apt-get -y install libpaho-mqtt-dev python3-paho-mqtt gir1.2-json-1.0 libjson-glib-1.0-0 libjson-glib-1.0-common | ||
COPY scripts/* /scripts/ | ||
# Healthcheck needs be an on image script that will know what service is running and check it. | ||
# Current image function stored in /usr/local/etc/running-as | ||
HEALTHCHECK --interval=60s --start-period=300s --timeout=10s \ | ||
HEALTHCHECK --interval=300s --start-period=300s --timeout=120s \ | ||
CMD /scripts/healthcheck.sh || exit 1 | ||
ENTRYPOINT [ "/scripts/start.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
TAG=latest | ||
VER=$(cat ver.current) | ||
DOCKERFILE=$(mktemp) | ||
sed "s/\$VER/$VER/" Dockerfile.refresh > $DOCKERFILE | ||
docker buildx build -f $DOCKERFILE \ | ||
--target final \ | ||
-t gitlab.immauss.com:5050/immauss/openvas:latest \ | ||
--platform linux/arm64,linux/amd64,linux/arm/v7 \ | ||
--push . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,10 +11,12 @@ WorkDir=$(pwd) | |
# Tag to work with. Normally latest but might be using new tag during upgrades. | ||
TAG="latest" | ||
SQLBU="${TAG}.base.sql" | ||
TAR="${TAG}.var-lib.tar.xz" | ||
VER=$(cat ver.current) | ||
DOCKERFILE=$(mktemp) | ||
sed "s/\$VER/$VER/" Dockerfile.refresh > $DOCKERFILE | ||
# Temp working directory ... needs enough space to pull the entire feed and then compress it. ~2G | ||
TWD="/var/lib/openvas/" # Must have a trailing "/" | ||
STIME="30m" # time between resync and archiving. | ||
STIME="10m" # time between resync and archiving. | ||
# First, clean TWD and make sure there's enough storage available before doing anything. | ||
if [ -d $TWD ]; then # Make sure the TWD exists and is a directory so we don't accidently destroy the system. | ||
echo " Cleaning $TWD " | ||
|
@@ -88,17 +90,21 @@ if [ $SQL_SIZE -le 2000 ] || [ $FEED_SIZE -le 2000 ]; then | |
logger -t db-refresh "SQL_SIZE = $SQL_SIZE : FEED_SIZE = $FEED_SIZE: Failing out" | ||
exit | ||
fi | ||
echo " Push updates to www" | ||
scp *.xz [email protected]:/var/www/html/drupal/openvas/ | ||
if [ $? -ne 0 ]; then | ||
echo "SCP of new db failed $?" | ||
logger -t db-refresh "SCP of new db failed $?" | ||
exit | ||
fi | ||
# Now rebuild the image | ||
cp latest.base.sql.xz /home/scott/Projects/openvas/base.sql.xz | ||
cp latest.var-lib.tar.xz /home/scott/Projects/openvas/var-lib.tar.xz | ||
|
||
# echo " Push updates to www" | ||
# scp *.xz [email protected]:/var/www/html/drupal/openvas/ | ||
# if [ $? -ne 0 ]; then | ||
# echo "SCP of new db failed $?" | ||
# logger -t db-refresh "SCP of new db failed $?" | ||
# exit | ||
# fi | ||
echo "Now rebuild the image" | ||
cd $WorkDir | ||
echo "$(pwd) Is current working directory." | ||
date > update.ts | ||
docker buildx build -f Dockerfile.refresh --build-arg TAG=${TAG} --target final -t immauss/openvas:$TAG --platform linux/arm64,linux/amd64,linux/arm/v7 --push . | ||
docker buildx build -f $DOCKERFILE --target final -t immauss/openvas:$TAG --platform linux/arm64,linux/amd64,linux/arm/v7 --push . | ||
if [ $? -ne 0 ]; then | ||
echo "Build failed." | ||
exit | ||
|
@@ -108,5 +114,3 @@ echo "Cleaning up" | |
cd $TWD | ||
rm -rf * | ||
echo "All done" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# Replace a few images in the gsa build with Immauss branded images. | ||
mkdir -p /usr/local/share/gvm/gsad/web/img | ||
cp /branding/* /usr/local/share/gvm/gsad/web/img/ | ||
|
Oops, something went wrong.