wazuh-agent port from github

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,520
Messages: 27,956

#2
Try contacting the owner. He may want to get this in the ports tree but isn't finished yet.

This is an attempt to port Wazuh to the FreeBSD Ports Tree.
[/code]
 
OP
OP
R

rainer_d

Member

Thanks: 4
Messages: 97

#3
ok, I'll try.

Also, the author is actually female. I made the same mistake at first. But the github account is named "RainbowHackerHorse" for a reason (and not Stallion)....
;-)
 
OP
OP
R

rainer_d

Member

Thanks: 4
Messages: 97

#6
Doesn't make a difference.
Code:
# $FreeBSD$

PORTNAME=       wazuh
PORTVERSION=    2.1.0
DISTVERSIONPREFIX=      v
PORTREVISION?=  0
CATEGORIES=     security
USE_GITHUB=     yes
GH_ACCOUNT=     wazuh
GH_TAGNAME=     v2.1.0
PKGNAMESUFFIX=  -agent

MAINTAINER=     [email]jonathan@wazuh.com[/email]
COMMENT?=       Security tool to monitor and check logs and intrusions

CFLAGS+=        -ferror-limit=0

USES=           gmake readline
USE_OPENSSL=    yes
#USE_GCC= yes
BINARY_ALIAS= gcc=${CC}

.if defined(MAINTAINER_MODE)
UID_FILES+=     ../../UIDs
GID_FILES+=     ../../GIDs
.endif
USERS=          ossec ossecm ossecr
GROUPS=         ossec

.if !defined(CLIENT_ONLY)
OPTIONS_DEFINE= MYSQL PGSQL

USES+=          shebangfix
SHEBANG_LANG=   expect
expect_OLD_CMD= "/usr/bin/env expect"
expect_CMD=     ${LOCALBASE}/bin/expect
.endif

OPTIONS_DEFINE+=        DOCS

SUB_LIST=       PORTNAME=${PORTNAME}
SUB_FILES=      pkg-message
PLIST_SUB=      PORTNAME=${PORTNAME}
DOCSFILES=      BUGS CONFIG CONTRIBUTORS INSTALL LICENSE
PORTDOCS=       ${DOCSFILES}

#WRKSRC_SUBDIR= src
USE_GMAKE=      yes
PLIST=          ${.CURDIR}/pkg-plist

.include <bsd.port.pre.mk>

do-build:
        cd ${WRKSRC}/src && ${GMAKE} TARGET=agent PREFIX=/opt/
do-install:
        @${CP} ${WRKSRC}/etc/ossec-agent.conf* ${STAGEDIR}${PREFIX}/${PORTNAME}/etc/ossec.conf.sample   
.include <bsd.port.mk>
 

tobik@

Daemon
Developer

Thanks: 1,350
Messages: 1,909

#7
Code:
 .include <bsd.port.pre.mk>

do-build:
cd ${WRKSRC}/src && ${GMAKE} TARGET=agent PREFIX=/opt/
This is very wrong (BINARY_ALIAS can't have any effect if gmake is run like this) and my best guess is that it should be replaced by
Code:
BUILD_WRKSRC= ${WRKSRC}/src
MAKE_ARGS= TARGET=agent PREFIX=/opt/
But the whole port is a mess unfortunately :(. It also misses a pkg-plist and pkg-descr so you'll have to fix this too if you want it to build.
 
OP
OP
R

rainer_d

Member

Thanks: 4
Messages: 97

#8
Hm, yes.
I'll try to look at it over the holidays, I guess.

I'm really just a "consumer" of ports, normally. But I have a need to have the wazuh agent for FreeBSD....
 

Rainbow

New Member


Messages: 3

#9
Hey folks. RainbowHackerHorse here.
I'm aware the port is broken, but thanks for the criticism ;p
In all seriousness, it was never completed. I was working on this as a side-project at work in conjunction with some folks from the Wazuh team. Something happened to the guy I was collaborating with, and then I got busy with other things.
I'll be trying to set aside some time to actually work on this very soon, and get it up to snuff. Got a perpetually open tab with the Porter's Handbook up, and a friend of mine who's committed to core in the past planning on reviewing it with me before I submit, just to be extra safe :)
Feel free to keep checking the GitHub project for updates.
(And for the record, just as an aside, half the stuff in that Makefile makes me cringe too, and was courtesy of the guy I was working with... I plan on reverting his changes and starting back from where I got to on my own, before I try to finish this.)
 

Rainbow

New Member


Messages: 3

#10
Try contacting the owner. She may want to get this in the ports tree but isn't finished yet.
Exactly. Too many things to do, not enough time, I'm afraid. Luckily, I've been working my way through porting a piece of software I wrote, and that'll help me tackle getting Wazuh into ports as well, hopefully shortly.
 
Top