Skip to content

Commit

Permalink
Merge pull request #177 from Secure-Compliance-Solutions-LLC/data-dow…
Browse files Browse the repository at this point in the history
…nload-speed-up

Add tar download for first sync
  • Loading branch information
pixelsquared committed May 21, 2021
2 parents f65be6b + ed7588e commit fd8a011
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
17 changes: 0 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,6 @@ RUN mkdir /build && \
cd / && \
rm -rf /build

#
# Install Greenbone Library for GVM helper functions in PostgreSQL
#

#RUN mkdir /build && \
# cd /build && \
# wget --no-verbose https://github.com/greenbone/pg-gvm/archive/$pggvm_version.tar.gz && \
# tar -zxf $pggvm_version.tar.gz && \
# cd /build/*/ && \
# mkdir build && \
# cd build && \
# cmake -DCMAKE_BUILD_TYPE=Release .. && \
# make && \
# make install && \
# cd / && \
# rm -rf /build

#
# Install Greenbone Vulnerability Manager (GVMD)
#
Expand Down
22 changes: 22 additions & 0 deletions scripts/sync-all.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
#!/usr/bin/env bash

if [ ! -f "/firstsync" ]; then
echo "Downloading data TAR to speed up first sync..."
curl -o /tmp/data.tar.xz https://vulndata.securecompliance.solutions/file/VulnData/data.tar.xz # This file is updated at 0:00 UTC every day
mkdir /tmp/data

echo "Extracting data TAR..."
tar --extract --file=/tmp/data.tar.xz --directory=/tmp/data

mv /tmp/data/nvt-feed/* /usr/local/var/lib/openvas/plugins
mv /tmp/data/gvmd-data/* /usr/local/var/lib/gvm/data-objects
mv /tmp/data/scap-data/* /usr/local/var/lib/gvm/scap-data
mv /tmp/data/cert-data/* /usr/local/var/lib/gvm/cert-data

chown gvm:gvm -R /usr/local/var/lib/openvas/plugins
chown gvm:gvm -R /usr/local/var/lib/gvm/data-objects
chown gvm:gvm -R /usr/local/var/lib/gvm/scap-data
chown gvm:gvm -R /usr/local/var/lib/gvm/cert-data

rm /tmp/data.tar.xz
rm -r /tmp/data
fi

echo "Updating NVTs..."
su -c "rsync --compress-level=9 --links --times --omit-dir-times --recursive --partial --quiet rsync://feed.community.greenbone.net:/nvt-feed /usr/local/var/lib/openvas/plugins" gvm
sleep 5
Expand Down

0 comments on commit fd8a011

Please sign in to comment.