From nobody Sun May 22 05:44:23 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 73C2F1B3E244; Sun, 22 May 2022 05:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L5TtH2j4qz4VB0; Sun, 22 May 2022 05:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653198263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fUCZ9eXiOQDvMpYeYUGREFXhcAfWe42iMm9mSgKcYNQ=; b=UBkqAVM+h0IXwS2qHRQTpF/qrasUtFIPKzoeGNLnRZs/h3WqM5f+cwuK/oVnS476/CXV0U X3tBuCzkRttLGAq4wqHrjaqeEOBew5wqALeVQv43WcEN4UpxhqKrlTj6oKPIGY7hrgzPHF xdIjPeTDIWrSqh9M628BHbi/l08UoeGXxPSj+n1kBcaEILWSCkJXxgE5MKfGyJLYo9pDXJ wDcSkf2XsaSiYPIHRG2NEnQXlGw1eZm1xClYaO4ymaOiI2lFw5/TyK7WQG36r03YDkMptH SNjv3YsrrDp1Q/K95cQm32ACOquCDAvItW91TD44GEg5EjjLf5rsmeOor/4yLg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3CABA15926; Sun, 22 May 2022 05:44:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24M5iNIl005403; Sun, 22 May 2022 05:44:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24M5iN1P005402; Sun, 22 May 2022 05:44:23 GMT (envelope-from git) Date: Sun, 22 May 2022 05:44:23 GMT Message-Id: <202205220544.24M5iN1P005402@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Jose Alonso Cardenas Marquez Subject: git: 557ad9b56608 - main - security/gsad: New port: Greenbone Security Assistant HTTP server List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: acm X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 557ad9b56608f2aadf5df410417c49768289d968 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653198263; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fUCZ9eXiOQDvMpYeYUGREFXhcAfWe42iMm9mSgKcYNQ=; b=O2XvSFyhV/3ij0lve+7cZbZhVFCgOmZ9vAx8CvQArcAqfMApa4Xv6seG5dJ2v9m5N+NaaN WymcI0OvZLJ4tqOI46hHzQv1c2Xax32yuIxHRhGt1OZmr6dSnLx5oSaHMZGuAo3mkrM3Q8 zjyABbLaO3Fkg0NNmM58L/2ty9f0jIC7q1cKRH28MccLheqwPtrP37QNCBMqyvu0AvIoK6 uaFyVb1RUCjDy1RXOpjw5jTPdKJdeBeK3qg0LBeuniBjdb64lDtsp2PCB0hzidwGTU9J/A dvyO4dKFszjHtZGosL3w3Ed7S8oy/KyX3Dj6MUbrzsTvyXgnZrNwxOXiI+LQ1w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653198263; a=rsa-sha256; cv=none; b=bvs9switYPyiG8JQlShxp6wSqch90KN7LW8MOmcmsVJVCvvjxdpCOPYPNE3xX6VUuURsjb 50ZO5LF0t/n6PPiW6HCO/V1FA+gFvShmWMT2zeveY8hxSSoMLVZjtu1sRylw2LrtxjCPxn +JZSqCRR5RhgN6j4ED37B9qqpEfW7a2YOypgqnqxNh3XQ+/IrSnnvqN8DXrywFl58uiilF YcBTSbb5cMnkaC2UGhs3SArAgWis1m8BdJ6Ou3c080yasl6YdVKdq+kQPMu5QU0IUkKCd6 UmolOArZN9YxVLa3T+Vdn5QDRzYe2t12Qe/RYkebXPUv9voJlNFnutLQS7xg+g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by acm: URL: https://cgit.FreeBSD.org/ports/commit/?id=557ad9b56608f2aadf5df410417c49768289d968 commit 557ad9b56608f2aadf5df410417c49768289d968 Author: Jose Alonso Cardenas Marquez AuthorDate: 2022-05-22 05:16:51 +0000 Commit: Jose Alonso Cardenas Marquez CommitDate: 2022-05-22 05:42:10 +0000 security/gsad: New port: Greenbone Security Assistant HTTP server security/greenbone-security-assistant was splitted into gsa and gsad ports --- security/gsad/Makefile | 51 ++++++++++++++++++++++++++++++++ security/gsad/distinfo | 3 ++ security/gsad/files/gsad.in | 27 +++++++++++++++++ security/gsad/files/patch-CMakeLists.txt | 51 ++++++++++++++++++++++++++++++++ security/gsad/files/patch-src_gsad_gmp.c | 16 ++++++++++ security/gsad/pkg-descr | 10 +++++++ 6 files changed, 158 insertions(+) diff --git a/security/gsad/Makefile b/security/gsad/Makefile new file mode 100644 index 000000000000..66760cbac3b9 --- /dev/null +++ b/security/gsad/Makefile @@ -0,0 +1,51 @@ +PORTNAME= gsad +DISTVERSIONPREFIX= v +DISTVERSION= 21.4.4 +CATEGORIES= security + +MAINTAINER= acm@FreeBSD.org +COMMENT= Greenbone Security Assistant HTTP server + +LICENSE= AGPLv3+ + +LIB_DEPENDS= libgvm_base.so:security/gvm-libs \ + libgnutls.so:security/gnutls \ + libgcrypt.so:security/libgcrypt \ + 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 gettext-runtime gnome pkgconfig python +USE_GNOME= glib20 libxml2 + +USE_GITHUB= yes +GH_ACCOUNT= greenbone +GH_PROJECT= gsad + +USERS= gvm +GROUPS= ${USERS} + +USE_RC_SUBR= gsad + +LDFLAGS+= -lm + +ETCDIR= ${PREFIX}/etc/gvm + +post-extract: + @${MV} ${WRKSRC}/src/gsad_log_conf.cmake_in ${WRKSRC}/src/gsad_log.conf.sample + +post-patch: + ${REINPLACE_CMD} -e 's|$${GVM_LOG_DIR}|/var/log/gvm|g' ${WRKSRC}/src/gsad_log.conf.sample + +post-install: + @${MKDIR} ${STAGEDIR}/var/run/gvm + @${MKDIR} ${STAGEDIR}${ETCDIR} + @${INSTALL_DATA} ${WRKSRC}/src/gsad_log.conf.sample ${STAGEDIR}${ETCDIR} + + @${ECHO_CMD} "@sample etc/gvm/gsad_log.conf.sample" >> ${TMPPLIST} + @${ECHO_CMD} "sbin/gsad" >> ${TMPPLIST} >> ${TMPPLIST} + @${ECHO_CMD} "share/man/man8/gsad.8.gz" >> ${TMPPLIST} + @${ECHO_CMD} "@dir(gvm,gvm,750) /var/run/gsad" >> ${TMPPLIST} + +.include diff --git a/security/gsad/distinfo b/security/gsad/distinfo new file mode 100644 index 000000000000..7c66c0ba3f92 --- /dev/null +++ b/security/gsad/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1650489331 +SHA256 (greenbone-gsad-v21.4.4_GH0.tar.gz) = ea60fc00a1e8d9a2e548aba5056472a8076cd8ba26012f3e20e44e3906b02525 +SIZE (greenbone-gsad-v21.4.4_GH0.tar.gz) = 220618 diff --git a/security/gsad/files/gsad.in b/security/gsad/files/gsad.in new file mode 100644 index 000000000000..48d5b575c641 --- /dev/null +++ b/security/gsad/files/gsad.in @@ -0,0 +1,27 @@ +#!/bin/sh + +# PROVIDE: gsad +# REQUIRE: DAEMON +# KEYWORD: shutdown +# +# Add the following to /etc/rc.conf[.local] to enable this service +# +# 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/gvmd/gvmd.sock"} + +name=gsad +rcvar=${name}_enable +command="%%PREFIX%%/sbin/gsad" +command_args="${gsad_flags}" +pidfile=/var/run/gsad/gsad.pid + +run_rc_command "$1" diff --git a/security/gsad/files/patch-CMakeLists.txt b/security/gsad/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..5000d6714dd7 --- /dev/null +++ b/security/gsad/files/patch-CMakeLists.txt @@ -0,0 +1,51 @@ +--- CMakeLists.txt.orig 2022-04-20 16:19:23.710555000 -0500 ++++ CMakeLists.txt 2022-04-20 16:22:09.030744000 -0500 +@@ -61,7 +61,7 @@ + endif (CLANG_FORMAT) + + if (NOT SYSCONFDIR) +- set (SYSCONFDIR "/etc") ++ set (SYSCONFDIR "{CMAKE_INSTALL_PREFIX}/etc") + endif (NOT SYSCONFDIR) + + if (NOT EXEC_PREFIX) +@@ -96,7 +96,7 @@ + set (GSAD_CONFIG_DIR "${SYSCONFDIR}/gvm/") + + if (NOT GSAD_RUN_DIR) +- set (GSAD_RUN_DIR "/run/gsad") ++ set (GSAD_RUN_DIR "${LOCALSTATEDIR}/run/gsad") + endif (NOT GSAD_RUN_DIR) + + if (NOT GSAD_PID_PATH) +@@ -104,7 +104,7 @@ + endif (NOT GSAD_PID_PATH) + + if (NOT GVMD_RUN_DIR) +- set (GVMD_RUN_DIR "/run/gvmd") ++ set (GVMD_RUN_DIR "${LOCALSTATEDIR}/run/gvmd") + endif (NOT GVMD_RUN_DIR) + + if (NOT GSAD_PID_DIR) +@@ -143,17 +143,17 @@ + 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) + + ## Install + + install (DIRECTORY DESTINATION ${GSAD_RUN_DIR}) + +-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/src/gsad_log.conf +- DESTINATION ${GSAD_CONFIG_DIR}) ++#install (FILES ${CMAKE_CURRENT_BINARY_DIR}/src/gsad_log.conf ++# DESTINATION ${GSAD_CONFIG_DIR}) + + add_subdirectory (src) +-add_subdirectory (config) ++#add_subdirectory (config) + + add_subdirectory (doc) + diff --git a/security/gsad/files/patch-src_gsad_gmp.c b/security/gsad/files/patch-src_gsad_gmp.c new file mode 100644 index 000000000000..71780501f762 --- /dev/null +++ b/security/gsad/files/patch-src_gsad_gmp.c @@ -0,0 +1,16 @@ +--- src/gsad_gmp.c 2022-04-20 16:25:17.556260000 -0500 ++++ src/gsad_gmp.c 2022-04-20 16:27:20.232932000 -0500 +@@ -16645,8 +16645,13 @@ + /* Connect to server. */ + + address.sun_family = AF_UNIX; ++#if defined(__FreeBSD__) ++ strcpy (address.sun_path, path); ++ if (connect (sock, (struct sockaddr *) &address, sizeof (struct sockaddr_un)) == -1) ++#else + strncpy (address.sun_path, path, sizeof (address.sun_path) - 1); + if (connect (sock, (struct sockaddr *) &address, sizeof (address)) == -1) ++#endif + { + g_warning ("Failed to connect to server at %s: %s", path, + strerror (errno)); diff --git a/security/gsad/pkg-descr b/security/gsad/pkg-descr new file mode 100644 index 000000000000..7c5e8859d13d --- /dev/null +++ b/security/gsad/pkg-descr @@ -0,0 +1,10 @@ +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