1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00

security/crowdsec: update to 1.1.1

This commit is contained in:
Sofian Brabez 2021-07-14 14:07:31 +00:00
parent 22d8cccfd0
commit 337d0e23c1
5 changed files with 91 additions and 11 deletions

View File

@ -1,5 +1,5 @@
PORTNAME= crowdsec
PORTVERSION= 1.0.13
PORTVERSION= 1.1.1
DISTVERSIONPREFIX= v
CATEGORIES= security
@ -11,18 +11,35 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:modules
USE_RC_SUBR= crowdsec
GO_MODULE= github.com/crowdsecurity/crowdsec
GO_BUILDFLAGS= -ldflags "-s -w \
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=v${PORTVERSION}\
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.System=freebsd"
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.Version=v${PORTVERSION} \
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.System=freebsd \
-X github.com/crowdsecurity/crowdsec/pkg/cwversion.BuildDate=`date -u '+%Y-%m-%d_%I:%M:%S%p'`"
GO_TARGET= ./cmd/crowdsec \
./cmd/crowdsec-cli
USE_RC_SUBR= crowdsec
SUB_FILES= pkg-message
PLIST_FILES= bin/crowdsec \
bin/crowdsec-cli
post-patch:
@${REINPLACE_CMD} 's,/etc/crowdsec/,${ETCDIR}/,g' \
${WRKSRC}/pkg/csconfig/config.go \
${WRKSRC}/cmd/crowdsec-cli/machines.go \
${WRKSRC}/cmd/crowdsec-cli/main.go \
${WRKSRC}/cmd/crowdsec/main.go
do-install:
@${MKDIR} ${STAGEDIR}${ETCDIR}
@(cd ${WRKSRC}/config && ${COPYTREE_SHARE} . ${STAGEDIR}${ETCDIR})
@${MV} ${STAGEDIR}${ETCDIR}/config.yaml \
${STAGEDIR}${ETCDIR}/config.yaml.sample
${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec ${STAGEDIR}${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKDIR}/bin/crowdsec-cli ${STAGEDIR}${PREFIX}/bin
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
TIMESTAMP = 1620115762
SHA256 (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.mod) = e751afda0503bcfe8589775002b1fc1bd7271d603d56aa47d18ed5b3187e15c6
SIZE (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.mod) = 3203
SHA256 (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.zip) = 6f94f690ef87d7cfd3befe28129fd3a3014b50d81f78259d364f2ede8605a25a
SIZE (go/security_crowdsec/crowdsec-v1.0.13/v1.0.13.zip) = 41998630
TIMESTAMP = 1626257804
SHA256 (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.mod) = f764f7d850f1e2306f6764e534ace7261f7dc99f3b4884c2b0f617cb791b35de
SIZE (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.mod) = 3295
SHA256 (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.zip) = f7e63641a67392d57412ab1ff86a26ae4deeb9fc8460542f6258f7c9f56238e9
SIZE (go/security_crowdsec/crowdsec-v1.1.1/v1.1.1.zip) = 640252

View File

@ -27,11 +27,25 @@ load_rc_config $name
: ${crowdsec_flags:=""}
pidfile=/var/run/${name}.pid
required_files="$crowdsec_config"
command="%%PREFIX%%/bin/${name}"
start_cmd="${name}_start"
start_precmd="${name}_precmd"
configtest_cmd="${name}_configtest"
extra_commands="configtest reload"
crowdsec_precmd() {
if [ ! -d %%PREFIX%%/etc/crowdsec/hub ]; then
%%PREFIX%%/bin/crowdsec-cli hub update || :
fi
if [ -z "`%%PREFIX%%/bin/crowdsec-cli machines list -o raw`" ]; then
%%PREFIX%%/bin/crowdsec-cli machines add --auto || :
fi
if [ ! -s %%PREFIX%%/etc/crowdsec/online_api_credentials.yaml ]; then
%%PREFIX%%/bin/crowdsec-cli capi register || :
fi
}
crowdsec_start()
{
/usr/sbin/daemon -f -p ${pidfile} -t "${desc}" \

View File

@ -0,0 +1,13 @@
[
{ type: install
message: <<EOM
crowdsec is installed.
You need to edit the agent config file %%ETCDIR%%/crowdsec.yaml and
enable rc via sysrc.
# sysrc crowdsec_enable="YES"
EOM
}
]

View File

@ -0,0 +1,36 @@
@sample %%ETCDIR%%/config.yaml.sample
bin/crowdsec
bin/crowdsec-cli
%%ETCDIR%%/acquis.yaml
%%ETCDIR%%/crowdsec.service
%%ETCDIR%%/crowdsec_pull
%%ETCDIR%%/dev.yaml
%%ETCDIR%%/local_api_credentials.yaml
%%ETCDIR%%/online_api_credentials.yaml
%%ETCDIR%%/patterns/aws
%%ETCDIR%%/patterns/bacula
%%ETCDIR%%/patterns/bro
%%ETCDIR%%/patterns/cowrie_honeypot
%%ETCDIR%%/patterns/exim
%%ETCDIR%%/patterns/firewalls
%%ETCDIR%%/patterns/haproxy
%%ETCDIR%%/patterns/java
%%ETCDIR%%/patterns/junos
%%ETCDIR%%/patterns/linux-syslog
%%ETCDIR%%/patterns/mcollective
%%ETCDIR%%/patterns/modsecurity
%%ETCDIR%%/patterns/mongodb
%%ETCDIR%%/patterns/mysql
%%ETCDIR%%/patterns/nagios
%%ETCDIR%%/patterns/nginx
%%ETCDIR%%/patterns/paths
%%ETCDIR%%/patterns/postgresql
%%ETCDIR%%/patterns/rails
%%ETCDIR%%/patterns/redis
%%ETCDIR%%/patterns/ruby
%%ETCDIR%%/patterns/smb
%%ETCDIR%%/patterns/ssh
%%ETCDIR%%/patterns/tcpdump
%%ETCDIR%%/profiles.yaml
%%ETCDIR%%/simulation.yaml
%%ETCDIR%%/user.yaml