View | Details | Raw Unified | Return to bug 226465 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-83 / +420 lines)
Lines 1-44 Link Here
1
# Created by: Valerio Daelli <valerio.daelli@gmail.com>
2
# $FreeBSD$
1
# $FreeBSD$
3
2
4
PORTNAME=	ossec-hids
3
PORTNAME=	ossec-hids
5
PORTVERSION=	2.8.3
4
PORTVERSION=	2.9.3
6
DISTVERSIONPREFIX=	v
5
PORTREVISION?=
7
PORTREVISION?=	3
8
CATEGORIES=	security
6
CATEGORIES=	security
9
PKGNAMESUFFIX=	-server
7
PKGNAMESUFFIX?=	-server
10
8
11
MAINTAINER=	dominik.lisiak@bemsoft.pl
9
MAINTAINER?=	dominik.lisiak@bemsoft.pl
12
COMMENT?=	Security tool to monitor and check logs and intrusions
10
COMMENT?=	Security tool to monitor and check logs and intrusions
13
11
14
USE_GITHUB=	yes
12
LICENSE?=	GPLv2
15
GH_ACCOUNT=	ossec
13
LICENSE_FILE?=	${WRKSRC}/LICENSE
16
USE_RC_SUBR=	ossec-hids
17
14
18
CFLAGS+=	-ferror-limit=0
15
.if !defined(AGENT_ONLY)
19
16
RUN_DEPENDS=	expect:lang/expect
20
USES=		readline ssl
21
22
.if defined(MAINTAINER_MODE)
23
UID_FILES+=	../../UIDs
24
GID_FILES+=	../../GIDs
25
.endif
17
.endif
26
USERS=		ossec ossecm ossecr
27
GROUPS=		ossec
28
18
29
.if !defined(CLIENT_ONLY)
19
GEOIP_LIB_DEPENDS=	libGeoIP.so:net/GeoIP
30
OPTIONS_DEFINE=	MYSQL PGSQL
20
INOTIFY_LIB_DEPENDS=	libinotify.so:devel/libinotify
21
PRELUDE_LIB_DEPENDS=	libprelude.so:security/libprelude
22
ZEROMQ_LIB_DEPENDS=	libczmq.so:net/czmq
31
23
32
MYSQL_VARS=	WITH_DB=yes
24
USES=		gmake readline ssl
33
MYSQL_USE=	MYSQL=client
25
MYSQL_USE=	mysql
34
MYSQL_PORTDOCS=	mysql.schema
35
36
PGSQL_VARS=	WITH_DB=yes
37
PGSQL_USES=	pgsql
26
PGSQL_USES=	pgsql
38
PGSQL_PORTDOCS=	postgresql.schema
39
27
40
RUN_DEPENDS=	expect:lang/expect
28
USE_GITHUB=	yes
29
GH_ACCOUNT=	ossec
30
USE_RC_SUBR=	ossec-hids
41
31
32
.if !defined(AGENT_ONLY)
42
USES+=		shebangfix
33
USES+=		shebangfix
43
SHEBANG_LANG=	expect
34
SHEBANG_LANG=	expect
44
expect_OLD_CMD=	"/usr/bin/env expect"
35
expect_OLD_CMD=	"/usr/bin/env expect"
Lines 55-136 Link Here
55
		src/agentlessd/scripts/sshlogin.exp \
46
		src/agentlessd/scripts/sshlogin.exp \
56
		src/agentlessd/scripts/su.exp
47
		src/agentlessd/scripts/su.exp
57
.endif
48
.endif
58
OPTIONS_DEFINE+=	DOCS
59
49
60
SUB_LIST=	PORTNAME=${PORTNAME}
50
OPTIONS_SUB=			yes
61
SUB_FILES=	pkg-message
51
OPTIONS_DEFINE+=		DOCS INOTIFY
52
53
.if !defined(AGENT_ONLY)
54
OPTIONS_DEFINE+=		GEOIP PRELUDE ZEROMQ
55
56
OPTIONS_RADIO=			DATABASE
57
OPTIONS_RADIO_DATABASE=		MYSQL PGSQL
58
.endif
59
60
.if !defined(AGENT_ONLY)
61
OPTIONS_GROUP+=			G_RULES G_AR
62
OPTIONS_GROUP_G_RULES=		DEFAULT_R CONFIG_R FIREWALL_R PORTS_R
63
OPTIONS_GROUP_G_AR=		DEFAULT_C MERGE_C MERGE_AR RESTART_AR
64
.endif
65
OPTIONS_GROUP+=			G_CHECKS G_CMDS G_LOGS
66
OPTIONS_GROUP_G_CHECKS=		ROOTCHECK SYSCHECK
67
OPTIONS_GROUP_G_CMDS=		LOGINS PORTS_TCP PORTS_UDP
68
OPTIONS_GROUP_G_LOGS=		BASELOGS ARLOG
69
70
.if !defined(AGENT_ONLY) && !defined(LOCAL_ONLY)
71
OPTIONS_GROUP+=			G_CHECKS_P G_LOGS_P
72
OPTIONS_GROUP_G_CHECKS_P=	ROOTCHECK_P SYSCHECK_P
73
OPTIONS_GROUP_G_LOGS_P=		BASELOGS_P ARLOG_P
74
.endif
75
76
.if !defined(AGENT_ONLY)
77
OPTIONS_SINGLE=			FIREWALL
78
OPTIONS_SINGLE_FIREWALL=	PF IPFW IPF
79
.endif
80
81
OPTIONS_DEFAULT+=		INOTIFY LOGINS PORTS_TCP PORTS_UDP
82
.if !defined(AGENT_ONLY)
83
OPTIONS_DEFAULT+=		IPF DEFAULT_R CONFIG_R FIREWALL_R PORTS_R DEFAULT_C MERGE_C MERGE_AR RESTART_AR ROOTCHECK SYSCHECK BASELOGS ARLOG
84
.if !defined(LOCAL_ONLY)
85
OPTIONS_DEFAULT+=		ROOTCHECK_P SYSCHECK_P BASELOGS_P ARLOG_P
86
.endif
87
.endif
88
89
DIST_CONF_DESC=		(ossec-dist.conf)
90
AGENT_DIST_CONF_DESC=	(agent-dist.conf)
91
92
INOTIFY_DESC=		Kevent based real time monitoring
93
PRELUDE_DESC=		Sensor support from Prelude SIEM
94
ZEROMQ_DESC=		ZeroMQ support (experimental)
95
96
G_RULES_DESC=		Rules ${DIST_CONF_DESC}
97
DEFAULT_R_DESC=		Rules provided by OSSEC
98
CONFIG_R_DESC=		Alert OSSEC main configuration files changes
99
FIREWALL_R_DESC=	Alert firewall active resonse (PF and IPFW)
100
PORTS_R_DESC=		Alert open TCP and UDP ports
101
G_AR_DESC=		Active response ${DIST_CONF_DESC}
102
DEFAULT_C_DESC=		Commands provided by OSSEC
103
MERGE_C_DESC=		Merge "dist" and "local" configs command
104
MERGE_AR_DESC=		Merge "dist" and "local" configs when they change
105
RESTART_AR_DESC=	Restart OSSEC when main configuration files change
106
G_CHECKS_DESC=		System checks ${DIST_CONF_DESC}
107
ROOTCHECK_DESC=		System audit and rootkit detection
108
SYSCHECK_DESC=		Integrity checking
109
G_CMDS_DESC=		Command monitoring ${DIST_CONF_DESC}
110
LOGINS_DESC=		Last logins
111
PORTS_TCP_DESC=		Listening TCP ports
112
PORTS_UDP_DESC=		Open UDP ports
113
G_LOGS_DESC=		Log monitoring ${DIST_CONF_DESC}
114
BASELOGS_DESC=		Base logs (messages, maillog, ...)
115
ARLOG_DESC=		Active response log
116
117
G_CHECKS_P_DESC=	Pushed system checks ${AGENT_DIST_CONF_DESC}
118
ROOTCHECK_P_DESC=	${ROOTCHECK_DESC} (profile: rootcheck)
119
SYSCHECK_P_DESC=	${SYSCHECK_DESC} (profile: syscheck)
120
G_LOGS_P_DESC=		Pushed log monitoring ${AGENT_DIST_CONF_DESC}
121
BASELOGS_P_DESC=	${BASELOGS_DESC} (profile: baselogs)
122
ARLOG_P_DESC=		${ARLOG_DESC} (profile: arlog)
123
124
FIREWALL_DESC=		Active response firewall ${DIST_CONF_DESC}
125
PF_DESC=		Packet Filter
126
IPFW_DESC=		ipfirewall
127
IPF_DESC=		ipfilter, iptables
128
129
DATABASE_DESC=		Database output
130
131
PKGMSG_FILES=		message-header
132
133
TEMPL_HEADER=		template-header.xml
134
TEMPL_SAMPLE_HEADER=	template-sample-header.xml
135
TEMPL_P_HEADER=		template-pushed-header.xml
136
137
TEMPL_DEFAULT_R=	template-rules-default.xml
138
TEMPL_CONFIG_R=		template-rules-config.xml
139
TEMPL_FIREWALL_R=	template-rules-firewall.xml
140
TEMPL_PORTS_R=		template-rules-ports.xml
141
TEMPL_DEFAULT_C=	template-ar-cmds-default.xml
142
TEMPL_MERGE_C=		template-ar-cmds-merge.xml
143
TEMPL_MERGE_AR=		template-ar-merge.xml
144
TEMPL_RESTART_AR=	template-ar-restart.xml
145
TEMPL_ROOTCHECK=	template-rootcheck.xml
146
TEMPL_SYSCHECK=		template-syscheck.xml
147
TEMPL_LOGINS=		template-cmds-logins.xml
148
TEMPL_PORTS_TCP=	template-cmds-ports-tcp.xml
149
TEMPL_PORTS_UDP=	template-cmds-ports-udp.xml
150
TEMPL_BASELOGS=		template-baselogs.xml
151
TEMPL_ARLOG=		template-arlog.xml
152
TEMPL_SAMPLE=		template-sample${PKGNAMESUFFIX}.xml
153
TEMPL_P_SAMPLE=		template-pushed-sample.xml
154
155
GEOIP_VARS=	OSSEC_ARGS+=USE_GEOIP=yes
156
INOTIFY_VARS=	OSSEC_ARGS+=USE_INOTIFY=yes
157
PRELUDE_VARS=	OSSEC_ARGS+=USE_PRELUDE=yes
158
ZEROMQ_VARS=	OSSEC_ARGS+=USE_ZEROMQ=yes
159
MYSQL_VARS=	OSSEC_ARGS+=DATABASE=mysql PKGMSG_FILES+=message-db DB_TYPE=mysql DB_SCHEMA=mysql.schema
160
PGSQL_VARS=	OSSEC_ARGS+=DATABASE=pgsql PKGMSG_FILES+=message-db DB_TYPE=postgresql DB_SCHEMA=postgresql.schema
161
162
DEFAULT_R_VARS=		TEMPL_FILES+=${TEMPL_DEFAULT_R}
163
CONFIG_R_VARS=		TEMPL_FILES+=${TEMPL_CONFIG_R}
164
FIREWALL_R_VARS=	TEMPL_FILES+=${TEMPL_FIREWALL_R}
165
PORTS_R_VARS=		TEMPL_FILES+=${TEMPL_PORTS_R}
166
DEFAULT_C_VARS=		TEMPL_FILES+=${TEMPL_DEFAULT_C}
167
MERGE_C_VARS=		TEMPL_FILES+=${TEMPL_MERGE_C}
168
MERGE_AR_VARS=		TEMPL_FILES+=${TEMPL_MERGE_AR}
169
RESTART_AR_VARS=	TEMPL_FILES+=${TEMPL_RESTART_AR}
170
ROOTCHECK_VARS=		TEMPL_FILES+=${TEMPL_ROOTCHECK}
171
SYSCHECK_VARS=		TEMPL_FILES+=${TEMPL_SYSCHECK}
172
LOGINS_VARS=		TEMPL_FILES+=${TEMPL_LOGINS}
173
PORTS_TCP_VARS=		TEMPL_FILES+=${TEMPL_PORTS_TCP}
174
PORTS_UDP_VARS=		TEMPL_FILES+=${TEMPL_PORTS_UDP}
175
BASELOGS_VARS=		TEMPL_FILES+=${TEMPL_BASELOGS}
176
ARLOG_VARS=		TEMPL_FILES+=${TEMPL_ARLOG}
177
178
DEFAULT_R_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_DEFAULT_R}
179
CONFIG_R_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_CONFIG_R}
180
FIREWALL_R_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_FIREWALL_R}
181
PORTS_R_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_PORTS_R}
182
DEFAULT_C_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_DEFAULT_C}
183
MERGE_C_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_MERGE_C}
184
MERGE_AR_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_MERGE_AR}
185
RESTART_AR_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_RESTART_AR}
186
ROOTCHECK_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_ROOTCHECK}
187
SYSCHECK_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_SYSCHECK}
188
LOGINS_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_LOGINS}
189
PORTS_TCP_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_PORTS_TCP}
190
PORTS_UDP_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_PORTS_UDP}
191
BASELOGS_VARS_OFF=	TEMPL_SAMPLE_FILES+=${TEMPL_BASELOGS}
192
ARLOG_VARS_OFF=		TEMPL_SAMPLE_FILES+=${TEMPL_ARLOG}
193
194
ROOTCHECK_P_VARS=	TEMPL_P_FILES+=${TEMPL_ROOTCHECK}
195
SYSCHECK_P_VARS=	TEMPL_P_FILES+=${TEMPL_SYSCHECK}
196
BASELOGS_P_VARS=	TEMPL_P_FILES+=${TEMPL_BASELOGS}
197
ARLOG_P_VARS=		TEMPL_P_FILES+=${TEMPL_ARLOG}
198
199
ROOTCHECK_PROFILE=	rootcheck
200
SYSCHECK_PROFILE=	syscheck
201
BASELOGS_PROFILE=	baselogs
202
ARLOG_PROFILE=		arlog
203
CLIENT_PROFILES:=	${ROOTCHECK_PROFILE}, ${SYSCHECK_PROFILE}, ${BASELOGS_PROFILE}, ${ARLOG_PROFILE}
204
205
SUB_LIST+=	ROOTCHECK_PROFILE=${ROOTCHECK_PROFILE} \
206
		SYSCHECK_PROFILE=${SYSCHECK_PROFILE} \
207
		BASELOGS_PROFILE=${BASELOGS_PROFILE} \
208
		ARLOG_PROFILE=${ARLOG_PROFILE} \
209
		CLIENT_PROFILES="${CLIENT_PROFILES}"
210
211
PF_VARS=	FW_DROP=pf.sh PKGMSG_FILES+=message-pf
212
IPFW_VARS=	FW_DROP=ipfw.sh
213
IPF_VARS=	FW_DROP=firewall-drop.sh
214
215
OSSEC_TYPE?=	server
216
PKGHELP=	${PKGDIR}/pkg-help${PKGNAMESUFFIX}
217
OSSEC_ARGS+=	TARGET=${OSSEC_TYPE}
218
CONFLICTS_INSTALL?=	ossec-hids-client-[0-9]* ossec-hids-agent-[0-9]* ossec-hids-local-[0-9]*
219
STRIP_FILES?=	agent_control \
220
		clear_stats \
221
		list_agents \
222
		manage_agents \
223
		ossec-agentlessd \
224
		ossec-analysisd \
225
		ossec-authd \
226
		ossec-csyslogd \
227
		ossec-dbd \
228
		ossec-execd \
229
		ossec-logcollector \
230
		ossec-logtest \
231
		ossec-lua \
232
		ossec-luac \
233
		ossec-maild \
234
		ossec-makelists \
235
		ossec-monitord \
236
		ossec-regex \
237
		ossec-remoted \
238
		ossec-reportd \
239
		ossec-syscheckd \
240
		rootcheck_control \
241
		syscheck_control \
242
		syscheck_update \
243
		verify-agent-conf
244
TEMPL_TO_OSSEC=		${SCRIPTDIR}/template-to-ossec.sh ${OSSEC_TYPE} ${PREFIX}/${PORTNAME}
245
TEMPL_TO_OSSEC_P=	${SCRIPTDIR}/template-to-agent.sh ${OSSEC_TYPE} ${PREFIX}/${PORTNAME}
246
OSSEC_RC=		${PREFIX}/etc/rc.d/ossec-hids
247
OSSEC_OSSEC_CONF=	${PREFIX}/${PORTNAME}/bin/ossec_conf
248
OSSEC_AGENT_CONF=	${PREFIX}/${PORTNAME}/bin/agent_conf
249
OSSEC_MERGE_CONFIG=	${PREFIX}/${PORTNAME}/active-response/bin/merge-configs.sh
250
OSSEC_RESTART_OSSEC=	${PREFIX}/${PORTNAME}/active-response/bin/restart-ossec.sh
251
OSSEC_TMP=		${PREFIX}/${PORTNAME}/tmp
252
OSSEC_SHARED=		${PREFIX}/${PORTNAME}/etc/shared
253
OSSEC_CONF=		${PREFIX}/${PORTNAME}/etc/ossec.conf
254
OSSEC_DIST_CONF=	${PREFIX}/${PORTNAME}/etc/ossec-dist.conf
255
OSSEC_LOCAL_CONF=	${PREFIX}/${PORTNAME}/etc/ossec-local.conf.sample
256
OSSEC_P_CONF=		${PREFIX}/${PORTNAME}/etc/shared/agent.conf
257
OSSEC_P_DIST_CONF=	${PREFIX}/${PORTNAME}/etc/agent-dist.conf
258
OSSEC_P_LOCAL_CONF=	${PREFIX}/${PORTNAME}/etc/agent-local.conf.sample
259
OSSEC_RULES_DIR=	${PREFIX}/${PORTNAME}/rules
260
OSSEC_RULES_FILES=	config firewall ports
261
262
.if !defined(MAINTAINER_MODE)
263
USER_ARGS+=	OSSEC_GROUP=${GROUP} \
264
		OSSEC_USER=${USER} \
265
		OSSEC_USER_MAIL=${USER} \
266
		OSSEC_USER_REM=${USER}
267
.endif
268
OSSEC_USER=	ossec
269
OSSEC_GROUP=	ossec
270
USERS=		${OSSEC_USER} ossecm ossecr
271
GROUPS=		${OSSEC_GROUP}
272
273
SUB_LIST+=	PORTNAME=${PORTNAME} \
274
		OSSEC_TYPE=${OSSEC_TYPE} \
275
		VERSION=${PORTVERSION} \
276
		DB_TYPE=${DB_TYPE} \
277
		DB_SCHEMA=${DOCSDIR}/${DB_SCHEMA} \
278
		FW_DROP=${FW_DROP} \
279
		USER=${USER} \
280
		OSSEC_USER=${OSSEC_USER} \
281
		OSSEC_GROUP=${OSSEC_GROUP} \
282
		OSSEC_RC=${OSSEC_RC}
283
SUB_FILES=	${PKGMSG_FILES} \
284
		${TEMPL_HEADER} \
285
		${TEMPL_FILES} \
286
		${TEMPL_SAMPLE_HEADER} \
287
		${TEMPL_SAMPLE_FILES} \
288
		${TEMPL_P_HEADER} \
289
		${TEMPL_P_SAMPLE} \
290
		merge-config.sh \
291
		restart-ossec.sh \
292
		ossec-conf
293
.if !defined(AGENT_ONLY) && !defined(LOCAL_ONLY)
294
SUB_FILES+=	agent-conf
295
.endif
296
.for file in ${OSSEC_RULES_FILES}
297
SUB_FILES+=	rule-${file}.xml
298
.endfor
299
300
PLIST=		${PKGDIR}/pkg-plist${PKGNAMESUFFIX}
62
PLIST_SUB=	PORTNAME=${PORTNAME}
301
PLIST_SUB=	PORTNAME=${PORTNAME}
63
DOCSFILES=	BUGS CONFIG CONTRIBUTORS INSTALL LICENSE
302
DOCSFILES=	BUGS CONFIG CONTRIBUTORS INSTALL LICENSE
64
PORTDOCS=	${DOCSFILES}
303
PKGMESSAGE=	${WRKDIR}/pkg-message
65
304
66
BROKEN_aarch64=		Fails to compile: error: use of undeclared identifier __LDPGSZ
305
CFLAGS+=	-I${LOCALBASE}/include
67
306
307
BUILD_ARGS+=	${MAKE_ARGS} ${OSSEC_ARGS} PREFIX=${PREFIX}/${PORTNAME}
308
INSTALL_ARGS+=	${USER_ARGS} ${OSSEC_ARGS} PREFIX=${STAGEDIR}${PREFIX}/${PORTNAME}
309
310
# Apache logs support
311
APACHE_OPTION=		APACHE
312
APACHE_PROFILE=		apache
313
APACHE_DESC=		Apache logs
314
APACHE_P_DESC=		${APACHE_DESC} (profile: ${APACHE_PROFILE})
315
LOGS_OPTIONS+=		${APACHE_OPTION}
316
317
# Nginx logs support
318
NGINX_OPTION=		NGINX
319
NGINX_PROFILE=		nginx
320
NGINX_DESC=		Nginx logs
321
NGINX_P_DESC=		${NGINX_DESC} (profile: ${NGINX_PROFILE})
322
LOGS_OPTIONS+=		${NGINX_OPTION}
323
324
# Radius logs support
325
RADIUS_OPTION=		RADIUS
326
RADIUS_PROFILE=		radius
327
RADIUS_DESC=		FreeRADIUS logs
328
RADIUS_P_DESC=		${RADIUS_DESC} (profile: ${RADIUS_PROFILE})
329
LOGS_OPTIONS+=		${RADIUS_OPTION}
330
331
# Vsftpd logs support
332
VSFTPD_OPTION=		VSFTPD
333
VSFTPD_PROFILE=		vsftpd
334
VSFTPD_DESC=		Vsftpd logs
335
VSFTPD_P_DESC=		${VSFTPD_DESC} (profile: ${VSFTPD_PROFILE})
336
LOGS_OPTIONS+=		${VSFTPD_OPTION}
337
338
.for option in ${LOGS_OPTIONS}
339
OPTIONS_GROUP_G_LOGS+=	${option}
340
OPTIONS_GROUP_G_LOGS_P+=${option}_P
341
OPTIONS_DEFAULT+=	${option}_P
342
SUB_FILES+=		template-logs-${${option}_PROFILE}.xml
343
SUB_LIST+=		${option}_PROFILE=${${option}_PROFILE}
344
CLIENT_PROFILES:=	${CLIENT_PROFILES}, ${${option}_PROFILE}
345
.endfor
346
68
.include <bsd.port.pre.mk>
347
.include <bsd.port.pre.mk>
69
348
70
STRIP_FILES=	ossec-luac agent_control ossec-lua ossec-dbd ossec-regex ossec-monitord ossec-makelists verify-agent-conf ossec-analysisd ossec-agentlessd syscheck_control ossec-execd manage_agents ossec-csyslogd ossec-syscheckd ossec-logtest ossec-authd ossec-logcollector list_agents ossec-maild clear_stats ossec-remoted ossec-reportd rootcheck_control syscheck_update
349
TEMPL_SAMPLE_FILES+=	${TEMPL_SAMPLE}
71
.if defined(CLIENT_ONLY)
350
TEMPL_P_SAMPLE_FILES+=	${TEMPL_P_SAMPLE}
72
SUB_LIST+=	PRECMD=:
351
PKGMSG_FILES+=		message-footer
73
PKGNAMESUFFIX=	-client
74
CONFLICTS_INSTALL=	ossec-hids-server-[0-9]* ossec-hids-local-[0-9]*
75
STRIP_FILES=	agent-auth manage_agents ossec-agentd ossec-execd ossec-logcollector ossec-lua ossec-luac ossec-syscheckd
76
.elif defined(LOCAL_ONLY)
77
SUB_LIST+=	PRECMD=ossechids_start_precmd
78
PKGNAMESUFFIX=	-local
79
CONFLICTS_INSTALL=	ossec-hids-client-[0-9]* ossec-hids-server-[0-9]*
80
.else
81
SUB_LIST+=	PRECMD=ossechids_start_precmd
82
CONFLICTS_INSTALL=	ossec-hids-client-[0-9]* ossec-hids-local-[0-9]*
83
.endif
84
352
85
post-patch:
353
post-patch:
86
	@${REINPLACE_CMD} 's|PREFIX|${PREFIX}/${PORTNAME}|' ${WRKSRC}/src/headers/defs.h
87
	@${ECHO} "DIR=\"${STAGEDIR}${PREFIX}/${PORTNAME}\"" > ${WRKSRC}/src/LOCATION
88
	@${REINPLACE_CMD} -e 's|-DLUA_USE_LINUX|& ${CPPFLAGS}|' \
354
	@${REINPLACE_CMD} -e 's|-DLUA_USE_LINUX|& ${CPPFLAGS}|' \
89
		-e 's|-lreadline|& ${LDFLAGS}|' \
355
		-e 's|-lreadline|& ${LDFLAGS}|' \
90
		${WRKSRC}/src/external/lua-5.2.3/src/Makefile
356
		${WRKSRC}/src/external/lua/src/Makefile
91
	@${REINPLACE_CMD} -e 's|OPENSSLCMD=|OPENSSLCMD=-L${OPENSSLLIB} |' \
92
		${WRKSRC}/src/Makeall
93
357
94
do-build:
358
do-build:
95
.if defined(WITH_DB)
359
	@cd ${WRKSRC}/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${BUILD_ARGS} build
96
.if defined(CLIENT_ONLY)
360
97
	@cd ${WRKSRC}/src;${MAKE} setagent;${MAKE} all;${MAKE} build
361
do-install:
98
.elif defined(LOCAL_ONLY)
362
	@cd ${WRKSRC}/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${INSTALL_ARGS} install
99
	@cd ${WRKSRC}/src;${MAKE} setlocal;${MAKE} setdb;${MAKE} all;${MAKE} build
363
100
.else
364
ossec-dist-conf:
101
	@cd ${WRKSRC}/src;${MAKE} setdb;${MAKE} all;${MAKE} build
365
	@${CAT} ${WRKDIR}/${TEMPL_HEADER} > ${STAGEDIR}${OSSEC_DIST_CONF}
366
.for file in ${TEMPL_FILES}
367
	@${TEMPL_TO_OSSEC} ${WRKDIR}/${file} >> ${STAGEDIR}${OSSEC_DIST_CONF}
368
	@${ECHO_CMD} >> ${STAGEDIR}${OSSEC_DIST_CONF}
369
.endfor
370
.for option in ${LOGS_OPTIONS}
371
.if ${PORT_OPTIONS:M${option}}
372
	@${TEMPL_TO_OSSEC} ${WRKDIR}/template-logs-${${option}_PROFILE}.xml >> ${STAGEDIR}${OSSEC_DIST_CONF}
373
	@${ECHO_CMD} >> ${STAGEDIR}${OSSEC_DIST_CONF}
102
.endif
374
.endif
103
.else
375
.endfor
104
.if defined(CLIENT_ONLY)
376
	@${CHMOD} 640 ${STAGEDIR}${OSSEC_DIST_CONF}
105
	@cd ${WRKSRC}/src;${MAKE} setagent;${MAKE} all;${MAKE} build; \
377
.if defined(MAINTAINER_MODE)
106
		${MAKE} unsetdb
378
	@${CHOWN} ${USER}:${OSSEC_GROUP} ${STAGEDIR}${OSSEC_DIST_CONF}
107
.elif defined(LOCAL_ONLY)
108
	@cd ${WRKSRC}/src;${MAKE} setlocal;${MAKE} all;${MAKE} build; \
109
		${MAKE} unsetdb
110
.else
111
	@cd ${WRKSRC}/src;${MAKE} all;${MAKE} build;${MAKE} unsetdb
112
.endif
379
.endif
380
381
ossec-local-conf:
382
	@${CAT} ${WRKDIR}/${TEMPL_SAMPLE_HEADER} > ${STAGEDIR}${OSSEC_LOCAL_CONF}
383
.for file in ${TEMPL_SAMPLE_FILES}
384
	@${TEMPL_TO_OSSEC} ${WRKDIR}/${file} >> ${STAGEDIR}${OSSEC_LOCAL_CONF}
385
	@${ECHO_CMD} >> ${STAGEDIR}${OSSEC_LOCAL_CONF}
386
.endfor
387
	@${CHMOD} 640 ${STAGEDIR}${OSSEC_LOCAL_CONF}
388
.if defined(MAINTAINER_MODE)
389
	@${CHOWN} ${USER}:${OSSEC_GROUP} ${STAGEDIR}${OSSEC_LOCAL_CONF}
113
.endif
390
.endif
114
391
115
do-install:
392
agent-dist-conf:
116
.if defined(CLIENT_ONLY)
393
.if !defined(AGENT_ONLY) && !defined(LOCAL_ONLY)
117
	@cd ${WRKSRC}/src; ${MAKE} agent
394
	@${CAT} ${WRKDIR}/${TEMPL_P_HEADER} > ${STAGEDIR}${OSSEC_P_DIST_CONF}
118
.elif defined(LOCAL_ONLY)
395
.for file in ${TEMPL_P_FILES}
119
	@cd ${WRKSRC}/src; ${MAKE} local
396
	@${TEMPL_TO_OSSEC_P} ${WRKDIR}/${file} >> ${STAGEDIR}${OSSEC_P_DIST_CONF}
397
	@${ECHO_CMD} >> ${STAGEDIR}${OSSEC_P_DIST_CONF}
398
.endfor
399
.for option in ${LOGS_OPTIONS}
400
.if ${PORT_OPTIONS:M${option}_P}
401
	@${TEMPL_TO_OSSEC_P} ${WRKDIR}/template-logs-${${option}_PROFILE}.xml >> ${STAGEDIR}${OSSEC_P_DIST_CONF}
402
	@${ECHO_CMD} >> ${STAGEDIR}${OSSEC_P_DIST_CONF}
403
.endif
404
.endfor
405
	@${CHMOD} 640 ${STAGEDIR}${OSSEC_P_DIST_CONF}
406
.if defined(MAINTAINER_MODE)
407
	@${CHOWN} ${USER}:${OSSEC_GROUP} ${STAGEDIR}${OSSEC_P_DIST_CONF}
408
.endif
409
.endif
410
411
agent-local-conf:
412
.if !defined(AGENT_ONLY) && !defined(LOCAL_ONLY)
413
	@${CAT} ${WRKDIR}/${TEMPL_SAMPLE_HEADER} > ${STAGEDIR}${OSSEC_P_LOCAL_CONF}
414
.for file in ${TEMPL_P_SAMPLE_FILES}
415
	@${TEMPL_TO_OSSEC_P} ${WRKDIR}/${file} >> ${STAGEDIR}${OSSEC_P_LOCAL_CONF}
416
	@${ECHO_CMD} >> ${STAGEDIR}${OSSEC_P_LOCAL_CONF}
417
.endfor
418
	@${CHMOD} 640 ${STAGEDIR}${OSSEC_P_LOCAL_CONF}
419
.if defined(MAINTAINER_MODE)
420
	@${CHOWN} ${USER}:${OSSEC_GROUP} ${STAGEDIR}${OSSEC_P_LOCAL_CONF}
421
.endif
422
.endif
423
424
ossec-rules:
425
.if !defined(AGENT_ONLY)
426
.for file in ${OSSEC_RULES_FILES}
427
	@${SED} -e 's|<?xml.*?>||' ${WRKDIR}/rule-${file}.xml > ${STAGEDIR}${OSSEC_RULES_DIR}/freebsd_${file}_rules.xml
428
	@${CHMOD} 640 ${STAGEDIR}${OSSEC_RULES_DIR}/freebsd_${file}_rules.xml
429
.if defined(MAINTAINER_MODE)
430
	@${CHOWN} ${USER}:${OSSEC_GROUP} ${STAGEDIR}${OSSEC_RULES_DIR}/freebsd_${file}_rules.xml
431
.endif
432
.endfor
433
.endif
434
435
ossec-scripts:
436
	@${CP} -f ${WRKDIR}/ossec-conf ${STAGEDIR}${OSSEC_OSSEC_CONF}
437
	@${CHMOD} 550 ${STAGEDIR}${OSSEC_OSSEC_CONF}
438
.if !defined(AGENT_ONLY) && !defined(LOCAL_ONLY)
439
	@${CP} -f ${WRKDIR}/agent-conf ${STAGEDIR}${OSSEC_AGENT_CONF}
440
	@${CHMOD} 550 ${STAGEDIR}${OSSEC_AGENT_CONF}
441
.endif
442
	@${CP} -f ${WRKDIR}/merge-config.sh ${STAGEDIR}${OSSEC_MERGE_CONFIG}
443
	@${CHMOD} 550 ${STAGEDIR}${OSSEC_MERGE_CONFIG}
444
	@${CP} -f ${WRKDIR}/restart-ossec.sh ${STAGEDIR}${OSSEC_RESTART_OSSEC}
445
	@${CHMOD} 550 ${STAGEDIR}${OSSEC_RESTART_OSSEC}
446
.if defined(MAINTAINER_MODE)
447
	@${CHOWN} ${USER}:${OSSEC_GROUP} ${STAGEDIR}${OSSEC_MERGE_CONFIG}
448
.endif
449
450
post-install: ossec-dist-conf ossec-local-conf agent-dist-conf agent-local-conf ossec-rules ossec-scripts
451
	@${CHMOD} 770 ${STAGEDIR}${OSSEC_TMP}
452
.if defined(AGENT_ONLY)
453
.if defined(MAINTAINER_MODE)
454
	@for file in $$(find "${STAGEDIR}${OSSEC_SHARED}" -type f); do ${CHMOD} 0644 $${file}; ${CHOWN} ${OSSEC_USER}:${OSSEC_GROUP} $${file}; done
120
.else
455
.else
121
	@cd ${WRKSRC}/src; ${MAKE} server
456
	@for file in $$(find "${STAGEDIR}${OSSEC_SHARED}" -type f); do ${CHMOD} 0644 $${file}; done
122
.endif
457
.endif
123
	@${MKDIR} ${STAGEDIR}${PREFIX}/${PORTNAME}/etc
458
.endif
459
	@${ECHO_CMD} -n > ${PKGMESSAGE}
460
.for file in ${PKGMSG_FILES}
461
	@${CAT} ${WRKDIR}/${file} >> ${PKGMESSAGE}
462
	@${ECHO_CMD} >> ${PKGMESSAGE}
463
.endfor
124
.for file in ${STRIP_FILES}
464
.for file in ${STRIP_FILES}
125
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/ossec-hids/bin/${file}
465
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/${PORTNAME}/bin/${file}
126
.endfor
466
.endfor
127
467
128
.if defined(CLIENT_ONLY)
468
.if defined(MAINTAINER_MODE)
129
	@${CP} ${WRKSRC}/etc/ossec-agent.conf ${STAGEDIR}${PREFIX}/${PORTNAME}/etc/ossec.conf.sample
469
plist: makeplist
130
.elif defined(LOCAL_ONLY)
470
	@${SCRIPTDIR}/plist.sh ${OSSEC_TYPE} ${PLIST} ${PREFIX}/${PORTNAME} ${WRKDIR}
131
	${CP} ${WRKSRC}/etc/ossec-local.conf ${STAGEDIR}${PREFIX}/${PORTNAME}/etc/ossec.conf.sample
132
.else
133
	${CP} ${WRKSRC}/etc/ossec-server.conf ${STAGEDIR}${PREFIX}/${PORTNAME}/etc/ossec.conf.sample
134
.endif
471
.endif
135
472
136
post-install-DOCS-on:
473
post-install-DOCS-on:
Lines 139-148 Link Here
139
476
140
post-install-MYSQL-on:
477
post-install-MYSQL-on:
141
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
478
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
142
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/mysql.schema ${STAGEDIR}${DOCSDIR}
479
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/${DB_SCHEMA} ${STAGEDIR}${DOCSDIR}
143
480
144
post-install-PGSQL-on:
481
post-install-PGSQL-on:
145
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
482
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
146
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/postgresql.schema ${STAGEDIR}${DOCSDIR}
483
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/${DB_SCHEMA} ${STAGEDIR}${DOCSDIR}
147
484
148
.include <bsd.port.post.mk>
485
.include <bsd.port.post.mk>
(-)distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (ossec-ossec-hids-v2.8.3_GH0.tar.gz) = 917989e23330d18b0d900e8722392cdbe4f17364a547508742c0fd005a1df7dd
1
TIMESTAMP = 1517645028
2
SIZE (ossec-ossec-hids-v2.8.3_GH0.tar.gz) = 1642095
2
SHA256 (ossec-ossec-hids-2.9.3_GH0.tar.gz) = 6b70a8f93fc2412bfc34a793a53b4d22323568866c09fde87c7d3a9d04e3b313
3
SIZE (ossec-ossec-hids-2.9.3_GH0.tar.gz) = 1711222
(-)files/agent-conf.in (+35 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_type="%%OSSEC_TYPE%%"
4
ossec_home="%%PREFIX%%/%%PORTNAME%%"
5
6
agent_dist_conf="${ossec_home}/etc/agent-dist.conf"
7
agent_local_conf="${ossec_home}/etc/agent-local.conf"
8
9
select_elements() {
10
    local element="$1"
11
    sed -n "/<${element}.*>/,/<\/${element}>/p"
12
}
13
14
remove_comments() {
15
    # Comments must be on separate lines i.e. not next to uncommented code
16
    awk '/<!--/ {off=1} /-->/ {off=2} /([\s\S]*)/ {if (off==0) print; if (off==2) off=0}'
17
}
18
19
remove_empty_lines() {
20
    sed '/^\s*$/d'
21
}
22
23
agent_conf() {
24
    local dist_conf="$1"
25
    local local_conf="$2"
26
27
    echo "<!-- OSSEC HIDS %%VERSION%% -->"
28
    echo
29
    echo "<!-- DO NOT EDIT - edit \"${local_conf}\" instead -->"
30
    echo
31
32
    cat "${dist_conf}" "${local_conf}" | remove_comments | select_elements "agent_config" | remove_empty_lines
33
}
34
35
agent_conf "${agent_dist_conf}" "${agent_local_conf}"
(-)files/merge-config.sh.in (+32 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# This script is part of FreeBSD port - report any issues to the port MAINTAINER
4
5
ossec_type="%%OSSEC_TYPE%%"
6
ossec_home="%%PREFIX%%/%%PORTNAME%%"
7
ossec_rc="%%OSSEC_RC%%"
8
9
ACTION=$1
10
USER=$2
11
IP=$3
12
13
LOCAL=`dirname $0`;
14
cd $LOCAL
15
cd ../../tmp
16
17
# Logging the call
18
echo "`date` $0 $1 $2 $3 $4 $5" >> "${ossec_home}/logs/active-responses.log"
19
20
case ${ACTION} in
21
    add)
22
        "${ossec_rc}" merge_config
23
        exit 0
24
        ;;
25
    delete)
26
        exit 0
27
        ;;
28
    *)
29
        echo "$0: invalid action: ${ACTION}"
30
        exit 1
31
        ;;
32
esac
(-)files/message-db.in (+8 lines)
Line 0 Link Here
1
The database schema file:
2
%%DB_SCHEMA%%
3
4
To enable database output execute:
5
# %%PREFIX%%/%%PORTNAME%%/bin/ossec-control enable database
6
7
Then check this documentation:
8
https://ossec.github.io/docs/syntax/head_ossec_config.database_output.html
(-)files/message-footer.in (+5 lines)
Line 0 Link Here
1
When you deinstall this port after starting the daemons once, many
2
directories that are created by the daemons will remain.  To fully
3
remove the port you need to delete those directories manually.  To
4
further enhance the security on your system, you may also enable
5
some checks in PAM for a fast reaction against intrusions.
(-)files/message-header.in (+9 lines)
Line 0 Link Here
1
After installation, you need to edit the ossec-local.conf file to reflect
2
the correct settings for your environment.  All the files related
3
to %%PORTNAME%% have been installed in %%PREFIX%%/%%PORTNAME%% and
4
its subdirectories.
5
6
For information on proper configuration see:
7
https://ossec.github.io/docs/syntax/ossec_config.html
8
9
To enable the startup script, add ossechids_enable="YES" to /etc/rc.conf.
(-)files/message-pf.in (+4 lines)
Line 0 Link Here
1
Add the ossec_fwtable to /etc/pf.conf if using firewall-drop command:
2
  table <ossec_fwtable> persist
3
  block in quick from <ossec_fwtable> to any
4
  block out quick from any to <ossec_fwtable>
(-)files/ossec-conf.in (+63 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_type="%%OSSEC_TYPE%%"
4
ossec_home="%%PREFIX%%/%%PORTNAME%%"
5
6
ossec_dist_conf="${ossec_home}/etc/ossec-dist.conf"
7
ossec_local_conf="${ossec_home}/etc/ossec-local.conf"
8
9
select_elements_content() {
10
    local element="$1"
11
    sed -n "/<${element}>/,/<\/${element}>/{ /<${element}>/d; /<\/${element}>/d; p; }"
12
}
13
14
remove_elements() {
15
    local element="$1"
16
    sed -e "/<${element}>/,/<\/${element}>/d"
17
}
18
19
remove_comments() {
20
    # Comments must be on separate lines i.e. not next to uncommented code
21
    awk '/<!--/ {off=1} /-->/ {off=2} /([\s\S]*)/ {if (off==0) print; if (off==2) off=0}'
22
}
23
24
remove_empty_lines() {
25
    sed '/^\s*$/d'
26
}
27
28
ossec_conf() {
29
    local dist_conf="$1"
30
    local local_conf="$2"
31
32
    echo "<!-- OSSEC HIDS %%VERSION%% -->"
33
    echo
34
    echo "<!-- DO NOT EDIT - edit \"${local_conf}\" instead -->"
35
    echo
36
    echo "<ossec_config>"
37
38
    if [ "${ossec_type}" != "agent"  ]; then
39
        if cat "${dist_conf}" "${local_conf}" | remove_comments | grep -q "<rules>"; then
40
            echo "  <rules>"
41
            cat "${dist_conf}" "${local_conf}" | remove_comments | select_elements_content "rules" | remove_empty_lines
42
            echo "  </rules>"
43
        fi
44
    fi
45
46
    if cat "${dist_conf}" "${local_conf}" | remove_comments | grep -q "<rootcheck>"; then
47
        echo "  <rootcheck>"
48
        cat "${dist_conf}" "${local_conf}" | remove_comments | select_elements_content "rootcheck" | remove_empty_lines
49
        echo "  </rootcheck>"
50
    fi
51
52
    if cat "${dist_conf}" "${local_conf}" | remove_comments | grep -q "<syscheck>"; then
53
        echo "  <syscheck>"
54
        cat "${dist_conf}" "${local_conf}" | remove_comments | select_elements_content "syscheck" | remove_empty_lines
55
        echo "  </syscheck>"
56
    fi
57
58
    cat "${dist_conf}" "${local_conf}" | remove_comments | select_elements_content "ossec_config" | remove_elements "rules" | remove_elements "rootcheck" |  remove_elements "syscheck" | remove_empty_lines
59
60
    echo "</ossec_config>"
61
}
62
63
ossec_conf "${ossec_dist_conf}" "${ossec_local_conf}"
(-)files/ossec-hids.in (-31 / +162 lines)
Lines 1-5 Link Here
1
#!/bin/sh
1
#!/bin/sh
2
# 
2
#
3
# PROVIDE: ossechids
3
# PROVIDE: ossechids
4
# REQUIRE: DAEMON
4
# REQUIRE: DAEMON
5
# BEFORE:  LOGIN
5
# BEFORE:  LOGIN
Lines 15-65 Link Here
15
: ${ossechids_enable="NO"}
15
: ${ossechids_enable="NO"}
16
: ${ossechids_user="ossec"}
16
: ${ossechids_user="ossec"}
17
: ${ossechids_group="ossec"}
17
: ${ossechids_group="ossec"}
18
: ${ossechids_clear_tmp="YES"}
19
: ${ossechids_clear_log="NO"}
20
: ${ossechids_clear_ar_log="NO"}
21
: ${ossechids_fetch_time=15}
18
22
19
start_precmd=%%PRECMD%%
23
ossec_type="%%OSSEC_TYPE%%"
24
ossec_home="%%PREFIX%%/%%PORTNAME%%"
25
26
ossec_conf="${ossec_home}/etc/ossec.conf"
27
ossec_dist_conf="${ossec_home}/etc/ossec-dist.conf"
28
ossec_local_conf="${ossec_home}/etc/ossec-local.conf"
29
30
agent_conf="${ossec_home}/etc/shared/agent.conf"
31
agent_dist_conf="${ossec_home}/etc/agent-dist.conf"
32
agent_local_conf="${ossec_home}/etc/agent-local.conf"
33
34
ossec_client_keys="${ossec_home}/etc/client.keys"
35
ossec_tmp="${ossec_home}/tmp"
36
ossec_log="${ossec_home}/logs/ossec.log"
37
ossec_ar_log="${ossec_home}/logs/active-responses.log"
38
ossec_merged="${ossec_home}/etc/shared/merged.mg"
39
40
extra_commands="reload ossec_conf"
41
case ${ossec_type} in
42
    server)
43
        extra_commands="${extra_commands} agent_conf"
44
        ;;
45
    agent)
46
        extra_commands="${extra_commands} fetch_config"
47
        ;;
48
esac
49
extra_commands="${extra_commands} merge_config"
50
20
start_cmd="ossechids_command start"
51
start_cmd="ossechids_command start"
21
stop_cmd="ossechids_command stop"
52
stop_cmd="ossechids_command stop"
22
restart_cmd="ossechids_command restart"
53
restart_cmd="ossechids_command restart"
23
status_cmd="ossechids_command status"
54
status_cmd="ossechids_command status"
24
reload_cmd="ossechids_command reload"
55
reload_cmd="ossechids_command reload"
56
fetch_config_cmd="ossechids_command restart"
57
merge_config_cmd="ossechids_create_configs"
58
ossec_conf_cmd="ossechids_ossec_conf"
59
agent_conf_cmd="ossechids_agent_conf"
25
60
26
command="%%PREFIX%%/%%PORTNAME%%/bin/ossec-control"
61
start_precmd="ossechids_prepare"
27
required_files="%%PREFIX%%/%%PORTNAME%%/etc/ossec.conf"
62
restart_precmd="ossechids_prepare"
28
extra_commands="reload"
63
reload_precmd="ossechids_prepare"
64
fetch_config_precmd="ossechids_prepare"
29
65
30
fts_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/fts-queue
66
install_file() {
31
ig_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/ig-queue
67
    local path=$1
32
ossec_log=%%PREFIX%%/%%PORTNAME%%/logs/ossec.log
68
    local owner=$2
33
active_responses_log=%%PREFIX%%/%%PORTNAME%%/logs/active-responses.log
69
    local mode=$3
34
70
35
ossechids_start_precmd() {
71
    if [ ! -e "${path}" ]; then
36
    # These files are not created by the daemons with the correct
72
        touch "${path}" && chown ${owner} "${path}" && chmod ${mode} "${path}"
37
    # ownership, so create them here before starting up the system,
38
    # if they don't already exist. This is only done for the "local" and
39
    # "server" installation types.
40
    if [ ! -e ${fts_queue} ]; then
41
        touch ${fts_queue}
42
        chown ${ossechids_user}:${ossechids_group} ${fts_queue}
43
        chmod 640 ${fts_queue}
44
    fi
73
    fi
45
    if [ ! -e ${ig_queue} ]; then
74
}
46
        touch ${ig_queue}
75
47
        chown ${ossechids_user}:${ossechids_group} ${ig_queue}
76
ossechids_check() {
48
        chmod 640 ${ig_queue}
77
    case ${ossec_type} in
78
        server)
79
            if [ ! -s "${ossec_client_keys}" ]; then
80
                echo "WARNING: There are no client keys created - remote connections will be disabled"
81
            fi
82
            ;;
83
        agent)
84
            if [ ! -s "${ossec_client_keys}" ]; then
85
                echo "WARNING: There are is no client key imported - connection to server not possible"
86
            fi
87
            ;;
88
    esac
89
90
    return 0
91
}
92
93
ossechids_create_configs() {
94
    case ${ossec_type} in
95
        server)
96
            # Merge agent-dist.conf and agent-local.conf into agent.conf
97
            if [ ! -e "${agent_conf}" -o "${agent_dist_conf}" -nt "${agent_conf}" -o "${agent_local_conf}" -nt "${agent_conf}" ]; then
98
                install_file "${agent_conf}" %%USER%%:%%OSSEC_GROUP%% 0640
99
                "${ossec_home}/bin/agent_conf" > "${agent_conf}"
100
            fi
101
            ;;
102
        agent)
103
            # Touch agent.conf so the agent daemons won't complain if it doesn't exist
104
            install_file "${agent_conf}" %%OSSEC_USER%%:%%OSSEC_GROUP%% 0644
105
            ;;
106
    esac
107
108
    # Merge ossec-dist.conf and ossec-local.conf into ossec.conf
109
    if [ ! -e "${ossec_conf}" -o "${ossec_dist_conf}" -nt "${ossec_conf}" -o "${ossec_local_conf}" -nt "${ossec_conf}" ]; then
110
        install_file "${ossec_conf}" %%USER%%:%%OSSEC_GROUP%% 0640
111
        "${ossec_home}/bin/ossec_conf" > "${ossec_conf}"
49
    fi
112
    fi
50
113
51
    # Ensure logfiles are created with the correct ownership and mode
114
    return 0
52
    for log in ${ossec_log} ${active_responses_log}; do
53
	if [ ! -e ${log} ]; then
54
	    touch ${log}
55
	    chown ${ossechids_user}:${ossechids_group} ${log}
56
	    chmod 660 ${log}
57
	fi
58
    done
59
}
115
}
60
116
117
ossechids_create_logs() {
118
    # Create required log files if they don't exist
119
    install_file "${ossec_log}" ${ossechids_user}:${ossechids_group} 0660
120
    install_file "${ossec_ar_log}" ${ossechids_user}:${ossechids_group} 0660
121
122
    return 0
123
}
124
125
ossechids_clean_temps() {
126
    if [ "${ossec_type}" == "server" ]; then
127
        rm -f "${ossec_merged}"
128
    fi
129
130
    if checkyesno ossechids_clear_tmp; then
131
        rm -rf "${ossec_tmp}/*"
132
    fi
133
134
    if checkyesno ossechids_clear_log; then
135
        echo -n > "${ossec_log}"
136
    fi
137
138
    if checkyesno ossechids_clear_ar_log; then
139
        echo -n > "${ossec_ar_log}"
140
    fi
141
142
    return 0
143
}
144
145
ossechids_fetch_configs() {
146
    case ${ossec_type} in
147
        agent)
148
            rm -f "${ossec_merged}"
149
            ossechids_command stop
150
            sleep 1
151
            ossechids_command start
152
            echo "Waiting ${ossechids_fetch_time} seconds for the shared configuration to be downloaded from the OSSEC server"
153
            sleep ${ossechids_fetch_time}
154
            if [ ! -s "${ossec_merged}" ]; then
155
                echo "Failed to download shared configuration from the OSSEC server"
156
                return 1
157
            fi
158
            ;;
159
        *)
160
            echo "Shared configuration is only available for client installations"
161
            return 1
162
            ;;
163
    esac
164
165
    return 0
166
}
167
168
ossechids_prepare() {
169
    case ${rc_arg} in
170
        start|restart)
171
            ossechids_create_logs && ossechids_create_configs && ossechids_clean_temps && ossechids_check || return 1
172
            ;;
173
        fetch_config)
174
            ossechids_create_logs && ossechids_create_configs && ossechids_clean_temps && ossechids_fetch_configs && ossechids_check || return 1
175
            ;;
176
        reload)
177
            ossechids_create_configs || return 1
178
            ;;
179
    esac
180
181
    return 0
182
}
183
184
ossechids_ossec_conf() {
185
    "${ossec_home}/bin/ossec_conf"
186
}
187
188
ossechids_agent_conf() {
189
    "${ossec_home}/bin/agent_conf"
190
}
191
61
ossechids_command() {
192
ossechids_command() {
62
	${command} ${rc_arg}
193
    "${ossec_home}/bin/ossec-control" "$1"
63
}
194
}
64
195
65
run_rc_command "$1"
196
run_rc_command "$1"
(-)files/patch-active-response_host-deny.sh (+24 lines)
Line 0 Link Here
1
--- active-response/host-deny.sh.orig	2017-12-19 21:30:31 UTC
2
+++ active-response/host-deny.sh
3
@@ -11,7 +11,7 @@ IP=$3
4
 
5
 LOCAL=`dirname $0`;
6
 cd $LOCAL
7
-cd ../
8
+cd ../../tmp
9
 PWD=`pwd`
10
 LOCK="${PWD}/host-deny-lock"
11
 LOCK_PID="${PWD}/host-deny-lock/pid"
12
@@ -112,10 +112,10 @@ if [ "x${ACTION}" = "xadd" ]; then
13
 # Deleting from hosts.deny   
14
 elif [ "x${ACTION}" = "xdelete" ]; then   
15
    lock;
16
-   TMP_FILE=`mktemp /var/ossec/ossec-hosts.XXXXXXXXXX` 
17
+   TMP_FILE=`mktemp ${PWD}/ossec-hosts.XXXXXXXXXX` 
18
    if [ "X${TMP_FILE}" = "X" ]; then 
19
      # Cheap fake tmpfile, but should be harder then no random data 
20
-     TMP_FILE="/var/ossec/ossec-hosts.`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -1 `"
21
+     TMP_FILE="${PWD}/ossec-hosts.`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -1 `"
22
    fi
23
    echo "${IP}" | grep "\:" > /dev/null 2>&1
24
    if [ $? = 0 ]; then
(-)files/patch-src__InstallAgent.sh (-123 lines)
Lines 1-123 Link Here
1
--- src/InstallAgent.sh.orig	2015-10-12 21:21:06 UTC
2
+++ src/InstallAgent.sh
3
@@ -37,11 +37,11 @@ fi
4
 
5
 # Creating groups/users
6
 if [ "$UNAME" = "FreeBSD" -o "$UNAME" = "DragonFly" ]; then
7
-    grep "^${USER}" /etc/passwd > /dev/null 2>&1
8
-    if [ ! $? = 0 ]; then
9
-    /usr/sbin/pw groupadd ${GROUP}
10
-	/usr/sbin/pw useradd ${USER} -d ${DIR} -s /sbin/nologin -g ${GROUP}
11
-    fi
12
+    #grep "^${USER}" /etc/passwd > /dev/null 2>&1
13
+    #if [ ! $? = 0 ]; then
14
+    #/usr/sbin/pw groupadd ${GROUP}
15
+	#/usr/sbin/pw useradd ${USER} -d ${DIR} -s /sbin/nologin -g ${GROUP}
16
+    #fi
17
 
18
 elif [ "$UNAME" = "SunOS" ]; then
19
     grep "^${USER}" /etc/passwd > /dev/null 2>&1
20
@@ -106,22 +106,17 @@ for i in ${subdirs}; do
21
 done
22
 
23
 # Default for all directories
24
-chmod -R 550 ${DIR}
25
-chown -R root:${GROUP} ${DIR}
26
+chmod -R 750 ${DIR}
27
 
28
 # To the ossec queue (default for agentd to read)
29
-chown -R ${USER}:${GROUP} ${DIR}/queue/ossec
30
 chmod -R 770 ${DIR}/queue/ossec
31
 
32
 # For the logging user
33
-chown -R ${USER}:${GROUP} ${DIR}/logs
34
 chmod -R 750 ${DIR}/logs
35
 chmod -R 775 ${DIR}/queue/rids
36
 touch ${DIR}/logs/ossec.log
37
-chown ${USER}:${GROUP} ${DIR}/logs/ossec.log
38
 chmod 664 ${DIR}/logs/ossec.log
39
 
40
-chown -R ${USER}:${GROUP} ${DIR}/queue/diff
41
 chmod -R 750 ${DIR}/queue/diff
42
 chmod 740 ${DIR}/queue/diff/* > /dev/null 2>&1
43
 
44
@@ -131,8 +126,7 @@ chmod 1550 ${DIR}/tmp
45
 
46
 
47
 # For the etc dir
48
-chmod 550 ${DIR}/etc
49
-chown -R root:${GROUP} ${DIR}/etc
50
+chmod 750 ${DIR}/etc
51
 
52
 ls /etc/localtime > /dev/null 2>&1
53
 if [ $? = 0 ]; then
54
@@ -144,13 +138,11 @@ if [ "$UNAME" = "SunOS" ]; then
55
     mkdir -p ${DIR}/usr/share/lib/zoneinfo/
56
     chmod -R 555 ${DIR}/usr/
57
     cp -pr /usr/share/lib/zoneinfo/* ${DIR}/usr/share/lib/zoneinfo/
58
-    chown -R root:${GROUP} ${DIR}/usr/
59
 fi    
60
 
61
 ls /etc/TIMEZONE > /dev/null 2>&1
62
 if [ $? = 0 ]; then
63
     cp -p /etc/TIMEZONE ${DIR}/etc/;
64
-    chown root:${GROUP} ${DIR}/etc/TIMEZONE
65
     chmod 555 ${DIR}/etc/TIMEZONE
66
 fi
67
             
68
@@ -170,25 +162,17 @@ cp -pr ../etc/local_internal_options.con
69
 cp -pr ../etc/client.keys ${DIR}/etc/ > /dev/null 2>&1
70
 cp -pr agentlessd/scripts/* ${DIR}/agentless/
71
 
72
-chown root:${GROUP} ${DIR}/etc/internal_options.conf
73
-chown root:${GROUP} ${DIR}/etc/local_internal_options.conf > /dev/null 2>&1
74
-chown root:${GROUP} ${DIR}/etc/client.keys > /dev/null 2>&1
75
-chown root:${GROUP} ${DIR}/agentless/*
76
-chown ${USER}:${GROUP} ${DIR}/.ssh
77
-chown -R root:${GROUP} ${DIR}/etc/shared
78
-
79
-chmod 550 ${DIR}/etc
80
+chmod 750 ${DIR}/etc
81
 chmod 440 ${DIR}/etc/internal_options.conf
82
 chmod 440 ${DIR}/etc/local_internal_options.conf > /dev/null 2>&1
83
 chmod 440 ${DIR}/etc/client.keys > /dev/null 2>&1
84
 chmod -R 770 ${DIR}/etc/shared # ossec must be able to write to it
85
-chmod 550 ${DIR}/agentless/*
86
+chmod 750 ${DIR}/agentless/*
87
 chmod 700 ${DIR}/.ssh
88
 
89
 
90
 # For the /var/run
91
 chmod 770 ${DIR}/var/run
92
-chown root:${GROUP} ${DIR}/var/run
93
 
94
 
95
 # Moving the binary files
96
@@ -202,7 +186,6 @@ cp -pr addagent/manage_agents ${DIR}/bin
97
 cp -pr ../contrib/util.sh ${DIR}/bin/
98
 cp -pr external/lua/src/ossec-lua ${DIR}/bin/
99
 cp -pr external/lua/src/ossec-luac ${DIR}/bin/
100
-chown root:${GROUP} ${DIR}/bin/util.sh
101
 chmod +x ${DIR}/bin/util.sh
102
 
103
 # Copying active response modules
104
@@ -210,10 +193,8 @@ sh ./init/fw-check.sh execute > /dev/nul
105
 cp -pr ../active-response/*.sh ${DIR}/active-response/bin/
106
 cp -pr ../active-response/firewalls/*.sh ${DIR}/active-response/bin/
107
 chmod 755 ${DIR}/active-response/bin/*
108
-chown root:${GROUP} ${DIR}/active-response/bin/*
109
 
110
-chown root:${GROUP} ${DIR}/bin/*
111
-chmod 550 ${DIR}/bin/*
112
+chmod 750 ${DIR}/bin/*
113
 
114
 
115
 # Moving the config file
116
@@ -229,7 +210,6 @@ if [ $? = 0 ]; then
117
 else    
118
     cp -pr ../etc/ossec-agent.conf ${DIR}/etc/ossec.conf
119
 fi
120
-chown root:${GROUP} ${DIR}/etc/ossec.conf
121
 chmod 440 ${DIR}/etc/ossec.conf
122
 
123
 
(-)files/patch-src__InstallServer.sh (-208 lines)
Lines 1-208 Link Here
1
--- src/InstallServer.sh.orig	2015-10-12 21:21:06 UTC
2
+++ src/InstallServer.sh
3
@@ -44,13 +44,13 @@ fi
4
 
5
 # Creating groups/users
6
 if [ "$UNAME" = "FreeBSD" -o "$UNAME" = "DragonFly" ]; then
7
-    grep "^${USER_REM}" /etc/passwd > /dev/null 2>&1
8
-    if [ ! $? = 0 ]; then
9
-    /usr/sbin/pw groupadd ${GROUP}
10
-	/usr/sbin/pw useradd ${USER} -d ${DIR} -s /sbin/nologin -g ${GROUP}
11
-	/usr/sbin/pw useradd ${USER_MAIL} -d ${DIR} -s /sbin/nologin -g ${GROUP}
12
-	/usr/sbin/pw useradd ${USER_REM} -d ${DIR} -s /sbin/nologin -g ${GROUP}
13
-    fi
14
+#    grep "^${USER_REM}" /etc/passwd > /dev/null 2>&1
15
+#    if [ ! $? = 0 ]; then
16
+#    /usr/sbin/pw groupadd ${GROUP}
17
+#	/usr/sbin/pw useradd ${USER} -d ${DIR} -s /sbin/nologin -g ${GROUP}
18
+#	/usr/sbin/pw useradd ${USER_MAIL} -d ${DIR} -s /sbin/nologin -g ${GROUP}
19
+#	/usr/sbin/pw useradd ${USER_REM} -d ${DIR} -s /sbin/nologin -g ${GROUP}
20
+#    fi
21
 
22
 elif [ "$UNAME" = "SunOS" ]; then
23
     grep "^${USER_REM}" /etc/passwd > /dev/null 2>&1
24
@@ -121,66 +121,49 @@ for i in ${subdirs}; do
25
 done
26
 
27
 # Default for all directories
28
-chmod 550 ${DIR}
29
-chmod 550 ${DIR}/*
30
-chown root:${GROUP} ${DIR}
31
-chown root:${GROUP} ${DIR}/*
32
+chmod 750 ${DIR}
33
+chmod 750 ${DIR}/*
34
 
35
 # AnalysisD needs to write to alerts: log, mail and cmds
36
-chown -R ${USER}:${GROUP} ${DIR}/queue/alerts
37
 chmod -R 770 ${DIR}/queue/alerts
38
 
39
 # To the ossec queue (default for analysisd to read)
40
-chown -R ${USER}:${GROUP} ${DIR}/queue/ossec
41
 chmod -R 770 ${DIR}/queue/ossec
42
 
43
 # To the ossec fts queue
44
-chown -R ${USER}:${GROUP} ${DIR}/queue/fts
45
 chmod -R 750 ${DIR}/queue/fts
46
 chmod 750 ${DIR}/queue/fts/* > /dev/null 2>&1
47
 
48
 # To the ossec syscheck/rootcheck queue
49
-chown -R ${USER}:${GROUP} ${DIR}/queue/syscheck
50
 chmod -R 750 ${DIR}/queue/syscheck
51
 chmod 740 ${DIR}/queue/syscheck/* > /dev/null 2>&1
52
 
53
-chown -R ${USER}:${GROUP} ${DIR}/queue/rootcheck
54
 chmod -R 750 ${DIR}/queue/rootcheck
55
 chmod 740 ${DIR}/queue/rootcheck/* > /dev/null 2>&1
56
 
57
-chown ${USER}:${GROUP} ${DIR}/queue/diff
58
-chown ${USER}:${GROUP} ${DIR}/queue/diff/* > /dev/null 2>&1
59
 chmod 750 ${DIR}/queue/diff
60
 chmod 740 ${DIR}/queue/diff/* > /dev/null 2>&1
61
 
62
-chown -R ${USER_REM}:${GROUP} ${DIR}/queue/agent-info
63
 chmod -R 750 ${DIR}/queue/agent-info
64
 chmod 740 ${DIR}/queue/agent-info/* > /dev/null 2>&1
65
-chown -R ${USER_REM}:${GROUP} ${DIR}/queue/rids
66
 chmod -R 750 ${DIR}/queue/rids
67
 chmod 740 ${DIR}/queue/rids/* > /dev/null 2>&1
68
 
69
-chown -R ${USER}:${GROUP} ${DIR}/queue/agentless
70
 chmod -R 750 ${DIR}/queue/agentless
71
 chmod 740 ${DIR}/queue/agentless/* > /dev/null 2>&1
72
 
73
-chown -R root:${GROUP} ${DIR}/tmp
74
-chmod 1550 ${DIR}/tmp
75
+chmod 1750 ${DIR}/tmp
76
 
77
 
78
 # For the stats directory
79
-chown -R ${USER}:${GROUP} ${DIR}/stats
80
 chmod -R 750 ${DIR}/stats
81
 
82
 # For the logging user
83
-chown -R ${USER}:${GROUP} ${DIR}/logs
84
 chmod -R 750 ${DIR}/logs
85
 touch ${DIR}/logs/ossec.log
86
-chown ${USER}:${GROUP} ${DIR}/logs/ossec.log
87
 chmod 660 ${DIR}/logs/ossec.log
88
 
89
 touch ${DIR}/logs/active-responses.log
90
-chown ${USER}:${GROUP} ${DIR}/logs/active-responses.log
91
 chmod 660 ${DIR}/logs/active-responses.log
92
 
93
 # For the rules directory
94
@@ -198,7 +181,7 @@ if [ $? = 0 ]; then
95
     fi    
96
 fi
97
     
98
-cp -pr ../etc/rules/* ${DIR}/rules/
99
+cp -pr ../etc/rules/*.xml ${DIR}/rules/
100
 find ${DIR}/rules/ -type f -exec chmod 440 {} \;
101
 
102
 # If the local_rules is saved, moved it back
103
@@ -207,37 +190,33 @@ if [ $? = 0 ]; then
104
     mv ${DIR}/rules/saved_local_rules.xml.$$ ${DIR}/rules/local_rules.xml
105
 fi    
106
 
107
-chown -R root:${GROUP} ${DIR}/rules
108
-chmod -R 550 ${DIR}/rules
109
+chmod -R 750 ${DIR}/rules
110
 
111
 
112
 # For the etc dir
113
-chmod 550 ${DIR}/etc
114
-chown -R root:${GROUP} ${DIR}/etc
115
+chmod 750 ${DIR}/etc
116
 ls /etc/localtime > /dev/null 2>&1
117
 if [ $? = 0 ]; then
118
     cp -pL /etc/localtime ${DIR}/etc/;
119
     chmod 440 ${DIR}/etc/localtime
120
-    chown root:${GROUP} ${DIR}/etc/localtime 
121
 fi
122
 
123
 # Solaris Needs some extra files
124
 if [ "$UNAME" = "SunOS" ]; then
125
     mkdir -p ${DIR}/usr/share/lib/zoneinfo/
126
-    chmod -R 550 ${DIR}/usr/
127
+    chmod -R 750 ${DIR}/usr/
128
     cp -pr /usr/share/lib/zoneinfo/* ${DIR}/usr/share/lib/zoneinfo/
129
 fi
130
 
131
 ls /etc/TIMEZONE > /dev/null 2>&1
132
 if [ $? = 0 ]; then
133
     cp -p /etc/TIMEZONE ${DIR}/etc/;
134
-    chmod 550 ${DIR}/etc/TIMEZONE
135
+    chmod 750 ${DIR}/etc/TIMEZONE
136
 fi
137
                         
138
 
139
 # For the /var/run
140
 chmod 770 ${DIR}/var/run
141
-chown root:${GROUP} ${DIR}/var/run
142
 
143
 # Moving the binary files
144
 cp -pr addagent/manage_agents agentlessd/ossec-agentlessd \
145
@@ -260,7 +239,6 @@ cp -pr util/rootcheck_control ${DIR}/bin
146
 cp -pr external/lua/src/ossec-lua ${DIR}/bin/
147
 cp -pr external/lua/src/ossec-luac ${DIR}/bin/
148
 cp -pr ../contrib/util.sh ${DIR}/bin/
149
-chown root:${GROUP} ${DIR}/bin/util.sh
150
 chmod +x ${DIR}/bin/util.sh
151
 
152
 # Local install chosen
153
@@ -290,23 +268,15 @@ fi
154
   
155
 cp -pr ../etc/internal_options.conf ${DIR}/etc/
156
 cp -pr rootcheck/db/*.txt ${DIR}/etc/shared/
157
-chown root:${GROUP} ${DIR}/etc/decoder.xml
158
-chown root:${GROUP} ${DIR}/etc/local_decoder.xml >/dev/null 2>&1
159
-chown root:${GROUP} ${DIR}/etc/internal_options.conf
160
-chown root:${GROUP} ${DIR}/etc/local_internal_options.conf >/dev/null 2>&1
161
-chown root:${GROUP} ${DIR}/etc/client.keys >/dev/null 2>&1
162
-chown root:${GROUP} ${DIR}/etc/shared/*
163
-chown root:${GROUP} ${DIR}/agentless/*
164
-chown ${USER}:${GROUP} ${DIR}/.ssh
165
 chmod 440 ${DIR}/etc/decoder.xml
166
 chmod 440 ${DIR}/etc/local_decoder.xml >/dev/null 2>&1
167
 chmod 440 ${DIR}/etc/internal_options.conf
168
 chmod 440 ${DIR}/etc/local_internal_options.conf >/dev/null 2>&1
169
 chmod 440 ${DIR}/etc/client.keys >/dev/null 2>&1
170
-chmod 550 ${DIR}/etc
171
+chmod 750 ${DIR}/etc
172
 chmod 770 ${DIR}/etc/shared
173
 chmod 440 ${DIR}/etc/shared/*
174
-chmod 550 ${DIR}/agentless/*
175
+chmod 750 ${DIR}/agentless/*
176
 rm ${DIR}/etc/shared/merged.mg >/dev/null 2>&1
177
 chmod 700 ${DIR}/.ssh
178
 
179
@@ -316,11 +286,9 @@ sh ./init/fw-check.sh execute > /dev/nul
180
 cp -p ../active-response/*.sh ${DIR}/active-response/bin/
181
 cp -p ../active-response/firewalls/*.sh ${DIR}/active-response/bin/
182
 
183
-chmod 550 ${DIR}/active-response/bin/*
184
-chown root:${GROUP} ${DIR}/active-response/bin/*
185
+chmod 750 ${DIR}/active-response/bin/*
186
 
187
-chown root:${GROUP} ${DIR}/bin/*
188
-chmod 550 ${DIR}/bin/*
189
+chmod 750 ${DIR}/bin/*
190
 
191
 
192
 # Moving the config file
193
@@ -331,12 +299,11 @@ fi
194
 
195
 ls ../etc/ossec.mc > /dev/null 2>&1
196
 if [ $? = 0 ]; then
197
-    cp -pr ../etc/ossec.mc ${DIR}/etc/ossec.conf
198
+    cp -pr ../etc/ossec.mc ${DIR}/etc/ossec.conf.sample
199
 else    
200
-    cp -pr ../etc/ossec-server.conf ${DIR}/etc/ossec.conf
201
+    cp -pr ../etc/ossec-server.conf ${DIR}/etc/ossec.conf.sample
202
 fi
203
-chown root:${GROUP} ${DIR}/etc/ossec.conf
204
-chmod 440 ${DIR}/etc/ossec.conf
205
+chmod 640 ${DIR}/etc/ossec.conf.sample
206
 
207
 
208
 
(-)files/patch-src__LOCATION (-5 lines)
Lines 1-5 Link Here
1
--- src/LOCATION.orig	2015-10-12 21:21:06 UTC
2
+++ src/LOCATION
3
@@ -1 +1 @@
4
-DIR="/var/ossec"
5
+DIR="/usr/ports/security/ossec-hids-server/work/stage/usr/local/ossec-hids"
(-)files/patch-src__headers__defs.h (-11 lines)
Lines 1-11 Link Here
1
--- src/headers/defs.h.orig	2015-10-12 21:21:06 UTC
2
+++ src/headers/defs.h
3
@@ -98,7 +98,7 @@ http://www.ossec.net/main/license/\n"
4
 #endif
5
 
6
 #ifndef DEFAULTDIR		
7
-	#define DEFAULTDIR	"/var/ossec"
8
+	#define DEFAULTDIR	"/usr/local/ossec-hids"
9
 #endif
10
 
11
 
(-)files/patch-src_os__dbd_mysql.schema (-11 lines)
Lines 1-11 Link Here
1
--- src/os_dbd/mysql.schema.orig	2015-10-12 21:21:06 UTC
2
+++ src/os_dbd/mysql.schema
3
@@ -45,7 +45,7 @@ CREATE TABLE server 
4
     last_contact    INT         UNSIGNED NOT NULL,
5
     version         VARCHAR(32)          NOT NULL,
6
     hostname        VARCHAR(64)          NOT NULL   UNIQUE,
7
-    information     VARCHAR(128)         NOT NULL,    
8
+    information     TEXT                 NOT NULL,    
9
     PRIMARY KEY  (id) 
10
     ); 
11
 
(-)files/patch-src_os__dbd_postgresql.schema (-11 lines)
Lines 1-11 Link Here
1
--- src/os_dbd/postgresql.schema.orig	2015-10-12 21:21:06 UTC
2
+++ src/os_dbd/postgresql.schema
3
@@ -47,7 +47,7 @@ CREATE TABLE server 
4
     last_contact    INT8                 NOT NULL,
5
     version         VARCHAR(32)          NOT NULL,
6
     hostname        VARCHAR(64)          NOT NULL   UNIQUE,
7
-    information     VARCHAR(128)         NOT NULL,    
8
+    information     TEXT                 NOT NULL,    
9
     PRIMARY KEY  (id) 
10
     ); 
11
 
(-)files/patch-src_os__net_os__net.c (+24 lines)
Line 0 Link Here
1
--- src/os_net/os_net.c.orig	2017-12-19 21:30:31 UTC
2
+++ src/os_net/os_net.c
3
@@ -48,16 +48,16 @@ int OS_Bindport(char *_port, unsigned in
4
 
5
 
6
     memset(&hints, 0, sizeof(struct addrinfo));
7
-#ifdef AI_V4MAPPED
8
-    hints.ai_family = AF_INET6;    /* Allow IPv4 and IPv6 */
9
-    hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG | AI_V4MAPPED;
10
-#else
11
+//#ifdef AI_V4MAPPED
12
+//    hints.ai_family = AF_INET6;    /* Allow IPv4 and IPv6 */
13
+//    hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG | AI_V4MAPPED;
14
+//#else
15
     /* Certain *BSD OS (eg. OpenBSD) do not allow binding to a
16
        single-socket for both IPv4 and IPv6 per RFC 3493.  This will 
17
        allow one or the other based on _ip. */
18
     hints.ai_family = AF_UNSPEC;    /* Allow IPv4 or IPv6 */
19
     hints.ai_flags = AI_PASSIVE;
20
-#endif
21
+//#endif
22
     hints.ai_protocol = _proto;
23
     if (_proto == IPPROTO_UDP) {
24
         hints.ai_socktype = SOCK_DGRAM;
(-)files/patch-src_rootcheck_db_system__audit__rcl.txt (+11 lines)
Line 0 Link Here
1
--- src/rootcheck/db/system_audit_rcl.txt.orig	2017-12-19 21:30:31 UTC
2
+++ src/rootcheck/db/system_audit_rcl.txt
3
@@ -25,7 +25,7 @@
4
 # Multiple patterns can be specified by using " && " between them.
5
 # (All of them must match for it to return true).
6
 
7
-$php.ini=/etc/php.ini,/var/www/conf/php.ini,/etc/php5/apache2/php.ini;
8
+$php.ini=/etc/php.ini,/var/www/conf/php.ini,/etc/php5/apache2/php.ini,/usr/local/etc/php.ini;
9
 $web_dirs=/var/www,/var/htdocs,/home/httpd,/usr/local/apache,/usr/local/apache2,/usr/local/www;
10
 
11
 # PHP checks
(-)files/pkg-message.in (-21 lines)
Lines 1-21 Link Here
1
After installation, you need to edit the ossec.conf file to reflect
2
the correct settings for your environment.  All the files related
3
to %%PORTNAME%% have been installed in %%PREFIX%%/%%PORTNAME%% and
4
its subdirectories.
5
6
For information on proper configuration, see http://www.ossec.net/.
7
8
To enable the startup script, add ossechids_enable="YES" to
9
/etc/rc.conf.  To enable database output, execute:
10
11
%%PREFIX%%/%%PORTNAME%%/bin/ossec-control enable database
12
13
Then check this documentation:
14
15
http://www.ossec.net/doc/manual/output/database-output.html
16
17
When you deinstall this port after starting the daemons once, many
18
directories that are created by the daemons will remain.  To fully
19
remove the port you need to delete those directories manually.  To
20
further enhance the security on your system, you may also enable
21
some checks in PAM for a fast reaction against intrusions.
(-)files/restart-ossec.sh.in (+32 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# This script is part of FreeBSD port - report any issues to the port MAINTAINER
4
5
ossec_type="%%OSSEC_TYPE%%"
6
ossec_home="%%PREFIX%%/%%PORTNAME%%"
7
ossec_rc="%%OSSEC_RC%%"
8
9
ACTION=$1
10
USER=$2
11
IP=$3
12
13
LOCAL=`dirname $0`;
14
cd $LOCAL
15
cd ../../tmp
16
17
# Logging the call
18
echo "`date` $0 $1 $2 $3 $4 $5" >> "${ossec_home}/logs/active-responses.log"
19
20
case ${ACTION} in
21
    add)
22
        "${ossec_rc}" restart
23
        exit 0
24
        ;;
25
    delete)
26
        exit 0
27
        ;;
28
    *)
29
        echo "$0: invalid action: ${ACTION}"
30
        exit 1
31
        ;;
32
esac
(-)files/rule-config.xml.in (+52 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<group name="ossec,">
3
4
  <rule id="56001" level="10">
5
    <if_group>syscheck</if_group>
6
    <match>%%PREFIX%%/%%PORTNAME%%/etc/ossec-dist.conf</match>
7
    <description>ossec-dist.conf has been modified</description>
8
  </rule>
9
10
  <rule id="56002" level="10">
11
    <if_group>syscheck</if_group>
12
    <match>%%PREFIX%%/%%PORTNAME%%/etc/ossec-local.conf</match>
13
    <description>ossec-local.conf has been modified</description>
14
  </rule>
15
16
  <rule id="56003" level="10" ignore="10">
17
    <if_group>syscheck</if_group>
18
    <match>%%PREFIX%%/%%PORTNAME%%/etc/ossec.conf</match>
19
    <description>ossec.conf has been modified</description>
20
  </rule>
21
22
  <rule id="56004" level="10" ignore="10">
23
    <if_group>syscheck</if_group>
24
    <match>/var/ossec/etc/ossec.conf</match>
25
    <description>ossec.conf has been modified</description>
26
  </rule>
27
28
  <rule id="56011" level="10">
29
    <if_group>syscheck</if_group>
30
    <match>%%PREFIX%%/%%PORTNAME%%/etc/agent-dist.conf</match>
31
    <description>agent-dist.conf has been modified</description>
32
  </rule>
33
34
  <rule id="56012" level="10">
35
    <if_group>syscheck</if_group>
36
    <match>%%PREFIX%%/%%PORTNAME%%/etc/agent-local.conf</match>
37
    <description>agent-local.conf has been modified</description>
38
  </rule>
39
40
  <rule id="56013" level="10" ignore="10">
41
    <if_group>syscheck</if_group>
42
    <match>%%PREFIX%%/%%PORTNAME%%/etc/shared/agent.conf</match>
43
    <description>agent.conf has been modified</description>
44
  </rule>
45
46
  <rule id="56014" level="10" ignore="10">
47
    <if_group>syscheck</if_group>
48
    <match>/var/ossec/etc/shared/agent.conf</match>
49
    <description>agent.conf has been modified</description>
50
  </rule>
51
52
</group>
(-)files/rule-firewall.xml.in (+32 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<group name="ossec,active_response,">
3
4
  <rule id="56021" level="3">
5
    <if_sid>600</if_sid>
6
    <action>ipfw.sh</action>
7
    <status>add</status>
8
    <description>Host Blocked by ipfw.sh Active Response</description>
9
  </rule>
10
11
  <rule id="56022" level="3">
12
    <if_sid>600</if_sid>
13
    <action>ipfw.sh</action>
14
    <status>delete</status>
15
    <description>Host Unblocked by ipfw.sh Active Response</description>
16
  </rule>
17
18
  <rule id="56023" level="3">
19
    <if_sid>600</if_sid>
20
    <action>pf.sh</action>
21
    <status>add</status>
22
    <description>Host Blocked by pf.sh Active Response</description>
23
  </rule>
24
25
  <rule id="56024" level="3">
26
    <if_sid>600</if_sid>
27
    <action>pf.sh</action>
28
    <status>delete</status>
29
    <description>Host Unblocked by pf.sh Active Response</description>
30
  </rule>
31
32
</group>
(-)files/rule-ports.xml.in (+32 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<group name="ossec,">
3
4
  <rule id="56041" level="7">
5
    <if_sid>530</if_sid>
6
    <match>ossec: output: 'freebsd-ports-tcp4'</match>
7
    <check_diff />
8
    <description>Listening IPv4 TCP port opened or closed.</description>
9
  </rule>
10
11
  <rule id="56042" level="7">
12
    <if_sid>530</if_sid>
13
    <match>ossec: output: 'freebsd-ports-tcp6'</match>
14
    <check_diff />
15
    <description>Listening IPv6 TCP port opened or closed.</description>
16
  </rule>
17
18
  <rule id="56043" level="7">
19
    <if_sid>530</if_sid>
20
    <match>ossec: output: 'freebsd-ports-udp4'</match>
21
    <check_diff />
22
    <description>IPv4 UDP port opened or closed.</description>
23
  </rule>
24
25
  <rule id="56044" level="7">
26
    <if_sid>530</if_sid>
27
    <match>ossec: output: 'freebsd-ports-udp6'</match>
28
    <check_diff />
29
    <description>IPv6 UDP port opened or closed.</description>
30
  </rule>
31
32
</group>
(-)files/template-ar-cmds-default.xml.in (+38 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <command>
5
    <name>host-deny</name>
6
    <executable>host-deny.sh</executable>
7
    <expect>srcip</expect>
8
    <timeout_allowed>yes</timeout_allowed>
9
  </command>
10
11
  <command>
12
    <name>firewall-drop</name>
13
    <executable>%%FW_DROP%%</executable>
14
    <expect>srcip</expect>
15
    <timeout_allowed>yes</timeout_allowed>
16
  </command>
17
18
  <command>
19
    <name>disable-account</name>
20
    <executable>disable-account.sh</executable>
21
    <expect>user</expect>
22
    <timeout_allowed>yes</timeout_allowed>
23
  </command>
24
25
  <command>
26
    <name>restart-ossec</name>
27
    <executable>restart-ossec.sh</executable>
28
    <expect></expect>
29
  </command>
30
31
  <command>
32
    <name>route-null</name>
33
    <executable>route-null.sh</executable>
34
    <expect>srcip</expect>
35
    <timeout_allowed>yes</timeout_allowed>
36
  </command>
37
38
</template_config>
(-)files/template-ar-cmds-merge.xml.in (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <command>
5
    <name>merge-configs</name>
6
    <executable>merge-configs.sh</executable>
7
    <expect></expect>
8
  </command>
9
10
</template_config>
(-)files/template-ar-merge.xml.in (+11 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <active-response>
5
    <!-- Create "ossec.conf" and "agent.conf" if "dist" or "local" files change. -->
6
    <command>merge-configs</command>
7
    <location>local</location>
8
    <rules_id>56001,56002,56011,56012</rules_id>
9
  </active-response>
10
11
</template_config>
(-)files/template-ar-restart.xml.in (+11 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <active-response>
5
    <!-- Restart OSSEC if "ossec.conf" or "agent.conf" changes. -->
6
    <command>restart-ossec</command>
7
    <location>local</location>
8
    <rules_id>56003,56004,56013,56014</rules_id>
9
  </active-response>
10
11
</template_config>
(-)files/template-arlog.xml.in (+18 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%ARLOG_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes log monitoring configuration using "agent.conf" (FreeBSD server can push it using "%%ARLOG_PROFILE%%" profile). -->
4
  <localfile>
5
    <log_format>syslog</log_format>
6
    <location>%%PREFIX%%/%%PORTNAME%%/logs/active-responses.log</location>
7
  </localfile>
8
9
</template_config>
10
11
<template_config os="Linux" profile="%%ARLOG_PROFILE%%">
12
13
  <localfile>
14
    <log_format>syslog</log_format>
15
    <location>/var/ossec/logs/active-responses.log</location>
16
  </localfile>
17
18
</template_config>
(-)files/template-baselogs.xml.in (+68 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%BASELOGS_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes log monitoring configuration using "agent.conf" (FreeBSD server can push it using "%%BASELOGS_PROFILE%%" profile). -->
4
  <localfile>
5
    <log_format>syslog</log_format>
6
    <location>/var/log/auth.log</location>
7
  </localfile>
8
9
  <localfile>
10
    <log_format>syslog</log_format>
11
    <location>/var/log/maillog</location>
12
  </localfile>
13
14
  <localfile>
15
    <log_format>syslog</log_format>
16
    <location>/var/log/messages</location>
17
  </localfile>
18
19
  <localfile>
20
    <log_format>syslog</log_format>
21
    <location>/var/log/security</location>
22
  </localfile>
23
24
  <localfile>
25
    <log_format>syslog</log_format>
26
    <location>/var/log/userlog</location>
27
  </localfile>
28
29
  <localfile>
30
    <log_format>syslog</log_format>
31
    <location>/var/log/xferlog</location>
32
  </localfile>
33
34
</template_config>
35
36
<template_config os="Linux" profile="%%BASELOGS_PROFILE%%">
37
38
  <localfile>
39
    <log_format>syslog</log_format>
40
    <location>/var/log/auth.log</location>
41
  </localfile>
42
43
  <localfile>
44
    <log_format>syslog</log_format>
45
    <location>/var/log/dpkg.log</location>
46
  </localfile>
47
48
  <localfile>
49
    <log_format>syslog</log_format>
50
    <location>/var/log/kern.log</location>
51
  </localfile>
52
53
  <localfile>
54
    <log_format>syslog</log_format>
55
    <location>/var/log/mail.log</location>
56
  </localfile>
57
58
  <localfile>
59
    <log_format>syslog</log_format>
60
    <location>/var/log/messages</location>
61
  </localfile>
62
63
  <localfile>
64
    <log_format>syslog</log_format>
65
    <location>/var/log/syslog</location>
66
  </localfile>
67
68
</template_config>
(-)files/template-cmds-logins.xml.in (+10 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <localfile>
5
    <log_format>full_command</log_format>
6
    <command>last -n 5</command>
7
    <alias>freebsd-last-logins</alias>
8
  </localfile>
9
10
</template_config>
(-)files/template-cmds-ports-tcp.xml.in (+16 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <localfile>
5
    <log_format>full_command</log_format>
6
    <command>netstat -4 -p tcp -Wan | grep LISTEN | awk '{print $4}' | sed 's/\(.*\)\./\1:/' | sort</command>
7
    <alias>freebsd-ports-tcp4</alias>
8
  </localfile>
9
10
  <localfile>
11
    <log_format>full_command</log_format>
12
    <command>netstat -6 -p tcp -Wan | grep LISTEN | awk '{print $4}' | sed 's/\(.*\)\./\1:/' | sort</command>
13
    <alias>freebsd-ports-tcp6</alias>
14
  </localfile>
15
16
</template_config>
(-)files/template-cmds-ports-udp.xml.in (+16 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <localfile>
5
    <log_format>full_command</log_format>
6
    <command>netstat -4 -p udp -Wan | grep udp4 | awk '{print $4}' | sed 's/\(.*\)\./\1:/' | sort</command>
7
    <alias>freebsd-ports-udp4</alias>
8
  </localfile>
9
10
  <localfile>
11
    <log_format>full_command</log_format>
12
    <command>netstat -6 -p udp -Wan | grep udp6 | awk '{print $4}' | sed 's/\(.*\)\./\1:/' | sort</command>
13
    <alias>freebsd-ports-udp6</alias>
14
  </localfile>
15
16
</template_config>
(-)files/template-header.xml.in (+4 lines)
Line 0 Link Here
1
<!-- OSSEC HIDS %%VERSION%% -->
2
3
<!-- DO NOT EDIT - file generated automatically based on selected port options. -->
4
(-)files/template-logs-apache.xml.in (+28 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%APACHE_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes log monitoring configuration using "agent.conf" (FreeBSD server can push it using "%%APACHE_PROFILE%%" profile). -->
4
  <localfile>
5
    <log_format>apache</log_format>
6
    <location>/var/log/httpd-error.log</location>
7
  </localfile>
8
9
  <localfile>
10
    <log_format>apache</log_format>
11
    <location>/var/log/httpd-access.log</location>
12
  </localfile>
13
14
</template_config>
15
16
<template_config os="Linux" profile="%%APACHE_PROFILE%%">
17
18
  <localfile>
19
    <log_format>apache</log_format>
20
    <location>/var/log/apache2/error.log</location>
21
  </localfile>
22
23
  <localfile>
24
    <log_format>apache</log_format>
25
    <location>/var/log/apache2/access.log</location>
26
  </localfile>
27
28
</template_config>
(-)files/template-logs-nginx.xml.in (+28 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%NGINX_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes log monitoring configuration using "agent.conf" (FreeBSD server can push it using "%%NGINX_PROFILE%%" profile). -->
4
  <localfile>
5
    <log_format>apache</log_format>
6
    <location>/var/log/nginx/error.log</location>
7
  </localfile>
8
9
  <localfile>
10
    <log_format>apache</log_format>
11
    <location>/var/log/nginx/access.log</location>
12
  </localfile>
13
14
</template_config>
15
16
<template_config os="Linux" profile="%%NGINX_PROFILE%%">
17
18
  <localfile>
19
    <log_format>apache</log_format>
20
    <location>/var/log/nginx/error.log</location>
21
  </localfile>
22
23
  <localfile>
24
    <log_format>apache</log_format>
25
    <location>/var/log/nginx/access.log</location>
26
  </localfile>
27
28
</template_config>
(-)files/template-logs-radius.xml.in (+18 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%RADIUS_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes log monitoring configuration using "agent.conf" (FreeBSD server can push it using "%%RADIUS_PROFILE%%" profile). -->
4
  <localfile>
5
    <log_format>syslog</log_format>
6
    <location>/var/log/radius.log</location>
7
  </localfile>
8
9
</template_config>
10
11
<template_config os="Linux" profile="%%RADIUS_PROFILE%%">
12
13
  <localfile>
14
    <log_format>syslog</log_format>
15
    <location>/var/log/freeradius/radius.log</location>
16
  </localfile>
17
18
</template_config>
(-)files/template-logs-vsftpd.xml.in (+18 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%VSFTPD_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes log monitoring configuration using "agent.conf" (FreeBSD server can push it using "%%VSFTPD_PROFILE%%" profile). -->
4
  <localfile>
5
    <log_format>syslog</log_format>
6
    <location>/var/log/vsftpd.log</location>
7
  </localfile>
8
9
</template_config>
10
11
<template_config os="Linux" profile="%%VSFTPD_PROFILE%%">
12
13
  <localfile>
14
    <log_format>syslog</log_format>
15
    <location>/var/log/vsftpd.log</location>
16
  </localfile>
17
18
</template_config>
(-)files/template-pushed-header.xml.in (+4 lines)
Line 0 Link Here
1
<!-- OSSEC HIDS %%VERSION%% -->
2
3
<!-- DO NOT EDIT - file generated automatically based on selected port options. -->
4
(-)files/template-pushed-sample.xml.in (+3 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
</template_config>
(-)files/template-rootcheck.xml.in (+23 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%ROOTCHECK_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes rootcheck configuration using "agent.conf" (FreeBSD server can push it using "%%ROOTCHECK_PROFILE%%" profile). -->
4
  <rootcheck>
5
    <rootkit_files>%%PREFIX%%/%%PORTNAME%%/etc/shared/rootkit_files.txt</rootkit_files>
6
    <rootkit_trojans>%%PREFIX%%/%%PORTNAME%%/etc/shared/rootkit_trojans.txt</rootkit_trojans>
7
    <system_audit>%%PREFIX%%/%%PORTNAME%%/etc/shared/system_audit_rcl.txt</system_audit>
8
    <system_audit>%%PREFIX%%/%%PORTNAME%%/etc/shared/system_audit_ssh.txt</system_audit>
9
  </rootcheck>
10
11
</template_config>
12
13
<template_config os="Linux" profile="%%ROOTCHECK_PROFILE%%">
14
15
  <rootcheck>
16
    <rootkit_files>/var/ossec/etc/shared/rootkit_files.txt</rootkit_files>
17
    <rootkit_trojans>/var/ossec/etc/shared/rootkit_trojans.txt</rootkit_trojans>
18
    <system_audit>/var/ossec/etc/shared/system_audit_rcl.txt</system_audit>
19
    <system_audit>/var/ossec/etc/shared/system_audit_ssh.txt</system_audit>
20
    <system_audit>/var/ossec/etc/shared/cis_debian_linux_rcl.txt</system_audit>
21
  </rootcheck>
22
23
</template_config>
(-)files/template-rules-config.xml.in (+8 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <rules>
5
    <include>freebsd_config_rules.xml</include>
6
  </rules>
7
8
</template_config>
(-)files/template-rules-default.xml.in (+66 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <rules>
5
    <!-- Imported from "ossec-hids-2.9.3/etc/templates/config/rules.template". -->
6
    <include>rules_config.xml</include>
7
    <include>pam_rules.xml</include>
8
    <include>sshd_rules.xml</include>
9
    <include>telnetd_rules.xml</include>
10
    <include>syslog_rules.xml</include>
11
    <include>arpwatch_rules.xml</include>
12
    <include>symantec-av_rules.xml</include>
13
    <include>symantec-ws_rules.xml</include>
14
    <include>pix_rules.xml</include>
15
    <include>named_rules.xml</include>
16
    <include>smbd_rules.xml</include>
17
    <include>vsftpd_rules.xml</include>
18
    <include>pure-ftpd_rules.xml</include>
19
    <include>proftpd_rules.xml</include>
20
    <include>ms_ftpd_rules.xml</include>
21
    <include>ftpd_rules.xml</include>
22
    <include>hordeimp_rules.xml</include>
23
    <include>roundcube_rules.xml</include>
24
    <include>wordpress_rules.xml</include>
25
    <include>cimserver_rules.xml</include>
26
    <include>vpopmail_rules.xml</include>
27
    <include>vmpop3d_rules.xml</include>
28
    <include>courier_rules.xml</include>
29
    <include>web_rules.xml</include>
30
    <include>web_appsec_rules.xml</include>
31
    <include>apache_rules.xml</include>
32
    <include>nginx_rules.xml</include>
33
    <include>php_rules.xml</include>
34
    <include>mysql_rules.xml</include>
35
    <include>postgresql_rules.xml</include>
36
    <include>ids_rules.xml</include>
37
    <include>squid_rules.xml</include>
38
    <include>firewall_rules.xml</include>
39
    <include>cisco-ios_rules.xml</include>
40
    <include>netscreenfw_rules.xml</include>
41
    <include>sonicwall_rules.xml</include>
42
    <include>postfix_rules.xml</include>
43
    <include>sendmail_rules.xml</include>
44
    <include>imapd_rules.xml</include>
45
    <include>mailscanner_rules.xml</include>
46
    <include>dovecot_rules.xml</include>
47
    <include>ms-exchange_rules.xml</include>
48
    <include>racoon_rules.xml</include>
49
    <include>vpn_concentrator_rules.xml</include>
50
    <include>spamd_rules.xml</include>
51
    <include>msauth_rules.xml</include>
52
    <include>mcafee_av_rules.xml</include>
53
    <include>trend-osce_rules.xml</include>
54
    <include>ms-se_rules.xml</include>
55
    <!-- <include>policy_rules.xml</include> -->
56
    <include>zeus_rules.xml</include>
57
    <include>solaris_bsm_rules.xml</include>
58
    <include>vmware_rules.xml</include>
59
    <include>ms_dhcp_rules.xml</include>
60
    <include>asterisk_rules.xml</include>
61
    <include>ossec_rules.xml</include>
62
    <include>attack_rules.xml</include>
63
    <include>local_rules.xml</include>
64
  </rules>
65
66
</template_config>
(-)files/template-rules-firewall.xml.in (+8 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <rules>
5
    <include>freebsd_firewall_rules.xml</include>
6
  </rules>
7
8
</template_config>
(-)files/template-rules-ports.xml.in (+8 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <rules>
5
    <include>freebsd_ports_rules.xml</include>
6
  </rules>
7
8
</template_config>
(-)files/template-sample-agent.xml.in (+19 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <client>
5
    <!-- Specify the IP address of the %%PORTNAME%% server. -->
6
    <server-ip>1.2.3.4</server-ip>
7
    <!-- Alternatively, specify the hostname of the %%PORTNAME%% server. -->
8
    <!-- <server-hostname>example.com</server-hostname> -->
9
10
    <!-- Specifies the agent.conf profiles to be used by the agent. Multiple profiles can be included, separated by a comma and a space. -->
11
    <!-- <config-profile>%%CLIENT_PROFILES%%</config-profile> -->
12
  </client>
13
14
  <syscheck>
15
    <!-- Ignoring the "hosts.allow" is reasonable if host-deny active response is active for this OSSEC instance. -->
16
    <ignore>/etc/hosts.allow</ignore>
17
  </syscheck>
18
19
</template_config>
(-)files/template-sample-header.xml.in (+1 lines)
Line 0 Link Here
1
<!-- Place customized configuration here - it will not be overwritten during upgrades. -->
(-)files/template-sample-local.xml.in (+51 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <global>
5
    <!-- Uncomment to enable email notifications. -->
6
    <!--
7
    <email_notification>yes</email_notification>
8
    <email_to>example@example.com</email_to>
9
    <smtp_server>smtp.example.com</smtp_server>
10
    <email_from>ossecm@example.com</email_from>
11
    -->
12
13
    <!-- List of IP addresses that should never be blocked by the active response (one per element). -->
14
    <white_list>127.0.0.1</white_list>
15
  </global>
16
17
  <!-- Run "%%PREFIX%%/%%PORTNAME%%/bin/ossec-control enable database" to enable ossec-dbd. -->
18
  <!-- Uncomment to enable database output (if compiled with database support). -->
19
  <!--
20
  <database_output>
21
    <hostname>localhost</hostname>
22
    <username>ossec</username>
23
    <password>secret</password>
24
    <database>ossec</database>
25
    <type>%%DB_TYPE%%</type>
26
  </database_output>
27
  -->
28
29
  <syscheck>
30
    <auto_ignore>no</auto_ignore>
31
    <!-- Ignoring the "hosts.allow" is reasonable if host-deny active response is active for this OSSEC instance. -->
32
    <ignore>/etc/hosts.allow</ignore>
33
  </syscheck>
34
35
  <active-response>
36
    <!-- Deny the IP in "/etc/hosts.allow". -->
37
    <command>host-deny</command>
38
    <location>local</location>
39
    <level>6</level>
40
    <timeout>600</timeout>
41
  </active-response>
42
43
  <active-response>
44
    <!-- Block the IP on the firewall. Remember to set proper "location" of the firewall. -->
45
    <command>firewall-drop</command>
46
    <location>local</location>
47
    <level>6</level>
48
    <timeout>600</timeout>
49
  </active-response>
50
51
</template_config>
(-)files/template-sample-server.xml.in (+57 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <remote>
5
    <connection>secure</connection>
6
    <!-- Because of a bug, setting the IP is mandatory for IPv4. -->
7
    <local_ip>1.2.3.4</local_ip>
8
  </remote>
9
10
  <global>
11
    <!-- Uncomment to enable email notifications. -->
12
    <!--
13
    <email_notification>yes</email_notification>
14
    <email_to>example@example.com</email_to>
15
    <smtp_server>smtp.example.com</smtp_server>
16
    <email_from>ossecm@example.com</email_from>
17
    -->
18
19
    <!-- List of IP addresses that should never be blocked by the active response (one per element). -->
20
    <white_list>127.0.0.1</white_list>
21
  </global>
22
23
  <!-- Run "%%PREFIX%%/%%PORTNAME%%/bin/ossec-control enable database" to enable ossec-dbd. -->
24
  <!-- Uncomment to enable database output (if compiled wit database support). -->
25
  <!--
26
  <database_output>
27
    <hostname>localhost</hostname>
28
    <username>ossec</username>
29
    <password>secret</password>
30
    <database>ossec</database>
31
    <type>%%DB_TYPE%%</type>
32
  </database_output>
33
  -->
34
35
  <syscheck>
36
    <auto_ignore>no</auto_ignore>
37
    <!-- Ignoring the "hosts.allow" is reasonable if host-deny active response is active for this OSSEC instance. -->
38
    <ignore>/etc/hosts.allow</ignore>
39
  </syscheck>
40
41
  <active-response>
42
    <!-- Deny the IP in "/etc/hosts.allow". -->
43
    <command>host-deny</command>
44
    <location>local</location>
45
    <level>6</level>
46
    <timeout>600</timeout>
47
  </active-response>
48
49
  <active-response>
50
    <!-- Block the IP on the firewall. Remember to set proper "location" of the firewall. -->
51
    <command>firewall-drop</command>
52
    <location>local</location>
53
    <level>6</level>
54
    <timeout>600</timeout>
55
  </active-response>
56
57
</template_config>
(-)files/template-syscheck.xml.in (+22 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%SYSCHECK_PROFILE%%">
3
  <!-- agent: Remove this section if server pushes syscheck configuration using "agent.conf" (FreeBSD server can push it using "%%SYSCHECK_PROFILE%%" profile). -->
4
  <syscheck>
5
    <directories realtime="yes" check_all="yes">/etc,/usr/bin,/usr/sbin</directories>
6
    <directories realtime="yes" check_all="yes">/bin,/sbin</directories>
7
    <directories realtime="yes" check_all="yes">%%PREFIX%%/etc,%%PREFIX%%/bin,%%PREFIX%%/sbin</directories>
8
    <directories realtime="yes" check_all="yes">%%OSSEC_SYSCHECK_DIRS%%</directories>
9
  </syscheck>
10
11
</template_config>
12
13
<template_config os="Linux" profile="%%SYSCHECK_PROFILE%%">
14
15
  <syscheck>
16
    <directories realtime="yes" check_all="yes">/etc,/usr/bin,/usr/sbin</directories>
17
    <directories realtime="yes" check_all="yes">/bin,/sbin</directories>
18
    <directories realtime="yes" check_all="yes">/usr/local/etc,/usr/local/bin,/usr/local/sbin</directories>
19
    <directories realtime="yes" check_all="yes">/var/ossec/etc,/var/ossec/bin,/var/ossec/active-response,/var/ossec/agentless,/var/ossec/rules</directories>
20
  </syscheck>
21
22
</template_config>
(-)pkg-deinstall (+14 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_home="${PKG_PREFIX}/ossec-hids"
4
ossec_conf="${ossec_home}/etc/ossec.conf"
5
agent_conf="${ossec_home}/etc/shared/agent.conf"
6
ar_conf="${ossec_home}/etc/shared/ar.conf"
7
merged_mg="${ossec_home}/etc/shared/merged.mg"
8
9
if [ "$2" == "DEINSTALL"  ]; then
10
    rm -f "${ossec_conf}"
11
    rm -f "${agent_conf}"
12
    rm -f "${ar_conf}"
13
    rm -f "${merged_mg}"
14
fi
(-)pkg-descr (-1 / +1 lines)
Lines 3-6 Link Here
3
monitoring, rootkit detection, time-based alerting and active
3
monitoring, rootkit detection, time-based alerting and active
4
response.
4
response.
5
5
6
WWW: http://www.ossec.net/
6
WWW: https://ossec.github.io
(-)pkg-help-agent (+13 lines)
Line 0 Link Here
1
Hints:
2
3
  The main configuration is kept in "ossec-dist.conf" and "ossec-local.conf".
4
  These two files will be merged into "ossec.conf" before OSSEC startup.
5
6
  Any unchecked "ossec-dist.conf" options will result in placing related
7
  configuration in "ossec-local.conf.sample" instead of "ossec-dist.conf".
8
9
  If the agent configuration is pushed by the server using "agent.conf", then
10
  the "System checks" and "Log monitoring" should remain empty - all options
11
  there should be unchecked (default) and proper sections removed from
12
  "ossec-local.conf". Note that for security reasons "Command monitoring"
13
  options cannot be pushed using "agent.conf".
(-)pkg-help-local (+7 lines)
Line 0 Link Here
1
Hints:
2
3
  The main configuration is kept in "ossec-dist.conf" and "ossec-local.conf".
4
  These two files will be merged into "ossec.conf" before OSSEC startup.
5
6
  Any unchecked "ossec-dist.conf" options will result in placing related
7
  configuration in "ossec-local.conf.sample" instead of "ossec-dist.conf".
(-)pkg-help-server (+24 lines)
Line 0 Link Here
1
Hints:
2
3
  The main configuration is kept in "ossec-dist.conf" and "ossec-local.conf".
4
  These two files will be merged into "ossec.conf" before OSSEC startup.
5
6
  Any unchecked "ossec-dist.conf" options will result in placing related
7
  configuration in "ossec-local.conf.sample" instead of "ossec-dist.conf".
8
9
  The agent configuration is kept in "agent-dist.conf" and "agent-local.conf".
10
  These two files will be merged into "agent.conf" before OSSEC startup.
11
12
  The agent needs to use proper profile to benefit from "agent.conf"
13
  configuration on the server. This means you can leave all of the
14
  "agent-dist.conf" options checked even if no agents use them.
15
16
17
Note:
18
19
  The currently supported agent systems via "agent-dist.conf" are:
20
  - FreeBSD
21
  - Debian Linux
22
23
  Consider contributing to the port by contacting the maintainer and
24
  providing template configurations for other operating systems.
(-)pkg-install (+59 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_home="${PKG_PREFIX}/ossec-hids"
4
ossec_conf="${ossec_home}/etc/ossec.conf"
5
ossec_conf_bak="${ossec_conf}.bak"
6
agent_conf="${ossec_home}/etc/shared/agent.conf"
7
agent_conf_bak="${ossec_home}/etc/agent.conf.bak"
8
ossec_client_keys="${ossec_home}/etc/client.keys"
9
ossec_internal_options="${ossec_home}/etc/local_internal_options.conf"
10
11
install_file() {
12
    local path=$1
13
    local owner=$2
14
    local mode=$3
15
16
    if [ ! -e "${path}" ]; then
17
        touch "${path}" && chown ${owner} "${path}" && chmod ${mode} "${path}"
18
    fi
19
}
20
21
if [ "$2" == "POST-INSTALL"  ]; then
22
    if [ -e "${ossec_conf}" ]; then
23
        mv -f "${ossec_conf}" "${ossec_conf_bak}"
24
        echo
25
        echo "WARNING:"
26
        echo "  Existing \"${ossec_conf}\" has been saved to \"${ossec_conf_bak}\"."
27
        echo "  The \"ossec.conf\" must no longer be used for configuration. Use \"ossec-local.conf\" instead."
28
        echo
29
    fi
30
31
    case "$1" in
32
        ossec-hids-server*)
33
            if [ -e "${agent_conf}" ]; then
34
                mv -f "${agent_conf}" "${agent_conf_bak}"
35
                echo
36
                echo "WARNING:"
37
                echo "  Existing \"${agent_conf}\" has been saved to \"${agent_conf_bak}\"."
38
                echo "  The \"agent.conf\" must no longer be used for configuration. Use \"agent-local.conf\" instead."
39
                echo
40
            fi
41
            ;;
42
    esac
43
44
    install_file "${ossec_client_keys}" root:ossec 0640
45
46
    if [ ! -e "${ossec_internal_options}" ]; then
47
       install_file "${ossec_internal_options}" root:ossec 0640
48
49
       echo "# local_internal_options.conf
50
#
51
# This file should be handled with care. It contains
52
# run time modifications that can affect the use
53
# of OSSEC. Only change it if you know what you
54
# are doing. Look first at ossec-local.conf
55
# for most of the things you want to change.
56
#
57
# This file will not be overwritten during upgrades." > "${ossec_internal_options}"
58
    fi
59
fi
(-)pkg-plist (-168 lines)
Lines 1-168 Link Here
1
%%PORTNAME%%/active-response/bin/disable-account.sh
2
%%PORTNAME%%/active-response/bin/firewall-drop.sh
3
%%PORTNAME%%/active-response/bin/host-deny.sh
4
%%PORTNAME%%/active-response/bin/ip-customblock.sh
5
%%PORTNAME%%/active-response/bin/ipfw_mac.sh
6
%%PORTNAME%%/active-response/bin/ipfw.sh
7
%%PORTNAME%%/active-response/bin/ossec-tweeter.sh
8
%%PORTNAME%%/active-response/bin/pf.sh
9
%%PORTNAME%%/active-response/bin/restart-ossec.sh
10
%%PORTNAME%%/active-response/bin/route-null.sh
11
%%PORTNAME%%/bin/agent_control
12
%%PORTNAME%%/bin/clear_stats
13
%%PORTNAME%%/bin/list_agents
14
%%PORTNAME%%/bin/manage_agents
15
%%PORTNAME%%/bin/ossec-agentlessd
16
%%PORTNAME%%/bin/ossec-analysisd
17
%%PORTNAME%%/bin/ossec-authd
18
%%PORTNAME%%/bin/ossec-control
19
%%PORTNAME%%/bin/ossec-csyslogd
20
%%PORTNAME%%/bin/ossec-dbd
21
%%PORTNAME%%/bin/ossec-execd
22
%%PORTNAME%%/bin/ossec-logcollector
23
%%PORTNAME%%/bin/ossec-logtest
24
%%PORTNAME%%/bin/ossec-lua
25
%%PORTNAME%%/bin/ossec-luac
26
%%PORTNAME%%/bin/ossec-maild
27
%%PORTNAME%%/bin/ossec-makelists
28
%%PORTNAME%%/bin/ossec-monitord
29
%%PORTNAME%%/bin/ossec-regex
30
%%PORTNAME%%/bin/ossec-remoted
31
%%PORTNAME%%/bin/ossec-reportd
32
%%PORTNAME%%/bin/ossec-syscheckd
33
%%PORTNAME%%/bin/rootcheck_control
34
%%PORTNAME%%/bin/syscheck_control
35
%%PORTNAME%%/bin/syscheck_update
36
%%PORTNAME%%/bin/util.sh
37
%%PORTNAME%%/bin/verify-agent-conf
38
@group ossec
39
%%PORTNAME%%/etc/decoder.xml
40
%%PORTNAME%%/etc/internal_options.conf
41
@sample %%PORTNAME%%/etc/ossec.conf.sample
42
%%PORTNAME%%/etc/shared/rootkit_files.txt
43
%%PORTNAME%%/etc/shared/rootkit_trojans.txt
44
%%PORTNAME%%/etc/shared/system_audit_rcl.txt
45
%%PORTNAME%%/etc/shared/win_applications_rcl.txt
46
%%PORTNAME%%/etc/shared/win_audit_rcl.txt
47
%%PORTNAME%%/etc/shared/win_malware_rcl.txt
48
%%PORTNAME%%/etc/shared/cis_debian_linux_rcl.txt
49
%%PORTNAME%%/etc/shared/cis_rhel_linux_rcl.txt
50
%%PORTNAME%%/etc/shared/cis_rhel5_linux_rcl.txt
51
@owner
52
@group
53
@mode
54
%%PORTNAME%%/rules/apache_rules.xml
55
%%PORTNAME%%/rules/arpwatch_rules.xml
56
%%PORTNAME%%/rules/asterisk_rules.xml
57
%%PORTNAME%%/rules/attack_rules.xml
58
%%PORTNAME%%/rules/cimserver_rules.xml
59
%%PORTNAME%%/rules/cisco-ios_rules.xml
60
%%PORTNAME%%/rules/clam_av_rules.xml
61
%%PORTNAME%%/rules/courier_rules.xml
62
%%PORTNAME%%/rules/dovecot_rules.xml
63
%%PORTNAME%%/rules/dropbear_rules.xml
64
%%PORTNAME%%/rules/firewall_rules.xml
65
%%PORTNAME%%/rules/ftpd_rules.xml
66
%%PORTNAME%%/rules/hordeimp_rules.xml
67
%%PORTNAME%%/rules/ids_rules.xml
68
%%PORTNAME%%/rules/imapd_rules.xml
69
%%PORTNAME%%/rules/local_rules.xml
70
%%PORTNAME%%/rules/mailscanner_rules.xml
71
%%PORTNAME%%/rules/mcafee_av_rules.xml
72
%%PORTNAME%%/rules/ms-exchange_rules.xml
73
%%PORTNAME%%/rules/ms-se_rules.xml
74
%%PORTNAME%%/rules/ms_dhcp_rules.xml
75
%%PORTNAME%%/rules/ms_ftpd_rules.xml
76
%%PORTNAME%%/rules/msauth_rules.xml
77
%%PORTNAME%%/rules/mysql_rules.xml
78
%%PORTNAME%%/rules/named_rules.xml
79
%%PORTNAME%%/rules/netscreenfw_rules.xml
80
%%PORTNAME%%/rules/nginx_rules.xml
81
%%PORTNAME%%/rules/openbsd_rules.xml
82
%%PORTNAME%%/rules/ossec_rules.xml
83
%%PORTNAME%%/rules/pam_rules.xml
84
%%PORTNAME%%/rules/php_rules.xml
85
%%PORTNAME%%/rules/pix_rules.xml
86
%%PORTNAME%%/rules/policy_rules.xml
87
%%PORTNAME%%/rules/postfix_rules.xml
88
%%PORTNAME%%/rules/postgresql_rules.xml
89
%%PORTNAME%%/rules/proftpd_rules.xml
90
%%PORTNAME%%/rules/pure-ftpd_rules.xml
91
%%PORTNAME%%/rules/racoon_rules.xml
92
%%PORTNAME%%/rules/roundcube_rules.xml
93
%%PORTNAME%%/rules/rules_config.xml
94
%%PORTNAME%%/rules/sendmail_rules.xml
95
%%PORTNAME%%/rules/smbd_rules.xml
96
%%PORTNAME%%/rules/solaris_bsm_rules.xml
97
%%PORTNAME%%/rules/sonicwall_rules.xml
98
%%PORTNAME%%/rules/spamd_rules.xml
99
%%PORTNAME%%/rules/squid_rules.xml
100
%%PORTNAME%%/rules/sshd_rules.xml
101
%%PORTNAME%%/rules/symantec-av_rules.xml
102
%%PORTNAME%%/rules/symantec-ws_rules.xml
103
%%PORTNAME%%/rules/syslog_rules.xml
104
%%PORTNAME%%/rules/telnetd_rules.xml
105
%%PORTNAME%%/rules/trend-osce_rules.xml
106
%%PORTNAME%%/rules/vmpop3d_rules.xml
107
%%PORTNAME%%/rules/vmware_rules.xml
108
%%PORTNAME%%/rules/vpn_concentrator_rules.xml
109
%%PORTNAME%%/rules/vpopmail_rules.xml
110
%%PORTNAME%%/rules/vsftpd_rules.xml
111
%%PORTNAME%%/rules/web_appsec_rules.xml
112
%%PORTNAME%%/rules/web_rules.xml
113
%%PORTNAME%%/rules/wordpress_rules.xml
114
%%PORTNAME%%/rules/zeus_rules.xml
115
@owner root
116
@group ossec
117
%%PORTNAME%%/agentless/main.exp
118
%%PORTNAME%%/agentless/register_host.sh
119
%%PORTNAME%%/agentless/ssh.exp
120
%%PORTNAME%%/agentless/ssh_asa-fwsmconfig_diff
121
%%PORTNAME%%/agentless/ssh_foundry_diff
122
%%PORTNAME%%/agentless/ssh_generic_diff
123
%%PORTNAME%%/agentless/ssh_integrity_check_bsd
124
%%PORTNAME%%/agentless/ssh_integrity_check_linux
125
%%PORTNAME%%/agentless/ssh_nopass.exp
126
%%PORTNAME%%/agentless/ssh_pixconfig_diff
127
%%PORTNAME%%/agentless/sshlogin.exp
128
%%PORTNAME%%/agentless/su.exp
129
@(ossec,,) %%PORTNAME%%/logs/active-responses.log
130
@(ossec,,) %%PORTNAME%%/logs/ossec.log
131
@mode 550
132
@dir %%PORTNAME%%/.ssh
133
@dir %%PORTNAME%%/active-response/bin
134
@dir %%PORTNAME%%/active-response
135
@dir %%PORTNAME%%/agentless
136
@dir %%PORTNAME%%/bin
137
@dir %%PORTNAME%%/etc/shared
138
@dir %%PORTNAME%%/etc
139
@dir %%PORTNAME%%/queue/rootcheck
140
@dir %%PORTNAME%%/rules
141
@dir %%PORTNAME%%/tmp
142
@mode 770
143
@dir %%PORTNAME%%/var/run
144
@mode 550
145
@dir %%PORTNAME%%/var
146
@owner ossec
147
@mode 770
148
@dir %%PORTNAME%%/queue/alerts
149
@dir %%PORTNAME%%/queue/ossec
150
@mode 750
151
@dir %%PORTNAME%%/queue/fts
152
@dir %%PORTNAME%%/queue/syscheck
153
@dir %%PORTNAME%%/queue/diff
154
@dir %%PORTNAME%%/queue/agentless
155
@dir %%PORTNAME%%/stats
156
@dir %%PORTNAME%%/logs/alerts
157
@dir %%PORTNAME%%/logs/archives
158
@dir %%PORTNAME%%/logs/firewall
159
@dir %%PORTNAME%%/logs
160
@owner ossecr
161
@dir %%PORTNAME%%/queue/agent-info
162
@dir %%PORTNAME%%/queue/rids
163
@owner ossec
164
@mode 550
165
@dir %%PORTNAME%%/queue
166
@owner root
167
@mode 550
168
@dir %%PORTNAME%%
(-)pkg-plist-agent (+67 lines)
Line 0 Link Here
1
@dir(,ossec,550) %%PORTNAME%%
2
@dir(,ossec,550) %%PORTNAME%%/active-response
3
@dir(,ossec,550) %%PORTNAME%%/active-response/bin
4
@(,ossec,550) %%PORTNAME%%/active-response/bin/disable-account.sh
5
@(,ossec,550) %%PORTNAME%%/active-response/bin/firewall-drop.sh
6
@(,ossec,550) %%PORTNAME%%/active-response/bin/firewalld-drop.sh
7
@(,ossec,550) %%PORTNAME%%/active-response/bin/host-deny.sh
8
@(,ossec,550) %%PORTNAME%%/active-response/bin/ip-customblock.sh
9
@(,ossec,550) %%PORTNAME%%/active-response/bin/ipfw.sh
10
@(,ossec,550) %%PORTNAME%%/active-response/bin/ipfw_mac.sh
11
@(,ossec,550) %%PORTNAME%%/active-response/bin/merge-configs.sh
12
@(,ossec,550) %%PORTNAME%%/active-response/bin/npf.sh
13
@(,ossec,550) %%PORTNAME%%/active-response/bin/ossec-slack.sh
14
@(,ossec,550) %%PORTNAME%%/active-response/bin/ossec-tweeter.sh
15
@(,ossec,550) %%PORTNAME%%/active-response/bin/pf.sh
16
@(,ossec,550) %%PORTNAME%%/active-response/bin/restart-ossec.sh
17
@(,ossec,550) %%PORTNAME%%/active-response/bin/route-null.sh
18
@dir(,,550) %%PORTNAME%%/bin
19
@(,,550) %%PORTNAME%%/bin/agent-auth
20
@(,,550) %%PORTNAME%%/bin/manage_agents
21
@(,,550) %%PORTNAME%%/bin/ossec-agentd
22
@(,,550) %%PORTNAME%%/bin/ossec-control
23
@(,,550) %%PORTNAME%%/bin/ossec-execd
24
@(,,550) %%PORTNAME%%/bin/ossec-logcollector
25
@(,,550) %%PORTNAME%%/bin/ossec-lua
26
@(,,550) %%PORTNAME%%/bin/ossec-luac
27
@(,,550) %%PORTNAME%%/bin/ossec-syscheckd
28
@(,,550) %%PORTNAME%%/bin/ossec_conf
29
@(,,550) %%PORTNAME%%/bin/util.sh
30
@dir(,ossec,550) %%PORTNAME%%/etc
31
@(,ossec,640) %%PORTNAME%%/etc/internal_options.conf
32
@(,ossec,440) %%PORTNAME%%/etc/localtime
33
@(,ossec,640) %%PORTNAME%%/etc/ossec-dist.conf
34
@sample(,ossec,640) %%PORTNAME%%/etc/ossec-local.conf.sample
35
@dir(,ossec,770) %%PORTNAME%%/etc/shared
36
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_debian_linux_rcl.txt
37
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_mysql5-6_community_rcl.txt
38
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_mysql5-6_enterprise_rcl.txt
39
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_rhel5_linux_rcl.txt
40
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_rhel6_linux_rcl.txt
41
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_rhel7_linux_rcl.txt
42
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_rhel_linux_rcl.txt
43
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_sles11_linux_rcl.txt
44
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/cis_sles12_linux_rcl.txt
45
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/rootkit_files.txt
46
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/rootkit_trojans.txt
47
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/system_audit_rcl.txt
48
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/system_audit_ssh.txt
49
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/win_applications_rcl.txt
50
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/win_audit_rcl.txt
51
@(ossec,ossec,644) %%PORTNAME%%/etc/shared/win_malware_rcl.txt
52
@dir(ossec,ossec,750) %%PORTNAME%%/logs
53
@dir(,ossec,700) %%PORTNAME%%/.ssh
54
@dir(,ossec,550) %%PORTNAME%%/queue
55
@dir(ossec,ossec,770) %%PORTNAME%%/queue/alerts
56
@dir(ossec,ossec,750) %%PORTNAME%%/queue/diff
57
@dir(ossec,ossec,750) %%PORTNAME%%/queue/ossec
58
@dir(ossec,ossec,750) %%PORTNAME%%/queue/rids
59
@dir(ossec,ossec,750) %%PORTNAME%%/queue/syscheck
60
@dir(,ossec,770) %%PORTNAME%%/tmp
61
@dir(,ossec,550) %%PORTNAME%%/var
62
@dir(,ossec,770) %%PORTNAME%%/var/run
63
%%PORTDOCS%%%%DOCSDIR%%/BUGS
64
%%PORTDOCS%%%%DOCSDIR%%/CONFIG
65
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS
66
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
67
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
(-)pkg-plist-local (+184 lines)
Line 0 Link Here
1
@dir(,ossec,550) %%PORTNAME%%
2
@dir(,ossec,550) %%PORTNAME%%/active-response
3
@dir(,ossec,550) %%PORTNAME%%/active-response/bin
4
@(,ossec,550) %%PORTNAME%%/active-response/bin/disable-account.sh
5
@(,ossec,550) %%PORTNAME%%/active-response/bin/firewall-drop.sh
6
@(,ossec,550) %%PORTNAME%%/active-response/bin/firewalld-drop.sh
7
@(,ossec,550) %%PORTNAME%%/active-response/bin/host-deny.sh
8
@(,ossec,550) %%PORTNAME%%/active-response/bin/ip-customblock.sh
9
@(,ossec,550) %%PORTNAME%%/active-response/bin/ipfw.sh
10
@(,ossec,550) %%PORTNAME%%/active-response/bin/ipfw_mac.sh
11
@(,ossec,550) %%PORTNAME%%/active-response/bin/merge-configs.sh
12
@(,ossec,550) %%PORTNAME%%/active-response/bin/npf.sh
13
@(,ossec,550) %%PORTNAME%%/active-response/bin/ossec-slack.sh
14
@(,ossec,550) %%PORTNAME%%/active-response/bin/ossec-tweeter.sh
15
@(,ossec,550) %%PORTNAME%%/active-response/bin/pf.sh
16
@(,ossec,550) %%PORTNAME%%/active-response/bin/restart-ossec.sh
17
@(,ossec,550) %%PORTNAME%%/active-response/bin/route-null.sh
18
@dir(,ossec,550) %%PORTNAME%%/agentless
19
@(,ossec,550) %%PORTNAME%%/agentless/main.exp
20
@(,ossec,550) %%PORTNAME%%/agentless/register_host.sh
21
@(,ossec,550) %%PORTNAME%%/agentless/ssh.exp
22
@(,ossec,550) %%PORTNAME%%/agentless/ssh_asa-fwsmconfig_diff
23
@(,ossec,550) %%PORTNAME%%/agentless/ssh_foundry_diff
24
@(,ossec,550) %%PORTNAME%%/agentless/ssh_generic_diff
25
@(,ossec,550) %%PORTNAME%%/agentless/ssh_integrity_check_bsd
26
@(,ossec,550) %%PORTNAME%%/agentless/ssh_integrity_check_linux
27
@(,ossec,550) %%PORTNAME%%/agentless/ssh_nopass.exp
28
@(,ossec,550) %%PORTNAME%%/agentless/ssh_pixconfig_diff
29
@(,ossec,550) %%PORTNAME%%/agentless/sshlogin.exp
30
@(,ossec,550) %%PORTNAME%%/agentless/su.exp
31
@dir(,,550) %%PORTNAME%%/bin
32
@(,,550) %%PORTNAME%%/bin/agent_control
33
@(,,550) %%PORTNAME%%/bin/clear_stats
34
@(,,550) %%PORTNAME%%/bin/list_agents
35
@(,,550) %%PORTNAME%%/bin/manage_agents
36
@(,,550) %%PORTNAME%%/bin/ossec-agentlessd
37
@(,,550) %%PORTNAME%%/bin/ossec-analysisd
38
@(,,550) %%PORTNAME%%/bin/ossec-authd
39
@(,,550) %%PORTNAME%%/bin/ossec-control
40
@(,,550) %%PORTNAME%%/bin/ossec-csyslogd
41
@(,,550) %%PORTNAME%%/bin/ossec-dbd
42
@(,,550) %%PORTNAME%%/bin/ossec-execd
43
@(,,550) %%PORTNAME%%/bin/ossec-logcollector
44
@(,,550) %%PORTNAME%%/bin/ossec-logtest
45
@(,,550) %%PORTNAME%%/bin/ossec-lua
46
@(,,550) %%PORTNAME%%/bin/ossec-luac
47
@(,,550) %%PORTNAME%%/bin/ossec-maild
48
@(,,550) %%PORTNAME%%/bin/ossec-makelists
49
@(,,550) %%PORTNAME%%/bin/ossec-monitord
50
@(,,550) %%PORTNAME%%/bin/ossec-regex
51
@(,,550) %%PORTNAME%%/bin/ossec-remoted
52
@(,,550) %%PORTNAME%%/bin/ossec-reportd
53
@(,,550) %%PORTNAME%%/bin/ossec-syscheckd
54
@(,,550) %%PORTNAME%%/bin/ossec_conf
55
@(,,550) %%PORTNAME%%/bin/rootcheck_control
56
@(,,550) %%PORTNAME%%/bin/syscheck_control
57
@(,,550) %%PORTNAME%%/bin/syscheck_update
58
@(,,550) %%PORTNAME%%/bin/util.sh
59
@(,,550) %%PORTNAME%%/bin/verify-agent-conf
60
@dir(,ossec,550) %%PORTNAME%%/etc
61
@(,ossec,640) %%PORTNAME%%/etc/decoder.xml
62
@(,ossec,640) %%PORTNAME%%/etc/internal_options.conf
63
@(,ossec,440) %%PORTNAME%%/etc/localtime
64
@(,ossec,640) %%PORTNAME%%/etc/ossec-dist.conf
65
@sample(,ossec,640) %%PORTNAME%%/etc/ossec-local.conf.sample
66
@dir(,ossec,770) %%PORTNAME%%/etc/shared
67
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_debian_linux_rcl.txt
68
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_mysql5-6_community_rcl.txt
69
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_mysql5-6_enterprise_rcl.txt
70
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel5_linux_rcl.txt
71
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel6_linux_rcl.txt
72
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel7_linux_rcl.txt
73
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel_linux_rcl.txt
74
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_sles11_linux_rcl.txt
75
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_sles12_linux_rcl.txt
76
@(,ossec,640) %%PORTNAME%%/etc/shared/rootkit_files.txt
77
@(,ossec,640) %%PORTNAME%%/etc/shared/rootkit_trojans.txt
78
@(,ossec,640) %%PORTNAME%%/etc/shared/system_audit_rcl.txt
79
@(,ossec,640) %%PORTNAME%%/etc/shared/system_audit_ssh.txt
80
@(,ossec,640) %%PORTNAME%%/etc/shared/win_applications_rcl.txt
81
@(,ossec,640) %%PORTNAME%%/etc/shared/win_audit_rcl.txt
82
@(,ossec,640) %%PORTNAME%%/etc/shared/win_malware_rcl.txt
83
@dir(ossec,ossec,750) %%PORTNAME%%/logs
84
@dir(,ossec,550) %%PORTNAME%%/rules
85
@(,ossec,640) %%PORTNAME%%/rules/apache_rules.xml
86
@(,ossec,640) %%PORTNAME%%/rules/apparmor_rules.xml
87
@(,ossec,640) %%PORTNAME%%/rules/arpwatch_rules.xml
88
@(,ossec,640) %%PORTNAME%%/rules/asterisk_rules.xml
89
@(,ossec,640) %%PORTNAME%%/rules/attack_rules.xml
90
@(,ossec,640) %%PORTNAME%%/rules/cimserver_rules.xml
91
@(,ossec,640) %%PORTNAME%%/rules/cisco-ios_rules.xml
92
@(,ossec,640) %%PORTNAME%%/rules/clam_av_rules.xml
93
@(,ossec,640) %%PORTNAME%%/rules/courier_rules.xml
94
@(,ossec,640) %%PORTNAME%%/rules/dovecot_rules.xml
95
@(,ossec,640) %%PORTNAME%%/rules/dropbear_rules.xml
96
@(,ossec,640) %%PORTNAME%%/rules/exim_rules.xml
97
@(,ossec,640) %%PORTNAME%%/rules/firewall_rules.xml
98
@(,ossec,640) %%PORTNAME%%/rules/firewalld_rules.xml
99
@(,ossec,640) %%PORTNAME%%/rules/freebsd_config_rules.xml
100
@(,ossec,640) %%PORTNAME%%/rules/freebsd_firewall_rules.xml
101
@(,ossec,640) %%PORTNAME%%/rules/freebsd_ports_rules.xml
102
@(,ossec,640) %%PORTNAME%%/rules/ftpd_rules.xml
103
@(,ossec,640) %%PORTNAME%%/rules/hordeimp_rules.xml
104
@(,ossec,640) %%PORTNAME%%/rules/ids_rules.xml
105
@(,ossec,640) %%PORTNAME%%/rules/imapd_rules.xml
106
@(,ossec,640) %%PORTNAME%%/rules/local_rules.xml
107
@(,ossec,640) %%PORTNAME%%/rules/mailscanner_rules.xml
108
@(,ossec,640) %%PORTNAME%%/rules/mcafee_av_rules.xml
109
@(,ossec,640) %%PORTNAME%%/rules/ms-exchange_rules.xml
110
@(,ossec,640) %%PORTNAME%%/rules/ms-se_rules.xml
111
@(,ossec,640) %%PORTNAME%%/rules/ms_dhcp_rules.xml
112
@(,ossec,640) %%PORTNAME%%/rules/ms_ftpd_rules.xml
113
@(,ossec,640) %%PORTNAME%%/rules/msauth_rules.xml
114
@(,ossec,640) %%PORTNAME%%/rules/mysql_rules.xml
115
@(,ossec,640) %%PORTNAME%%/rules/named_rules.xml
116
@(,ossec,640) %%PORTNAME%%/rules/netscreenfw_rules.xml
117
@(,ossec,640) %%PORTNAME%%/rules/nginx_rules.xml
118
@(,ossec,640) %%PORTNAME%%/rules/nsd_rules.xml
119
@(,ossec,640) %%PORTNAME%%/rules/openbsd_rules.xml
120
@(,ossec,640) %%PORTNAME%%/rules/opensmtpd_rules.xml
121
@(,ossec,640) %%PORTNAME%%/rules/ossec_rules.xml
122
@(,ossec,640) %%PORTNAME%%/rules/owncloud_rules.xml
123
@(,ossec,640) %%PORTNAME%%/rules/pam_rules.xml
124
@(,ossec,640) %%PORTNAME%%/rules/php_rules.xml
125
@(,ossec,640) %%PORTNAME%%/rules/pix_rules.xml
126
@(,ossec,640) %%PORTNAME%%/rules/policy_rules.xml
127
@(,ossec,640) %%PORTNAME%%/rules/postfix_rules.xml
128
@(,ossec,640) %%PORTNAME%%/rules/postgresql_rules.xml
129
@(,ossec,640) %%PORTNAME%%/rules/proftpd_rules.xml
130
@(,ossec,640) %%PORTNAME%%/rules/proxmox-ve_rules.xml
131
@(,ossec,640) %%PORTNAME%%/rules/psad_rules.xml
132
@(,ossec,640) %%PORTNAME%%/rules/pure-ftpd_rules.xml
133
@(,ossec,640) %%PORTNAME%%/rules/racoon_rules.xml
134
@(,ossec,640) %%PORTNAME%%/rules/roundcube_rules.xml
135
@(,ossec,640) %%PORTNAME%%/rules/rules_config.xml
136
@(,ossec,640) %%PORTNAME%%/rules/sendmail_rules.xml
137
@(,ossec,640) %%PORTNAME%%/rules/smbd_rules.xml
138
@(,ossec,640) %%PORTNAME%%/rules/solaris_bsm_rules.xml
139
@(,ossec,640) %%PORTNAME%%/rules/sonicwall_rules.xml
140
@(,ossec,640) %%PORTNAME%%/rules/spamd_rules.xml
141
@(,ossec,640) %%PORTNAME%%/rules/squid_rules.xml
142
@(,ossec,640) %%PORTNAME%%/rules/sshd_rules.xml
143
@(,ossec,640) %%PORTNAME%%/rules/symantec-av_rules.xml
144
@(,ossec,640) %%PORTNAME%%/rules/symantec-ws_rules.xml
145
@(,ossec,640) %%PORTNAME%%/rules/syslog_rules.xml
146
@(,ossec,640) %%PORTNAME%%/rules/sysmon_rules.xml
147
@(,ossec,640) %%PORTNAME%%/rules/systemd_rules.xml
148
@(,ossec,640) %%PORTNAME%%/rules/telnetd_rules.xml
149
@(,ossec,640) %%PORTNAME%%/rules/trend-osce_rules.xml
150
@(,ossec,640) %%PORTNAME%%/rules/unbound_rules.xml
151
@(,ossec,640) %%PORTNAME%%/rules/vmpop3d_rules.xml
152
@(,ossec,640) %%PORTNAME%%/rules/vmware_rules.xml
153
@(,ossec,640) %%PORTNAME%%/rules/vpn_concentrator_rules.xml
154
@(,ossec,640) %%PORTNAME%%/rules/vpopmail_rules.xml
155
@(,ossec,640) %%PORTNAME%%/rules/vsftpd_rules.xml
156
@(,ossec,640) %%PORTNAME%%/rules/web_appsec_rules.xml
157
@(,ossec,640) %%PORTNAME%%/rules/web_rules.xml
158
@(,ossec,640) %%PORTNAME%%/rules/wordpress_rules.xml
159
@(,ossec,640) %%PORTNAME%%/rules/zeus_rules.xml
160
@dir(,ossec,700) %%PORTNAME%%/.ssh
161
@dir(ossec,ossec,750) %%PORTNAME%%/logs/alerts
162
@dir(ossec,ossec,750) %%PORTNAME%%/logs/archives
163
@dir(ossec,ossec,750) %%PORTNAME%%/logs/firewall
164
@dir(,ossec,550) %%PORTNAME%%/queue
165
@dir(ossecr,ossec,750) %%PORTNAME%%/queue/agent-info
166
@dir(ossec,ossec,750) %%PORTNAME%%/queue/agentless
167
@dir(ossec,ossec,770) %%PORTNAME%%/queue/alerts
168
@dir(ossec,ossec,750) %%PORTNAME%%/queue/diff
169
@dir(ossec,ossec,750) %%PORTNAME%%/queue/fts
170
@dir(ossec,ossec,750) %%PORTNAME%%/queue/ossec
171
@dir(ossecr,ossec,750) %%PORTNAME%%/queue/rids
172
@dir(ossec,ossec,750) %%PORTNAME%%/queue/rootcheck
173
@dir(ossec,ossec,750) %%PORTNAME%%/queue/syscheck
174
@dir(ossec,ossec,750) %%PORTNAME%%/stats
175
@dir(,ossec,770) %%PORTNAME%%/tmp
176
@dir(,ossec,550) %%PORTNAME%%/var
177
@dir(,ossec,770) %%PORTNAME%%/var/run
178
%%PORTDOCS%%%%DOCSDIR%%/BUGS
179
%%PORTDOCS%%%%DOCSDIR%%/CONFIG
180
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS
181
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
182
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
183
%%MYSQL%%%%DOCSDIR%%/mysql.schema
184
%%PGSQL%%%%DOCSDIR%%/postgresql.schema
(-)pkg-plist-server (+187 lines)
Line 0 Link Here
1
@dir(,ossec,550) %%PORTNAME%%
2
@dir(,ossec,550) %%PORTNAME%%/active-response
3
@dir(,ossec,550) %%PORTNAME%%/active-response/bin
4
@(,ossec,550) %%PORTNAME%%/active-response/bin/disable-account.sh
5
@(,ossec,550) %%PORTNAME%%/active-response/bin/firewall-drop.sh
6
@(,ossec,550) %%PORTNAME%%/active-response/bin/firewalld-drop.sh
7
@(,ossec,550) %%PORTNAME%%/active-response/bin/host-deny.sh
8
@(,ossec,550) %%PORTNAME%%/active-response/bin/ip-customblock.sh
9
@(,ossec,550) %%PORTNAME%%/active-response/bin/ipfw.sh
10
@(,ossec,550) %%PORTNAME%%/active-response/bin/ipfw_mac.sh
11
@(,ossec,550) %%PORTNAME%%/active-response/bin/merge-configs.sh
12
@(,ossec,550) %%PORTNAME%%/active-response/bin/npf.sh
13
@(,ossec,550) %%PORTNAME%%/active-response/bin/ossec-slack.sh
14
@(,ossec,550) %%PORTNAME%%/active-response/bin/ossec-tweeter.sh
15
@(,ossec,550) %%PORTNAME%%/active-response/bin/pf.sh
16
@(,ossec,550) %%PORTNAME%%/active-response/bin/restart-ossec.sh
17
@(,ossec,550) %%PORTNAME%%/active-response/bin/route-null.sh
18
@dir(,ossec,550) %%PORTNAME%%/agentless
19
@(,ossec,550) %%PORTNAME%%/agentless/main.exp
20
@(,ossec,550) %%PORTNAME%%/agentless/register_host.sh
21
@(,ossec,550) %%PORTNAME%%/agentless/ssh.exp
22
@(,ossec,550) %%PORTNAME%%/agentless/ssh_asa-fwsmconfig_diff
23
@(,ossec,550) %%PORTNAME%%/agentless/ssh_foundry_diff
24
@(,ossec,550) %%PORTNAME%%/agentless/ssh_generic_diff
25
@(,ossec,550) %%PORTNAME%%/agentless/ssh_integrity_check_bsd
26
@(,ossec,550) %%PORTNAME%%/agentless/ssh_integrity_check_linux
27
@(,ossec,550) %%PORTNAME%%/agentless/ssh_nopass.exp
28
@(,ossec,550) %%PORTNAME%%/agentless/ssh_pixconfig_diff
29
@(,ossec,550) %%PORTNAME%%/agentless/sshlogin.exp
30
@(,ossec,550) %%PORTNAME%%/agentless/su.exp
31
@dir(,,550) %%PORTNAME%%/bin
32
@(,,550) %%PORTNAME%%/bin/agent_conf
33
@(,,550) %%PORTNAME%%/bin/agent_control
34
@(,,550) %%PORTNAME%%/bin/clear_stats
35
@(,,550) %%PORTNAME%%/bin/list_agents
36
@(,,550) %%PORTNAME%%/bin/manage_agents
37
@(,,550) %%PORTNAME%%/bin/ossec-agentlessd
38
@(,,550) %%PORTNAME%%/bin/ossec-analysisd
39
@(,,550) %%PORTNAME%%/bin/ossec-authd
40
@(,,550) %%PORTNAME%%/bin/ossec-control
41
@(,,550) %%PORTNAME%%/bin/ossec-csyslogd
42
@(,,550) %%PORTNAME%%/bin/ossec-dbd
43
@(,,550) %%PORTNAME%%/bin/ossec-execd
44
@(,,550) %%PORTNAME%%/bin/ossec-logcollector
45
@(,,550) %%PORTNAME%%/bin/ossec-logtest
46
@(,,550) %%PORTNAME%%/bin/ossec-lua
47
@(,,550) %%PORTNAME%%/bin/ossec-luac
48
@(,,550) %%PORTNAME%%/bin/ossec-maild
49
@(,,550) %%PORTNAME%%/bin/ossec-makelists
50
@(,,550) %%PORTNAME%%/bin/ossec-monitord
51
@(,,550) %%PORTNAME%%/bin/ossec-regex
52
@(,,550) %%PORTNAME%%/bin/ossec-remoted
53
@(,,550) %%PORTNAME%%/bin/ossec-reportd
54
@(,,550) %%PORTNAME%%/bin/ossec-syscheckd
55
@(,,550) %%PORTNAME%%/bin/ossec_conf
56
@(,,550) %%PORTNAME%%/bin/rootcheck_control
57
@(,,550) %%PORTNAME%%/bin/syscheck_control
58
@(,,550) %%PORTNAME%%/bin/syscheck_update
59
@(,,550) %%PORTNAME%%/bin/util.sh
60
@(,,550) %%PORTNAME%%/bin/verify-agent-conf
61
@dir(,ossec,550) %%PORTNAME%%/etc
62
@(,ossec,640) %%PORTNAME%%/etc/agent-dist.conf
63
@sample(,ossec,640) %%PORTNAME%%/etc/agent-local.conf.sample
64
@(,ossec,640) %%PORTNAME%%/etc/decoder.xml
65
@(,ossec,640) %%PORTNAME%%/etc/internal_options.conf
66
@(,ossec,440) %%PORTNAME%%/etc/localtime
67
@(,ossec,640) %%PORTNAME%%/etc/ossec-dist.conf
68
@sample(,ossec,640) %%PORTNAME%%/etc/ossec-local.conf.sample
69
@dir(,ossec,770) %%PORTNAME%%/etc/shared
70
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_debian_linux_rcl.txt
71
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_mysql5-6_community_rcl.txt
72
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_mysql5-6_enterprise_rcl.txt
73
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel5_linux_rcl.txt
74
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel6_linux_rcl.txt
75
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel7_linux_rcl.txt
76
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_rhel_linux_rcl.txt
77
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_sles11_linux_rcl.txt
78
@(,ossec,640) %%PORTNAME%%/etc/shared/cis_sles12_linux_rcl.txt
79
@(,ossec,640) %%PORTNAME%%/etc/shared/rootkit_files.txt
80
@(,ossec,640) %%PORTNAME%%/etc/shared/rootkit_trojans.txt
81
@(,ossec,640) %%PORTNAME%%/etc/shared/system_audit_rcl.txt
82
@(,ossec,640) %%PORTNAME%%/etc/shared/system_audit_ssh.txt
83
@(,ossec,640) %%PORTNAME%%/etc/shared/win_applications_rcl.txt
84
@(,ossec,640) %%PORTNAME%%/etc/shared/win_audit_rcl.txt
85
@(,ossec,640) %%PORTNAME%%/etc/shared/win_malware_rcl.txt
86
@dir(ossec,ossec,750) %%PORTNAME%%/logs
87
@dir(,ossec,550) %%PORTNAME%%/rules
88
@(,ossec,640) %%PORTNAME%%/rules/apache_rules.xml
89
@(,ossec,640) %%PORTNAME%%/rules/apparmor_rules.xml
90
@(,ossec,640) %%PORTNAME%%/rules/arpwatch_rules.xml
91
@(,ossec,640) %%PORTNAME%%/rules/asterisk_rules.xml
92
@(,ossec,640) %%PORTNAME%%/rules/attack_rules.xml
93
@(,ossec,640) %%PORTNAME%%/rules/cimserver_rules.xml
94
@(,ossec,640) %%PORTNAME%%/rules/cisco-ios_rules.xml
95
@(,ossec,640) %%PORTNAME%%/rules/clam_av_rules.xml
96
@(,ossec,640) %%PORTNAME%%/rules/courier_rules.xml
97
@(,ossec,640) %%PORTNAME%%/rules/dovecot_rules.xml
98
@(,ossec,640) %%PORTNAME%%/rules/dropbear_rules.xml
99
@(,ossec,640) %%PORTNAME%%/rules/exim_rules.xml
100
@(,ossec,640) %%PORTNAME%%/rules/firewall_rules.xml
101
@(,ossec,640) %%PORTNAME%%/rules/firewalld_rules.xml
102
@(,ossec,640) %%PORTNAME%%/rules/freebsd_config_rules.xml
103
@(,ossec,640) %%PORTNAME%%/rules/freebsd_firewall_rules.xml
104
@(,ossec,640) %%PORTNAME%%/rules/freebsd_ports_rules.xml
105
@(,ossec,640) %%PORTNAME%%/rules/ftpd_rules.xml
106
@(,ossec,640) %%PORTNAME%%/rules/hordeimp_rules.xml
107
@(,ossec,640) %%PORTNAME%%/rules/ids_rules.xml
108
@(,ossec,640) %%PORTNAME%%/rules/imapd_rules.xml
109
@(,ossec,640) %%PORTNAME%%/rules/local_rules.xml
110
@(,ossec,640) %%PORTNAME%%/rules/mailscanner_rules.xml
111
@(,ossec,640) %%PORTNAME%%/rules/mcafee_av_rules.xml
112
@(,ossec,640) %%PORTNAME%%/rules/ms-exchange_rules.xml
113
@(,ossec,640) %%PORTNAME%%/rules/ms-se_rules.xml
114
@(,ossec,640) %%PORTNAME%%/rules/ms_dhcp_rules.xml
115
@(,ossec,640) %%PORTNAME%%/rules/ms_ftpd_rules.xml
116
@(,ossec,640) %%PORTNAME%%/rules/msauth_rules.xml
117
@(,ossec,640) %%PORTNAME%%/rules/mysql_rules.xml
118
@(,ossec,640) %%PORTNAME%%/rules/named_rules.xml
119
@(,ossec,640) %%PORTNAME%%/rules/netscreenfw_rules.xml
120
@(,ossec,640) %%PORTNAME%%/rules/nginx_rules.xml
121
@(,ossec,640) %%PORTNAME%%/rules/nsd_rules.xml
122
@(,ossec,640) %%PORTNAME%%/rules/openbsd_rules.xml
123
@(,ossec,640) %%PORTNAME%%/rules/opensmtpd_rules.xml
124
@(,ossec,640) %%PORTNAME%%/rules/ossec_rules.xml
125
@(,ossec,640) %%PORTNAME%%/rules/owncloud_rules.xml
126
@(,ossec,640) %%PORTNAME%%/rules/pam_rules.xml
127
@(,ossec,640) %%PORTNAME%%/rules/php_rules.xml
128
@(,ossec,640) %%PORTNAME%%/rules/pix_rules.xml
129
@(,ossec,640) %%PORTNAME%%/rules/policy_rules.xml
130
@(,ossec,640) %%PORTNAME%%/rules/postfix_rules.xml
131
@(,ossec,640) %%PORTNAME%%/rules/postgresql_rules.xml
132
@(,ossec,640) %%PORTNAME%%/rules/proftpd_rules.xml
133
@(,ossec,640) %%PORTNAME%%/rules/proxmox-ve_rules.xml
134
@(,ossec,640) %%PORTNAME%%/rules/psad_rules.xml
135
@(,ossec,640) %%PORTNAME%%/rules/pure-ftpd_rules.xml
136
@(,ossec,640) %%PORTNAME%%/rules/racoon_rules.xml
137
@(,ossec,640) %%PORTNAME%%/rules/roundcube_rules.xml
138
@(,ossec,640) %%PORTNAME%%/rules/rules_config.xml
139
@(,ossec,640) %%PORTNAME%%/rules/sendmail_rules.xml
140
@(,ossec,640) %%PORTNAME%%/rules/smbd_rules.xml
141
@(,ossec,640) %%PORTNAME%%/rules/solaris_bsm_rules.xml
142
@(,ossec,640) %%PORTNAME%%/rules/sonicwall_rules.xml
143
@(,ossec,640) %%PORTNAME%%/rules/spamd_rules.xml
144
@(,ossec,640) %%PORTNAME%%/rules/squid_rules.xml
145
@(,ossec,640) %%PORTNAME%%/rules/sshd_rules.xml
146
@(,ossec,640) %%PORTNAME%%/rules/symantec-av_rules.xml
147
@(,ossec,640) %%PORTNAME%%/rules/symantec-ws_rules.xml
148
@(,ossec,640) %%PORTNAME%%/rules/syslog_rules.xml
149
@(,ossec,640) %%PORTNAME%%/rules/sysmon_rules.xml
150
@(,ossec,640) %%PORTNAME%%/rules/systemd_rules.xml
151
@(,ossec,640) %%PORTNAME%%/rules/telnetd_rules.xml
152
@(,ossec,640) %%PORTNAME%%/rules/trend-osce_rules.xml
153
@(,ossec,640) %%PORTNAME%%/rules/unbound_rules.xml
154
@(,ossec,640) %%PORTNAME%%/rules/vmpop3d_rules.xml
155
@(,ossec,640) %%PORTNAME%%/rules/vmware_rules.xml
156
@(,ossec,640) %%PORTNAME%%/rules/vpn_concentrator_rules.xml
157
@(,ossec,640) %%PORTNAME%%/rules/vpopmail_rules.xml
158
@(,ossec,640) %%PORTNAME%%/rules/vsftpd_rules.xml
159
@(,ossec,640) %%PORTNAME%%/rules/web_appsec_rules.xml
160
@(,ossec,640) %%PORTNAME%%/rules/web_rules.xml
161
@(,ossec,640) %%PORTNAME%%/rules/wordpress_rules.xml
162
@(,ossec,640) %%PORTNAME%%/rules/zeus_rules.xml
163
@dir(,ossec,700) %%PORTNAME%%/.ssh
164
@dir(ossec,ossec,750) %%PORTNAME%%/logs/alerts
165
@dir(ossec,ossec,750) %%PORTNAME%%/logs/archives
166
@dir(ossec,ossec,750) %%PORTNAME%%/logs/firewall
167
@dir(,ossec,550) %%PORTNAME%%/queue
168
@dir(ossecr,ossec,750) %%PORTNAME%%/queue/agent-info
169
@dir(ossec,ossec,750) %%PORTNAME%%/queue/agentless
170
@dir(ossec,ossec,770) %%PORTNAME%%/queue/alerts
171
@dir(ossec,ossec,750) %%PORTNAME%%/queue/diff
172
@dir(ossec,ossec,750) %%PORTNAME%%/queue/fts
173
@dir(ossec,ossec,750) %%PORTNAME%%/queue/ossec
174
@dir(ossecr,ossec,750) %%PORTNAME%%/queue/rids
175
@dir(ossec,ossec,750) %%PORTNAME%%/queue/rootcheck
176
@dir(ossec,ossec,750) %%PORTNAME%%/queue/syscheck
177
@dir(ossec,ossec,750) %%PORTNAME%%/stats
178
@dir(,ossec,770) %%PORTNAME%%/tmp
179
@dir(,ossec,550) %%PORTNAME%%/var
180
@dir(,ossec,770) %%PORTNAME%%/var/run
181
%%PORTDOCS%%%%DOCSDIR%%/BUGS
182
%%PORTDOCS%%%%DOCSDIR%%/CONFIG
183
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS
184
%%PORTDOCS%%%%DOCSDIR%%/INSTALL
185
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
186
%%MYSQL%%%%DOCSDIR%%/mysql.schema
187
%%PGSQL%%%%DOCSDIR%%/postgresql.schema
(-)scripts/plist.sh (+119 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# Script generates entries for pkg-plist
4
# Do not use it directly. Use the following command instead:
5
#
6
# make MAINTAINER_MODE=yes clean plist
7
8
OSSEC_TYPE=$1
9
PLIST=$2
10
PREFIX=$3
11
WORKDIR=$4
12
STAGEDIR="${WORKDIR}/stage"
13
14
staged_plist="${WORKDIR}/.staged-plist"
15
fixed_lines=""
16
if [ "${OSSEC_TYPE}" != "agent" ]; then
17
    fixed_lines="${fixed_lines} %%MYSQL%%%%DOCSDIR%%/mysql.schema %%PGSQL%%%%DOCSDIR%%/postgresql.schema"
18
fi
19
skip_lines="%%PORTDOCS%%%%DOCSDIR%%/mysql.schema %%PORTDOCS%%%%DOCSDIR%%/postgresql.schema"
20
skip_paths="/etc/ossec.conf /etc/local_internal_options.conf /etc/client.keys /logs/active-responses.log /logs/ossec.log /lua"
21
sample_paths="/etc/ossec-local.conf.sample /etc/agent-local.conf.sample"
22
if [ "${OSSEC_TYPE}" == "agent" ]; then
23
    skip_paths="${skip_paths} /rules /agentless"
24
fi
25
26
print_path() {
27
    local path="$1"
28
    local command="$2"
29
    local full_path="${STAGEDIR}${PREFIX}${path}"
30
    if [ -z "${command}" ]; then
31
	command="@"
32
	if [ -d "${full_path}" ]; then
33
	    command="@dir"
34
	fi
35
    fi
36
    local user=`stat -f "%Su" "${full_path}"`
37
    if [ "${user}" == "${USER}" ]; then
38
	user=""
39
    fi
40
    local group=`stat -f "%Sg" "${full_path}"`
41
    if [ "${group}" == "${GROUP}" ]; then
42
	group=""
43
    fi
44
    local mode=`stat -f "%p" "${full_path}" | tail -c 4`
45
    echo -e "${command}(${user},${group},${mode}) %%PORTNAME%%${path}" >> "${PLIST}"
46
}
47
48
echo -n > "${PLIST}"
49
50
print_path
51
52
done_paths=""
53
while read line; do
54
    skip_line=""
55
    for e in ${skip_lines}; do
56
	if [ "${e}" == "${line}" ]; then
57
	    skip_line="${e}"
58
	    break
59
	fi
60
    done
61
    if [ -z "${skip_line}" ]; then
62
	path=""
63
	case $line in
64
	    "@dir %%PORTNAME%%"*)
65
		path=`echo "${line}" | sed -e "s|@dir %%PORTNAME%%||g"`
66
		;;
67
	    "%%PORTNAME%%"*)
68
		path=`echo "${line}" | sed -e "s|%%PORTNAME%%||g"`
69
		;;
70
	    "%%"*)
71
		unchanged_lines="${unchanged_lines} ${line}"
72
		;;
73
	esac
74
	if [ -n "${path}" ]; then
75
	    segments=`echo "${path}" | tr "/" "\n"`
76
	    path=""
77
	    for segment in ${segments}; do
78
		path="${path}/${segment}"
79
		skip_path=""
80
		for e in ${skip_paths}; do
81
		    if [ "${e}" == "${path}" ]; then
82
			skip_path="${e}"
83
			break
84
		    fi
85
		done
86
		if [ -n "${skip_path}" ]; then
87
		    break
88
		fi
89
		done_path=""
90
		for e in ${done_paths}; do
91
		    if [ "${e}" == "${path}" ]; then
92
			done_path="${e}"
93
			break
94
		    fi
95
		done
96
		if [ -z "${done_path}" ]; then
97
		    done_paths="${done_paths} ${path}"
98
		    sample_path=""
99
		    for e in ${sample_paths}; do
100
			if [ "${e}" == "${path}" ]; then
101
			    sample_path="${e}"
102
			    break
103
			fi
104
		    done
105
		    if [ -n "${sample_path}" ]; then
106
			print_path "${path}" @sample
107
		    else
108
			print_path "${path}"
109
		    fi
110
		fi
111
	    done
112
	fi
113
    fi
114
done < "${staged_plist}"
115
116
unchanged_lines="${unchanged_lines} ${fixed_lines}"
117
for line in ${unchanged_lines}; do
118
    echo "${line}" >> "${PLIST}"
119
done
(-)scripts/template-to-agent.sh (+21 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_type="$1"
4
ossec_prefix="$2"
5
ossec_file="$3"
6
7
ossec_syscheck_dirs="${ossec_prefix}/etc,${ossec_prefix}/bin,${ossec_prefix}/active-response"
8
9
replace() {
10
    sed -e 's|<template_config\(.*\)>|<agent_config\1>|' \
11
        -e 's|</template_config>|</agent_config>|' \
12
        -e "s|%%OSSEC_SYSCHECK_DIRS%%|${ossec_syscheck_dirs}|" \
13
        -e 's|^  <!-- agent:.*-->$||' \
14
        "${ossec_file}"
15
}
16
17
extract() {
18
    sed -n '/^<agent_config.*>$/,/^<\/agent_config>$/p'
19
}
20
21
replace | extract
(-)scripts/template-to-ossec.sh (+37 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_type="$1"
4
ossec_prefix="$2"
5
ossec_file="$3"
6
7
ossec_syscheck_dirs="${ossec_prefix}/etc,${ossec_prefix}/bin,${ossec_prefix}/active-response"
8
if [ "${ossec_type}" != "agent" ]; then
9
    ossec_syscheck_dirs="${ossec_syscheck_dirs},${ossec_prefix}/agentless,${ossec_prefix}/rules"
10
fi
11
12
replace() {
13
    case "${ossec_type}" in
14
        agent)
15
            sed -e 's|<template_config>|<ossec_config>|' \
16
                -e 's|<template_config .*os="FreeBSD".*>|<ossec_config>|' \
17
                -e 's|</template_config>|</ossec_config>|' \
18
                -e "s|%%OSSEC_SYSCHECK_DIRS%%|${ossec_syscheck_dirs}|" \
19
                -e 's|^  <!-- agent:\(.*\)-->$|  <!--\1-->|' \
20
                "${ossec_file}"
21
            ;;
22
        *)
23
            sed -e 's|<template_config>|<ossec_config>|' \
24
                -e 's|<template_config .*os="FreeBSD".*>|<ossec_config>|' \
25
                -e 's|</template_config>|</ossec_config>|' \
26
                -e "s|%%OSSEC_SYSCHECK_DIRS%%|${ossec_syscheck_dirs}|" \
27
                -e 's|^  <!-- agent:.*-->$||' \
28
                "${ossec_file}"
29
            ;;
30
    esac
31
}
32
33
extract() {
34
    sed -n '/^<ossec_config.*>$/,/^<\/ossec_config>$/p'
35
}
36
37
replace | extract

Return to bug 226465