diff options
author | Alf | 2016-01-05 16:06:50 +0800 |
---|---|---|
committer | Alf | 2016-01-05 16:06:50 +0800 |
commit | 65533733c6c87aac6929604855315dc8c51fd043 (patch) | |
tree | ba97170017d5d08c7d10a5208f5c919362c51e8a | |
download | aur-65533733c6c87aac6929604855315dc8c51fd043.tar.gz |
Initial import
-rw-r--r-- | .SRCINFO | 25 | ||||
-rw-r--r-- | PKGBUILD | 26 | ||||
-rw-r--r-- | greenbone-security-assistant.service | 12 | ||||
-rw-r--r-- | openvas-manager.service | 16 | ||||
-rwxr-xr-x | openvas-setup | 41 | ||||
-rwxr-xr-x | openvas-start | 6 | ||||
-rwxr-xr-x | openvas-stop | 6 | ||||
-rw-r--r-- | openvassd.conf | 1 |
8 files changed, 133 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..13bd3da3f57e --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,25 @@ +pkgbase = openvas-script + pkgdesc = openvas-setup/openvas-start/openvas-stop script + pkgver = 1.0 + pkgrel = 0 + url = http://www.openvas.org/ + arch = any + license = unknown + depends = openvas-scanner + depends = openvas-manager + depends = openvas-cli + source = greenbone-security-assistant.service + source = openvas-manager.service + source = openvassd.conf + source = openvas-setup + source = openvas-start + source = openvas-stop + sha1sums = 365f23d6a2c090b5e34a20767ef5d7e86d54de6b + sha1sums = 77beaf32e2670cfed7e4372146205a1694dd4daa + sha1sums = 1b58f461da39cc54d201813d64ef8b598b656da4 + sha1sums = adec95aebf7e090685a63e2dab9f090b42795d2b + sha1sums = 719f18f4a9d33884b7938276f450082d2184fb94 + sha1sums = 36faa124fb08a24dbae6d9a8d2a387b48467a294 + +pkgname = openvas-script + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..ba9aca0db1c8 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,26 @@ +# Maintainer: Alf <naihe2010 at 126.com> + +pkgname=openvas-script +pkgver=1.0 +pkgrel=0 +pkgdesc="openvas-setup/openvas-start/openvas-stop script" +arch=('any') +license=('unknown') +url="http://www.openvas.org/" +depends=('openvas-scanner' 'openvas-manager' 'openvas-cli') +replaces=() +conflicts=() +source=("greenbone-security-assistant.service" "openvas-manager.service" "openvassd.conf" "openvas-setup" "openvas-start" "openvas-stop") +sha1sums=('365f23d6a2c090b5e34a20767ef5d7e86d54de6b' '77beaf32e2670cfed7e4372146205a1694dd4daa' '1b58f461da39cc54d201813d64ef8b598b656da4' 'adec95aebf7e090685a63e2dab9f090b42795d2b' '719f18f4a9d33884b7938276f450082d2184fb94' '36faa124fb08a24dbae6d9a8d2a387b48467a294') + +package() { + install -d "$pkgdir/usr/lib/systemd/system" + install -m644 greenbone-security-assistant.service "$pkgdir/usr/lib/systemd/system/" + install -m644 openvas-manager.service "$pkgdir/usr/lib/systemd/system/" + install -d "$pkgdir/etc/openvas" + install -m644 openvassd.conf "$pkgdir/etc/openvas/" + install -d "$pkgdir/usr/bin" + install -m755 openvas-setup "$pkgdir/usr/bin/" + install -m755 openvas-start "$pkgdir/usr/bin/" + install -m755 openvas-stop "$pkgdir/usr/bin/" +} diff --git a/greenbone-security-assistant.service b/greenbone-security-assistant.service new file mode 100644 index 000000000000..4919116d00fd --- /dev/null +++ b/greenbone-security-assistant.service @@ -0,0 +1,12 @@ +[Unit] +Description=Greenbone Security Assistant +Documentation=man:gsad(8) http://www.openvas.org/ +Wants=openvas-manager.service + +[Service] +Type=simple +PIDFile=/var/run/gsad.pid +ExecStart=/usr/sbin/gsad --foreground --listen=127.0.0.1 --port=9392 --mlisten=127.0.0.1 --mport=9390 + +[Install] +WantedBy=multi-user.target diff --git a/openvas-manager.service b/openvas-manager.service new file mode 100644 index 000000000000..e14f6f0d143d --- /dev/null +++ b/openvas-manager.service @@ -0,0 +1,16 @@ +[Unit] +Description=Open Vulnerability Assessment System Manager Daemon +Documentation=man:openvasmd(8) http://www.openvas.org/ +Wants=openvas-scanner.service + +[Service] +Type=forking +PIDFile=/var/run/openvasmd.pid +ExecStart=/usr/sbin/openvasmd --listen=127.0.0.1 --port=9390 --database=/var/lib/openvas/mgr/tasks.db +ExecReload=/bin/kill -HUP $MAINPID +# Kill the main process with SIGTERM and after TimeoutStopSec (defaults to +# 1m30) kill remaining processes with SIGKILL +KillMode=mixed + +[Install] +WantedBy=multi-user.target diff --git a/openvas-setup b/openvas-setup new file mode 100755 index 000000000000..4b68d1908efe --- /dev/null +++ b/openvas-setup @@ -0,0 +1,41 @@ +#!/bin/bash +if ! grep -q "^unixsocket /var/lib/redis/redis.sock" /etc/redis.conf ; then + sed -i -e 's/^\(#.\)\?port.*$/port 0/' /etc/redis.conf + sed -i -e 's/^\(#.\)\?unixsocket \/.*$/unixsocket \/var\/lib\/redis\/redis.sock/' /etc/redis.conf + sed -i -e 's/^\(#.\)\?unixsocketperm.*$/unixsocketperm 700/' /etc/redis.conf +fi + +test -e /var/lib/openvas/CA/cacert.pem || openvas-mkcert -q +if (openssl verify -CAfile /var/lib/openvas/CA/cacert.pem \ + /var/lib/openvas/CA/servercert.pem |grep -q ^error); then + openvas-mkcert -q -f +fi +openvas-nvt-sync +openvas-scapdata-sync +openvas-certdata-sync +if ! test -e /var/lib/openvas/CA/clientcert.pem || \ + ! test -e /var/lib/openvas/private/CA/clientkey.pem; then + openvas-mkcert-client -n -i +fi +if (openssl verify -CAfile /var/lib/openvas/CA/cacert.pem \ + /var/lib/openvas/CA/clientcert.pem |grep -q ^error); then + openvas-mkcert-client -n -i +fi + +systemctl stop openvas-manager +systemctl stop openvas-scanner + +openvassd +openvasmd --migrate +openvasmd --progress --rebuild + +killall --wait openvassd +sleep 5 + +systemctl start openvas-scanner +systemctl start openvas-manager +systemctl start greenbone-security-assistant + +if ! openvasmd --get-users | grep -q ^admin$ ; then + openvasmd --create-user=admin +fi diff --git a/openvas-start b/openvas-start new file mode 100755 index 000000000000..2bd1d0516ee9 --- /dev/null +++ b/openvas-start @@ -0,0 +1,6 @@ +#!/bin/bash +echo "Starting OpenVas Services" +systemctl start greenbone-security-assistant +systemctl start openvas-scanner +systemctl start openvas-manager + diff --git a/openvas-stop b/openvas-stop new file mode 100755 index 000000000000..715907bdabe3 --- /dev/null +++ b/openvas-stop @@ -0,0 +1,6 @@ +#!/bin/bash +echo "Stopping OpenVas Services" +systemctl stop greenbone-security-assistant +systemctl stop openvas-scanner +systemctl stop openvas-manager + diff --git a/openvassd.conf b/openvassd.conf new file mode 100644 index 000000000000..c945d08396ef --- /dev/null +++ b/openvassd.conf @@ -0,0 +1 @@ +kb_location = /var/lib/redis/redis.sock |