diff --git a/security/crowdsec/Makefile b/security/crowdsec/Makefile index 8669cf259828..14510f464b77 100644 --- a/security/crowdsec/Makefile +++ b/security/crowdsec/Makefile @@ -1,176 +1,175 @@ PORTNAME= crowdsec DISTVERSIONPREFIX= v -DISTVERSION= 1.6.5 -PORTREVISION= 4 +DISTVERSION= 1.6.8 CATEGORIES= security MAINTAINER= marco@crowdsec.net COMMENT= CrowdSec lightweight and collaborative security engine WWW= https://github.com/crowdsecurity/crowdsec LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE LIB_DEPENDS= libabsl_base.so:devel/abseil \ libre2.so:devel/re2 -USES= go:1.23,modules pkgconfig -_COMMIT= d8dcdc91 +USES= go:1.24,modules pkgconfig +_COMMIT= f209766e _BUILD_DATE= $$(date -u "+%F_%T") USE_RC_SUBR= crowdsec GO_MODULE= github.com/crowdsecurity/crowdsec GO_TARGET= ./cmd/crowdsec \ ./cmd/crowdsec-cli \ ./cmd/notification-email \ ./cmd/notification-http \ ./cmd/notification-sentinel \ ./cmd/notification-slack \ ./cmd/notification-splunk GO_BUILDFLAGS= -v -trimpath -tags netgo,osusergo,sqlite_omit_load_extension,re2_cgo \ -ldflags="\ -a -s \ -X github.com/crowdsecurity/go-cs-lib/version.Version=${DISTVERSIONPREFIX}${PKGVERSION} \ -X github.com/crowdsecurity/go-cs-lib/version.BuildDate=${_BUILD_DATE} \ -X github.com/crowdsecurity/go-cs-lib/version.Tag=${_COMMIT} \ -X ${GO_MODULE}/pkg/cwversion.Codename=alphaga \ -X ${GO_MODULE}/pkg/csconfig.defaultConfigDir=${PREFIX}/etc/crowdsec \ -X ${GO_MODULE}/pkg/csconfig.defaultDataDir=/var/db/crowdsec/data \ -X ${GO_MODULE}/pkg/cwversion.Libre2=C++" SUB_FILES= pkg-deinstall pkg-install pkg-message crowdsec.cron upgrade-hub OPTIONS_DEFINE= FIREWALL_BOUNCER OPTIONS_DEFAULT= FIREWALL_BOUNCER_DESC= Depend on security/crowdsec-firewall-bouncer FIREWALL_BOUNCER_RUN_DEPENDS= crowdsec-firewall-bouncer>=0.0.27:security/crowdsec-firewall-bouncer PLUGIN_DIR= ${PREFIX}/lib/crowdsec/plugins STAGE_PLUGINS= ${STAGEDIR}${PLUGIN_DIR} STAGE_BIN= ${STAGEDIR}${PREFIX}/bin post-patch: @${REINPLACE_CMD} 's,/etc/crowdsec/,${ETCDIR}/,g' \ ${WRKSRC}/config/config.yaml @${REINPLACE_CMD} 's,/var/lib/,/var/db/,g' \ ${WRKSRC}/config/config.yaml do-install: # # Binaries # ${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec ${STAGE_BIN}/ ${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec-cli ${STAGE_BIN}/cscli # keep this around for compatibility ${LN} -s cscli ${STAGE_BIN}/crowdsec-cli @${MKDIR} ${STAGE_PLUGINS} ${INSTALL_PROGRAM} ${WRKDIR}/bin/notification-email ${STAGE_PLUGINS}/ ${INSTALL_PROGRAM} ${WRKDIR}/bin/notification-http ${STAGE_PLUGINS}/ ${INSTALL_PROGRAM} ${WRKDIR}/bin/notification-sentinel ${STAGE_PLUGINS}/ ${INSTALL_PROGRAM} ${WRKDIR}/bin/notification-slack ${STAGE_PLUGINS}/ ${INSTALL_PROGRAM} ${WRKDIR}/bin/notification-splunk ${STAGE_PLUGINS}/ # # Configuration # @${MKDIR} ${STAGEDIR}${ETCDIR} @(cd ${WRKSRC}/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR}) @${MV} ${STAGEDIR}${ETCDIR}/acquis.yaml \ ${STAGEDIR}${ETCDIR}/acquis.yaml.sample @${MV} ${STAGEDIR}${ETCDIR}/config.yaml \ ${STAGEDIR}${ETCDIR}/config.yaml.sample @${MV} ${STAGEDIR}${ETCDIR}/console.yaml \ ${STAGEDIR}${ETCDIR}/console.yaml.sample @${MV} ${STAGEDIR}${ETCDIR}/profiles.yaml \ ${STAGEDIR}${ETCDIR}/profiles.yaml.sample # managed by "cscli simulation" @${MV} ${STAGEDIR}${ETCDIR}/simulation.yaml \ ${STAGEDIR}${ETCDIR}/simulation.yaml.sample # # Plugin configuration # @${MKDIR} ${STAGEDIR}${ETCDIR}/notifications @${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/email @${MV} ${WRKSRC}/cmd/notification-email/email.yaml \ ${STAGEDIR}${ETCDIR}/notifications/email.yaml.sample @${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/http @${MV} ${WRKSRC}/cmd/notification-http/http.yaml \ ${STAGEDIR}${ETCDIR}/notifications/http.yaml.sample @${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/sentinel @${MV} ${WRKSRC}/cmd/notification-sentinel/sentinel.yaml \ ${STAGEDIR}${ETCDIR}/notifications/sentinel.yaml.sample @${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/slack @${MV} ${WRKSRC}/cmd/notification-slack/slack.yaml \ ${STAGEDIR}${ETCDIR}/notifications/slack.yaml.sample @${MKDIR} ${STAGEDIR}${ETCDIR}/notifications/splunk @${MV} ${WRKSRC}/cmd/notification-splunk/splunk.yaml \ ${STAGEDIR}${ETCDIR}/notifications/splunk.yaml.sample # updated by "cscli machines" at first service start @${MV} ${STAGEDIR}${ETCDIR}/local_api_credentials.yaml \ ${STAGEDIR}${ETCDIR}/local_api_credentials.yaml.sample # updated by "cscli capi" at first service start @${MV} ${STAGEDIR}${ETCDIR}/online_api_credentials.yaml \ ${STAGEDIR}${ETCDIR}/online_api_credentials.yaml.sample # # Data # @${MKDIR} ${STAGEDIR}${ETCDIR}/hub @${MKDIR} ${STAGEDIR}${ETCDIR}/acquis.d @${MKDIR} ${STAGEDIR}/var/db/crowdsec/data @${MKDIR} ${STAGEDIR}/var/db/crowdsec/data/trace # # Cron # @${MKDIR} ${STAGEDIR}${PREFIX}/libexec/crowdsec ${INSTALL_DATA} ${WRKDIR}/upgrade-hub \ ${STAGEDIR}${PREFIX}/libexec/crowdsec/upgrade-hub # # Cleanup # @${RM} ${STAGEDIR}${ETCDIR}/acquis_win.yaml @${RM} ${STAGEDIR}${ETCDIR}/config_win_no_lapi.yaml @${RM} ${STAGEDIR}${ETCDIR}/config_win.yaml @${RM} ${STAGEDIR}${ETCDIR}/crowdsec.cron.daily @${RM} ${STAGEDIR}${ETCDIR}/crowdsec.service @${RM} ${STAGEDIR}${ETCDIR}/context.yaml @${RM} ${STAGEDIR}${ETCDIR}/detect.yaml @${RM} ${STAGEDIR}${ETCDIR}/dev.yaml @${RM} ${STAGEDIR}${ETCDIR}/user.yaml @${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/email @${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/http @${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/sentinel @${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/slack @${RMDIR} ${STAGEDIR}${ETCDIR}/notifications/splunk post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc/cron.d ${INSTALL_DATA} ${WRKDIR}/crowdsec.cron ${STAGEDIR}${PREFIX}/etc/cron.d/crowdsec .include diff --git a/security/crowdsec/distinfo b/security/crowdsec/distinfo index d060c226d846..75f426b46bc3 100644 --- a/security/crowdsec/distinfo +++ b/security/crowdsec/distinfo @@ -1,5 +1,5 @@ -TIMESTAMP = 1738941832 -SHA256 (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.mod) = f288295700dd0a49cd69d520167cd00826d974877450cc627f8f839850c0d617 -SIZE (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.mod) = 10932 -SHA256 (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.zip) = 1d9642ab9b6cdbc9dd8f1a1331d9d72da06f0b876b2970499e3f27443889cad5 -SIZE (go/security_crowdsec/crowdsec-v1.6.5/v1.6.5.zip) = 1669439 +TIMESTAMP = 1742918468 +SHA256 (go/security_crowdsec/crowdsec-v1.6.8/v1.6.8.mod) = fc6fecb30189e6d764fa8c14b20914d34084808f4a3b676582ee113ab1615eff +SIZE (go/security_crowdsec/crowdsec-v1.6.8/v1.6.8.mod) = 10955 +SHA256 (go/security_crowdsec/crowdsec-v1.6.8/v1.6.8.zip) = 9d61fe2253c77600884df933467be4efb5d2059e4c453b1d48f10a9c7916647c +SIZE (go/security_crowdsec/crowdsec-v1.6.8/v1.6.8.zip) = 1753101 diff --git a/security/crowdsec/files/patch-pkg_cwhub_hub.go b/security/crowdsec/files/patch-pkg_cwhub_hub.go deleted file mode 100644 index b87e90c287c8..000000000000 --- a/security/crowdsec/files/patch-pkg_cwhub_hub.go +++ /dev/null @@ -1,13 +0,0 @@ ---- pkg/cwhub/hub.go.orig 2025-02-10 13:37:25 UTC -+++ pkg/cwhub/hub.go -@@ -165,7 +165,9 @@ func (h *Hub) Update(ctx context.Context, indexProvide - } - - if !downloaded { -- fmt.Println("Nothing to do, the hub index is up to date.") -+ // use logger and the message will be silenced in the cron job -+ // (no mail if nothing happened) -+ h.logger.Info("Nothing to do, the hub index is up to date.") - } - - return nil diff --git a/security/crowdsec/files/patch-pkg_hubops_download.go b/security/crowdsec/files/patch-pkg_hubops_download.go deleted file mode 100644 index 25fc210f1959..000000000000 --- a/security/crowdsec/files/patch-pkg_hubops_download.go +++ /dev/null @@ -1,13 +0,0 @@ ---- pkg/hubops/download.go.orig 2025-02-10 13:37:39 UTC -+++ pkg/hubops/download.go -@@ -114,6 +114,10 @@ func downloadDataSet(ctx context.Context, dataFolder s - } - - for _, dataS := range data.Data { -+ if dataS.SourceURL == "" { -+ continue -+ } -+ - // XXX: check context cancellation - destPath, err := cwhub.SafePath(dataFolder, dataS.DestPath) - if err != nil { diff --git a/security/crowdsec/files/upgrade-hub.in b/security/crowdsec/files/upgrade-hub.in index b5b6fd2565c5..36b924fb4ad2 100644 --- a/security/crowdsec/files/upgrade-hub.in +++ b/security/crowdsec/files/upgrade-hub.in @@ -1,18 +1,18 @@ #!/bin/sh test -x %%PREFIX%%/bin/cscli || exit 0 # splay hub upgrade and crowdsec reload sleep "$(jot -r 1 1 300)" # favor the opnsense plugin's cron if it's there test -e /usr/local/etc/cron.d/oscrowdsec.cron && exit 0 -%%PREFIX%%/bin/cscli --error -o human hub update +%%PREFIX%%/bin/cscli --error -o human hub update >/dev/null upgraded=$(%%PREFIX%%/bin/cscli --error -o human hub upgrade) if [ -n "$upgraded" ]; then service crowdsec onestatus && service crowdsec onereload fi exit 0