Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jan 2021 09:13:32 +0000 (UTC)
From:      Jose Alonso Cardenas Marquez <acm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r560482 - in head/security/greenbone-security-assistant: . files
Message-ID:  <202101060913.1069DWGH094563@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: acm
Date: Wed Jan  6 09:13:31 2021
New Revision: 560482
URL: https://svnweb.freebsd.org/changeset/ports/560482

Log:
  - Re-add port: security/greenbone-security-assistant
  
  The Greenbone Security Assistant is the web interface developed for the
  Greenbone Security Manager appliances.
  
  It connects to the Greenbone Vulnerability Manager GVM to provide a
  full-featured user interface for vulnerability management.
  
  Greenbone Security Assistant consists of GSA - The webpage written in React
  and GSAD - The HTTP server talking to the GVM daemon
  
  WWW: https://github.com/greenbone/gsa

Added:
  head/security/greenbone-security-assistant/
     - copied from r447184, head/security/greenbone-security-assistant/
  head/security/greenbone-security-assistant/files/patch-gsa_CMakeLists.txt   (contents, props changed)
  head/security/greenbone-security-assistant/files/patch-gsad-src_gsad_gmp.c   (contents, props changed)
  head/security/greenbone-security-assistant/files/patch-gsad_CMakeLists.txt   (contents, props changed)
Deleted:
  head/security/greenbone-security-assistant/files/patch-doc-CMakeLists.txt
  head/security/greenbone-security-assistant/files/patch-src-xslt_i18n.c
  head/security/greenbone-security-assistant/pkg-plist
Modified:
  head/security/greenbone-security-assistant/Makefile
  head/security/greenbone-security-assistant/distinfo
  head/security/greenbone-security-assistant/files/gsad.in
  head/security/greenbone-security-assistant/files/patch-CMakeLists.txt
  head/security/greenbone-security-assistant/pkg-descr

Modified: head/security/greenbone-security-assistant/Makefile
==============================================================================
--- head/security/greenbone-security-assistant/Makefile	Wed Aug  2 23:58:03 2017	(r447184)
+++ head/security/greenbone-security-assistant/Makefile	Wed Jan  6 09:13:31 2021	(r560482)
@@ -1,24 +1,63 @@
 # $FreeBSD$
 
 PORTNAME=	greenbone-security-assistant
-PORTVERSION=	6.0.10
-PORTREVISION=	2
+DISTVERSION=	20.8.0
+DISTVERSIONPREFIX=	v
+MASTER_SITES=   LOCAL/acm/gsa/:yarn_cache
 CATEGORIES=	security
-MASTER_SITES=	http://wald.intevation.org/frs/download.php/2299/
+DISTFILES=	${PORTNAME}-cache${EXTRACT_SUFX}:yarn_cache
 
-MAINTAINER=	ports@FreeBSD.org
-COMMENT=	OpenVAS web interface
+MAINTAINER=	acm@FreeBSD.org
+COMMENT=	libraries module for the GVM solution
 
-LICENSE=	GPLv2+
-LICENSE_FILE=	${WRKSRC}/COPYING.GPL
+LICENSE=	AGPLv3+
 
-LIB_DEPENDS=	libgnutls.so:security/gnutls \
+BUILD_DEPENDS=	node:www/node \
+		yarn:www/yarn
+LIB_DEPENDS=	libgvm_base.so:security/gvm-libs \
+		libgnutls.so:security/gnutls \
 		libgcrypt.so:security/libgcrypt \
-		libopenvas_base.so:security/openvas-libraries \
+		libgpg-error.so:security/libgpg-error \
 		libmicrohttpd.so:www/libmicrohttpd
+RUN_DEPENDS=	doxygen>0:devel/doxygen \
+		${PYTHON_PKGNAMEPREFIX}polib>=0:devel/py-polib@${PY_FLAVOR}
 
-USES=		cmake:outsource gettext gnome pkgconfig
-USE_GNOME=	glib20 libxml2 libxslt
+USE_GITHUB=	yes
+GH_ACCOUNT=	greenbone
+GH_PROJECT=	gsa
+
+CMAKE_ARGS+=	-DINSTALLER_ARGS="--offline"
+
+USES=		cmake gettext-runtime gnome pkgconfig python
+USE_GNOME=	glib20 libxml2
+
 USE_RC_SUBR=	gsad
+
+ETCDIR=		${PREFIX}/etc/gvm
+PLIST_FILES=	"@sample %%ETCDIR%%/gsad_log.conf.sample"
+
+post-extract:
+	@${MV} ${WRKSRC}/gsad/src/gsad_log_conf.cmake_in ${WRKSRC}/gsad/src/gsad_log.conf.sample
+
+post-patch:
+	${ECHO_CMD} 'yarn-offline-mirror "${WRKDIR}/yarn-offline-cache"' >> \
+		${WRKSRC}/.yarnrc
+	${REINPLACE_CMD} -e 's|$${GVM_LOG_DIR}|/var/log/gvm|g' ${WRKSRC}/gsad/src/gsad_log.conf.sample
+
+post-install:
+	@${MKDIR} ${STAGEDIR}/var/run/gvm
+	@${MKDIR} ${STAGEDIR}${ETCDIR}
+	@${INSTALL_DATA} ${WRKSRC}/gsad/src/gsad_log.conf.sample ${STAGEDIR}${ETCDIR}
+	
+	@${ECHO_CMD} "@sample %%ETCDIR%%/gsad_log.conf.sample"
+	@${ECHO_CMD} "etc/rc.d/gsad" >> ${TMPPLIST}
+	@${ECHO_CMD} "sbin/gsad" >> ${TMPPLIST}
+
+	@cd ${WRKSRC}/gsa/build && \
+		${FIND} -s img locales static -not -type d \
+			-exec ${ECHO_CMD} "share/gvm/gsad/web/{}" \; >> ${TMPPLIST}
+
+	@${ECHO_CMD} "share/man/man8/gsad.8.gz" >> ${TMPPLIST}
+	@${ECHO_CMD} "@dir /var/run/gvm" >> ${TMPPLIST}
 
 .include <bsd.port.mk>

Modified: head/security/greenbone-security-assistant/distinfo
==============================================================================
--- head/security/greenbone-security-assistant/distinfo	Wed Aug  2 23:58:03 2017	(r447184)
+++ head/security/greenbone-security-assistant/distinfo	Wed Jan  6 09:13:31 2021	(r560482)
@@ -1,2 +1,5 @@
-SHA256 (greenbone-security-assistant-6.0.10.tar.gz) = 9581ba04010987ff6f66edc7393595a2e2b05b64d3463886fba9e5d1152cc8df
-SIZE (greenbone-security-assistant-6.0.10.tar.gz) = 1477638
+TIMESTAMP = 1609922298
+SHA256 (greenbone-security-assistant-cache.tar.gz) = 54e91c17d834c20864b7b8bcd539afaae041ea377aea546db2d7cdc6c7e234c1
+SIZE (greenbone-security-assistant-cache.tar.gz) = 49197096
+SHA256 (greenbone-gsa-v20.8.0_GH0.tar.gz) = 8f9f6d985a592b805aeba8c73cba7efaaa497f67a0a9dc8264590d2f41e98ddc
+SIZE (greenbone-gsa-v20.8.0_GH0.tar.gz) = 2131696

Modified: head/security/greenbone-security-assistant/files/gsad.in
==============================================================================
--- head/security/greenbone-security-assistant/files/gsad.in	Wed Aug  2 23:58:03 2017	(r447184)
+++ head/security/greenbone-security-assistant/files/gsad.in	Wed Jan  6 09:13:31 2021	(r560482)
@@ -8,17 +8,23 @@
 #
 # Add the following to /etc/rc.conf[.local] to enable this service
 #
-# gsad_enable="YES"
+# gsad_enable  (bool):   Set to NO by default.
+#                Set it to YES to enable gsad.
+# gsad_flags (params):   Set params used to start gsad.
 #
 
 . /etc/rc.subr
 
+load_rc_config $name
+
+: ${gsad_enable="NO"}
+: ${gsad_flags="--http-cors="http://127.0.0.1" -k /var/lib/gvm/private/CA/serverkey.pem -c /var/lib/gvm/CA/servercert.pem --munix-socket=/var/run/gvm/gvmd.sock"}
+
 name=gsad
-rcvar=gsad_enable
+rcvar=${name}_enable
+gsad_user=gvm
 command="%%PREFIX%%/sbin/gsad"
-pidfile=/var/run/gsad.pid
+command_args="${gsad_flags}"
+pidfile=/var/run/gvm/gsad.pid
 
-: ${gsad_enable=NO}
-
-load_rc_config $name
 run_rc_command "$1"

Modified: head/security/greenbone-security-assistant/files/patch-CMakeLists.txt
==============================================================================
--- head/security/greenbone-security-assistant/files/patch-CMakeLists.txt	Wed Aug  2 23:58:03 2017	(r447184)
+++ head/security/greenbone-security-assistant/files/patch-CMakeLists.txt	Wed Jan  6 09:13:31 2021	(r560482)
@@ -1,6 +1,6 @@
---- CMakeLists.txt.orig	2016-02-03 09:07:18 UTC
-+++ CMakeLists.txt
-@@ -214,7 +214,7 @@ if (NOT LIBDIR)
+--- CMakeLists.txt	2021-01-04 10:09:59.295410000 -0500
++++ CMakeLists.txt	2021-01-04 10:10:43.087240000 -0500
+@@ -60,7 +60,7 @@
  endif (NOT LIBDIR)
  
  if (NOT LOCALSTATEDIR)
@@ -9,12 +9,3 @@
  endif (NOT LOCALSTATEDIR)
  
  if (NOT INCLUDEDIR)
-@@ -487,7 +487,7 @@ install (FILES ${CMAKE_CURRENT_BINARY_DI
- 
- ## Program
- 
--set (HARDENING_FLAGS            "-Wformat -Wformat-security -O2 -D_FORTIFY_SOURCE=2 -fstack-protector -Wl,-z,relro -Wl,-z,now")
-+set (HARDENING_FLAGS            "-Wformat -Wformat-security -Wl,-z,relro -Wl,-z,now")
- 
- set (CMAKE_C_FLAGS_DEBUG        "${CMAKE_C_FLAGS_DEBUG} -Werror")
- set (CMAKE_C_FLAGS              "${CMAKE_C_FLAGS} ${HARDENING_FLAGS} -Wall")

Added: head/security/greenbone-security-assistant/files/patch-gsa_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/greenbone-security-assistant/files/patch-gsa_CMakeLists.txt	Wed Jan  6 09:13:31 2021	(r560482)
@@ -0,0 +1,11 @@
+--- gsa/CMakeLists.txt	2021-01-05 00:32:41.516624000 -0500
++++ gsa/CMakeLists.txt	2021-01-05 00:32:59.477060000 -0500
+@@ -1187,7 +1187,7 @@
+ 
+ 
+ add_custom_command (OUTPUT bundle.stamp
+-                    COMMAND ${CMAKE_COMMAND} -E env REACT_APP_VERSION=${PROJECT_VERSION_STRING} ${INSTALLER} "${INSTALLER_ARGS}" run build
++                    COMMAND ${CMAKE_COMMAND} -E env REACT_APP_VERSION=${PROJECT_VERSION_STRING} ${INSTALLER} "${INSTALLER_ARGS}" react-scripts build
+                     COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/bundle.stamp
+                     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+                     DEPENDS  ${CMAKE_CURRENT_BINARY_DIR}/node-modules.stamp

Added: head/security/greenbone-security-assistant/files/patch-gsad-src_gsad_gmp.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/greenbone-security-assistant/files/patch-gsad-src_gsad_gmp.c	Wed Jan  6 09:13:31 2021	(r560482)
@@ -0,0 +1,13 @@
+--- gsad/src/gsad_gmp.c	2021-01-03 19:47:56.782208000 -0500
++++ gsad/src/gsad_gmp.c	2021-01-03 19:49:29.616531000 -0500
+@@ -16573,8 +16573,8 @@
+   /* Connect to server. */
+ 
+   address.sun_family = AF_UNIX;
+-  strncpy (address.sun_path, path, sizeof (address.sun_path) - 1);
+-  if (connect (sock, (struct sockaddr *) &address, sizeof (address)) == -1)
++  strcpy (address.sun_path, path);
++  if (connect (sock, (struct sockaddr *) &address, sizeof (struct sockaddr_un)) == -1)
+     {
+       g_warning ("Failed to connect to server at %s: %s", path,
+                  strerror (errno));

Added: head/security/greenbone-security-assistant/files/patch-gsad_CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/greenbone-security-assistant/files/patch-gsad_CMakeLists.txt	Wed Jan  6 09:13:31 2021	(r560482)
@@ -0,0 +1,30 @@
+--- gsad/CMakeLists.txt	2020-08-11 10:23:07.000000000 -0500
++++ gsad/CMakeLists.txt	2021-01-05 18:03:53.919183000 -0500
+@@ -86,7 +86,7 @@
+ set (GSAD_CONFIG_DIR "${SYSCONFDIR}/gvm/")
+ 
+ if (NOT GSAD_PID_DIR)
+-  set (GSAD_PID_DIR "${LOCALSTATEDIR}/run")
++  set (GSAD_PID_DIR "${LOCALSTATEDIR}/run/gvm")
+ endif (NOT GSAD_PID_DIR)
+ 
+ if (NOT GVM_RUN_DIR)
+@@ -124,15 +124,14 @@
+ endif (NOT GVM_CA_CERTIFICATE)
+ 
+ 
+-configure_file (src/gsad_log_conf.cmake_in src/gsad_log.conf)
++#configure_file (src/gsad_log_conf.cmake_in src/gsad_log.conf.sample)
+ 
+ ## Install
+ 
+-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/src/gsad_log.conf
+-         DESTINATION ${GSAD_CONFIG_DIR})
++#install (FILES ${CMAKE_CURRENT_BINARY_DIR}/src/gsad_log.conf.sample
++#         DESTINATION ${GSAD_CONFIG_DIR})
+ 
+ add_subdirectory (src)
+-add_subdirectory (config)
+ 
+ add_subdirectory (doc)
+ 

Modified: head/security/greenbone-security-assistant/pkg-descr
==============================================================================
--- head/security/greenbone-security-assistant/pkg-descr	Wed Aug  2 23:58:03 2017	(r447184)
+++ head/security/greenbone-security-assistant/pkg-descr	Wed Jan  6 09:13:31 2021	(r560482)
@@ -1,8 +1,10 @@
-The Open Vulnerability Assessment System (OpenVAS) is a framework of several
-services and tools offering a comprehensive and powerful vulnerability
-scanning and vulnerability management solution.
+The Greenbone Security Assistant is the web interface developed for the 
+Greenbone Security Manager appliances.
 
-This package contains the Greenbone Security Assistant, a web interface for
-the OpenVAS Manager.
+It connects to the Greenbone Vulnerability Manager GVM to provide a 
+full-featured user interface for vulnerability management.
 
-WWW: http://www.openvas.org/
+Greenbone Security Assistant consists of GSA - The webpage written in React
+and GSAD - The HTTP server talking to the GVM daemon
+
+WWW: https://github.com/greenbone/gsa



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101060913.1069DWGH094563>