From owner-svn-ports-head@freebsd.org Thu Oct 12 11:00:51 2017 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BBDAE25998; Thu, 12 Oct 2017 11:00:51 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 524E37189D; Thu, 12 Oct 2017 11:00:51 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v9CB0ouH032093; Thu, 12 Oct 2017 11:00:50 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v9CB0oUj032087; Thu, 12 Oct 2017 11:00:50 GMT (envelope-from se@FreeBSD.org) Message-Id: <201710121100.v9CB0oUj032087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Thu, 12 Oct 2017 11:00:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r451847 - in head/security/cvechecker: . files X-SVN-Group: ports-head X-SVN-Commit-Author: se X-SVN-Commit-Paths: in head/security/cvechecker: . files X-SVN-Commit-Revision: 451847 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Oct 2017 11:00:51 -0000 Author: se Date: Thu Oct 12 11:00:49 2017 New Revision: 451847 URL: https://svnweb.freebsd.org/changeset/ports/451847 Log: Check installed packages for vulnerabilities recorded in the CVE database. Approved by: antoine (mentor) Added: head/security/cvechecker/ head/security/cvechecker/Makefile (contents, props changed) head/security/cvechecker/distinfo (contents, props changed) head/security/cvechecker/files/ head/security/cvechecker/files/patch-scripts_cverules (contents, props changed) head/security/cvechecker/pkg-deinstall (contents, props changed) head/security/cvechecker/pkg-descr (contents, props changed) head/security/cvechecker/pkg-plist (contents, props changed) Added: head/security/cvechecker/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cvechecker/Makefile Thu Oct 12 11:00:49 2017 (r451847) @@ -0,0 +1,47 @@ +# Created by: Stefan Esser +# $FreeBSD$ + +PORTNAME= cvechecker +PORTVERSION= 3.8 +CATEGORIES= security + +MAINTAINER= se@FreeBSD.org +COMMENT= Check CVE database for vulnerabilities affecting installed packages + +LICENSE= GPLv3 + +LIB_DEPENDS= libargp.so:devel/argp-standalone \ + libconfig.so:devel/libconfig +RUN_DEPENDS= bash:shells/bash + +MAKE_ENV+= LDADD=-largp + +USES= autoreconf pkgconfig shebangfix + +SHEBANG_FILES= scripts/cverules scripts/cvegenversdat + +GNU_CONFIGURE= yes +CONFIGURE_ARGS= --localstatedir=/var/db + +bash_OLD_CMD+= /bin/sh + +OPTIONS_MULTI= DB +OPTIONS_MULTI_DB= MYSQL SQLITE +OPTIONS_DEFAULT= SQLITE +DB_DESC= CVE Database + +MYSQL_USES= mysql ssl +MYSQL_CONFIGURE_ENABLE= mysql + +SQLITE_USES= sqlite +SQLITE_CONFIGURE_ENABLE= sqlite3 + +USE_GITHUB= yes +GH_ACCOUNT= sjvermeu +GH_PROJECT= cvechecker +GH_TAGNAME= v${PORTVERSION} + +post-stage: + ${MV} ${STAGEDIR}${PREFIX}/etc/cvechecker.conf ${STAGEDIR}${PREFIX}/etc/cvechecker.conf.sample + +.include Added: head/security/cvechecker/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cvechecker/distinfo Thu Oct 12 11:00:49 2017 (r451847) @@ -0,0 +1,3 @@ +TIMESTAMP = 1507628153 +SHA256 (sjvermeu-cvechecker-3.8-v3.8_GH0.tar.gz) = 53a2f0edab34ea75d3d33b8c840f27c60464f0433c2b82bc8b02298306c53268 +SIZE (sjvermeu-cvechecker-3.8-v3.8_GH0.tar.gz) = 3329220 Added: head/security/cvechecker/files/patch-scripts_cverules ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cvechecker/files/patch-scripts_cverules Thu Oct 12 11:00:49 2017 (r451847) @@ -0,0 +1,37 @@ +--- scripts/cverules.orig 2017-10-11 10:44:44 UTC ++++ scripts/cverules +@@ -19,26 +19,11 @@ then + fi + + +-if [ -f /etc/gentoo-release ]; +-then +- cd /var/db/pkg; +- for CAT in *; +- do +- cd ${CAT}; +- for PKG in *; +- do +- echo "!!!! Checking ${PKG}"; +- typeset PKGNAME=$(echo ${PKG} | sed -e 's:\(.*\)-[0-9][0-9]*.*:\1:g'); +- typeset PKGVERSION=$(echo ${PKG} | sed -e 's:.*-\([0-9][0-9]*.*\):\1:g' | sed -e 's:-r[0-9]*$::g' | sed -e 's:\.:\\.:g'); +- export IGNORESTRINGS="tmp/portage"; +- qlist ${PKG} | egrep '(bin/|\.so)' | cvegenversdat ${PKGNAME} ${PKGVERSION} ${CONFFILE} breakon; +- done +- cd .. +- done +-else +- echo "Could not deduce if this system is a supported distribution or platform."; +- echo "Currently supported platforms are: Gentoo." +- echo "If you wish to help expand the supported distributions or platforms, please"; +- echo "do not hesitate to contact the author at sven.vermeulen@siphos.be."; +- exit 1; +-fi ++for PKG in $(pkg info -q) ++do ++ echo "!!!! Checking ${PKG}" ++ set -- $(echo ${PKG} | sed -e 's:,[0-9][0-9]*$::; s:_[0-9][0-9]*$::; s:\(.*\)-r\{0,1\}\([0-9][0-9]*.*\):\1 \2:; s:\.:\\.:g') ++ PKGNAME=$1 ++ PKGVERSION=$2 ++ pkg list ${PKG} | egrep '(/bin/|/sbin/|/libexec/|\.so\.|\.so$)' | cvegenversdat ${PKGNAME} ${PKGVERSION} ${CONFFILE} breakon ++done Added: head/security/cvechecker/pkg-deinstall ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cvechecker/pkg-deinstall Thu Oct 12 11:00:49 2017 (r451847) @@ -0,0 +1,13 @@ +#!/bin/sh + +[ "$2" = DEINSTALL ] && cat <<***EOM +------------------------------------------------------------------------------ + +If you are no longer using the $1 port, then manually delete +the following directory: + + /var/db/cvechecker + +------------------------------------------------------------------------------ +***EOM +exit 0 Added: head/security/cvechecker/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cvechecker/pkg-descr Thu Oct 12 11:00:49 2017 (r451847) @@ -0,0 +1,11 @@ +------------------------------------------------------------------------------ +The goal of cvechecker is to report about possible vulnerabilities on your +system, by scanning a list of installed software and matching results with +the CVE database. + +This is not a bullet-proof method and you may have many false positives (ie: +vulnerability is fixed with a revision-release, but the tool isn't able to +detect the revision itself), yet it is still better than nothing, especially +if you are running a distribution with little security coverage. + +WWW: https://github.com/sjvermeu/cvechecker/wiki Added: head/security/cvechecker/pkg-plist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/cvechecker/pkg-plist Thu Oct 12 11:00:49 2017 (r451847) @@ -0,0 +1,21 @@ +bin/cvechecker +bin/cvegenversdat +bin/cvereport +bin/cverules +bin/pullcves +@sample %%ETCDIR%%.conf.sample +man/man1/cvechecker.1.gz +man/man1/cvegenversdat.1.gz +man/man1/cvereport.1.gz +man/man1/cverules.1.gz +man/man1/pullcves.1.gz +%%DATADIR%%/csv2xml.awk +%%DATADIR%%/cvereport.xsl +%%DATADIR%%/mysql_cvechecker.sql +%%DATADIR%%/nvdcve2simple.xsl +%%DATADIR%%/report.css +%%PORTDOCS%%%%DOCSDIR%%/acknowledgements.xml +%%PORTDOCS%%%%DOCSDIR%%/userguide.xml +@dir /var/db/cvechecker/cache +@dir /var/db/cvechecker/local +@dir /var/db/cvechecker