mirror of
https://github.com/pentoo/pentoo-overlay
synced 2026-04-20 13:51:00 +02:00
openvas: remove gvm 10
This commit is contained in:
parent
715814d54a
commit
b9ae06400f
26 changed files with 4 additions and 1008 deletions
|
|
@ -1,2 +1 @@
|
|||
DIST gvm-libs-10.0.1.tar.gz 198483 BLAKE2B 4f4ddc7a3a1b4d45a51868cf03844365a9c4dd07f17ab53957ac4a1452ecba595885abdf01402a78aa784163aaba60b5c452fb9c2b5a11d38c40706e820c22c2 SHA512 961570e8fa8f89f0b462991bff1bf4e512ed6419cff6871c7432899847fb9edcc9f0adb7c280d12ee69fbb5c8e306c9e4366e2cbbb05fc3bae06795dcfb42206
|
||||
DIST gvm-libs-11.0.0.tar.gz 207205 BLAKE2B 026b999a48ad524df9305d219dd29f5deb71affb3f5d338ad1178924aa701f2fe698ee4009f4b5a6973de6e590a870871b3b708a2531aaba6e05755cd7f00f97 SHA512 ff981b4ca37b425a8d1f491e90bd1cef4701033886f9fd47dad34540b36fa275d4af8b176e63a07405cc1f29137851b96a6ce80c46ed92f809b089fb0cd928af
|
||||
|
|
|
|||
|
|
@ -1,11 +0,0 @@
|
|||
--- a/CMakeLists.txt 2019-04-05 11:27:07.000000000 +0300
|
||||
+++ b/CMakeLists.txt 2019-07-14 23:42:42.723081614 +0300
|
||||
@@ -172,7 +172,7 @@
|
||||
endif (NOT DATADIR)
|
||||
|
||||
if (NOT GVM_PID_DIR)
|
||||
- set (GVM_PID_DIR "${LOCALSTATEDIR}/run")
|
||||
+ set (GVM_PID_DIR "/var/lib/gvm")
|
||||
endif (NOT GVM_PID_DIR)
|
||||
|
||||
if (NOT GVM_SYSCONF_DIR)
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
CMAKE_MAKEFILE_GENERATOR="emake"
|
||||
inherit cmake-utils flag-o-matic toolchain-funcs user
|
||||
|
||||
DESCRIPTION="Greenbone vulnerability management libraries, previously named openvas-libraries"
|
||||
HOMEPAGE="https://www.greenbone.net/en/"
|
||||
SRC_URI="https://github.com/greenbone/gvm-libs/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2+"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="extras ldap radius"
|
||||
|
||||
DEPEND="
|
||||
app-crypt/gpgme:=
|
||||
dev-libs/hiredis
|
||||
dev-libs/libgcrypt:=
|
||||
dev-perl/UUID
|
||||
net-libs/gnutls:=
|
||||
net-libs/libssh:=
|
||||
sys-libs/zlib
|
||||
ldap? ( net-nds/openldap )
|
||||
radius? ( net-dialup/freeradius-client )"
|
||||
|
||||
RDEPEND="
|
||||
${DEPEND}
|
||||
!net-analyzer/openvas-libraries"
|
||||
|
||||
BDEPEND="
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
virtual/pkgconfig
|
||||
extras? ( app-doc/doxygen[dot]
|
||||
app-doc/xmltoman
|
||||
app-text/htmldoc
|
||||
dev-perl/CGI
|
||||
dev-perl/SQL-Translator
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
# Creating pid on build time instead of relying daemon!
|
||||
# QA fix for 10.0.1.
|
||||
"${FILESDIR}/${P}-pid.patch"
|
||||
)
|
||||
|
||||
pkg_setup() {
|
||||
enewgroup gvm 495
|
||||
enewuser gvm 495 -1 /var/lib/gvm gvm
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
cmake-utils_src_prepare
|
||||
# QA-Fix | Remove doxygen warnings for !CLANG
|
||||
if use extras; then
|
||||
if ! tc-is-clang; then
|
||||
local f
|
||||
for f in doc/*.in
|
||||
do
|
||||
sed -i \
|
||||
-e "s*CLANG_ASSISTED_PARSING = NO*#CLANG_ASSISTED_PARSING = NO*g" \
|
||||
-e "s*CLANG_OPTIONS*#CLANG_OPTIONS*g" \
|
||||
"${f}" || die "couldn't disable CLANG parsing"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
"-DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr"
|
||||
"-DLOCALSTATEDIR=${EPREFIX}/var"
|
||||
"-DSYSCONFDIR=${EPREFIX}/etc"
|
||||
$(usex ldap -DBUILD_WITHOUT_LDAP=0 -DBUILD_WITHOUT_LDAP=1)
|
||||
$(usex radius -DBUILD_WITHOUT_RADIUS=0 -DBUILD_WITHOUT_RADIUS=1)
|
||||
)
|
||||
# Add release hardening flags for 10.0.1
|
||||
append-cflags -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector
|
||||
append-ldflags -Wl,-z,relro -Wl,-z,now
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake-utils_src_compile
|
||||
if use extras; then
|
||||
cmake-utils_src_make -C "${BUILD_DIR}" doc
|
||||
cmake-utils_src_make doc-full -C "${BUILD_DIR}" doc
|
||||
HTML_DOCS=( "${BUILD_DIR}"/doc/generated/html/. )
|
||||
fi
|
||||
cmake-utils_src_make rebuild_cache
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-utils_src_install
|
||||
|
||||
# Set proper permissions on required files/directories
|
||||
keepdir /var/lib/gvm
|
||||
fowners -R gvm:gvm /var/lib/gvm
|
||||
}
|
||||
|
|
@ -1,2 +1 @@
|
|||
DIST gvm-tools-1.4.1.tar.gz 52020 BLAKE2B 0648c7e26dc0aed02eeeafdc8db45ae88afd8725196457a6a8cdcb888ed7e07c9998fc83c03fd9dd4f7aca1e238b46052653216b7373f98b150f6a181ba1538c SHA512 cd1049311241ad7b4a2d9648b54224ca1636f9620ffd238282bbf1089ab0c3b4e8b8f722c93c6809695bc71b0c7cb2bc3e65561b05269c7737abdc6ddca69aea
|
||||
DIST gvm-tools-2.0.0.tar.gz 114592 BLAKE2B 73532138f4153ce625e68d4feb477bea4504be910266d6dac113caff1da096bc6072649ddc456b3348e1aba79c9b7e147ba019a70e4163267c474850019a076e SHA512 0adf7e06b1208c91fbc02dab42593280c95f6572e27d96d6f8777d710747a9e427c79678d9aef785b7ecd6d4fd30e79a1c063fe4256025ac0616c1d242f45025
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
PYTHON_COMPAT=( python3_{5,6} )
|
||||
inherit distutils-r1
|
||||
|
||||
DESCRIPTION="Remote control for Greenbone Vulnerability Manager, previously named openvas-cli"
|
||||
HOMEPAGE="https://www.greenbone.net/en/"
|
||||
SRC_URI="https://github.com/greenbone/gvm-tools/archive/v1.4.1.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE=""
|
||||
|
||||
RDEPEND="
|
||||
dev-python/defusedxml[${PYTHON_USEDEP}]
|
||||
dev-python/lxml[${PYTHON_USEDEP}]
|
||||
dev-python/paramiko[${PYTHON_USEDEP}]
|
||||
dev-python/pythondialog:0[${PYTHON_USEDEP}]
|
||||
dev-python/setuptools[${PYTHON_USEDEP}]
|
||||
!net-analyzer/openvas-cli"
|
||||
|
||||
DEPEND="
|
||||
${RDEPEND}"
|
||||
|
||||
src_prepare() {
|
||||
distutils-r1_python_prepare_all
|
||||
# Exlude tests & correct FHS/Gentoo policy paths
|
||||
sed -i "s/packages=find_packages(),.*/packages=find_packages(exclude=['tests*', 'docs']),/" "$S"/setup.py || die
|
||||
sed -i -e "s*''*'/usr/share/doc/${P}'*g" "$S"/setup.py || die
|
||||
}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
inherit eutils
|
||||
|
||||
DESCRIPTION="Greenbone Vulnerability Management,previously named OpenVAS"
|
||||
HOMEPAGE="https://www.greenbone.net/en/"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="cli cron extras +gsa ldap ospd postgres radius sqlite"
|
||||
REQUIRED_USE="|| ( postgres sqlite )"
|
||||
|
||||
RDEPEND="
|
||||
>=net-analyzer/gvm-libs-10.0.1[extras?,ldap?,radius?]
|
||||
>=net-analyzer/gvmd-8.0.1[extras?,postgres?,sqlite?]
|
||||
~net-analyzer/openvas-scanner-6.0.1[cron?,extras?]
|
||||
!net-analyzer/openvas
|
||||
cli? ( >=net-analyzer/gvm-tools-1.4.1 )
|
||||
gsa? ( ~net-analyzer/greenbone-security-assistant-8.0.1[extras?] )
|
||||
ospd? ( >=net-analyzer/ospd-1.3.2[extras?] )"
|
||||
|
||||
pkg_postinst() {
|
||||
elog "Please following the following URL to configure:"
|
||||
elog "https://wiki.alpinelinux.org/wiki/Setting_up_GVM10"
|
||||
elog "Also, change permissions to the following:"
|
||||
elog "chown -R gvm /var/lib/gvm"
|
||||
elog
|
||||
elog "Additional support for extra checks can be get from"
|
||||
optfeature "Web server scanning and testing tool" net-analyzer/nikto
|
||||
optfeature "Portscanner" net-analyzer/nmap
|
||||
optfeature "IPsec VPN scanning, fingerprinting and testing tool" net-analyzer/ike-scan
|
||||
optfeature "Application protocol detection tool" net-analyzer/amap
|
||||
optfeature "ovaldi (OVAL) — an OVAL Interpreter" app-forensics/ovaldi
|
||||
optfeature "Linux-kernel-based portscanner" net-analyzer/portbunny
|
||||
optfeature "Web application attack and audit framework" net-analyzer/w3af
|
||||
}
|
||||
|
|
@ -1,2 +1 @@
|
|||
DIST gvmd-8.0.1.tar.gz 1495311 BLAKE2B 17419f5fecf7cce07536a5e12f17a61a31d45add185e0e1635515834eca6abd8a6babeb89b8f879ff8cb90b60f3682a19a62403142f4901be3f932b8a44cac68 SHA512 5490b902ad42499657eca9031b396c70a82d3c523985601067e697758f2472d123c4e99b085b963e58888d99224fa2a441a140772c702d7cd60d6424b126bfc8
|
||||
DIST gvmd-9.0.0.tar.gz 1425724 BLAKE2B f44c14a660f2ee9986e5873011233a423565acfdaea479ac6749998da997343a97dabec0355d618fd9032b65871737ba0407525b8d2b49e88aaa58523b633cae SHA512 99faf4b4a9e0baf7993769efb30ef39e09d76173416b44baa1b0849c7b68bd07cd9f82404832136a3e1b37769c7d5e77e5da54275ff75fffc2e6e6fa7a8b9dac
|
||||
|
|
|
|||
|
|
@ -1,56 +0,0 @@
|
|||
--- a/src/CMakeLists.txt 2019-07-17 17:11:52.000000000 +0300
|
||||
+++ b/src/CMakeLists.txt 2019-07-21 22:43:17.299106863 +0300
|
||||
@@ -248,12 +248,12 @@
|
||||
## Install
|
||||
|
||||
install (TARGETS ${BINARY_NAME}
|
||||
- RUNTIME DESTINATION ${SBINDIR}
|
||||
+ RUNTIME DESTINATION ${BINDIR}
|
||||
LIBRARY DESTINATION ${LIBDIR}
|
||||
ARCHIVE DESTINATION ${LIBDIR}/static)
|
||||
|
||||
install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gvmd
|
||||
- DESTINATION ${SBINDIR})
|
||||
+ DESTINATION ${BINDIR})
|
||||
|
||||
if (BACKEND STREQUAL POSTGRESQL)
|
||||
install (TARGETS gvm-pg-server
|
||||
--- a/CMakeLists.txt 2019-07-22 11:31:13.430827400 +0300
|
||||
+++ b/CMakeLists.txt 2019-07-22 11:32:29.034765809 +0300
|
||||
@@ -571,17 +571,17 @@
|
||||
PERMISSIONS OWNER_WRITE OWNER_READ GROUP_READ WORLD_READ)
|
||||
|
||||
install (FILES ${CMAKE_BINARY_DIR}/tools/gvm-portnames-update
|
||||
- DESTINATION ${SBINDIR}
|
||||
+ DESTINATION ${BINDIR}
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
install (FILES ${CMAKE_BINARY_DIR}/tools/greenbone-scapdata-sync
|
||||
- DESTINATION ${SBINDIR}
|
||||
+ DESTINATION ${BINDIR}
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
install (FILES ${CMAKE_BINARY_DIR}/tools/greenbone-certdata-sync
|
||||
- DESTINATION ${SBINDIR}
|
||||
+ DESTINATION ${BINDIR}
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
@@ -593,13 +593,13 @@
|
||||
WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
install (FILES ${CMAKE_BINARY_DIR}/tools/gvm-migrate-to-postgres
|
||||
- DESTINATION ${SBINDIR}
|
||||
+ DESTINATION ${BINDIR}
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
|
||||
if (BACKEND STREQUAL SQLITE3)
|
||||
install (FILES ${CMAKE_SOURCE_DIR}/tools/database-statistics-sqlite
|
||||
- DESTINATION ${SBINDIR}
|
||||
+ DESTINATION ${BINDIR}
|
||||
PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
|
||||
GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||
endif (BACKEND STREQUAL SQLITE3)
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
--- a/tools/greenbone-certdata-sync.in 2019-07-17 17:11:52.000000000 +0300
|
||||
+++ b/tools/greenbone-certdata-sync.in 2019-07-22 21:11:36.173099530 +0300
|
||||
@@ -494,13 +494,11 @@
|
||||
fi
|
||||
(
|
||||
flock -n 9
|
||||
- date > $LOCK_FILE
|
||||
if [ $? -eq 1 ] ; then
|
||||
log_notice "Sync in progress, exiting."
|
||||
exit 1
|
||||
fi
|
||||
sync_certdata
|
||||
- echo -n > $LOCK_FILE
|
||||
-) 9>$LOCK_FILE
|
||||
+)
|
||||
|
||||
exit 0
|
||||
--- a/tools/greenbone-scapdata-sync.in 2019-07-17 17:11:52.000000000 +0300
|
||||
+++ b/tools/greenbone-scapdata-sync.in 2019-07-22 21:12:49.193161531 +0300
|
||||
@@ -517,13 +517,11 @@
|
||||
fi
|
||||
(
|
||||
flock -n 9
|
||||
- date > $LOCK_FILE
|
||||
if [ $? -eq 1 ] ; then
|
||||
log_notice "Sync in progress, exiting."
|
||||
exit 1
|
||||
fi
|
||||
sync_scapdata
|
||||
- echo -n > $LOCK_FILE
|
||||
-) 9>$LOCK_FILE
|
||||
+)
|
||||
|
||||
exit 0
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
# GVMD command args
|
||||
|
||||
# e.g --foreground
|
||||
GVMD_OPTIONS=""
|
||||
|
||||
# Manager listen address unix socket
|
||||
# Failing under non-root user (looking for solution)
|
||||
GVMD_LISTEN_ADDRESS_UNIX="--unix-socket=/var/run/gvmd.sock"
|
||||
|
||||
# Manager listen address TCP
|
||||
GVMD_LISTEN_ADDRESS_TCP="--listen=127.0.0.1"
|
||||
|
||||
# Manager listen port
|
||||
GVMD_PORT="--port=9390"
|
||||
|
||||
# Manager unix socket listen owner
|
||||
GVMD_LISTEN_OWNER="--listen-owner=gvm"
|
||||
|
||||
# Manager unix socket listen group
|
||||
GVMD_LISTEN_GROUP="--listen-group=gvm"
|
||||
|
||||
# Manager unix socket listen mode
|
||||
GVMD_LISTEN_MODE="--listen-mode=755"
|
||||
|
||||
# Scanner listen address unix socket
|
||||
GVMD_SCANNER_HOST="--scanner-host=/var/run/openvassd.sock"
|
||||
|
||||
# TLS settings
|
||||
GVMD_GNUTLS_PRIORITIES="--gnutls-priorities=SECURE256:+SUITEB192:+SECURE192:+SECURE128:+SUITEB128:-MD5:-SHA1:-VERS-TLS1.0:-VERS-TLS1.1:-VERS-SSL3.0"
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
: ${GVMD_USER:=gvm}
|
||||
: ${GVMD_GROUP:=gvm}
|
||||
: ${GVMD_TIMEOUT:=30}
|
||||
|
||||
name="Greenbone Vulnerability Manager"
|
||||
command=/usr/bin/gvmd
|
||||
command_args="${GVMD_OPTIONS} ${GVMD_LISTEN_ADDRESS_TCP} ${GVMD_PORT} ${GVMD_SCANNER_HOST} ${GVMD_GNUTLS_PRIORITIES}"
|
||||
command_background="true"
|
||||
command_user="${GVMD_USER}:${GVMD_GROUP}"
|
||||
pidfile="/run/gvmd.pid"
|
||||
retry="${GVMD_TIMEOUT}"
|
||||
|
||||
depend() {
|
||||
after bootmisc
|
||||
need localmount net openvassd
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
/bin/bash /etc/gvm/gvmd-startpre.sh
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
CMAKE_MAKEFILE_GENERATOR="emake"
|
||||
inherit cmake-utils flag-o-matic systemd toolchain-funcs
|
||||
|
||||
DESCRIPTION="Greenbone vulnerability manager, previously named openvas-manager"
|
||||
HOMEPAGE="https://www.greenbone.net/en/"
|
||||
SRC_URI="https://github.com/greenbone/gvmd/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2+"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="extras +postgres sqlite"
|
||||
REQUIRED_USE="|| ( postgres sqlite )"
|
||||
|
||||
DEPEND="
|
||||
dev-libs/libgcrypt:0=
|
||||
dev-libs/libical
|
||||
>=net-analyzer/gvm-libs-10.0.1
|
||||
net-libs/gnutls:=[tools]
|
||||
extras? ( app-text/xmlstarlet
|
||||
dev-texlive/texlive-latexextra )
|
||||
postgres? ( dev-db/postgresql:* )
|
||||
sqlite? ( dev-db/sqlite:3 )"
|
||||
|
||||
RDEPEND="
|
||||
${DEPEND}
|
||||
!net-analyzer/openvas-manager
|
||||
~net-analyzer/openvas-scanner-6.0.1"
|
||||
|
||||
BDEPEND="
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
virtual/pkgconfig
|
||||
extras? ( app-doc/doxygen[dot]
|
||||
app-doc/xmltoman
|
||||
app-text/htmldoc
|
||||
dev-libs/libxslt
|
||||
)"
|
||||
|
||||
PATCHES=(
|
||||
# Install exec. to /usr/bin instead of /usr/sbin
|
||||
"${FILESDIR}/${P}-sbin.patch"
|
||||
# Fix permissions for user gvm.
|
||||
"${FILESDIR}/${P}-tmplock.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
cmake-utils_src_prepare
|
||||
# QA-Fix | Use correct FHS/Gentoo policy paths for 8.0.1
|
||||
sed -i -e "s*share/doc/gvm/html/*share/doc/gvmd-${PV}/html/*g" "$S"/doc/CMakeLists.txt || die
|
||||
sed -i -e "s*/doc/gvm/*/doc/gvmd-${PV}/*g" "$S"/CMakeLists.txt || die
|
||||
# QA-Fix | Remove !CLANG Doxygen warnings for 8.0.1
|
||||
if use extras; then
|
||||
if ! tc-is-clang; then
|
||||
local f
|
||||
for f in doc/*.in
|
||||
do
|
||||
sed -i \
|
||||
-e "s*CLANG_ASSISTED_PARSING = NO*#CLANG_ASSISTED_PARSING = NO*g" \
|
||||
-e "s*CLANG_OPTIONS*#CLANG_OPTIONS*g" \
|
||||
"${f}" || die "couldn't disable CLANG parsing"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
"-DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr"
|
||||
"-DLOCALSTATEDIR=${EPREFIX}/var"
|
||||
"-DSYSCONFDIR=${EPREFIX}/etc"
|
||||
)
|
||||
# Add release hardening flags for 8.0.1
|
||||
append-cflags -Wno-nonnull -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector
|
||||
append-ldflags -Wl,-z,relro -Wl,-z,now
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake-utils_src_compile
|
||||
if use extras; then
|
||||
cmake-utils_src_make -C "${BUILD_DIR}" doc
|
||||
cmake-utils_src_make doc-full -C "${BUILD_DIR}" doc
|
||||
HTML_DOCS=( "${BUILD_DIR}"/doc/generated/html/. )
|
||||
fi
|
||||
cmake-utils_src_make rebuild_cache
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-utils_src_install
|
||||
|
||||
dodir /etc/gvm
|
||||
insinto /etc/gvm
|
||||
doins -r "${FILESDIR}"/*sync*
|
||||
|
||||
dodir /etc/gvm/sysconfig
|
||||
insinto /etc/gvm/sysconfig
|
||||
doins "${FILESDIR}/${PN}-daemon.conf"
|
||||
|
||||
exeinto /etc/gvm
|
||||
doexe "${FILESDIR}"/gvmd-startpre.sh
|
||||
|
||||
fowners -R gvm:gvm /etc/gvm
|
||||
|
||||
newinitd "${FILESDIR}/${PN}.init" "${PN}"
|
||||
newconfd "${FILESDIR}/${PN}-daemon.conf" "${PN}"
|
||||
|
||||
insinto /etc/logrotate.d
|
||||
newins "${FILESDIR}/${PN}.logrotate" "${PN}"
|
||||
|
||||
systemd_dounit "${FILESDIR}/${PN}.service"
|
||||
|
||||
# Set proper permissions on required files/directories
|
||||
keepdir /var/lib/gvm/gvmd
|
||||
fowners -R gvm:gvm /var/lib/gvm
|
||||
}
|
||||
|
|
@ -1,2 +1 @@
|
|||
DIST openvas-scanner-6.0.1.tar.gz 522100 BLAKE2B af82b41736329bd90ba1ea73a0ace36d4115375f81a7aaff5d3bd50f21cfa3195cdf4012aa952da52c4103a31475de5c5790ef3e2e36180aa06737371fa0e5a0 SHA512 db4087fffe1d50e232fa1e51325cf7f142237e2bd3cc5dcaa1e7058a4871300f352f2c0e700eae72ea9412c347b072e9d1f2eca508b27cb30f36c6895ec95147
|
||||
DIST openvas-scanner-7.0.0.tar.gz 428304 BLAKE2B fa0a21127edd2223dbbf533b6c188729a1b6de4977e5667fbc1a45b2c426045cdc73eb58d05df24b8b39d0e47fb445fa704bd1b827bb5ea6403fdb83c6b01fd9 SHA512 ce3e78ce5e1575c5c37b6c2aa77ec8955754029832bafb3fcedd75b48dff309906a97bac052d206f6e93e9e72b8461a131558e849f70b3afce6280a7b06924d1
|
||||
|
|
|
|||
|
|
@ -1,42 +0,0 @@
|
|||
--- openvas-scanner-5.1.3/src/openvassd.c 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/src/openvassd.c 2019-02-04 03:28:24.635539266 +0300
|
||||
@@ -103,7 +103,6 @@
|
||||
*/
|
||||
static openvassd_option openvassd_defaults[] = {
|
||||
{"plugins_folder", OPENVAS_NVT_DIR},
|
||||
- {"cache_folder", OPENVAS_CACHE_DIR},
|
||||
{"include_folders", OPENVAS_NVT_DIR},
|
||||
{"max_hosts", "30"},
|
||||
{"max_checks", "10"},
|
||||
--- openvas-scanner-5.1.3/src/CMakeLists.txt 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/src/CMakeLists.txt 2019-02-04 03:22:20.078824664 +0300
|
||||
@@ -68,10 +68,6 @@
|
||||
add_definitions (-DOPENVAS_NVT_DIR=\\\"${OPENVAS_NVT_DIR}\\\")
|
||||
endif (OPENVAS_NVT_DIR)
|
||||
|
||||
-if (OPENVAS_CACHE_DIR)
|
||||
- add_definitions (-DOPENVAS_CACHE_DIR=\\\"${OPENVAS_CACHE_DIR}\\\")
|
||||
-endif (OPENVAS_CACHE_DIR)
|
||||
-
|
||||
if (OPENVAS_LOG_DIR)
|
||||
add_definitions (-DOPENVAS_LOG_DIR=\\\"${OPENVAS_LOG_DIR}\\\")
|
||||
endif (OPENVAS_LOG_DIR)
|
||||
--- openvas-scanner-5.1.3/CMakeLists.txt 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/CMakeLists.txt 2019-02-04 03:18:37.889999639 +0300
|
||||
@@ -166,7 +166,6 @@
|
||||
set (OPENVAS_DATA_DIR "${DATADIR}/openvas")
|
||||
set (OPENVAS_STATE_DIR "${LOCALSTATEDIR}/lib/openvas")
|
||||
set (OPENVAS_LOG_DIR "${LOCALSTATEDIR}/log/openvas")
|
||||
-set (OPENVAS_CACHE_DIR "${LOCALSTATEDIR}/cache/openvas")
|
||||
set (OPENVAS_SYSCONF_DIR "${SYSCONFDIR}/openvas")
|
||||
|
||||
if (NOT OPENVAS_NVT_DIR)
|
||||
@@ -265,7 +264,6 @@
|
||||
DESTINATION ${DATADIR}/doc/openvas-scanner/ )
|
||||
|
||||
install (DIRECTORY DESTINATION ${OPENVAS_NVT_DIR})
|
||||
-install (DIRECTORY DESTINATION ${OPENVAS_CACHE_DIR})
|
||||
|
||||
## Tests
|
||||
|
||||
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
--- openvas-scanner-5.1.3/src/ntp.c 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/src/ntp.c 2019-02-02 00:57:56.832878754 +0300
|
||||
@@ -361,9 +361,7 @@
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------
|
||||
-
|
||||
Communication protocol: timestamps
|
||||
-
|
||||
----------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -391,7 +389,7 @@
|
||||
static int
|
||||
__ntp_timestamp_scan_host (int soc, char *msg, char *host)
|
||||
{
|
||||
- char timestr[1024];
|
||||
+ char timestr[64];
|
||||
char *tmp;
|
||||
time_t t;
|
||||
int len;
|
||||
--- openvas-scanner-5.1.3/src/pluginload.c 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/src/pluginload.c 2019-02-02 00:59:24.494774959 +0300
|
||||
@@ -250,7 +250,7 @@
|
||||
g_slist_free_full (oids, g_free);
|
||||
}
|
||||
|
||||
-static int
|
||||
+static void
|
||||
plugins_reload_from_dir (void *folder)
|
||||
{
|
||||
GSList *files = NULL, *f;
|
||||
--- openvas-scanner-5.1.3/src/processes.h 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/src/processes.h 2019-02-02 01:06:42.772908314 +0300
|
||||
@@ -28,7 +28,7 @@
|
||||
#ifndef _OPENVAS_THREADS_H
|
||||
#define _OPENVAS_THREADS_H
|
||||
|
||||
-typedef int (*process_func_t) (void *);
|
||||
+typedef void (*process_func_t) (void *);
|
||||
pid_t create_process (process_func_t, void *);
|
||||
int terminate_process (pid_t);
|
||||
|
|
@ -1,93 +0,0 @@
|
|||
--- openvas-scanner-5.1.3/src/attack.c 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/src/attack.c 2019-02-02 00:44:12.834888067 +0300
|
||||
@@ -97,9 +97,7 @@
|
||||
};
|
||||
|
||||
/*******************************************************
|
||||
-
|
||||
PRIVATE FUNCTIONS
|
||||
-
|
||||
********************************************************/
|
||||
|
||||
/**
|
||||
@@ -996,6 +994,14 @@
|
||||
sched = plugins_scheduler_init
|
||||
(prefs_get ("plugin_set"), prefs_get_bool ("auto_enable_dependencies"),
|
||||
network_phase);
|
||||
+ if (sched == NULL)
|
||||
+ {
|
||||
+ error_message_to_client (global_socket,
|
||||
+ "Failed to initialize the plugins scheduler.",
|
||||
+ NULL, NULL);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
|
||||
max_hosts = get_max_hosts_number ();
|
||||
max_checks = get_max_checks_number ();
|
||||
--- openvas-scanner-5.1.3/src/pluginscheduler.c 2018-08-29 19:27:26.000000000 +0300
|
||||
+++ openvas-scanner-5.1.3/src/pluginscheduler.c 2019-02-02 00:48:03.799598381 +0300
|
||||
@@ -486,7 +486,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
-static void
|
||||
+static int
|
||||
plugins_scheduler_fill (plugins_scheduler_t sched)
|
||||
{
|
||||
int i;
|
||||
@@ -500,6 +500,15 @@
|
||||
int category;
|
||||
|
||||
category = nvticache_get_category (element->data);
|
||||
+ if (category < 0)
|
||||
+ {
|
||||
+ log_write ("The NVT with oid %s has not category assigned. This is "
|
||||
+ "considered a fatal error, since the NVTI Cache "
|
||||
+ "structure stored in Redis is out dated or corrupted.",
|
||||
+ (char *) element->data);
|
||||
+ g_slist_free_full (list, g_free);
|
||||
+ return 1;
|
||||
+ }
|
||||
scheduler_plugin = g_malloc0 (sizeof (struct scheduler_plugin));
|
||||
scheduler_plugin->running_state = PLUGIN_STATUS_UNRUN;
|
||||
scheduler_plugin->oid = g_strdup (element->data);
|
||||
@@ -529,6 +538,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
plugins_scheduler_t
|
||||
@@ -540,7 +550,11 @@
|
||||
/* Fill our lists */
|
||||
ret = g_malloc0 (sizeof (*ret));
|
||||
ret->hash = hash_init ();
|
||||
- plugins_scheduler_fill (ret);
|
||||
+ if (plugins_scheduler_fill (ret))
|
||||
+ {
|
||||
+ plugins_scheduler_free (ret);
|
||||
+ return NULL;
|
||||
+ }
|
||||
|
||||
plugins_scheduler_enable (ret, plugins_list, autoload);
|
||||
|
||||
@@ -729,9 +743,12 @@
|
||||
void
|
||||
plugins_scheduler_free (plugins_scheduler_t sched)
|
||||
{
|
||||
- int i;
|
||||
- hash_destroy (sched->hash);
|
||||
- for (i = ACT_FIRST; i <= ACT_LAST; i++)
|
||||
- list_destroy (sched->list[i]);
|
||||
- g_free (sched);
|
||||
+ if (sched)
|
||||
+ {
|
||||
+ int i;
|
||||
+ hash_destroy (sched->hash);
|
||||
+ for (i = ACT_FIRST; i <= ACT_LAST; i++)
|
||||
+ list_destroy (sched->list[i]);
|
||||
+ g_free (sched);
|
||||
+ }
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# OpenVAS Scanner command args
|
||||
|
||||
# e.g --foreground
|
||||
OPENVAS_SCANNER_OPTIONS=""
|
||||
|
||||
# Scanner listen socket
|
||||
OPENVAS_SCANNER_LISTEN_SOCKET="--unix-socket=/var/run/openvassd.sock"
|
||||
|
||||
# Scanner listen owner
|
||||
OPENVAS_SCANNER_LISTEN_OWNER="--listen-owner=gvm"
|
||||
|
||||
# Scanner listen group
|
||||
OPENVAS_SCANNER_LISTEN_GROUP="--listen-group=gvm"
|
||||
|
||||
# Scanner listen mode
|
||||
OPENVAS_SCANNER_LISTEN_MODE="--listen-mode=755"
|
||||
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
#You can get detailed informations from https://linux.die.net/man/8/openvassd
|
||||
|
||||
plugins_folder = /var/lib/openvas/plugins
|
||||
include_folders = /var/lib/openvas/plugins
|
||||
max_hosts = 30
|
||||
max_checks = 10
|
||||
|
||||
#Resource friendly
|
||||
be_nice = no
|
||||
|
||||
#Logfile
|
||||
logfile = /var/log/openvas/openvassd.messages
|
||||
|
||||
log_whole_attack = no
|
||||
log_plugins_name_at_load = no
|
||||
dumpfile = /var/log/openvas/openvassd.dump
|
||||
cgi_path = /cgi-bin:/scripts
|
||||
|
||||
#Turn off for push hard but increase false positive and slow down scans
|
||||
optimize_test = yes
|
||||
|
||||
checks_read_timeout = 5
|
||||
network_scan = no
|
||||
non_simult_ports = 139, 445
|
||||
plugins_timeout = 320
|
||||
scanner_plugins_timeout = 36000
|
||||
|
||||
#Push harder to target
|
||||
safe_checks = no
|
||||
|
||||
auto_enable_dependencies = yes
|
||||
use_mac_addr = no
|
||||
nasl_no_signature_check = yes
|
||||
drop_privileges = no
|
||||
unscanned_closed = yes
|
||||
unscanned_closed_udp = yes
|
||||
vhosts =
|
||||
vhosts_ip =
|
||||
report_host_details = yes
|
||||
|
||||
#Redis listening socket (must be same with redis socket)
|
||||
kb_location = /tmp/redis.sock
|
||||
|
||||
timeout_retry = 3
|
||||
time_between_request = 0
|
||||
|
||||
#Config File
|
||||
config_file = /etc/openvas/openvassd.conf
|
||||
|
||||
#Certificates (default these are not needed here but setup-check script looking for them)
|
||||
cert_file = /var/lib/openvas/CA/servercert.pem
|
||||
key_file = /var/lib/openvas/private/CA/serverkey.pem
|
||||
ca_file = /var/lib/openvas/CA/cacert.pem
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
# You can get detailed informations from https://linux.die.net/man/8/openvassd
|
||||
# Configuration file of the OpenVAS Security Scanner
|
||||
# Every line starting with a '#' is a comment
|
||||
|
||||
[Misc]
|
||||
|
||||
# Path to the security checks folder:
|
||||
plugins_folder = /var/lib/openvas/plugins
|
||||
|
||||
# Path to OpenVAS caching folder:
|
||||
cache_folder = /var/cache/openvas
|
||||
|
||||
# Path to OpenVAS include directories:
|
||||
# (multiple entries are separated with colon ':')
|
||||
include_folders = /var/lib/openvas/plugins
|
||||
|
||||
# Config File
|
||||
config_file = /etc/openvas/openvassd.conf
|
||||
|
||||
# Maximum number of simultaneous hosts tested :
|
||||
max_hosts = 30
|
||||
|
||||
# Maximum number of simultaneous checks against each host tested :
|
||||
max_checks = 10
|
||||
|
||||
# Niceness. If set to 'yes', openvassd will renice itself to 10.
|
||||
be_nice = no
|
||||
|
||||
# Log file (or 'syslog') :
|
||||
logfile = /var/log/gvm/openvassd.log
|
||||
|
||||
# Shall we log every details of the attack ? (disk intensive)
|
||||
log_whole_attack = no
|
||||
|
||||
# Log the name of the plugins that are loaded by the server ?
|
||||
log_plugins_name_at_load = no
|
||||
|
||||
# Dump file for debugging output, use `-' for stdout
|
||||
dumpfile = /var/log/gvm/openvassd.dump
|
||||
|
||||
# Rules file :
|
||||
rules = /etc/openvas/openvassd.rules
|
||||
|
||||
# CGI paths to check for (cgi-bin:/cgi-aws:/ can do)
|
||||
cgi_path = /cgi-bin:/scripts
|
||||
|
||||
# Range of the ports the port scanners will scan :
|
||||
# 'default' means that OpenVAS will scan ports found in its
|
||||
# services file.
|
||||
port_range = default
|
||||
|
||||
# Optimize the test (recommended) :
|
||||
# Turn off for push hard but increase false positive and slow down scans
|
||||
optimize_test = yes
|
||||
|
||||
# Optimization :
|
||||
# Read timeout for the sockets of the tests :
|
||||
checks_read_timeout = 5
|
||||
|
||||
# Ports against which two plugins should not be run simultaneously :
|
||||
# non_simult_ports = Services/www, 139, Services/finger
|
||||
non_simult_ports = 139, 445
|
||||
|
||||
# Maximum lifetime of a plugin (in seconds) :
|
||||
plugins_timeout = 320
|
||||
|
||||
# Safe checks rely on banner grabbing & If enabled push harder to target:
|
||||
safe_checks = yes
|
||||
|
||||
# Automatically activate the plugins that are depended on
|
||||
auto_enable_dependencies = yes
|
||||
|
||||
# Do not echo data from plugins which have been automatically enabled
|
||||
silent_dependencies = no
|
||||
|
||||
# Designate hosts by MAC address, not IP address (useful for DHCP networks)
|
||||
use_mac_addr = no
|
||||
|
||||
|
||||
#--- Knowledge base saving (can be configured by the client) :
|
||||
# Save the knowledge base on disk :
|
||||
save_knowledge_base = no
|
||||
|
||||
# Restore the KB for each test :
|
||||
kb_restore = no
|
||||
|
||||
# Only test hosts whose KB we do not have :
|
||||
only_test_hosts_whose_kb_we_dont_have = no
|
||||
|
||||
# Only test hosts whose KB we already have :
|
||||
only_test_hosts_whose_kb_we_have = no
|
||||
|
||||
# KB test replay :
|
||||
kb_dont_replay_scanners = no
|
||||
kb_dont_replay_info_gathering = no
|
||||
kb_dont_replay_attacks = no
|
||||
kb_dont_replay_denials = no
|
||||
kb_max_age = 864000
|
||||
#--- end of the KB section
|
||||
|
||||
# Redis socket default setting
|
||||
db_address = /tmp/redis.sock
|
||||
|
||||
# If this option is set, OpenVAS will not scan a network incrementally
|
||||
# (10.0.0.1, then 10.0.0.2, 10.0.0.3 and so on..) but will attempt to
|
||||
# slice the workload throughout the whole network (ie: it will scan
|
||||
# 10.0.0.1, then 10.0.0.127, then 10.0.0.2, then 10.0.0.128 and so on...
|
||||
slice_network_addresses = no
|
||||
|
||||
# Should consider all the NASL scripts as being signed ? (unsafe if set to 'yes')
|
||||
nasl_no_signature_check = yes
|
||||
|
||||
#Certificates
|
||||
cert_file=/var/lib/gvm/CA/servercert.pem
|
||||
key_file=/var/lib/gvm/private/CA/serverkey.pem
|
||||
ca_file=/var/lib/gvm/CA/cacert.pem
|
||||
|
||||
# If you decide to protect your private key with a password,
|
||||
# uncomment and change next line
|
||||
# pem_password=password
|
||||
# If you want to force the use of a client certificate, uncomment next line
|
||||
# force_pubkey_auth = yes
|
||||
|
||||
#end.
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
#!/sbin/openrc-run
|
||||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
name="Open Vulnerability Assessment Scanner"
|
||||
command="/usr/bin/openvassd"
|
||||
command_args="${OPENVAS_SCANNER_OPTIONS} ${OPENVAS_SCANNER_LISTEN_SOCKET} ${OPENVAS_SCANNER_LISTEN_OWNER} ${OPENVAS_SCANNER_LISTEN_GROUP} ${OPENVAS_SCANNER_LISTEN_MODE}"
|
||||
pidfile="/run/openvassd.pid"
|
||||
command_background="true"
|
||||
|
||||
depend() {
|
||||
after bootmisc
|
||||
need localmount net redis
|
||||
}
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
# Daemon ignore HUP so we use 'copytruncate' instead of 'create'
|
||||
# with safe file size to prevent losing log entries.
|
||||
|
||||
/var/log/gvm/openvassd.log {
|
||||
compress
|
||||
missingok
|
||||
notifempty
|
||||
sharedscripts
|
||||
copytruncate
|
||||
maxsize 10M
|
||||
}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
[Unit]
|
||||
Description=Open Vulnerability Assessment Scanner
|
||||
After=network.target
|
||||
After=redis.service
|
||||
Before=gvmd.service
|
||||
Requires=redis.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
EnvironmentFile=-/etc/openvas/sysconfig/openvassd-daemon.conf
|
||||
ExecStart=/usr/bin/openvassd $OPENVAS_SCANNER_OPTIONS $OPENVAS_SCANNER_LISTEN_SOCKET $OPENVAS_SCANNER_LISTEN_OWNER $OPENVAS_SCANNER_LISTEN_GROUP $OPENVAS_SCANNER_LISTEN_MODE
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
|
@ -1,138 +0,0 @@
|
|||
# Copyright 1999-2019 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=7
|
||||
|
||||
CMAKE_MAKEFILE_GENERATOR="emake"
|
||||
inherit cmake-utils flag-o-matic systemd toolchain-funcs
|
||||
|
||||
MY_PN="openvas"
|
||||
MY_DN="openvassd"
|
||||
|
||||
DESCRIPTION="Open Vulnerability Assessment Scanner"
|
||||
HOMEPAGE="https://www.greenbone.net/en/"
|
||||
SRC_URI="https://github.com/greenbone/openvas-scanner/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
SLOT="0"
|
||||
LICENSE="GPL-2 GPL-2+"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
IUSE="cron extras"
|
||||
|
||||
DEPEND="
|
||||
app-crypt/gpgme:=
|
||||
dev-db/redis
|
||||
dev-libs/libgcrypt:=
|
||||
dev-libs/libksba
|
||||
>=net-analyzer/gvm-libs-10.0.1
|
||||
net-analyzer/net-snmp
|
||||
net-libs/gnutls:=
|
||||
net-libs/libpcap
|
||||
net-libs/libssh:=
|
||||
"
|
||||
|
||||
RDEPEND="
|
||||
${DEPEND}
|
||||
!~net-analyzer/openvas-scanner-5.1.3
|
||||
!net-analyzer/openvas-tools"
|
||||
|
||||
BDEPEND="
|
||||
sys-devel/bison
|
||||
sys-devel/flex
|
||||
virtual/pkgconfig
|
||||
extras? ( app-doc/doxygen[dot]
|
||||
app-doc/xmltoman
|
||||
app-text/htmldoc
|
||||
dev-perl/CGI
|
||||
dev-perl/SQL-Translator
|
||||
)"
|
||||
|
||||
BUILD_DIR="${WORKDIR}/${MY_PN}-${PV}_build"
|
||||
S="${WORKDIR}/${MY_PN}-${PV}"
|
||||
|
||||
PATCHES=(
|
||||
# Install exec. to /usr/bin instead of /usr/sbin
|
||||
"${FILESDIR}/${P}-sbin.patch"
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
cmake-utils_src_prepare
|
||||
# QA-Fix | Correct FHS/Gentoo policy paths for 6.0.1
|
||||
sed -i -e "s*/doc/openvas-scanner/*/doc/openvas-scanner-${PV}/*g" "$S"/src/CMakeLists.txt || die
|
||||
# QA-Fix | Remove !CLANG doxygen warnings for 6.0.1
|
||||
if use extras; then
|
||||
if ! tc-is-clang; then
|
||||
local f
|
||||
for f in doc/*.in
|
||||
do
|
||||
sed -i \
|
||||
-e "s*CLANG_ASSISTED_PARSING = NO*#CLANG_ASSISTED_PARSING = NO*g" \
|
||||
-e "s*CLANG_OPTIONS*#CLANG_OPTIONS*g" \
|
||||
"${f}" || die "couldn't disable CLANG parsing"
|
||||
done
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
"-DCMAKE_INSTALL_PREFIX=${EPREFIX}/usr"
|
||||
"-DLOCALSTATEDIR=${EPREFIX}/var"
|
||||
"-DSYSCONFDIR=${EPREFIX}/etc"
|
||||
)
|
||||
# Add release hardening flags for 6.0.1
|
||||
append-cflags -Wno-format-truncation -Wformat -Wformat-security -D_FORTIFY_SOURCE=2 -fstack-protector
|
||||
append-ldflags -Wl,-z,relro -Wl,-z,now
|
||||
cmake-utils_src_configure
|
||||
}
|
||||
|
||||
src_compile() {
|
||||
cmake-utils_src_compile
|
||||
if use extras; then
|
||||
cmake-utils_src_make -C "${BUILD_DIR}" doc
|
||||
cmake-utils_src_make doc-full -C "${BUILD_DIR}" doc
|
||||
HTML_DOCS=( "${BUILD_DIR}"/doc/generated/html/. )
|
||||
fi
|
||||
cmake-utils_src_make rebuild_cache
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake-utils_src_install
|
||||
|
||||
dodir /etc/openvas
|
||||
insinto /etc/openvas
|
||||
newins "${FILESDIR}/${MY_DN}.gvm.conf" openvassd.conf
|
||||
|
||||
insinto /etc/openvas
|
||||
doins "${FILESDIR}"/redis.conf.example
|
||||
|
||||
dodir /etc/openvas/sysconfig
|
||||
insinto /etc/openvas/sysconfig
|
||||
doins "${FILESDIR}/${MY_DN}-daemon.conf"
|
||||
|
||||
if use cron; then
|
||||
# Install the cron job if they want it.
|
||||
exeinto /etc/gvm
|
||||
doexe "${FILESDIR}/gvm-feed-sync.sh"
|
||||
fowners gvm:gvm /etc/gvm/gvm-feed-sync.sh
|
||||
|
||||
insinto /etc/cron.d
|
||||
newins "${FILESDIR}"/gvm-feed-sync.cron gvm
|
||||
fi
|
||||
|
||||
fowners -R gvm:gvm /etc/openvas
|
||||
|
||||
newinitd "${FILESDIR}/${MY_DN}.init" "${MY_DN}"
|
||||
newconfd "${FILESDIR}/${MY_DN}-daemon.conf" "${MY_DN}"
|
||||
|
||||
dodir /etc/logrotate.d
|
||||
insinto /etc/logrotate.d
|
||||
newins "${FILESDIR}/${MY_DN}.logrotate" "${MY_DN}"
|
||||
|
||||
systemd_dounit "${FILESDIR}/${MY_DN}.service"
|
||||
|
||||
# Set proper permissions on required files/directories
|
||||
keepdir /var/log/gvm
|
||||
fowners gvm:gvm /var/log/gvm
|
||||
keepdir /var/lib/openvas/{gnupg,plugins}
|
||||
fowners -R gvm:gvm /var/lib/openvas
|
||||
}
|
||||
|
|
@ -7,4 +7,4 @@ unix_socket = /tmp/ospd.sock
|
|||
#unix_socket = /run/ospd/ospd-openvas.pid
|
||||
|
||||
log_level = DEBUG
|
||||
log_file = /var/log/gvm/openvas.log
|
||||
log_file = /var/log/gvm/ospd-openvas.log
|
||||
|
|
|
|||
|
|
@ -28,7 +28,9 @@ python_install() {
|
|||
|
||||
dodir /etc/openvas
|
||||
insinto /etc/openvas
|
||||
newins "${FILESDIR}/ospd.conf" ospd.conf
|
||||
|
||||
doins "${FILESDIR}"/redis.conf.example
|
||||
doins "${FILESDIR}/ospd.conf"
|
||||
|
||||
newinitd "${FILESDIR}/${PN}.initd" "${PN}"
|
||||
newconfd "${FILESDIR}/${PN}.confd" "${PN}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue