From nobody Sat Feb 24 23:37:53 2024 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 4Tj3GB1LTBz5Bqfh; Sat, 24 Feb 2024 23:37:54 +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 4Tj3GB0T2Fz4kMV; Sat, 24 Feb 2024 23:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708817874; 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=T4kr8mgxvmJQIg590DTmjqHKxyiNQLn02+/W7ZnHKwA=; b=AEn42trjo1SuMJXZAZ8z7roMFrN/gxJQ0k1CnKMG2gs5qkbXCQOldlsoGZV3qtlY9UbO4l UqOCnO85DRj0+QoBK2EZW1lsLqzRBZan7kq8ym9hhZz50X5D2TJEH3WhSUk14pFSdoUMb2 MJIGlhfbFxoxOr2hl/e/Il54NMwHAMQOa/f/XRUGk78mWy8WrEtnPFS93j6jhG12aTAK3o YTHQhG4Hgm0WkYFX7W6/EEtZT9bJNROz8ovCFGoLjBm+Nn2Oa0BXDYBLWwfhQ7e3ZxJ6K4 r8oNqr+v0XulbYXq4e4lAKg4ge+mDZUcw9e8adCn4P4gWKH1Z0vb5mFMV/J4Og== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708817874; a=rsa-sha256; cv=none; b=nNHd7Ob5MZ9UVBPfaW7CGFE40RbcF9PtA9Fs765+dB3Ou56MdKCthZnJT5zC0Ej8ElpbuX tlxII36OJupK1h9gj2YYQPos3S1J29gcAF9h8UWx4MNx8yST81BCPu8DoZrWg2lq+Gb2Di xhoypGz0RiGCEL+ITFVwAqk6qfCQH3qc1K3sYTsJGJRCaOW+xSPY0m8TLBegMfzhhzQyhE YaZ6JGqgv+1wVIznGqCE5ZV4RNEY447xeZgCWTzXidZkzu7LT630J0cAwd9MN9V4LgLSK0 zZswXpj6mzHdTegFrmnu04KkKInEmPgf6x1pnYLVBGpL+DfxrcgmUpHyiFyreg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708817874; 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=T4kr8mgxvmJQIg590DTmjqHKxyiNQLn02+/W7ZnHKwA=; b=eibAD3+Z3lbdVwcYXduvFfXkipBJZ4f59+7bOfv5Vml+O4QSHdkWTAtewmI1gRHP77sLsn 602dkAcL1U/+I1+Gt97gHrve5IT6M6bxDEYSonaSJCzXka91bAexlP9kgeq9oRmd0Gtros ktiTNwf2Z7z7MJaO12Zy+w5juGv9CxOvpDetOLchvR8VQqRZh6ijGrZYw+lwnlcj2a7zRv zrqVX6NUAB5htNaSb3SfJMGKrKJ1q/gU+k/UYzLhgQ0cHfud5g/a49Kux9tKl8qJ+0ZIAz 8QPZTVrKOoDG5Vt/rAh5P12SK9gMzb5Y52J6mVWgx28CugyzRZkHATE88qAtBA== 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 4Tj3G96cmkzL8D; Sat, 24 Feb 2024 23:37:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41ONbrP4046629; Sat, 24 Feb 2024 23:37:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41ONbrIv046626; Sat, 24 Feb 2024 23:37:53 GMT (envelope-from git) Date: Sat, 24 Feb 2024 23:37:53 GMT Message-Id: <202402242337.41ONbrIv046626@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Palle Girgensohn Subject: git: 952fa7cc8e66 - main - security/vulsrepo: new port 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: girgen X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 952fa7cc8e66f3160ea8ec408a4e98d78720ffdf Auto-Submitted: auto-generated The branch main has been updated by girgen: URL: https://cgit.FreeBSD.org/ports/commit/?id=952fa7cc8e66f3160ea8ec408a4e98d78720ffdf commit 952fa7cc8e66f3160ea8ec408a4e98d78720ffdf Author: Palle Girgensohn AuthorDate: 2024-02-22 00:39:25 +0000 Commit: Palle Girgensohn CommitDate: 2024-02-24 23:37:45 +0000 security/vulsrepo: new port vulsrepo runs a small custom web server presenting a web gui for the vulnerabilty reports created by security/vuls. --- security/Makefile | 1 + security/vulsrepo/Makefile | 47 ++++++ security/vulsrepo/distinfo | 5 + security/vulsrepo/files/newsyslog-vulsrepo.conf | 6 + security/vulsrepo/files/patch-main.go | 12 ++ security/vulsrepo/files/pkg-message.in | 17 ++ security/vulsrepo/files/vulsrepo-config.toml.in | 12 ++ security/vulsrepo/files/vulsrepo.in | 52 +++++++ security/vulsrepo/pkg-descr | 2 + security/vulsrepo/pkg-message | 7 + security/vulsrepo/pkg-plist | 199 ++++++++++++++++++++++++ 11 files changed, 360 insertions(+) diff --git a/security/Makefile b/security/Makefile index 33e6b3715b06..c0405584553f 100644 --- a/security/Makefile +++ b/security/Makefile @@ -1354,6 +1354,7 @@ SUBDIR += vouch-proxy SUBDIR += vpnc SUBDIR += vuls + SUBDIR += vulsrepo SUBDIR += vuxml SUBDIR += vxquery SUBDIR += wapiti diff --git a/security/vulsrepo/Makefile b/security/vulsrepo/Makefile new file mode 100644 index 000000000000..bceccd252e95 --- /dev/null +++ b/security/vulsrepo/Makefile @@ -0,0 +1,47 @@ +PORTNAME= vulsrepo +PORTVERSION= 0.7.1 +DISTVERSIONPREFIX=v +CATEGORIES= security www +MASTER_SITES= https://raw.githubusercontent.com/${GH_ACCOUNT}/${PORTNAME}/v${PORTVERSION}/server/:gomod +DISTFILES= go.mod:gomod + +MAINTAINER= girgen@FreeBSD.org +COMMENT= Web presentation layer for vuls CVE scanner +WWW= https://github.com/ishiDACo/vulsrepo/ + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/../LICENSE.txt + +RUN_DEPENDS= vuls:security/vuls + +USES= go:modules tar:xz +USE_GITHUB= yes +GH_ACCOUNT= ishiDACo +GH_PROJECT= vulsrepo + +GO_MODULE= github.com/ishiDACo/vulsrepo/server +WRKSRC_SUBDIR= server + +USE_RC_SUBR= ${PORTNAME} + +SUB_FILES= pkg-message vulsrepo-config.toml +SUB_LIST= PORTNAME=${PORTNAME} USERS=${USERS} GROUPS=${GROUPS} + +USERS= vuls +GROUPS= vuls + +post-patch: + ${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/main.go + +post-install: + ${MKDIR} ${STAGEDIR}${WWWDIR} \ + ${STAGEDIR}/var/db/vuls/results \ + ${STAGEDIR}/var/log/vuls + ${INSTALL_DATA} ${FILESDIR}/newsyslog-${PORTNAME}.conf \ + ${STAGEDIR}${PREFIX}/etc/newsyslog.conf.d/${PORTNAME}.conf.sample + ${INSTALL_DATA} ${WRKDIR}/${PORTNAME}-config.toml \ + ${STAGEDIR}${PREFIX}/etc/${PORTNAME}-config.toml.sample + cd ${WRKSRC}/..; ${PAX} -rw dist gallery index.html plugins \ + ${STAGEDIR}${WWWDIR} + +.include diff --git a/security/vulsrepo/distinfo b/security/vulsrepo/distinfo new file mode 100644 index 000000000000..651252b75a22 --- /dev/null +++ b/security/vulsrepo/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1708504074 +SHA256 (go/security_vulsrepo/ishiDACo-vulsrepo-v0.7.1_GH0/go.mod) = 9edbb81a8563d5e37ec776fb3ae0fbab4b744b3f4943bcff15098acce3b1edb6 +SIZE (go/security_vulsrepo/ishiDACo-vulsrepo-v0.7.1_GH0/go.mod) = 247 +SHA256 (go/security_vulsrepo/ishiDACo-vulsrepo-v0.7.1_GH0/ishiDACo-vulsrepo-v0.7.1_GH0.tar.gz) = dc027c95fb35ba0cc7a02abf939109deafa7c6b20d7112900f8849ccec4b53ad +SIZE (go/security_vulsrepo/ishiDACo-vulsrepo-v0.7.1_GH0/ishiDACo-vulsrepo-v0.7.1_GH0.tar.gz) = 15285568 diff --git a/security/vulsrepo/files/newsyslog-vulsrepo.conf b/security/vulsrepo/files/newsyslog-vulsrepo.conf new file mode 100644 index 000000000000..8609c3a6ef0d --- /dev/null +++ b/security/vulsrepo/files/newsyslog-vulsrepo.conf @@ -0,0 +1,6 @@ +# configuration file for newsyslog for sqlpage +# +# see newsyslog.conf(5) for details +# +# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] +/var/log/vuls/vulsrepo.log vuls:vuls 640 7 100 * J /var/run/vulsrepo_daemon.pid diff --git a/security/vulsrepo/files/patch-main.go b/security/vulsrepo/files/patch-main.go new file mode 100644 index 000000000000..dcedd2ad513a --- /dev/null +++ b/security/vulsrepo/files/patch-main.go @@ -0,0 +1,12 @@ +--- main.go.orig 2021-12-20 04:40:08 UTC ++++ main.go +@@ -134,8 +134,7 @@ func loadConfig() { + } + + func loadConfig() { +- fpath, _ := (os.Executable()) +- _, err := toml.DecodeFile(filepath.Dir(fpath)+"/vulsrepo-config.toml", &config) ++ _, err := toml.DecodeFile("%%PREFIX%%/etc/vulsrepo-config.toml", &config) + if err != nil { + _, err := toml.DecodeFile("./vulsrepo-config.toml", &config) + if err != nil { diff --git a/security/vulsrepo/files/pkg-message.in b/security/vulsrepo/files/pkg-message.in new file mode 100644 index 000000000000..9a6370f5291c --- /dev/null +++ b/security/vulsrepo/files/pkg-message.in @@ -0,0 +1,17 @@ +[ +{ type: install + message: <