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

Collapse All | Expand All

(-)security/ossec-hids/Makefile (+35 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	ossec-hids
4
PORTVERSION=	3.1.0
5
PORTREVISION=
6
CATEGORIES=	security
7
8
MAINTAINER=	dominik.lisiak@bemsoft.pl
9
COMMENT=	Security tool to monitor and check logs and intrusions
10
11
LICENSE=	GPLv2
12
13
RUN_DEPENDS=	ossec-hids-${OSSEC_TYPE}>=${PORTVERSION}:security/ossec-hids-${OSSEC_TYPE}
14
15
USES=		metaport
16
17
OPTIONS_DEFINE=		CONFIG
18
19
OPTIONS_SINGLE=		G_TYPE
20
OPTIONS_SINGLE_G_TYPE=	LOCAL AGENT SERVER
21
22
OPTIONS_DEFAULT=	CONFIG LOCAL
23
24
CONFIG_DESC=		Install configuration manager and samples
25
G_TYPE_DESC=		Installation type
26
LOCAL_DESC=		Analizes local data only (standalone)
27
AGENT_DESC=		Sends local data to the server for analysis
28
SERVER_DESC=		Analizes local data and data received from multiple agents
29
30
CONFIG_VARS=		RUN_DEPENDS+=ossec-hids-${OSSEC_TYPE}-config>=${PORTVERSION}:security/ossec-hids-${OSSEC_TYPE}-config
31
LOCAL_VARS=		OSSEC_TYPE=local
32
AGENT_VARS=		OSSEC_TYPE=agent
33
SERVER_VARS=		OSSEC_TYPE=server
34
35
.include <bsd.port.mk>
(-)security/ossec-hids/pkg-descr (+6 lines)
Line 0 Link Here
1
OSSEC is a scalable, multi-platform, open source Host-based Intrusion Detection
2
System (HIDS). It has a powerful correlation and analysis engine, integrating
3
log analysis, file integrity checking, Windows registry monitoring, centralized
4
policy enforcement, rootkit detection, real-time alerting and active response.
5
6
WWW: https://ossec.github.io
(-)security/ossec-hids-agent-config/Makefile (+7 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
OSSEC_TYPE=	agent
4
5
MASTERDIR=	${.CURDIR}/../ossec-hids-local-config
6
7
.include "${MASTERDIR}/Makefile"
(-)security/ossec-hids-client/Makefile (-8 / +2 lines)
Lines 1-13 Link Here
1
# Created by: Valerio Daelli <valerio.daelli@gmail.com>
2
# $FreeBSD$
1
# $FreeBSD$
3
2
4
PORTREVISION=	0
3
OSSEC_TYPE=	agent
5
COMMENT=	Client port of ossec-hids
6
4
7
CLIENT_ONLY=	yes
5
MASTERDIR=	${.CURDIR}/../ossec-hids-local
8
6
9
MASTERDIR=	${.CURDIR}/../ossec-hids-server
10
11
PLIST=		${.CURDIR}/pkg-plist.client
12
13
.include "${MASTERDIR}/Makefile"
7
.include "${MASTERDIR}/Makefile"
(-)security/ossec-hids-client/pkg-plist.client (-69 lines)
Lines 1-69 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.sh
6
%%PORTNAME%%/active-response/bin/ipfw_mac.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-auth
12
%%PORTNAME%%/bin/manage_agents
13
%%PORTNAME%%/bin/ossec-agentd
14
%%PORTNAME%%/bin/ossec-control
15
%%PORTNAME%%/bin/ossec-execd
16
%%PORTNAME%%/bin/ossec-logcollector
17
%%PORTNAME%%/bin/ossec-lua
18
%%PORTNAME%%/bin/ossec-luac
19
%%PORTNAME%%/bin/ossec-syscheckd
20
%%PORTNAME%%/bin/util.sh
21
@group ossec
22
%%PORTNAME%%/etc/shared/cis_debian_linux_rcl.txt
23
%%PORTNAME%%/etc/shared/cis_rhel_linux_rcl.txt
24
%%PORTNAME%%/etc/shared/cis_rhel5_linux_rcl.txt
25
%%PORTNAME%%/etc/shared/rootkit_trojans.txt
26
%%PORTNAME%%/etc/shared/rootkit_files.txt
27
%%PORTNAME%%/etc/shared/system_audit_rcl.txt
28
%%PORTNAME%%/etc/shared/win_malware_rcl.txt
29
%%PORTNAME%%/etc/shared/win_audit_rcl.txt
30
%%PORTNAME%%/etc/shared/win_applications_rcl.txt
31
@sample %%PORTNAME%%/etc/ossec.conf.sample
32
%%PORTNAME%%/etc/internal_options.conf
33
@owner ossec
34
%%PORTNAME%%/logs/ossec.log
35
@owner
36
%%PORTNAME%%/agentless/main.exp
37
%%PORTNAME%%/agentless/sshlogin.exp
38
%%PORTNAME%%/agentless/ssh_asa-fwsmconfig_diff
39
%%PORTNAME%%/agentless/ssh_foundry_diff
40
%%PORTNAME%%/agentless/ssh_pixconfig_diff
41
%%PORTNAME%%/agentless/ssh_nopass.exp
42
%%PORTNAME%%/agentless/ssh_integrity_check_linux
43
%%PORTNAME%%/agentless/ssh_integrity_check_bsd
44
%%PORTNAME%%/agentless/ssh_generic_diff
45
%%PORTNAME%%/agentless/ssh.exp
46
%%PORTNAME%%/agentless/register_host.sh
47
%%PORTNAME%%/agentless/su.exp
48
@dir %%PORTNAME%%/agentless
49
@dir %%PORTNAME%%/active-response/bin
50
@dir %%PORTNAME%%/active-response
51
@dir %%PORTNAME%%/etc/shared
52
@dir %%PORTNAME%%/etc
53
@dir %%PORTNAME%%/tmp
54
@dir %%PORTNAME%%/var/run
55
@dir %%PORTNAME%%/var
56
@dir %%PORTNAME%%/queue/syscheck
57
@dir %%PORTNAME%%/queue/rids
58
@owner ossec
59
@dir %%PORTNAME%%/queue/ossec
60
@dir %%PORTNAME%%/queue/diff
61
@owner
62
@dir %%PORTNAME%%/queue/alerts
63
@dir %%PORTNAME%%/queue
64
@dir %%PORTNAME%%/logs
65
@dir %%PORTNAME%%/bin
66
@owner ossec
67
@dir %%PORTNAME%%/.ssh
68
@owner
69
@dir %%PORTNAME%%
(-)security/ossec-hids-local/Makefile (-6 / +242 lines)
Lines 1-11 Link Here
1
# Created by: Valerio Daelli <valerio.daelli@gmail.com>
2
# $FreeBSD$
1
# $FreeBSD$
3
2
4
PORTREVISION=	1
3
PORTNAME=	ossec-hids
5
COMMENT=	Client and server (local) port of ossec-hids
4
PORTVERSION=	3.1.0
5
PORTREVISION=
6
CATEGORIES=	security
7
PKGNAMESUFFIX=	-${OSSEC_TYPE}
6
8
7
LOCAL_ONLY=	yes
9
MAINTAINER=	dominik.lisiak@bemsoft.pl
10
COMMENT=	Security tool to monitor and check logs and intrusions
8
11
9
MASTERDIR=	${.CURDIR}/../ossec-hids-server
12
LICENSE=	GPLv2
13
LICENSE_FILE=	${WRKSRC}/LICENSE
10
14
11
.include "${MASTERDIR}/Makefile"
15
OSSEC_TYPE?=	local
16
17
.if ${OSSEC_TYPE} == local
18
CONFLICTS_INSTALL=	ossec-hids-client-* \
19
			ossec-hids-agent-* \
20
			ossec-hids-server-*
21
.elif ${OSSEC_TYPE} == agent
22
CONFLICTS_INSTALL=	ossec-hids-client-* \
23
			ossec-hids-local-* \
24
			ossec-hids-server-*
25
.elif ${OSSEC_TYPE} == server
26
CONFLICTS_INSTALL=	ossec-hids-client-* \
27
			ossec-hids-agent-* \
28
			ossec-hids-local-*
29
.endif
30
31
.if ${OSSEC_TYPE} != agent
32
RUN_DEPENDS=	expect:lang/expect
33
.endif
34
35
GEOIP_LIB_DEPENDS=	libGeoIP.so:net/GeoIP
36
INOTIFY_LIB_DEPENDS=	libinotify.so:devel/libinotify
37
PRELUDE_LIB_DEPENDS=	libprelude.so:security/libprelude
38
ZEROMQ_LIB_DEPENDS=	libczmq.so:net/czmq
39
40
USES=		gmake readline ssl
41
MYSQL_USE=	mysql
42
PGSQL_USES=	pgsql
43
44
USE_GITHUB=	yes
45
GH_ACCOUNT=	ossec
46
USE_RC_SUBR=	ossec-hids
47
48
.if ${OSSEC_TYPE} != agent
49
USES+=		shebangfix
50
SHEBANG_LANG=	expect
51
expect_OLD_CMD=	"/usr/bin/env expect"
52
expect_CMD=	${LOCALBASE}/bin/expect
53
SHEBANG_FILES=	src/agentlessd/scripts/main.exp \
54
		src/agentlessd/scripts/ssh.exp \
55
		src/agentlessd/scripts/ssh_asa-fwsmconfig_diff \
56
		src/agentlessd/scripts/ssh_foundry_diff \
57
		src/agentlessd/scripts/ssh_generic_diff \
58
		src/agentlessd/scripts/ssh_integrity_check_bsd \
59
		src/agentlessd/scripts/ssh_integrity_check_linux \
60
		src/agentlessd/scripts/ssh_nopass.exp \
61
		src/agentlessd/scripts/ssh_pixconfig_diff \
62
		src/agentlessd/scripts/sshlogin.exp \
63
		src/agentlessd/scripts/su.exp
64
.endif
65
66
OPTIONS_SUB=			yes
67
OPTIONS_DEFINE=			DOCS INOTIFY
68
69
.if ${OSSEC_TYPE} != agent
70
OPTIONS_DEFINE+=		GEOIP PRELUDE ZEROMQ
71
72
OPTIONS_RADIO=			DATABASE
73
OPTIONS_RADIO_DATABASE=		MYSQL PGSQL
74
.endif
75
76
OPTIONS_DEFAULT=		INOTIFY
77
78
INOTIFY_DESC=		Kevent based real time monitoring
79
PRELUDE_DESC=		Sensor support from Prelude SIEM
80
ZEROMQ_DESC=		ZeroMQ support (experimental)
81
DATABASE_DESC=		Database output
82
83
GEOIP_VARS=	OSSEC_ARGS+=USE_GEOIP=yes
84
INOTIFY_VARS=	OSSEC_ARGS+=USE_INOTIFY=yes
85
PRELUDE_VARS=	OSSEC_ARGS+=USE_PRELUDE=yes
86
ZEROMQ_VARS=	OSSEC_ARGS+=USE_ZEROMQ=yes
87
MYSQL_VARS=	OSSEC_ARGS+=DATABASE=mysql PKGMSG_FILES+=message-database DB_TYPE=mysql DB_SCHEMA=mysql.schema
88
PGSQL_VARS=	OSSEC_ARGS+=DATABASE=pgsql PKGMSG_FILES+=message-database DB_TYPE=postgresql DB_SCHEMA=postgresql.schema
89
90
OSSEC_ARGS+=	TARGET=${OSSEC_TYPE}
91
.if ${OSSEC_TYPE} == agent
92
STRIP_FILES=	agent-auth \
93
		manage_agents \
94
		ossec-agentd \
95
		ossec-execd \
96
		ossec-logcollector \
97
		ossec-lua \
98
		ossec-luac \
99
		ossec-syscheckd
100
.else
101
STRIP_FILES=	agent_control \
102
		clear_stats \
103
		list_agents \
104
		manage_agents \
105
		ossec-agentlessd \
106
		ossec-analysisd \
107
		ossec-authd \
108
		ossec-csyslogd \
109
		ossec-dbd \
110
		ossec-execd \
111
		ossec-logcollector \
112
		ossec-logtest \
113
		ossec-lua \
114
		ossec-luac \
115
		ossec-maild \
116
		ossec-makelists \
117
		ossec-monitord \
118
		ossec-regex \
119
		ossec-remoted \
120
		ossec-reportd \
121
		ossec-syscheckd \
122
		rootcheck_control \
123
		syscheck_control \
124
		syscheck_update \
125
		verify-agent-conf
126
.endif
127
.if defined(MAINTAINER_MODE)
128
OSSEC_HOME=		${PREFIX}/${PORTNAME}
129
.else
130
OSSEC_HOME?=		${PREFIX}/${PORTNAME}
131
.endif
132
OSSEC_RC=		${PREFIX}/etc/rc.d/ossec-hids
133
FIREWALL_DROP_BIN=	${OSSEC_HOME}/active-response/bin/firewall-drop.sh
134
IPFILTER_BIN=		${OSSEC_HOME}/active-response/bin/ipfilter.sh
135
RESTART_OSSEC_BIN=	${OSSEC_HOME}/active-response/bin/restart-ossec.sh
136
SHARED_DIR=		${OSSEC_HOME}/etc/shared
137
INTERNAL_OPTS_CONF=	${OSSEC_HOME}/etc/local_internal_options.conf
138
139
.if empty(USER)
140
USER=$$(${ID} -un)
141
.endif
142
.if empty(GROUP)
143
GROUP=$$(${ID} -gn)
144
.endif
145
146
.if !defined(MAINTAINER_MODE)
147
USER_ARGS+=	OSSEC_GROUP=${GROUP} \
148
		OSSEC_USER=${USER} \
149
		OSSEC_USER_MAIL=${USER} \
150
		OSSEC_USER_REM=${USER}
151
.endif
152
OSSEC_USER=	ossec
153
OSSEC_GROUP=	ossec
154
USERS=		${OSSEC_USER} ossecm ossecr
155
GROUPS=		${OSSEC_GROUP}
156
157
SUB_LIST+=	PORTNAME=${PORTNAME} \
158
		CATEGORY=${CATEGORIES:[1]} \
159
		OSSEC_TYPE=${OSSEC_TYPE} \
160
		OSSEC_HOME=${OSSEC_HOME} \
161
		VERSION=${PORTVERSION} \
162
		DB_TYPE=${DB_TYPE} \
163
		DB_SCHEMA=${DOCSDIR}/${DB_SCHEMA} \
164
		USER=${USER} \
165
		OSSEC_USER=${OSSEC_USER} \
166
		OSSEC_GROUP=${OSSEC_GROUP} \
167
		OSSEC_RC=${OSSEC_RC}
168
SUB_FILES=	pkg-install \
169
		pkg-deinstall \
170
		${PKGMSG_FILES} \
171
		restart-ossec.sh
172
173
.if defined(MAINTAINER_MODE)
174
PLIST_SUB=	OSSEC_HOME=${PORTNAME}
175
.else
176
PLIST_SUB=	OSSEC_HOME=${OSSEC_HOME}
177
.endif
178
PLIST=		${PKGDIR}/pkg-plist-${OSSEC_TYPE}
179
DOCSFILES=	BUGS CHANGELOG CONTRIBUTORS LICENSE README.md SUPPORT.md
180
PKGHELP=	${PKGDIR}/pkg-help-${OSSEC_TYPE}
181
PKGMESSAGE=	${WRKDIR}/pkg-message
182
PKGMSG_FILES=	message-header
183
184
CFLAGS+=	-I${LOCALBASE}/include
185
186
BUILD_ARGS+=	${MAKE_ARGS} ${OSSEC_ARGS} PREFIX=${OSSEC_HOME}
187
INSTALL_ARGS+=	${USER_ARGS} ${OSSEC_ARGS} PREFIX=${STAGEDIR}${OSSEC_HOME}
188
189
.include <bsd.port.pre.mk>
190
191
PKGMSG_FILES+=	message-firewall message-config
192
193
post-patch:
194
	@${REINPLACE_CMD} -e 's|-DLUA_USE_LINUX|& ${CPPFLAGS}|' \
195
		-e 's|-lreadline|& ${LDFLAGS}|' \
196
		${WRKSRC}/src/external/lua/src/Makefile
197
198
do-build:
199
	@cd ${WRKSRC}/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${BUILD_ARGS} build
200
201
do-install:
202
	@cd ${WRKSRC}/src; ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${INSTALL_ARGS} install
203
204
post-install:
205
	@${MV} -f ${STAGEDIR}${INTERNAL_OPTS_CONF} ${STAGEDIR}${INTERNAL_OPTS_CONF}.sample
206
	@${MV} -f ${STAGEDIR}${FIREWALL_DROP_BIN} ${STAGEDIR}${IPFILTER_BIN}
207
	@${CP} -f ${WRKDIR}/restart-ossec.sh ${STAGEDIR}${RESTART_OSSEC_BIN}
208
	@${CHMOD} 550 ${STAGEDIR}${RESTART_OSSEC_BIN}
209
.if defined(MAINTAINER_MODE)
210
	@${CHOWN} ${USER}:${OSSEC_GROUP} ${STAGEDIR}${RESTART_OSSEC_BIN}
211
.endif
212
	
213
.if ${OSSEC_TYPE} == agent
214
.if defined(MAINTAINER_MODE)
215
	@for file_name in $$(find "${STAGEDIR}${SHARED_DIR}" -type f); do ${CHMOD} 0644 $${file_name}; ${CHOWN} ${OSSEC_USER}:${OSSEC_GROUP} $${file_name}; done
216
.else
217
	@for file_name in $$(find "${STAGEDIR}${SHARED_DIR}" -type f); do ${CHMOD} 0644 $${file_name}; done
218
.endif
219
.endif
220
	@${ECHO_CMD} -n > ${PKGMESSAGE}
221
.for file_name in ${PKGMSG_FILES}
222
	@${CAT} ${WRKDIR}/${file_name} >> ${PKGMESSAGE}
223
	@${ECHO_CMD} >> ${PKGMESSAGE}
224
.endfor
225
.for file_name in ${STRIP_FILES}
226
	@${STRIP_CMD} ${STAGEDIR}${OSSEC_HOME}/bin/${file_name}
227
.endfor
228
229
.if defined(MAINTAINER_MODE)
230
plist: makeplist
231
	@${SCRIPTDIR}/plist.sh ${OSSEC_TYPE} ${OSSEC_HOME} ${PLIST} ${WRKDIR} ${STAGEDIR}
232
.endif
233
234
post-install-DOCS-on:
235
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
236
	@cd ${WRKSRC} && ${INSTALL_DATA} ${DOCSFILES} ${STAGEDIR}${DOCSDIR}
237
	@cd ${WRKSRC} && ${INSTALL_DATA} etc/ossec-${OSSEC_TYPE}.conf ${STAGEDIR}${DOCSDIR}/ossec.conf.sample
238
239
post-install-MYSQL-on:
240
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
241
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/${DB_SCHEMA} ${STAGEDIR}${DOCSDIR}
242
243
post-install-PGSQL-on:
244
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
245
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/${DB_SCHEMA} ${STAGEDIR}${DOCSDIR}
246
247
.include <bsd.port.post.mk>
(-)security/ossec-hids-local/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1539457911
2
SHA256 (ossec-ossec-hids-3.1.0_GH0.tar.gz) = e0e2987751badb95c2bf618531c7853b2289c910f796da85ff394c0faea43f50
3
SIZE (ossec-ossec-hids-3.1.0_GH0.tar.gz) = 1886469
(-)security/ossec-hids-local/files/message-config.in (+5 lines)
Line 0 Link Here
1
Consider installing "%%CATEGORY%%/%%PORTNAME%%-%%OSSEC_TYPE%%-config" to ease
2
OSSEC configuration.
3
4
For additional help execute:
5
# %%PREFIX%%/etc/rc.d/ossec-hids help
(-)security/ossec-hids-local/files/message-database.in (+8 lines)
Line 0 Link Here
1
The database schema file:
2
%%DB_SCHEMA%%
3
4
To enable database output execute:
5
# %%OSSEC_HOME%%/bin/ossec-control enable database
6
7
For further steps see the documentation:
8
https://www.ossec.net/docs/syntax/head_ossec_config.database_output.html
(-)security/ossec-hids-local/files/message-firewall.in (+12 lines)
Line 0 Link Here
1
If you intend to use "firewall-drop" active response on this OSSEC instance
2
create the script:
3
%%OSSEC_HOME%%/active-response/bin/firewall-drop.sh
4
5
You can copy or hard link (symbolic link is not supported) one of the scripts
6
already provided by OSSEC:
7
%%OSSEC_HOME%%/active-response/bin/ipfilter.sh
8
%%OSSEC_HOME%%/active-response/bin/ipfw.sh
9
%%OSSEC_HOME%%/active-response/bin/pf.sh
10
11
For further steps see the documentation:
12
https://www.ossec.net/docs/syntax/head_ossec_config.active-response.html
(-)security/ossec-hids-local/files/message-header.in (+10 lines)
Line 0 Link Here
1
All the files related to OSSEC have been installed in:
2
%%OSSEC_HOME%%
3
4
You need to create main configuration file:
5
%%OSSEC_HOME%%/etc/ossec.conf
6
7
For information on proper configuration see:
8
https://www.ossec.net/docs/syntax/ossec_config.html
9
10
To enable the startup script add ossec_hids_enable="YES" to /etc/rc.conf.
(-)security/ossec-hids-local/files/ossec-hids.in (+537 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# PROVIDE: ossec_hids
4
# REQUIRE: DAEMON
5
# BEFORE:  LOGIN
6
# KEYWORD: shutdown
7
8
# ossec_hids_enable (bool):             Set it to YES to enable %%PORTNAME%%.
9
#                                       Default: NO
10
# ossec_hids_clear_log (bool):          Set it to YES to clear ossec.log before %%PORTNAME%% startup.
11
#                                       Default: NO
12
# ossec_hids_clear_ar_log (bool):       Set it to YES to clear active-responses.log before %%PORTNAME%% startup.
13
#                                       Default: NO
14
# ossec_hids_fetch_connect_time (int):  Time in seconds to wait for the download of the shared configuration to start.
15
#                                       Used only by agent installation.
16
#                                       Default: 30
17
# ossec_hids_fetch_read_time (int):     Time in seconds to wait for subsequent download chunks of the shared configuration.
18
#                                       Used only by agent installation.
19
#                                       Default: 10
20
21
. /etc/rc.subr
22
23
name="ossec_hids"
24
rcvar=ossec_hids_enable
25
26
load_rc_config $name
27
28
: ${ossec_hids_enable="NO"}
29
: ${ossec_hids_clear_log="NO"}
30
: ${ossec_hids_clear_ar_log="NO"}
31
: ${ossec_hids_fetch_connect_time=30}
32
: ${ossec_hids_fetch_read_time=10}
33
34
ossec_type="%%OSSEC_TYPE%%"
35
ossec_home="%%OSSEC_HOME%%"
36
37
ossec_conf="${ossec_home}/etc/ossec.conf"
38
ossec_conf_dir="${ossec_home}/etc/ossec.conf.d"
39
ossec_conf_bin="${ossec_home}/bin/config/ossec-conf"
40
41
agent_conf="${ossec_home}/etc/shared/agent.conf"
42
agent_conf_dir="${ossec_home}/etc/agent.conf.d"
43
agent_conf_bin="${ossec_home}/bin/config/agent-conf"
44
45
ossec_client_keys="${ossec_home}/etc/client.keys"
46
ossec_ar_tmp="${ossec_home}/active-response"
47
ossec_log="${ossec_home}/logs/ossec.log"
48
ossec_ar_log="${ossec_home}/logs/active-responses.log"
49
ossec_merged="${ossec_home}/etc/shared/merged.mg"
50
51
ossec_local_time="/etc/localtime"
52
53
extra_commands="help status reload ossec_conf"
54
case ${ossec_type} in
55
    server)
56
        extra_commands="${extra_commands} agent_conf manage_agent reset_counter"
57
        ;;
58
    agent)
59
        extra_commands="${extra_commands} agent_conf manage_agent reset_counter config_profile fetch_config"
60
        ;;
61
esac
62
if [ -x "${ossec_conf_bin}" ]; then
63
    extra_commands="${extra_commands} merge_config"
64
fi
65
66
ossec_rc_command=$1
67
shift 1
68
69
help_cmd="ossec_hids_help $@"
70
start_cmd="ossec_hids_command start $@"
71
stop_cmd="ossec_hids_command stop $@"
72
restart_cmd="ossec_hids_command restart $@"
73
status_cmd="ossec_hids_command status $@"
74
reload_cmd="ossec_hids_command reload $@"
75
manage_agent_cmd="ossec_hids_manage_agent $@"
76
reset_counter_cmd="ossec_hids_reset_counter $@"
77
config_profile_cmd="ossec_hids_config_profile $@"
78
fetch_config_cmd="ossec_hids_fetch_config $@"
79
merge_config_cmd="ossec_hids_create_config force $@"
80
ossec_conf_cmd="ossec_hids_ossec_conf $@"
81
agent_conf_cmd="ossec_hids_agent_conf $@"
82
83
start_precmd="ossec_hids_create_env && ossec_hids_create_config && ossec_hids_clean && ossec_hids_check"
84
restart_precmd="${start_precmd}"
85
reload_precmd="ossec_hids_create_env && ossec_hids_create_config"
86
config_profile_precmd="ossec_hids_check"
87
fetch_config_precmd="${start_precmd}"
88
89
agent_ids_cmd="${ossec_home}/bin/manage_agents -l | sed -En -e 's|.*ID:[[:space:]]*([[:digit:]]+).*|\1|p'"
90
agent_names_cmd="${ossec_home}/bin/manage_agents -l | sed -En -e 's|.*Name:[[:space:]]*([^,]+).*|\1|p'"
91
92
ossec_hids_help() {
93
    local indent="    "
94
95
    echo "Additional commands:"
96
    echo
97
98
    for command in ${extra_commands}; do
99
        case ${command} in
100
            ossec_conf)
101
                echo "${command}"
102
                if [ -x "${ossec_conf_bin}" ]; then
103
                    echo "${indent}Displays the \"ossec.conf\" as it would have been produced"
104
                    echo "${indent}by merging files from \"ossec.conf.d\" directory."
105
                    echo "${indent}Does not overwrite the actual \"ossec.conf\"."
106
                else
107
                    echo "${indent}Displays the current \"ossec.conf\"."
108
                fi
109
                echo
110
            ;;
111
            agent_conf)
112
                echo "${command}"
113
                if [ -x "${agent_conf_bin}" ]; then
114
                    echo "${indent}Displays the \"agent.conf\" as it would have been produced"
115
                    echo "${indent}by merging files from \"agent.conf.d\" directory."
116
                    echo "${indent}Does not overwrite the actual \"agent.conf\"."
117
                else
118
                    echo "${indent}Displays the current \"agent.conf\"."
119
                fi
120
                echo
121
            ;;
122
            manage_agent)
123
                echo "${command} [...]"
124
                echo "${indent}Executes OSSEC Agent Manager."
125
                echo "${indent}Any additional arguments will be passed along (-h for help)."
126
                echo "${indent}Use this command to export and import agent keys."
127
                echo
128
            ;;
129
            reset_counter)
130
                case ${ossec_type} in
131
                    server)
132
                        echo "${command} <agent_name>"
133
                        echo "${indent}Stops the OSSEC and resets (removes) the replay attack prevention counter(s)."
134
                        echo "${indent}Only the counter for the given <agent_name> is reset."
135
                        echo "${indent}If the <agent_name> is \"-\", then counters for all agents are reset."
136
                    ;;
137
                    agent)
138
                        echo "${command}"
139
                        echo "${indent}Stops the OSSEC and resets (removes) the replay attack prevention counter."
140
                    ;;
141
                esac
142
                echo "${indent}Use this command on both the server and the agent to bring back connectivity."
143
                echo "${indent}The typical scenario for desynchronization of counters is one of the OSSEC"
144
                echo "${indent}instances has been restored from backup."
145
                echo "${indent}Use the following procedure:"
146
                echo "${indent}1. Reset counter on the agent."
147
                echo "${indent}2. Reset counter on the server for that specific agent."
148
                echo "${indent}3. Start the server."
149
                echo "${indent}4. Start the agent."
150
                echo
151
            ;;
152
            config_profile)
153
                echo "${command}"
154
                echo "${indent}Displays a list (i.e. union of sets) of applicable (to this agent) configuration"
155
                echo "${indent}profiles sent by the server (current \"agent.conf\") merged with configuration"
156
                echo "${indent}profiles enabled on this agent (current \"ossec.conf\"). Each entry on the list"
157
                echo "${indent}is marked with one of the following markers:"
158
                echo "${indent}(+) - The profile is sent by the server and is enabled on this agent."
159
                echo "${indent}(-) - The profile is sent by the server and is applicable for this agent, but is"
160
                echo "${indent}      not enabled in the \"ossec.conf\"."
161
                echo "${indent}(?) - The profile is enabled on this agent, but is not sent by the server or is"
162
                echo "${indent}      not applicable to this agent."
163
                echo
164
            ;;
165
            fetch_config)
166
                echo "${command}"
167
                echo "${indent}(Re)starts the agent with a fresh copy of server shared configuration (including"
168
                echo "${indent}\"agent.conf\"). Command can also be used to ensure server connectivity."
169
                echo
170
            ;;
171
            merge_config)
172
                echo "${command}"
173
                echo "${indent}Creates \"ossec.conf\" by merging files from \"ossec.conf.d\" directory."
174
                case ${ossec_type} in
175
                    server)
176
                        echo "${indent}Creates \"agent.conf\" by merging files from \"agent.conf.d\" directory."
177
                    ;;
178
                esac
179
                echo "${indent}Usually you do not need to run this command, because configuration files will"
180
                echo "${indent}be merged before OSSEC startup if any of them has been modified/created/deleted"
181
                echo "${indent}since the last merging. This command, however, does merging unconditionally."
182
                echo
183
            ;;
184
        esac
185
    done
186
187
    echo "To avoid problems with this script and the port in general, keep your XML-like"
188
    echo "configuration pretty printed. Place element tags in single and separate lines."
189
    echo "Comments can span on multiple but still separate lines."
190
    echo "Do NOT use the following formatting:"
191
    echo
192
    echo "${indent}<elementA"
193
    echo "${indent}${indent}attribute=\"value\"><!-- I am a long and"
194
    echo "${indent}${indent}${indent}descriptive comment -->"
195
    echo "${indent}${indent}<elementB>"
196
    echo "${indent}${indent}${indent}Some content"
197
    echo "${indent}${indent}</elementB><elementC>"
198
    echo "${indent}${indent}${indent}Another content</elementC>"
199
    echo "${indent}</elementA>"
200
    echo
201
    echo "Use instead:"
202
    echo
203
    echo "${indent}<elementA attribute=\"value\">"
204
    echo "${indent}${indent}<!-- I am a long and"
205
    echo "${indent}${indent}descriptive comment -->"
206
    echo "${indent}${indent}<elementB>Some content</elementB>"
207
    echo "${indent}${indent}<elementC>Another content</elementC>"
208
    echo "${indent}</elementA>"
209
    echo
210
}
211
212
ossec_hids_create_file() {
213
    local path=$1
214
    local owner=$2
215
    local mode=$3
216
217
    if [ ! -e "${path}" ]; then
218
        touch "${path}" && chown ${owner} "${path}" && chmod ${mode} "${path}"
219
    fi
220
}
221
222
ossec_hids_check() {
223
    case ${ossec_type} in
224
        server)
225
            if [ ! -s "${ossec_client_keys}" ]; then
226
                echo "WARNING: There are no client keys created - remote connections will be disabled."
227
                echo
228
            fi
229
            ;;
230
        agent)
231
            if [ ! -s "${ossec_client_keys}" ]; then
232
                echo "WARNING: There are is no client key imported - connection to server not possible."
233
                echo
234
            else
235
                if [ $(eval ${agent_ids_cmd} | wc -l) -gt 1 ]; then
236
                    echo "ERROR: There are multiple client keys imported - only one is allowed."
237
                    echo
238
                    return 1
239
                fi
240
            fi
241
            ;;
242
    esac
243
244
    return 0
245
}
246
247
ossec_hids_inline_content() {
248
    local element="$1"
249
    sed -En "s|.*<${element}>(.*)</${element}>.*|\1|p"
250
}
251
252
ossec_hids_remove_comments() {
253
    # Comments must be on separate lines i.e. not next to uncommented code
254
    awk '/<!--/ {off=1} /-->/ {off=2} /([\s\S]*)/ {if (off==0) print; if (off==2) off=0}'
255
}
256
257
ossec_hids_config_profile() {
258
    if [ ! -f "${ossec_conf}" ]; then
259
        echo -n "ERROR: The \"${ossec_conf}\" is missing."
260
        if [ -x "${ossec_conf_bin}" ]; then
261
            echo " Run:"
262
            echo "$(realpath $0) merge_config"
263
        else
264
            echo
265
        fi
266
        echo
267
        return 1
268
    fi
269
    if [ ! -f "${agent_conf}" ]; then
270
        echo "ERROR: The \"${agent_conf}\" is missing. Run:"
271
        echo "$(realpath $0) fetch_config"
272
        echo
273
        return 1
274
    fi
275
276
    local os="FreeBSD"
277
    local name=$(eval ${agent_names_cmd})
278
279
    local server_profiles=`ossec_hids_remove_comments < "${agent_conf}" | sed -En \
280
        -e "s|.*<agent_config[[:space:]]+profile=\"([^\"]+)\"[[:space:]]*>.*|\1|p" \
281
        -e "s|.*<agent_config[[:space:]]+profile=\"([^\"]+)\"[[:space:]]+os=\"${os}\"[[:space:]]*>.*|\1|p" \
282
        -e "s|.*<agent_config[[:space:]]+os=\"${os}\"[[:space:]]+profile=\"([^\"]+)\"[[:space:]]*>.*|\1|p" \
283
        -e "s|.*<agent_config[[:space:]]+profile=\"([^\"]+)\"[[:space:]]+name=\"${name}\"[[:space:]]*>.*|\1|p" \
284
        -e "s|.*<agent_config[[:space:]]+name=\"${name}\"[[:space:]]+profile=\"([^\"]+)\"[[:space:]]*>.*|\1|p" \
285
        -e "s|.*<agent_config[[:space:]]+profile=\"([^\"]+)\"[[:space:]]+os=\"${os}\"[[:space:]]+name=\"${name}\"[[:space:]]*>.*|\1|p" \
286
        -e "s|.*<agent_config[[:space:]]+profile=\"([^\"]+)\"[[:space:]]+name=\"${name}\"[[:space:]]+os=\"${os}\"[[:space:]]*>.*|\1|p" \
287
        -e "s|.*<agent_config[[:space:]]+os=\"${os}\"[[:space:]]+profile=\"([^\"]+)\"[[:space:]]+name=\"${name}\"[[:space:]]*>.*|\1|p" \
288
        -e "s|.*<agent_config[[:space:]]+os=\"${os}\"[[:space:]]+name=\"${name}\"[[:space:]]+profile=\"([^\"]+)\"[[:space:]]*>.*|\1|p" \
289
        -e "s|.*<agent_config[[:space:]]+name=\"${name}\"[[:space:]]+profile=\"([^\"]+)\"[[:space:]]+os=\"${os}\"[[:space:]]*>.*|\1|p" \
290
        -e "s|.*<agent_config[[:space:]]+name=\"${name}\"[[:space:]]+os=\"${os}\"[[:space:]]+profile=\"([^\"]+)\"[[:space:]]*>.*|\1|p" \
291
        | sort -u`
292
293
    local agent_profiles=$(ossec_hids_remove_comments < "${ossec_conf}" | ossec_hids_inline_content "config-profile" | sed -E 's|[[:space:]]*,[[:space:]]*| |g')
294
295
    local output=""
296
    for server_profile in ${server_profiles}; do
297
        local matching_profile=""
298
        for agent_profile in ${agent_profiles}; do
299
            if [ "${agent_profile}" == "${server_profile}" ]; then
300
                matching_profile="${agent_profile}"
301
                break
302
            fi
303
        done
304
        if [ -n "${matching_profile}" ]; then
305
            output="${output}(+) ${server_profile}
306
"
307
        else
308
            output="${output}(-) ${server_profile}
309
"
310
        fi
311
    done
312
    for agent_profile in ${agent_profiles}; do
313
        local matching_profile=""
314
        for server_profile in ${server_profiles}; do
315
            if [ "${server_profile}" == "${agent_profile}" ]; then
316
                matching_profile="${server_profile}"
317
                break
318
            fi
319
        done
320
        if [ -z "${matching_profile}" ]; then
321
            output="${output}(?) ${agent_profile}
322
"
323
        fi
324
    done
325
326
    echo -n "${output}" | sort -k 2
327
}
328
329
ossec_hids_config_is_outdated() {
330
    local dst_file="$1"
331
    local src_dir="$2"
332
333
    if [ ! -e "${dst_file}" ]; then
334
        return 0
335
    fi
336
337
    if [ "${src_dir}" -nt "${dst_file}" ]; then
338
        return 0
339
    fi
340
341
    for src_file in $(find "${src_dir}" -maxdepth 1 -type f -name "*.conf"); do
342
        if [ "${src_file}" -nt "${dst_file}" ]; then
343
            return 0
344
        fi
345
    done
346
347
    return 1
348
}
349
350
ossec_hids_create_config() {
351
    case ${ossec_type} in
352
        server)
353
            if [ -x "${agent_conf_bin}" ]; then
354
                # Merge agent.conf.d files into agent.conf
355
                if [ "$1" == "force" ] || ossec_hids_config_is_outdated "${agent_conf}" "${agent_conf_dir}"; then
356
                    ossec_hids_create_file "${agent_conf}" %%USER%%:%%OSSEC_GROUP%% 0640
357
                    "${agent_conf_bin}" > "${agent_conf}"
358
                fi
359
            fi
360
            ;;
361
    esac
362
363
    if [ -x "${ossec_conf_bin}" ]; then
364
        # Merge ossec.conf.d files into ossec.conf
365
        if [ "$1" == "force" ] || ossec_hids_config_is_outdated "${ossec_conf}" "${ossec_conf_dir}"; then
366
            ossec_hids_create_file "${ossec_conf}" %%USER%%:%%OSSEC_GROUP%% 0640
367
            "${ossec_conf_bin}" > "${ossec_conf}"
368
        fi
369
    fi
370
371
    return 0
372
}
373
374
ossec_hids_create_env() {
375
    # Copy required files from outside of home directory
376
    if [ ! -e "${ossec_local_time}" ]; then
377
        echo "ERROR: Missing \"${ossec_local_time}\". Run command \"tzsetup\"."
378
        echo
379
        return 1
380
    fi
381
    install -o %%USER%% -g %%OSSEC_GROUP%% -m 0440 "${ossec_local_time}" "${ossec_home}${ossec_local_time}"
382
383
    return 0
384
}
385
386
ossec_hids_clean() {
387
    if [ "${ossec_type}" == "server" ]; then
388
        rm -f "${ossec_merged}"
389
    fi
390
391
    if checkyesno ossec_hids_clear_log && [ -e "${ossec_log}" ]; then
392
        echo -n > "${ossec_log}"
393
    fi
394
395
    if checkyesno ossec_hids_clear_ar_log && [ -e "${ossec_ar_log}" ]; then
396
        echo -n > "${ossec_ar_log}"
397
    fi
398
399
    return 0
400
}
401
402
ossec_hids_reset_counter() {
403
    local agent_name="$1"
404
405
    ossec_hids_command stop
406
    sleep 1
407
    echo
408
409
    case ${ossec_type} in
410
        server)
411
            if [ -z "${agent_name}" ]; then
412
                echo "ERROR: Specify agent name to reset counter for this agent or \"-\" to reset counters for all agents."
413
                echo
414
                return 1
415
            fi
416
            local agent_counter=0
417
            if [ "${agent_name}" == "-" ]; then
418
                for agent_id in $(eval ${agent_ids_cmd}); do
419
                    if [ -e "${ossec_home}/queue/rids/${agent_id}" ]; then
420
                        rm "${ossec_home}/queue/rids/${agent_id}" && agent_counter=$((agent_counter + 1))
421
                    fi
422
                done
423
            else
424
                local agent_id=`${ossec_home}/bin/manage_agents -l | sed -En -e "s|.*ID:[[:space:]]*([[:digit:]]+),[[:space:]]*Name:[[:space:]]${agent_name},.*|\1|p"`
425
                if [ -n "${agent_id}" ]; then
426
                    if [ -e "${ossec_home}/queue/rids/${agent_id}" ]; then
427
                        rm "${ossec_home}/queue/rids/${agent_id}" && agent_counter=$((agent_counter + 1))
428
                    fi
429
                fi
430
            fi
431
            echo "Removed ${agent_counter} counter(s)."
432
            echo
433
            ;;
434
        agent)
435
            local agent_counter=0
436
            for agent_id in $(eval ${agent_ids_cmd}); do
437
                # Should be executed only once
438
                if [ -e "${ossec_home}/queue/rids/${agent_id}" ]; then
439
                    rm "${ossec_home}/queue/rids/${agent_id}" && agent_counter=$((agent_counter + 1))
440
                fi
441
            done
442
            echo "Removed ${agent_counter} counter(s)."
443
            echo
444
            ;;
445
    esac
446
447
    return 0
448
}
449
450
ossec_hids_fetch_config() {
451
    ossec_hids_command stop
452
    sleep 1
453
    echo
454
    rm -f "${ossec_merged}"
455
    ossec_hids_command start || return 1
456
    echo
457
    echo "Waiting ${ossec_hids_fetch_connect_time} seconds for the shared configuration download to start."
458
    sleep ${ossec_hids_fetch_connect_time}
459
    if [ ! -s "${ossec_merged}" ]; then
460
        echo "ERROR: Failed to download shared configuration from the OSSEC server."
461
        echo
462
        local ossec_log_tail=$(tail "${ossec_log}")
463
        echo "Portion of the \"${ossec_log}\":"
464
        echo "${ossec_log_tail}"
465
        echo
466
        if echo "${ossec_log_tail}" | grep -q "ERROR: Unable to send message to"; then
467
            echo "Check if your configuration contains the correct server address in \"server-ip\" option."
468
            echo
469
        else
470
            local ossec_rc_path="$(realpath $0)"
471
            echo "Is the imported agent key correct? To import it run:"
472
            echo "${ossec_rc_path} manage_agent"
473
            echo
474
            echo "If you are certain the imported agent key is correct, then run:"
475
            echo "${ossec_rc_path} reset_counter"
476
            echo "${ossec_rc_path} fetch_config"
477
            echo
478
            echo "If this does't help, you need to reset counter on the server."
479
            echo "If the server runs FreeBSD port of OSSEC, run:"
480
            echo "On the agent:"
481
            echo "${ossec_rc_path} reset_counter"
482
            echo "On the server:"
483
            echo "${ossec_rc_path} reset_counter $(eval ${agent_names_cmd})"
484
            echo "${ossec_rc_path} start"
485
            echo "On the agent:"
486
            echo "${ossec_rc_path} fetch_config"
487
            echo
488
        fi
489
        ossec_hids_command stop
490
        return 1
491
    else
492
        # The download has started
493
        while true; do
494
            local current_time=$(date +%s)
495
            local modification_time=$(stat -f %m "${ossec_merged}")
496
            if [ $((current_time - modification_time)) -gt ${ossec_hids_fetch_read_time} ]; then
497
                echo "Download finished."
498
                echo
499
                ossec_hids_command restart || return 1
500
                break;
501
            else
502
                echo "Download in progress..."
503
                sleep ${ossec_hids_fetch_read_time}
504
            fi
505
        done
506
    fi
507
508
    return 0
509
}
510
511
ossec_hids_ossec_conf() {
512
    if [ -x "${ossec_conf_bin}" ]; then
513
        "${ossec_conf_bin}"
514
    elif [ -f "${ossec_conf}" ]; then
515
        cat "${ossec_conf}"
516
    fi
517
}
518
519
ossec_hids_agent_conf() {
520
    if [ -x "${agent_conf_bin}" ]; then
521
        "${agent_conf_bin}"
522
    elif [ -f "${agent_conf}" ]; then
523
        cat "${agent_conf}"
524
    fi
525
}
526
527
ossec_hids_manage_agent() {
528
    "${ossec_home}/bin/manage_agents" $@
529
    return $?
530
}
531
532
ossec_hids_command() {
533
    "${ossec_home}/bin/ossec-control" $1
534
    return $?
535
}
536
537
run_rc_command "${ossec_rc_command}"
(-)security/ossec-hids-local/files/patch-src_Makefile (+10 lines)
Line 0 Link Here
1
--- src/Makefile.orig	2018-10-11 22:25:16 UTC
2
+++ src/Makefile
3
@@ -406,7 +406,6 @@ endif
4
 	install -d -m 0750 -o ${OSSEC_USER} -g ${OSSEC_GROUP} ${PREFIX}/queue/diff
5
 
6
 	install -d -m 0550 -o root -g ${OSSEC_GROUP} ${PREFIX}/etc
7
-	install -m 0440 -o root -g ${OSSEC_GROUP} /etc/localtime ${PREFIX}/etc
8
 
9
 	install -d -m 1550 -o root -g ${OSSEC_GROUP} ${PREFIX}/tmp
10
 
(-)security/ossec-hids-local/files/pkg-deinstall.in (+18 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_home="%%OSSEC_HOME%%"
4
ar_conf="${ossec_home}/etc/shared/ar.conf"
5
merged_mg="${ossec_home}/etc/shared/merged.mg"
6
client_keys="${ossec_home}/etc/client.keys"
7
firewall_drop="${ossec_home}/active-response/bin/firewall-drop.sh"
8
local_time="${ossec_home}/etc/localtime"
9
10
if [ "$2" == "DEINSTALL"  ]; then
11
    rm -f "${ar_conf}"
12
    rm -f "${merged_mg}"
13
    if [ ! -s "${client_keys}" ]; then
14
        rm -f "${client_keys}"
15
    fi
16
    rm -f "${firewall_drop}"
17
    rm -f "${local_time}"
18
fi
(-)security/ossec-hids-local/files/pkg-install.in (+23 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_home="%%OSSEC_HOME%%"
4
client_keys="${ossec_home}/etc/client.keys"
5
6
create_file() {
7
    local path=$1
8
    local owner=$2
9
    local mode=$3
10
11
    if [ ! -e "${path}" ]; then
12
        touch "${path}" && chown ${owner} "${path}" && chmod ${mode} "${path}"
13
    fi
14
}
15
16
if [ "$2" == "POST-INSTALL"  ]; then
17
    pw usermod %%OSSEC_USER%% -d "${ossec_home}"
18
    pw usermod ossecm -d "${ossec_home}"
19
    pw usermod ossecr -d "${ossec_home}"
20
    chown %%USER%%:%%OSSEC_GROUP%% "${ossec_home}"
21
22
    create_file "${client_keys}" root:ossec 0640
23
fi
(-)security/ossec-hids-local/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="%%OSSEC_HOME%%"
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
(-)security/ossec-hids-local/pkg-descr (+6 lines)
Line 0 Link Here
1
OSSEC is a scalable, multi-platform, open source Host-based Intrusion Detection
2
System (HIDS). It has a powerful correlation and analysis engine, integrating
3
log analysis, file integrity checking, Windows registry monitoring, centralized
4
policy enforcement, rootkit detection, real-time alerting and active response.
5
6
WWW: https://ossec.github.io
(-)security/ossec-hids-local/pkg-plist-agent (+79 lines)
Line 0 Link Here
1
@dir(,ossec,0550) %%OSSEC_HOME%%
2
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response
3
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response/bin
4
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/disable-account.sh
5
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/firewalld-drop.sh
6
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/host-deny.sh
7
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ip-customblock.sh
8
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfilter.sh
9
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfw.sh
10
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfw_mac.sh
11
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/npf.sh
12
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-pagerduty.sh
13
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-slack.sh
14
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-tweeter.sh
15
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/pf.sh
16
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/restart-ossec.sh
17
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/route-null.sh
18
@dir(,,0550) %%OSSEC_HOME%%/bin
19
@(,,0550) %%OSSEC_HOME%%/bin/agent-auth
20
@(,,0550) %%OSSEC_HOME%%/bin/manage_agents
21
@(,,0550) %%OSSEC_HOME%%/bin/ossec-agentd
22
@(,,0550) %%OSSEC_HOME%%/bin/ossec-control
23
@(,,0550) %%OSSEC_HOME%%/bin/ossec-execd
24
@(,,0550) %%OSSEC_HOME%%/bin/ossec-logcollector
25
@(,,0550) %%OSSEC_HOME%%/bin/ossec-lua
26
@(,,0550) %%OSSEC_HOME%%/bin/ossec-luac
27
@(,,0550) %%OSSEC_HOME%%/bin/ossec-syscheckd
28
@(,,0550) %%OSSEC_HOME%%/bin/util.sh
29
@dir(,ossec,0550) %%OSSEC_HOME%%/etc
30
@(,ossec,0640) %%OSSEC_HOME%%/etc/internal_options.conf
31
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/local_internal_options.conf.sample
32
@dir(,ossec,0770) %%OSSEC_HOME%%/etc/shared
33
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/acsc_office2016_rcl.txt
34
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_apache2224_rcl.txt
35
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_debian_linux_rcl.txt
36
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_debianlinux7-8_L1_rcl.txt
37
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_debianlinux7-8_L2_rcl.txt
38
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_mysql5-6_community_rcl.txt
39
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_mysql5-6_enterprise_rcl.txt
40
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_rhel5_linux_rcl.txt
41
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_rhel6_linux_rcl.txt
42
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_rhel7_linux_rcl.txt
43
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_rhel_linux_rcl.txt
44
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_sles11_linux_rcl.txt
45
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_sles12_linux_rcl.txt
46
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win10_enterprise_L1_rcl.txt
47
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win10_enterprise_L2_rcl.txt
48
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_domainL1_rcl.txt
49
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_domainL2_rcl.txt
50
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_memberL1_rcl.txt
51
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_memberL2_rcl.txt
52
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2016_domainL1_rcl.txt
53
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2016_domainL2_rcl.txt
54
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2016_memberL1_rcl.txt
55
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/cis_win2016_memberL2_rcl.txt
56
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/rootkit_files.txt
57
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/rootkit_trojans.txt
58
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/system_audit_rcl.txt
59
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/system_audit_ssh.txt
60
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/win_applications_rcl.txt
61
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/win_audit_rcl.txt
62
@(ossec,ossec,0644) %%OSSEC_HOME%%/etc/shared/win_malware_rcl.txt
63
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs
64
@dir(,ossec,0550) %%OSSEC_HOME%%/queue
65
@dir(ossec,ossec,0770) %%OSSEC_HOME%%/queue/alerts
66
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/diff
67
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/ossec
68
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/rids
69
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/syscheck
70
@dir(,ossec,1550) %%OSSEC_HOME%%/tmp
71
@dir(,ossec,0550) %%OSSEC_HOME%%/var
72
@dir(,ossec,0770) %%OSSEC_HOME%%/var/run
73
%%PORTDOCS%%%%DOCSDIR%%/BUGS
74
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
75
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS
76
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
77
%%PORTDOCS%%%%DOCSDIR%%/README.md
78
%%PORTDOCS%%%%DOCSDIR%%/SUPPORT.md
79
%%PORTDOCS%%%%DOCSDIR%%/ossec.conf.sample
(-)security/ossec-hids-local/pkg-plist-local (+200 lines)
Line 0 Link Here
1
@dir(,ossec,0550) %%OSSEC_HOME%%
2
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response
3
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response/bin
4
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/disable-account.sh
5
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/firewalld-drop.sh
6
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/host-deny.sh
7
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ip-customblock.sh
8
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfilter.sh
9
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfw.sh
10
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfw_mac.sh
11
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/npf.sh
12
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-pagerduty.sh
13
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-slack.sh
14
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-tweeter.sh
15
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/pf.sh
16
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/restart-ossec.sh
17
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/route-null.sh
18
@dir(,ossec,0550) %%OSSEC_HOME%%/agentless
19
@(,ossec,0550) %%OSSEC_HOME%%/agentless/main.exp
20
@(,ossec,0550) %%OSSEC_HOME%%/agentless/register_host.sh
21
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh.exp
22
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_asa-fwsmconfig_diff
23
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_foundry_diff
24
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_generic_diff
25
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_integrity_check_bsd
26
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_integrity_check_linux
27
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_nopass.exp
28
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_pixconfig_diff
29
@(,ossec,0550) %%OSSEC_HOME%%/agentless/sshlogin.exp
30
@(,ossec,0550) %%OSSEC_HOME%%/agentless/su.exp
31
@dir(,,0550) %%OSSEC_HOME%%/bin
32
@(,,0550) %%OSSEC_HOME%%/bin/agent_control
33
@(,,0550) %%OSSEC_HOME%%/bin/clear_stats
34
@(,,0550) %%OSSEC_HOME%%/bin/list_agents
35
@(,,0550) %%OSSEC_HOME%%/bin/manage_agents
36
@(,,0550) %%OSSEC_HOME%%/bin/ossec-agentlessd
37
@(,,0550) %%OSSEC_HOME%%/bin/ossec-analysisd
38
@(,,0550) %%OSSEC_HOME%%/bin/ossec-authd
39
@(,,0550) %%OSSEC_HOME%%/bin/ossec-control
40
@(,,0550) %%OSSEC_HOME%%/bin/ossec-csyslogd
41
@(,,0550) %%OSSEC_HOME%%/bin/ossec-dbd
42
@(,,0550) %%OSSEC_HOME%%/bin/ossec-execd
43
@(,,0550) %%OSSEC_HOME%%/bin/ossec-logcollector
44
@(,,0550) %%OSSEC_HOME%%/bin/ossec-logtest
45
@(,,0550) %%OSSEC_HOME%%/bin/ossec-lua
46
@(,,0550) %%OSSEC_HOME%%/bin/ossec-luac
47
@(,,0550) %%OSSEC_HOME%%/bin/ossec-maild
48
@(,,0550) %%OSSEC_HOME%%/bin/ossec-makelists
49
@(,,0550) %%OSSEC_HOME%%/bin/ossec-monitord
50
@(,,0550) %%OSSEC_HOME%%/bin/ossec-regex
51
@(,,0550) %%OSSEC_HOME%%/bin/ossec-remoted
52
@(,,0550) %%OSSEC_HOME%%/bin/ossec-reportd
53
@(,,0550) %%OSSEC_HOME%%/bin/ossec-syscheckd
54
@(,,0550) %%OSSEC_HOME%%/bin/rootcheck_control
55
@(,,0550) %%OSSEC_HOME%%/bin/syscheck_control
56
@(,,0550) %%OSSEC_HOME%%/bin/syscheck_update
57
@(,,0550) %%OSSEC_HOME%%/bin/util.sh
58
@(,,0550) %%OSSEC_HOME%%/bin/verify-agent-conf
59
@dir(,ossec,0550) %%OSSEC_HOME%%/etc
60
@(,ossec,0640) %%OSSEC_HOME%%/etc/decoder.xml
61
@(,ossec,0640) %%OSSEC_HOME%%/etc/internal_options.conf
62
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/local_internal_options.conf.sample
63
@dir(,ossec,0770) %%OSSEC_HOME%%/etc/shared
64
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/acsc_office2016_rcl.txt
65
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_apache2224_rcl.txt
66
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_debian_linux_rcl.txt
67
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_debianlinux7-8_L1_rcl.txt
68
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_debianlinux7-8_L2_rcl.txt
69
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_mysql5-6_community_rcl.txt
70
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_mysql5-6_enterprise_rcl.txt
71
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel5_linux_rcl.txt
72
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel6_linux_rcl.txt
73
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel7_linux_rcl.txt
74
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel_linux_rcl.txt
75
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_sles11_linux_rcl.txt
76
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_sles12_linux_rcl.txt
77
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win10_enterprise_L1_rcl.txt
78
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win10_enterprise_L2_rcl.txt
79
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_domainL1_rcl.txt
80
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_domainL2_rcl.txt
81
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_memberL1_rcl.txt
82
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_memberL2_rcl.txt
83
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_domainL1_rcl.txt
84
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_domainL2_rcl.txt
85
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_memberL1_rcl.txt
86
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_memberL2_rcl.txt
87
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/rootkit_files.txt
88
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/rootkit_trojans.txt
89
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/system_audit_rcl.txt
90
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/system_audit_ssh.txt
91
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/win_applications_rcl.txt
92
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/win_audit_rcl.txt
93
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/win_malware_rcl.txt
94
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs
95
@dir(,ossec,0550) %%OSSEC_HOME%%/rules
96
@(,ossec,0640) %%OSSEC_HOME%%/rules/apache_rules.xml
97
@(,ossec,0640) %%OSSEC_HOME%%/rules/apparmor_rules.xml
98
@(,ossec,0640) %%OSSEC_HOME%%/rules/arpwatch_rules.xml
99
@(,ossec,0640) %%OSSEC_HOME%%/rules/asterisk_rules.xml
100
@(,ossec,0640) %%OSSEC_HOME%%/rules/attack_rules.xml
101
@(,ossec,0640) %%OSSEC_HOME%%/rules/cimserver_rules.xml
102
@(,ossec,0640) %%OSSEC_HOME%%/rules/cisco-ios_rules.xml
103
@(,ossec,0640) %%OSSEC_HOME%%/rules/clam_av_rules.xml
104
@(,ossec,0640) %%OSSEC_HOME%%/rules/courier_rules.xml
105
@(,ossec,0640) %%OSSEC_HOME%%/rules/dnsmasq_rules.xml
106
@(,ossec,0640) %%OSSEC_HOME%%/rules/dovecot_rules.xml
107
@(,ossec,0640) %%OSSEC_HOME%%/rules/dropbear_rules.xml
108
@(,ossec,0640) %%OSSEC_HOME%%/rules/exim_rules.xml
109
@(,ossec,0640) %%OSSEC_HOME%%/rules/firewall_rules.xml
110
@(,ossec,0640) %%OSSEC_HOME%%/rules/firewalld_rules.xml
111
@(,ossec,0640) %%OSSEC_HOME%%/rules/ftpd_rules.xml
112
@(,ossec,0640) %%OSSEC_HOME%%/rules/hordeimp_rules.xml
113
@(,ossec,0640) %%OSSEC_HOME%%/rules/ids_rules.xml
114
@(,ossec,0640) %%OSSEC_HOME%%/rules/imapd_rules.xml
115
@(,ossec,0640) %%OSSEC_HOME%%/rules/linux_usbdetect_rules.xml
116
@(,ossec,0640) %%OSSEC_HOME%%/rules/local_rules.xml
117
@(,ossec,0640) %%OSSEC_HOME%%/rules/mailscanner_rules.xml
118
@(,ossec,0640) %%OSSEC_HOME%%/rules/mcafee_av_rules.xml
119
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms-exchange_rules.xml
120
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms-se_rules.xml
121
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms1016_usbdetect_rules.xml
122
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_dhcp_rules.xml
123
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_firewall_rules.xml
124
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_ftpd_rules.xml
125
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_ipsec_rules.xml
126
@(,ossec,0640) %%OSSEC_HOME%%/rules/msauth_rules.xml
127
@(,ossec,0640) %%OSSEC_HOME%%/rules/mysql_rules.xml
128
@(,ossec,0640) %%OSSEC_HOME%%/rules/named_rules.xml
129
@(,ossec,0640) %%OSSEC_HOME%%/rules/netscreenfw_rules.xml
130
@(,ossec,0640) %%OSSEC_HOME%%/rules/nginx_rules.xml
131
@(,ossec,0640) %%OSSEC_HOME%%/rules/nsd_rules.xml
132
@(,ossec,0640) %%OSSEC_HOME%%/rules/openbsd-dhcpd_rules.xml
133
@(,ossec,0640) %%OSSEC_HOME%%/rules/openbsd_rules.xml
134
@(,ossec,0640) %%OSSEC_HOME%%/rules/opensmtpd_rules.xml
135
@(,ossec,0640) %%OSSEC_HOME%%/rules/ossec_rules.xml
136
@(,ossec,0640) %%OSSEC_HOME%%/rules/owncloud_rules.xml
137
@(,ossec,0640) %%OSSEC_HOME%%/rules/pam_rules.xml
138
@(,ossec,0640) %%OSSEC_HOME%%/rules/php_rules.xml
139
@(,ossec,0640) %%OSSEC_HOME%%/rules/pix_rules.xml
140
@(,ossec,0640) %%OSSEC_HOME%%/rules/policy_rules.xml
141
@(,ossec,0640) %%OSSEC_HOME%%/rules/postfix_rules.xml
142
@(,ossec,0640) %%OSSEC_HOME%%/rules/postgresql_rules.xml
143
@(,ossec,0640) %%OSSEC_HOME%%/rules/proftpd_rules.xml
144
@(,ossec,0640) %%OSSEC_HOME%%/rules/proxmox-ve_rules.xml
145
@(,ossec,0640) %%OSSEC_HOME%%/rules/psad_rules.xml
146
@(,ossec,0640) %%OSSEC_HOME%%/rules/pure-ftpd_rules.xml
147
@(,ossec,0640) %%OSSEC_HOME%%/rules/racoon_rules.xml
148
@(,ossec,0640) %%OSSEC_HOME%%/rules/roundcube_rules.xml
149
@(,ossec,0640) %%OSSEC_HOME%%/rules/rules_config.xml
150
@(,ossec,0640) %%OSSEC_HOME%%/rules/sendmail_rules.xml
151
@(,ossec,0640) %%OSSEC_HOME%%/rules/smbd_rules.xml
152
@(,ossec,0640) %%OSSEC_HOME%%/rules/solaris_bsm_rules.xml
153
@(,ossec,0640) %%OSSEC_HOME%%/rules/sonicwall_rules.xml
154
@(,ossec,0640) %%OSSEC_HOME%%/rules/spamd_rules.xml
155
@(,ossec,0640) %%OSSEC_HOME%%/rules/squid_rules.xml
156
@(,ossec,0640) %%OSSEC_HOME%%/rules/sshd_rules.xml
157
@(,ossec,0640) %%OSSEC_HOME%%/rules/symantec-av_rules.xml
158
@(,ossec,0640) %%OSSEC_HOME%%/rules/symantec-ws_rules.xml
159
@(,ossec,0640) %%OSSEC_HOME%%/rules/syslog_rules.xml
160
@(,ossec,0640) %%OSSEC_HOME%%/rules/sysmon_rules.xml
161
@(,ossec,0640) %%OSSEC_HOME%%/rules/systemd_rules.xml
162
@(,ossec,0640) %%OSSEC_HOME%%/rules/telnetd_rules.xml
163
@(,ossec,0640) %%OSSEC_HOME%%/rules/trend-osce_rules.xml
164
@(,ossec,0640) %%OSSEC_HOME%%/rules/unbound_rules.xml
165
@(,ossec,0640) %%OSSEC_HOME%%/rules/vmpop3d_rules.xml
166
@(,ossec,0640) %%OSSEC_HOME%%/rules/vmware_rules.xml
167
@(,ossec,0640) %%OSSEC_HOME%%/rules/vpn_concentrator_rules.xml
168
@(,ossec,0640) %%OSSEC_HOME%%/rules/vpopmail_rules.xml
169
@(,ossec,0640) %%OSSEC_HOME%%/rules/vsftpd_rules.xml
170
@(,ossec,0640) %%OSSEC_HOME%%/rules/web_appsec_rules.xml
171
@(,ossec,0640) %%OSSEC_HOME%%/rules/web_rules.xml
172
@(,ossec,0640) %%OSSEC_HOME%%/rules/wordpress_rules.xml
173
@(,ossec,0640) %%OSSEC_HOME%%/rules/zeus_rules.xml
174
@dir(,ossec,0700) %%OSSEC_HOME%%/.ssh
175
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs/alerts
176
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs/archives
177
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs/firewall
178
@dir(,ossec,0550) %%OSSEC_HOME%%/queue
179
@dir(ossecr,ossec,0750) %%OSSEC_HOME%%/queue/agent-info
180
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/agentless
181
@dir(ossec,ossec,0770) %%OSSEC_HOME%%/queue/alerts
182
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/diff
183
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/fts
184
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/ossec
185
@dir(ossecr,ossec,0750) %%OSSEC_HOME%%/queue/rids
186
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/rootcheck
187
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/syscheck
188
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/stats
189
@dir(,ossec,1550) %%OSSEC_HOME%%/tmp
190
@dir(,ossec,0550) %%OSSEC_HOME%%/var
191
@dir(,ossec,0770) %%OSSEC_HOME%%/var/run
192
%%PORTDOCS%%%%DOCSDIR%%/BUGS
193
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
194
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS
195
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
196
%%PORTDOCS%%%%DOCSDIR%%/README.md
197
%%PORTDOCS%%%%DOCSDIR%%/SUPPORT.md
198
%%PORTDOCS%%%%DOCSDIR%%/ossec.conf.sample
199
%%MYSQL%%%%DOCSDIR%%/mysql.schema
200
%%PGSQL%%%%DOCSDIR%%/postgresql.schema
(-)security/ossec-hids-local/pkg-plist-server (+200 lines)
Line 0 Link Here
1
@dir(,ossec,0550) %%OSSEC_HOME%%
2
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response
3
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response/bin
4
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/disable-account.sh
5
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/firewalld-drop.sh
6
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/host-deny.sh
7
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ip-customblock.sh
8
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfilter.sh
9
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfw.sh
10
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ipfw_mac.sh
11
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/npf.sh
12
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-pagerduty.sh
13
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-slack.sh
14
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/ossec-tweeter.sh
15
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/pf.sh
16
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/restart-ossec.sh
17
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/route-null.sh
18
@dir(,ossec,0550) %%OSSEC_HOME%%/agentless
19
@(,ossec,0550) %%OSSEC_HOME%%/agentless/main.exp
20
@(,ossec,0550) %%OSSEC_HOME%%/agentless/register_host.sh
21
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh.exp
22
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_asa-fwsmconfig_diff
23
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_foundry_diff
24
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_generic_diff
25
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_integrity_check_bsd
26
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_integrity_check_linux
27
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_nopass.exp
28
@(,ossec,0550) %%OSSEC_HOME%%/agentless/ssh_pixconfig_diff
29
@(,ossec,0550) %%OSSEC_HOME%%/agentless/sshlogin.exp
30
@(,ossec,0550) %%OSSEC_HOME%%/agentless/su.exp
31
@dir(,,0550) %%OSSEC_HOME%%/bin
32
@(,,0550) %%OSSEC_HOME%%/bin/agent_control
33
@(,,0550) %%OSSEC_HOME%%/bin/clear_stats
34
@(,,0550) %%OSSEC_HOME%%/bin/list_agents
35
@(,,0550) %%OSSEC_HOME%%/bin/manage_agents
36
@(,,0550) %%OSSEC_HOME%%/bin/ossec-agentlessd
37
@(,,0550) %%OSSEC_HOME%%/bin/ossec-analysisd
38
@(,,0550) %%OSSEC_HOME%%/bin/ossec-authd
39
@(,,0550) %%OSSEC_HOME%%/bin/ossec-control
40
@(,,0550) %%OSSEC_HOME%%/bin/ossec-csyslogd
41
@(,,0550) %%OSSEC_HOME%%/bin/ossec-dbd
42
@(,,0550) %%OSSEC_HOME%%/bin/ossec-execd
43
@(,,0550) %%OSSEC_HOME%%/bin/ossec-logcollector
44
@(,,0550) %%OSSEC_HOME%%/bin/ossec-logtest
45
@(,,0550) %%OSSEC_HOME%%/bin/ossec-lua
46
@(,,0550) %%OSSEC_HOME%%/bin/ossec-luac
47
@(,,0550) %%OSSEC_HOME%%/bin/ossec-maild
48
@(,,0550) %%OSSEC_HOME%%/bin/ossec-makelists
49
@(,,0550) %%OSSEC_HOME%%/bin/ossec-monitord
50
@(,,0550) %%OSSEC_HOME%%/bin/ossec-regex
51
@(,,0550) %%OSSEC_HOME%%/bin/ossec-remoted
52
@(,,0550) %%OSSEC_HOME%%/bin/ossec-reportd
53
@(,,0550) %%OSSEC_HOME%%/bin/ossec-syscheckd
54
@(,,0550) %%OSSEC_HOME%%/bin/rootcheck_control
55
@(,,0550) %%OSSEC_HOME%%/bin/syscheck_control
56
@(,,0550) %%OSSEC_HOME%%/bin/syscheck_update
57
@(,,0550) %%OSSEC_HOME%%/bin/util.sh
58
@(,,0550) %%OSSEC_HOME%%/bin/verify-agent-conf
59
@dir(,ossec,0550) %%OSSEC_HOME%%/etc
60
@(,ossec,0640) %%OSSEC_HOME%%/etc/decoder.xml
61
@(,ossec,0640) %%OSSEC_HOME%%/etc/internal_options.conf
62
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/local_internal_options.conf.sample
63
@dir(,ossec,0770) %%OSSEC_HOME%%/etc/shared
64
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/acsc_office2016_rcl.txt
65
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_apache2224_rcl.txt
66
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_debian_linux_rcl.txt
67
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_debianlinux7-8_L1_rcl.txt
68
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_debianlinux7-8_L2_rcl.txt
69
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_mysql5-6_community_rcl.txt
70
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_mysql5-6_enterprise_rcl.txt
71
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel5_linux_rcl.txt
72
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel6_linux_rcl.txt
73
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel7_linux_rcl.txt
74
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_rhel_linux_rcl.txt
75
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_sles11_linux_rcl.txt
76
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_sles12_linux_rcl.txt
77
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win10_enterprise_L1_rcl.txt
78
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win10_enterprise_L2_rcl.txt
79
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_domainL1_rcl.txt
80
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_domainL2_rcl.txt
81
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_memberL1_rcl.txt
82
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2012r2_memberL2_rcl.txt
83
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_domainL1_rcl.txt
84
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_domainL2_rcl.txt
85
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_memberL1_rcl.txt
86
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/cis_win2016_memberL2_rcl.txt
87
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/rootkit_files.txt
88
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/rootkit_trojans.txt
89
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/system_audit_rcl.txt
90
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/system_audit_ssh.txt
91
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/win_applications_rcl.txt
92
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/win_audit_rcl.txt
93
@(ossec,ossec,0640) %%OSSEC_HOME%%/etc/shared/win_malware_rcl.txt
94
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs
95
@dir(,ossec,0550) %%OSSEC_HOME%%/rules
96
@(,ossec,0640) %%OSSEC_HOME%%/rules/apache_rules.xml
97
@(,ossec,0640) %%OSSEC_HOME%%/rules/apparmor_rules.xml
98
@(,ossec,0640) %%OSSEC_HOME%%/rules/arpwatch_rules.xml
99
@(,ossec,0640) %%OSSEC_HOME%%/rules/asterisk_rules.xml
100
@(,ossec,0640) %%OSSEC_HOME%%/rules/attack_rules.xml
101
@(,ossec,0640) %%OSSEC_HOME%%/rules/cimserver_rules.xml
102
@(,ossec,0640) %%OSSEC_HOME%%/rules/cisco-ios_rules.xml
103
@(,ossec,0640) %%OSSEC_HOME%%/rules/clam_av_rules.xml
104
@(,ossec,0640) %%OSSEC_HOME%%/rules/courier_rules.xml
105
@(,ossec,0640) %%OSSEC_HOME%%/rules/dnsmasq_rules.xml
106
@(,ossec,0640) %%OSSEC_HOME%%/rules/dovecot_rules.xml
107
@(,ossec,0640) %%OSSEC_HOME%%/rules/dropbear_rules.xml
108
@(,ossec,0640) %%OSSEC_HOME%%/rules/exim_rules.xml
109
@(,ossec,0640) %%OSSEC_HOME%%/rules/firewall_rules.xml
110
@(,ossec,0640) %%OSSEC_HOME%%/rules/firewalld_rules.xml
111
@(,ossec,0640) %%OSSEC_HOME%%/rules/ftpd_rules.xml
112
@(,ossec,0640) %%OSSEC_HOME%%/rules/hordeimp_rules.xml
113
@(,ossec,0640) %%OSSEC_HOME%%/rules/ids_rules.xml
114
@(,ossec,0640) %%OSSEC_HOME%%/rules/imapd_rules.xml
115
@(,ossec,0640) %%OSSEC_HOME%%/rules/linux_usbdetect_rules.xml
116
@(,ossec,0640) %%OSSEC_HOME%%/rules/local_rules.xml
117
@(,ossec,0640) %%OSSEC_HOME%%/rules/mailscanner_rules.xml
118
@(,ossec,0640) %%OSSEC_HOME%%/rules/mcafee_av_rules.xml
119
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms-exchange_rules.xml
120
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms-se_rules.xml
121
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms1016_usbdetect_rules.xml
122
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_dhcp_rules.xml
123
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_firewall_rules.xml
124
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_ftpd_rules.xml
125
@(,ossec,0640) %%OSSEC_HOME%%/rules/ms_ipsec_rules.xml
126
@(,ossec,0640) %%OSSEC_HOME%%/rules/msauth_rules.xml
127
@(,ossec,0640) %%OSSEC_HOME%%/rules/mysql_rules.xml
128
@(,ossec,0640) %%OSSEC_HOME%%/rules/named_rules.xml
129
@(,ossec,0640) %%OSSEC_HOME%%/rules/netscreenfw_rules.xml
130
@(,ossec,0640) %%OSSEC_HOME%%/rules/nginx_rules.xml
131
@(,ossec,0640) %%OSSEC_HOME%%/rules/nsd_rules.xml
132
@(,ossec,0640) %%OSSEC_HOME%%/rules/openbsd-dhcpd_rules.xml
133
@(,ossec,0640) %%OSSEC_HOME%%/rules/openbsd_rules.xml
134
@(,ossec,0640) %%OSSEC_HOME%%/rules/opensmtpd_rules.xml
135
@(,ossec,0640) %%OSSEC_HOME%%/rules/ossec_rules.xml
136
@(,ossec,0640) %%OSSEC_HOME%%/rules/owncloud_rules.xml
137
@(,ossec,0640) %%OSSEC_HOME%%/rules/pam_rules.xml
138
@(,ossec,0640) %%OSSEC_HOME%%/rules/php_rules.xml
139
@(,ossec,0640) %%OSSEC_HOME%%/rules/pix_rules.xml
140
@(,ossec,0640) %%OSSEC_HOME%%/rules/policy_rules.xml
141
@(,ossec,0640) %%OSSEC_HOME%%/rules/postfix_rules.xml
142
@(,ossec,0640) %%OSSEC_HOME%%/rules/postgresql_rules.xml
143
@(,ossec,0640) %%OSSEC_HOME%%/rules/proftpd_rules.xml
144
@(,ossec,0640) %%OSSEC_HOME%%/rules/proxmox-ve_rules.xml
145
@(,ossec,0640) %%OSSEC_HOME%%/rules/psad_rules.xml
146
@(,ossec,0640) %%OSSEC_HOME%%/rules/pure-ftpd_rules.xml
147
@(,ossec,0640) %%OSSEC_HOME%%/rules/racoon_rules.xml
148
@(,ossec,0640) %%OSSEC_HOME%%/rules/roundcube_rules.xml
149
@(,ossec,0640) %%OSSEC_HOME%%/rules/rules_config.xml
150
@(,ossec,0640) %%OSSEC_HOME%%/rules/sendmail_rules.xml
151
@(,ossec,0640) %%OSSEC_HOME%%/rules/smbd_rules.xml
152
@(,ossec,0640) %%OSSEC_HOME%%/rules/solaris_bsm_rules.xml
153
@(,ossec,0640) %%OSSEC_HOME%%/rules/sonicwall_rules.xml
154
@(,ossec,0640) %%OSSEC_HOME%%/rules/spamd_rules.xml
155
@(,ossec,0640) %%OSSEC_HOME%%/rules/squid_rules.xml
156
@(,ossec,0640) %%OSSEC_HOME%%/rules/sshd_rules.xml
157
@(,ossec,0640) %%OSSEC_HOME%%/rules/symantec-av_rules.xml
158
@(,ossec,0640) %%OSSEC_HOME%%/rules/symantec-ws_rules.xml
159
@(,ossec,0640) %%OSSEC_HOME%%/rules/syslog_rules.xml
160
@(,ossec,0640) %%OSSEC_HOME%%/rules/sysmon_rules.xml
161
@(,ossec,0640) %%OSSEC_HOME%%/rules/systemd_rules.xml
162
@(,ossec,0640) %%OSSEC_HOME%%/rules/telnetd_rules.xml
163
@(,ossec,0640) %%OSSEC_HOME%%/rules/trend-osce_rules.xml
164
@(,ossec,0640) %%OSSEC_HOME%%/rules/unbound_rules.xml
165
@(,ossec,0640) %%OSSEC_HOME%%/rules/vmpop3d_rules.xml
166
@(,ossec,0640) %%OSSEC_HOME%%/rules/vmware_rules.xml
167
@(,ossec,0640) %%OSSEC_HOME%%/rules/vpn_concentrator_rules.xml
168
@(,ossec,0640) %%OSSEC_HOME%%/rules/vpopmail_rules.xml
169
@(,ossec,0640) %%OSSEC_HOME%%/rules/vsftpd_rules.xml
170
@(,ossec,0640) %%OSSEC_HOME%%/rules/web_appsec_rules.xml
171
@(,ossec,0640) %%OSSEC_HOME%%/rules/web_rules.xml
172
@(,ossec,0640) %%OSSEC_HOME%%/rules/wordpress_rules.xml
173
@(,ossec,0640) %%OSSEC_HOME%%/rules/zeus_rules.xml
174
@dir(,ossec,0700) %%OSSEC_HOME%%/.ssh
175
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs/alerts
176
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs/archives
177
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/logs/firewall
178
@dir(,ossec,0550) %%OSSEC_HOME%%/queue
179
@dir(ossecr,ossec,0750) %%OSSEC_HOME%%/queue/agent-info
180
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/agentless
181
@dir(ossec,ossec,0770) %%OSSEC_HOME%%/queue/alerts
182
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/diff
183
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/fts
184
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/ossec
185
@dir(ossecr,ossec,0750) %%OSSEC_HOME%%/queue/rids
186
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/rootcheck
187
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/queue/syscheck
188
@dir(ossec,ossec,0750) %%OSSEC_HOME%%/stats
189
@dir(,ossec,1550) %%OSSEC_HOME%%/tmp
190
@dir(,ossec,0550) %%OSSEC_HOME%%/var
191
@dir(,ossec,0770) %%OSSEC_HOME%%/var/run
192
%%PORTDOCS%%%%DOCSDIR%%/BUGS
193
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG
194
%%PORTDOCS%%%%DOCSDIR%%/CONTRIBUTORS
195
%%PORTDOCS%%%%DOCSDIR%%/LICENSE
196
%%PORTDOCS%%%%DOCSDIR%%/README.md
197
%%PORTDOCS%%%%DOCSDIR%%/SUPPORT.md
198
%%PORTDOCS%%%%DOCSDIR%%/ossec.conf.sample
199
%%MYSQL%%%%DOCSDIR%%/mysql.schema
200
%%PGSQL%%%%DOCSDIR%%/postgresql.schema
(-)security/ossec-hids-local/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
OSSEC_HOME=$2
10
PLIST=$3
11
WORKDIR=$4
12
STAGEDIR=$5
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/client.keys /logs/active-responses.log /logs/ossec.log /lua"
21
sample_paths="/etc/local_internal_options.conf.sample"
22
if [ "${OSSEC_TYPE}" == "agent" ]; then
23
    skip_paths="${skip_paths} /rules /agentless /.ssh"
24
fi
25
26
print_path() {
27
    local path="$1"
28
    local command="$2"
29
    local full_path="${STAGEDIR}${OSSEC_HOME}${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 5`
45
    echo -e "${command}(${user},${group},${mode}) %%OSSEC_HOME%%${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 %%OSSEC_HOME%%"*)
65
                path=`echo "${line}" | sed -e "s|@dir %%OSSEC_HOME%%||g"`
66
                ;;
67
            "%%OSSEC_HOME%%"*)
68
                path=`echo "${line}" | sed -e "s|%%OSSEC_HOME%%||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
(-)security/ossec-hids-local-config/Makefile (+456 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
PORTNAME=	ossec-hids
4
PORTVERSION=	3.1.0
5
PORTREVISION=
6
CATEGORIES=	security
7
PKGNAMESUFFIX=	-${OSSEC_TYPE}-config
8
9
MAINTAINER=	dominik.lisiak@bemsoft.pl
10
COMMENT=	Configuration manager for ossec-hids
11
12
LICENSE=	GPLv2
13
14
OSSEC_TYPE?=	local
15
16
MASTERDIR?=	${.CURDIR}
17
18
.if ${OSSEC_TYPE} == local
19
CONFLICTS_INSTALL=	ossec-hids-client-* \
20
			ossec-hids-agent-* \
21
			ossec-hids-server-*
22
.elif ${OSSEC_TYPE} == agent
23
CONFLICTS_INSTALL=	ossec-hids-client-* \
24
			ossec-hids-local-* \
25
			ossec-hids-server-*
26
.elif ${OSSEC_TYPE} == server
27
CONFLICTS_INSTALL=	ossec-hids-client-* \
28
			ossec-hids-agent-* \
29
			ossec-hids-local-*
30
.endif
31
32
.if !defined(MAINTAINER_MODE)
33
RUN_DEPENDS=	ossec-hids-${OSSEC_TYPE}>=${PORTVERSION}:security/ossec-hids-${OSSEC_TYPE}
34
.endif
35
36
.if defined(MAINTAINER_MODE)
37
USE_GITHUB=	yes
38
GH_ACCOUNT=	ossec
39
.else
40
MASTER_SITES=	#
41
DISTFILES=	#
42
EXTRACT_ONLY=	#
43
.endif
44
NO_BUILD=	yes
45
NO_ARCH=	yes
46
47
OPTIONS_SUB=			yes
48
49
OPTIONS_SINGLE=			FIREWALL
50
OPTIONS_SINGLE_FIREWALL=	IPF IPFW PF
51
52
OPTIONS_DEFAULT+=		IPF
53
54
FIREWALL_DESC=		Active Response Firewall
55
PF_DESC=		Packet Filter
56
IPFW_DESC=		ipfirewall
57
IPF_DESC=		ipfilter
58
59
TEMPL_ENABLED_HEADER=		template-header-enabled.xml
60
TEMPL_DISABLED_HEADER=		template-header-disabled.xml
61
TEMPL_SAMPLE_HEADER=		template-header-sample.xml
62
TEMPL_PUSHED_ENABLED_HEADER=	${TEMPL_ENABLED_HEADER}
63
TEMPL_PUSHED_DISABLED_HEADER=	${TEMPL_DISABLED_HEADER}
64
65
TEMPL_SAMPLE=		template-sample-${OSSEC_TYPE}.xml
66
TEMPL_SAMPLE_DB=	template-sample-database.xml
67
68
PF_VARS=		FW_DROP=pf.sh PKGMSG_FILES+=message-pf
69
IPFW_VARS=		FW_DROP=ipfw.sh
70
IPF_VARS=		FW_DROP=ipfilter.sh
71
72
.if defined(MAINTAINER_MODE)
73
OSSEC_HOME=		${PREFIX}/${PORTNAME}
74
.else
75
OSSEC_HOME?=		${PREFIX}/${PORTNAME}
76
.endif
77
OSSEC_RC=		${PREFIX}/etc/rc.d/ossec-hids
78
TEMPL_TO_OSSEC=		${SCRIPTDIR}/template-to-ossec.sh ${OSSEC_TYPE} ${OSSEC_HOME}
79
TEMPL_TO_AGENT=		${SCRIPTDIR}/template-to-agent.sh ${OSSEC_TYPE} ${OSSEC_HOME}
80
81
OSSEC_DIR=		${STAGEDIR}${OSSEC_HOME}
82
BIN_DIR=		${OSSEC_DIR}/bin
83
CONF_BIN_DIR=		${BIN_DIR}/config
84
OSSEC_CONF_BIN=		${CONF_BIN_DIR}/ossec-conf
85
AGENT_CONF_BIN=		${CONF_BIN_DIR}/agent-conf
86
COMMAND_BIN_DIR=	${BIN_DIR}/command
87
88
AR_BIN_DIR=		${OSSEC_DIR}/active-response/bin
89
MERGE_CONFIG_BIN=	${AR_BIN_DIR}/merge-config.sh
90
91
ETC_DIR=		${OSSEC_DIR}/etc
92
OSSEC_CONF_DIR=		${ETC_DIR}/ossec.conf.d
93
AGENT_CONF_DIR=		${ETC_DIR}/agent.conf.d
94
OSSEC_LOCAL_CONF_DIR=	${OSSEC_CONF_DIR}/disabled
95
AGENT_LOCAL_CONF_DIR=	${AGENT_CONF_DIR}/disabled
96
OSSEC_SAMPLE_CONF=	${OSSEC_CONF_DIR}/900.local.conf.sample
97
COMMAND_CONF_DIR=	${ETC_DIR}
98
COMMAND_CONF=		${COMMAND_CONF_DIR}/command.conf.sample
99
RULES_DIR=		${OSSEC_DIR}/rules
100
101
.if empty(USER)
102
USER=$$(${ID} -un)
103
.endif
104
.if empty(GROUP)
105
GROUP=$$(${ID} -gn)
106
.endif
107
108
OSSEC_USER=	ossec
109
OSSEC_GROUP=	ossec
110
111
SUB_LIST+=	PORTNAME=${PORTNAME} \
112
		OSSEC_TYPE=${OSSEC_TYPE} \
113
		OSSEC_HOME=${OSSEC_HOME} \
114
		VERSION=${PORTVERSION} \
115
		USER=${USER} \
116
		OSSEC_USER=${OSSEC_USER} \
117
		OSSEC_GROUP=${OSSEC_GROUP} \
118
		OSSEC_RC=${OSSEC_RC} \
119
		FW_DROP=${FW_DROP}
120
SUB_FILES=	pkg-install \
121
		pkg-deinstall \
122
		${PKGMSG_FILES} \
123
		${TEMPL_ENABLED_HEADER} \
124
		${TEMPL_DISABLED_HEADER} \
125
		${TEMPL_SAMPLE_HEADER} \
126
		${TEMPL_PUSHED_ENABLED_HEADER} \
127
		${TEMPL_PUSHED_DISABLED_HEADER} \
128
		${TEMPL_SAMPLE} \
129
		merge-config.sh \
130
		ossec-conf \
131
		command.conf
132
.if ${OSSEC_TYPE} == server
133
SUB_FILES+=	agent-conf
134
.endif
135
136
.if defined(MAINTAINER_MODE)
137
PLIST_SUB=	OSSEC_HOME=${PORTNAME}
138
.else
139
PLIST_SUB=	OSSEC_HOME=${OSSEC_HOME}
140
.endif
141
PLIST=		${PKGDIR}/pkg-plist-${OSSEC_TYPE}
142
PKGHELP=	${PKGDIR}/pkg-help-${OSSEC_TYPE}
143
PKGMESSAGE=	${WRKDIR}/pkg-message
144
PKGMSG_FILES=	message-ossec-conf
145
.if ${OSSEC_TYPE} == server
146
PKGMSG_FILES+=	message-agent-conf
147
.endif
148
149
CONF_GROUPS=	RULES AR ROOTCHECK SYSCHECK CMDOUT LOGS
150
151
############################################################
152
153
.for conf_group in ${CONF_GROUPS}
154
. include "${MASTERDIR}/opt-${conf_group:tl}.mk"
155
${conf_group}_INSTANCE_OPTIONS=
156
${conf_group}_PUSHED_OPTIONS=
157
. for option in ${${conf_group}_OPTIONS}
158
.  if ${${option}_DEFINE:M${OSSEC_TYPE}}
159
${conf_group}_INSTANCE_OPTIONS+=		${option}
160
${conf_group}_ALL_OPTIONS+=			${option}
161
.  endif
162
.  if ${${option}_DEFINE:Mpushed}
163
.   if ${OSSEC_TYPE} == server
164
${conf_group}_PUSHED_OPTIONS+=			${option}
165
.   endif
166
.   if !${${conf_group}_ALL_OPTIONS:M${option}}
167
${conf_group}_ALL_OPTIONS+=			${option}
168
.   endif
169
.  endif
170
. endfor
171
.endfor
172
173
############################################################
174
175
.for conf_group in ${CONF_GROUPS}
176
. if !empty(${conf_group}_PROFILE)
177
.  if ${OSSEC_TYPE} == agent
178
.   if empty(CLIENT_PROFILES)
179
CLIENT_PROFILES:=	${${conf_group}_PROFILE}
180
.   else
181
CLIENT_PROFILES:=	${CLIENT_PROFILES}, ${${conf_group}_PROFILE}
182
.   endif
183
.  endif
184
SUB_LIST+=		${conf_group}_PROFILE=${${conf_group}_PROFILE}
185
. endif
186
. for option in ${${conf_group}_ALL_OPTIONS}
187
.  if !empty(${option}_PROFILE)
188
.   if ${OSSEC_TYPE} == agent
189
.    if empty(CLIENT_PROFILES)
190
CLIENT_PROFILES:=	${${option}_PROFILE}
191
.    else
192
CLIENT_PROFILES:=	${CLIENT_PROFILES}, ${${option}_PROFILE}
193
.    endif
194
.   endif
195
SUB_LIST+=		${option}_PROFILE=${${option}_PROFILE}
196
.  endif
197
. endfor
198
.endfor
199
200
SUB_LIST+=		CLIENT_PROFILES="${CLIENT_PROFILES}"
201
202
############################################################
203
204
.for conf_group in ${CONF_GROUPS}
205
. for option in ${${conf_group}_ALL_OPTIONS}
206
.  if !defined(${option}_TEMPLATE)
207
${option}_TEMPLATE=	template-${option:tl:S/_/-/g}.xml
208
.  endif
209
.  if !empty(${option}_TEMPLATE) && !${SUB_FILES:M${${option}_TEMPLATE}}
210
SUB_FILES+=		${${option}_TEMPLATE}
211
.  endif
212
. endfor
213
.endfor
214
215
.for file_name in ${RULES_FILES}
216
SUB_FILES+=		rules-${file_name}.xml
217
.endfor
218
219
.for file_name in ${CMDOUT_SCRIPTS}
220
SUB_FILES+=		command-${file_name}.sh
221
.endfor
222
223
############################################################
224
225
.for conf_group in ${CONF_GROUPS}
226
. for option in ${${conf_group}_INSTANCE_OPTIONS}
227
.  if !empty(${option}_DEPENDS) && !empty(${${option}_DEPENDS}_OPTION) && ${${${option}_DEPENDS:S/_/ /:[1]}_INSTANCE_OPTIONS:M${${option}_DEPENDS}}
228
${${${option}_DEPENDS}_OPTION}_VARS+=		${conf_group}_INSTANCE_OPTIONS_ENABLED+=${option}
229
${${${option}_DEPENDS}_OPTION}_VARS_OFF+=	${conf_group}_INSTANCE_OPTIONS_DISABLED+=${option}
230
.  elif !empty(${option}_OPTION)
231
OPTIONS_GROUP_G_${conf_group}+=			${${option}_OPTION}
232
${${option}_OPTION}_DESC=			${${option}_DESC}
233
.   if ${${option}_DEFAULT:M${OSSEC_TYPE}}
234
OPTIONS_DEFAULT+=				${${option}_OPTION}
235
.   endif
236
${${option}_OPTION}_VARS+=			${conf_group}_INSTANCE_OPTIONS_ENABLED+=${option}
237
${${option}_OPTION}_VARS_OFF+=			${conf_group}_INSTANCE_OPTIONS_DISABLED+=${option}
238
.  endif
239
. endfor
240
. if !empty(OPTIONS_GROUP_G_${conf_group})
241
OPTIONS_GROUP+=			G_${conf_group}
242
G_${conf_group}_DESC=		${${conf_group}_DESC}
243
. endif
244
.endfor
245
246
############################################################
247
248
.for conf_group in ${CONF_GROUPS}
249
. for option in ${${conf_group}_PUSHED_OPTIONS}
250
.  if !empty(${option}_DEPENDS) && !empty(${${option}_DEPENDS}_OPTION) && ${${${option}_DEPENDS:S/_/ /:[1]}_PUSHED_OPTIONS:M${${option}_DEPENDS}}
251
${${${option}_DEPENDS}_OPTION}_P_VARS+=		${conf_group}_PUSHED_OPTIONS_ENABLED+=${option}
252
${${${option}_DEPENDS}_OPTION}_P_VARS_OFF+=	${conf_group}_PUSHED_OPTIONS_DISABLED+=${option}
253
.  elif !empty(${option}_DEPENDS) && !empty(${${option}_DEPENDS}_OPTION) && ${${${option}_DEPENDS:S/_/ /:[1]}_INSTANCE_OPTIONS:M${${option}_DEPENDS}}
254
${${${option}_DEPENDS}_OPTION}_VARS+=		${conf_group}_PUSHED_OPTIONS_ENABLED+=${option}
255
${${${option}_DEPENDS}_OPTION}_VARS_OFF+=	${conf_group}_PUSHED_OPTIONS_DISABLED+=${option}
256
.  elif !empty(${option}_OPTION)
257
OPTIONS_GROUP_G_${conf_group}_P+=		${${option}_OPTION}_P
258
${${option}_OPTION}_P_DESC=			${${option}_DESC}
259
.   if !empty(${option}_PROFILE)
260
${${option}_OPTION}_P_DESC+=			(profile: ${${option}_PROFILE})
261
.   endif
262
.   if ${${option}_DEFAULT:Mpushed}
263
OPTIONS_DEFAULT+=				${${option}_OPTION}_P
264
.   endif
265
${${option}_OPTION}_P_VARS+=			${conf_group}_PUSHED_OPTIONS_ENABLED+=${option}
266
${${option}_OPTION}_P_VARS_OFF+=		${conf_group}_PUSHED_OPTIONS_DISABLED+=${option}
267
.  endif
268
. endfor
269
. if !empty(OPTIONS_GROUP_G_${conf_group}_P)
270
OPTIONS_GROUP+=			G_${conf_group}_P
271
G_${conf_group}_P_DESC=		Pushed ${${conf_group}_DESC}
272
.  if !empty(${conf_group}_PROFILE)
273
G_${conf_group}_P_DESC+=	(profile: ${${conf_group}_PROFILE})
274
.  endif
275
. endif
276
.endfor
277
278
############################################################
279
280
.include <bsd.port.pre.mk>
281
282
show-opts:
283
.for conf_group in ${CONF_GROUPS}
284
	@${ECHO_CMD} "${conf_group}: ${${conf_group}_DESC}"
285
. for option in ${${conf_group}_INSTANCE_OPTIONS}
286
	@${ECHO_CMD} "  ${option}: ${${option}_DESC}"
287
.  if empty(${option}_TEMPLATE)
288
	@${ECHO_CMD} "    Template: -"
289
.  else
290
	@${ECHO_CMD} "    Template: ${${option}_TEMPLATE}"
291
.  endif
292
.  if !empty(${conf_group}_INSTANCE_OPTIONS_ENABLED) && ${${conf_group}_INSTANCE_OPTIONS_ENABLED:M${option}}
293
	@${ECHO_CMD} "    Enabled:  true"
294
.  endif
295
.  if !empty(${conf_group}_INSTANCE_OPTIONS_DISABLED) && ${${conf_group}_INSTANCE_OPTIONS_DISABLED:M${option}}
296
	@${ECHO_CMD} "    Enabled:  false"
297
.  endif
298
.  if !empty(${conf_group}_PUSHED_OPTIONS_ENABLED) && ${${conf_group}_PUSHED_OPTIONS_ENABLED:M${option}}
299
	@${ECHO_CMD} "    Pushed:   true"
300
.  endif
301
.  if !empty(${conf_group}_PUSHED_OPTIONS_DISABLED) && ${${conf_group}_PUSHED_OPTIONS_DISABLED:M${option}}
302
	@${ECHO_CMD} "    Pushed:   false"
303
.  endif
304
. endfor
305
.endfor
306
307
pre-install:
308
	@-${OSSEC_HOME}/bin/ossec-dbd -h 2>&1 | ${GREP} -q 'PostgreSQL' && \
309
		${SED} -e 's|%%OSSEC_HOME%%|${OSSEC_HOME}|g' -e 's|%%DB_TYPE%%|postgresql|g' \
310
		${FILESDIR}/${TEMPL_SAMPLE_DB}.in > ${WRKDIR}/${TEMPL_SAMPLE_DB}
311
	@-${OSSEC_HOME}/bin/ossec-dbd -h 2>&1 | ${GREP} -q 'MySQL' && \
312
		${SED} -e 's|%%OSSEC_HOME%%|${OSSEC_HOME}|g' -e 's|%%DB_TYPE%%|mysql|g' \
313
		${FILESDIR}/${TEMPL_SAMPLE_DB}.in > ${WRKDIR}/${TEMPL_SAMPLE_DB}
314
315
ossec-dirs:
316
	@${MKDIR} -p ${CONF_BIN_DIR} ${COMMAND_BIN_DIR} ${AR_BIN_DIR} ${OSSEC_CONF_DIR} ${OSSEC_LOCAL_CONF_DIR} ${COMMAND_CONF_DIR}
317
.if ${OSSEC_TYPE} != agent
318
	@${MKDIR} -p ${RULES_DIR}
319
.endif
320
.if ${OSSEC_TYPE} == server
321
	@${MKDIR} -p ${AGENT_CONF_DIR} ${AGENT_LOCAL_CONF_DIR}
322
.endif
323
324
ossec-scripts:
325
	@${CP} -f ${WRKDIR}/ossec-conf ${OSSEC_CONF_BIN}
326
.if ${OSSEC_TYPE} == server
327
	@${CP} -f ${WRKDIR}/agent-conf ${AGENT_CONF_BIN}
328
.endif
329
.for file_name in ${CMDOUT_SCRIPTS}
330
	@${CP} -f ${WRKDIR}/command-${file_name}.sh ${COMMAND_BIN_DIR}/${file_name}.sh
331
.endfor
332
	@${CP} -f ${WRKDIR}/command.conf ${COMMAND_CONF}
333
	@${CP} -f ${WRKDIR}/merge-config.sh ${MERGE_CONFIG_BIN}
334
335
ossec-rules:
336
.if ${OSSEC_TYPE} != agent
337
. for file_name in ${RULES_FILES}
338
	@${SED} -e 's|<?xml.*?>||' ${WRKDIR}/rules-${file_name}.xml > ${RULES_DIR}/freebsd_${file_name}_rules.xml
339
. endfor
340
.endif
341
342
ossec-conf-managed:
343
.for conf_group in ${CONF_GROUPS}
344
. if !empty(${conf_group}_INSTANCE_OPTIONS)
345
	@${CAT} ${WRKDIR}/${TEMPL_ENABLED_HEADER} > ${OSSEC_CONF_DIR}/${${conf_group}_MANAGED_CONF}
346
.  if !empty(${conf_group}_INSTANCE_OPTIONS_ENABLED)
347
.   for option in ${${conf_group}_INSTANCE_OPTIONS}
348
.    if ${${conf_group}_INSTANCE_OPTIONS_ENABLED:M${option}}
349
.     if !empty(${option}_TEMPLATE)
350
	@${ECHO_CMD} "<!-- Enabled ${${option}_OPTION} -->" >> ${OSSEC_CONF_DIR}/${${conf_group}_MANAGED_CONF}
351
	@${TEMPL_TO_OSSEC} ${WRKDIR}/${${option}_TEMPLATE} >> ${OSSEC_CONF_DIR}/${${conf_group}_MANAGED_CONF}
352
	@${ECHO_CMD} >> ${OSSEC_CONF_DIR}/${${conf_group}_MANAGED_CONF}
353
.     endif
354
.    endif
355
.   endfor
356
.  endif
357
. endif
358
.endfor
359
360
ossec-conf-local:
361
.for conf_group in ${CONF_GROUPS}
362
. if !empty(${conf_group}_INSTANCE_OPTIONS)
363
	@${CAT} ${WRKDIR}/${TEMPL_DISABLED_HEADER} > ${OSSEC_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
364
.  if !empty(${conf_group}_INSTANCE_OPTIONS_DISABLED)
365
.   for option in ${${conf_group}_INSTANCE_OPTIONS}
366
.    if ${${conf_group}_INSTANCE_OPTIONS_DISABLED:M${option}}
367
.     if !empty(${option}_TEMPLATE)
368
	@${ECHO_CMD} "<!-- Disabled ${${option}_OPTION} -->" >> ${OSSEC_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
369
	@${TEMPL_TO_OSSEC} ${WRKDIR}/${${option}_TEMPLATE} >> ${OSSEC_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
370
	@${ECHO_CMD} >> ${OSSEC_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
371
.     endif
372
.    endif
373
.   endfor
374
.  endif
375
. endif
376
.endfor
377
378
ossec-conf-sample:
379
	@${CAT} ${WRKDIR}/${TEMPL_SAMPLE_HEADER} > ${OSSEC_SAMPLE_CONF}
380
	@${ECHO_CMD} >> ${OSSEC_SAMPLE_CONF}
381
	@${TEMPL_TO_OSSEC} ${WRKDIR}/${TEMPL_SAMPLE} >> ${OSSEC_SAMPLE_CONF}
382
	@${ECHO_CMD} >> ${OSSEC_SAMPLE_CONF}
383
	@-${TEST} -f ${WRKDIR}/${TEMPL_SAMPLE_DB} && \
384
		${TEMPL_TO_OSSEC} ${WRKDIR}/${TEMPL_SAMPLE_DB} >> ${OSSEC_SAMPLE_CONF} && \
385
		${ECHO_CMD} >> ${OSSEC_SAMPLE_CONF}
386
387
agent-conf-managed:
388
.for conf_group in ${CONF_GROUPS}
389
. if !empty(${conf_group}_PUSHED_OPTIONS)
390
	@${CAT} ${WRKDIR}/${TEMPL_PUSHED_ENABLED_HEADER} > ${AGENT_CONF_DIR}/${${conf_group}_MANAGED_CONF}
391
.  if !empty(${conf_group}_PUSHED_OPTIONS_ENABLED)
392
.   for option in ${${conf_group}_PUSHED_OPTIONS}
393
.    if ${${conf_group}_PUSHED_OPTIONS_ENABLED:M${option}}
394
.     if !empty(${option}_TEMPLATE)
395
	@${ECHO_CMD} "<!-- Enabled ${${option}_OPTION}_P -->" >> ${AGENT_CONF_DIR}/${${conf_group}_MANAGED_CONF}
396
	@${TEMPL_TO_AGENT} ${WRKDIR}/${${option}_TEMPLATE} >> ${AGENT_CONF_DIR}/${${conf_group}_MANAGED_CONF}
397
	@${ECHO_CMD} >> ${AGENT_CONF_DIR}/${${conf_group}_MANAGED_CONF}
398
.     endif
399
.    endif
400
.   endfor
401
.  endif
402
. endif
403
.endfor
404
405
agent-conf-local:
406
.for conf_group in ${CONF_GROUPS}
407
. if !empty(${conf_group}_PUSHED_OPTIONS)
408
	@${CAT} ${WRKDIR}/${TEMPL_PUSHED_DISABLED_HEADER} > ${AGENT_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
409
.  if !empty(${conf_group}_PUSHED_OPTIONS_DISABLED)
410
.   for option in ${${conf_group}_PUSHED_OPTIONS}
411
.    if ${${conf_group}_PUSHED_OPTIONS_DISABLED:M${option}}
412
.     if !empty(${option}_TEMPLATE)
413
	@${ECHO_CMD} "<!-- Disabled ${${option}_OPTION}_P -->" >> ${AGENT_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
414
	@${TEMPL_TO_AGENT} ${WRKDIR}/${${option}_TEMPLATE} >> ${AGENT_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
415
	@${ECHO_CMD} >> ${AGENT_LOCAL_CONF_DIR}/${${conf_group}_LOCAL_CONF}
416
.     endif
417
.    endif
418
.   endfor
419
.  endif
420
. endif
421
.endfor
422
423
do-install: ossec-dirs ossec-scripts ossec-rules ossec-conf-managed ossec-conf-local ossec-conf-sample agent-conf-managed agent-conf-local
424
425
ossec-permissions:
426
	@${CHMOD} -R 550 ${OSSEC_DIR}
427
	@${CHMOD} 640 ${COMMAND_CONF} ${OSSEC_CONF_DIR}/* ${OSSEC_LOCAL_CONF_DIR}/*
428
	@${CHMOD} 550 ${OSSEC_CONF_DIR} ${OSSEC_LOCAL_CONF_DIR}
429
.if ${OSSEC_TYPE} != agent
430
	@${CHMOD} 640 ${RULES_DIR}/*
431
.endif
432
.if ${OSSEC_TYPE} == server
433
	@${CHMOD} 640 ${AGENT_CONF_DIR}/* ${AGENT_LOCAL_CONF_DIR}/*
434
	@${CHMOD} 550 ${AGENT_CONF_DIR} ${AGENT_LOCAL_CONF_DIR}
435
.endif
436
.if defined(MAINTAINER_MODE)
437
	@${CHOWN} -R ${USER}:${OSSEC_GROUP} ${OSSEC_DIR}
438
	@${CHOWN} -R ${USER}:${GROUP} ${BIN_DIR}
439
.endif
440
441
post-install: ossec-permissions
442
	@${ECHO_CMD} -n > ${PKGMESSAGE}
443
.for file_name in ${PKGMSG_FILES}
444
	@${CAT} ${WRKDIR}/${file_name} >> ${PKGMESSAGE}
445
	@${ECHO_CMD} >> ${PKGMESSAGE}
446
.endfor
447
448
.if defined(MAINTAINER_MODE)
449
plist: makeplist
450
	@${SCRIPTDIR}/plist.sh ${OSSEC_TYPE} ${OSSEC_HOME} ${PLIST} ${WRKDIR} ${STAGEDIR}
451
452
rules: extract
453
	@${SCRIPTDIR}/rules.sh ${FILESDIR}/${RULES_DEFAULT_TEMPLATE}.in ${WRKSRC}
454
.endif
455
456
.include <bsd.port.post.mk>
(-)security/ossec-hids-local-config/distinfo (+3 lines)
Line 0 Link Here
1
TIMESTAMP = 1539459620
2
SHA256 (ossec-ossec-hids-3.1.0_GH0.tar.gz) = e0e2987751badb95c2bf618531c7853b2289c910f796da85ff394c0faea43f50
3
SIZE (ossec-ossec-hids-3.1.0_GH0.tar.gz) = 1886469
(-)security/ossec-hids-local-config/files/agent-conf.in (+33 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_type="%%OSSEC_TYPE%%"
4
ossec_home="%%OSSEC_HOME%%"
5
6
agent_conf_dir="${ossec_home}/etc/agent.conf.d"
7
agent_conf_files="${agent_conf_dir}/*.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
25
    echo "<!-- OSSEC HIDS %%VERSION%% -->"
26
    echo
27
    echo "<!-- DO NOT EDIT - file generated automatically - edit \"agent.conf.d/900.local.conf\" instead -->"
28
    echo
29
30
    cat $@ | remove_comments | select_elements "agent_config" | remove_empty_lines
31
}
32
33
agent_conf "${agent_conf_files}"
(-)security/ossec-hids-local-config/files/command-last-logins.sh.in (+8 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_home="%%OSSEC_HOME%%"
6
. "${ossec_home}/etc/command.conf"
7
8
last -n ${last_logins}
(-)security/ossec-hids-local-config/files/command-open-ports.sh.in (+19 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
family=$1
6
protocol=$2
7
ports=$3
8
9
if [ -z "${ports}" ]; then
10
    privileged_ports="1-$((`sysctl -n net.inet.ip.portrange.first` - 1))"
11
12
    ossec_home="%%OSSEC_HOME%%"
13
    . "${ossec_home}/etc/command.conf"
14
15
    ports="privileged_${protocol}_ports"
16
    eval ports=\$${ports}
17
fi
18
19
sockstat -l -${family} -P ${protocol} -p ${ports} | grep -Eo '[^[:space:]]+:[0-9]+' | sort -u
(-)security/ossec-hids-local-config/files/command.conf.in (+6 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
last_logins=5
4
5
privileged_tcp_ports=${privileged_ports},10050-10051
6
privileged_udp_ports=${privileged_ports}
(-)security/ossec-hids-local-config/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="%%OSSEC_HOME%%"
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
(-)security/ossec-hids-local-config/files/message-agent-conf.in (+3 lines)
Line 0 Link Here
1
The "agent.conf" must no longer be used for configuration. It will be
2
overwritten by merged "*.conf" files from the configuration directory:
3
%%OSSEC_HOME%%/etc/agent.conf.d
(-)security/ossec-hids-local-config/files/message-ossec-conf.in (+3 lines)
Line 0 Link Here
1
The "ossec.conf" must no longer be used for configuration. It will be
2
overwritten by merged "*.conf" files from the configuration directory:
3
%%OSSEC_HOME%%/etc/ossec.conf.d
(-)security/ossec-hids-local-config/files/message-pf.in (+4 lines)
Line 0 Link Here
1
Add the ossec_fwtable to /etc/pf.conf if using "firewall-drop" active response:
2
  table <ossec_fwtable> persist
3
  block in quick from <ossec_fwtable> to any
4
  block out quick from any to <ossec_fwtable>
(-)security/ossec-hids-local-config/files/ossec-conf.in (+60 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_type="%%OSSEC_TYPE%%"
4
ossec_home="%%OSSEC_HOME%%"
5
6
ossec_conf_dir="${ossec_home}/etc/ossec.conf.d"
7
ossec_conf_files="${ossec_conf_dir}/*.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
    echo "<!-- OSSEC HIDS %%VERSION%% -->"
30
    echo
31
    echo "<!-- DO NOT EDIT - file generated automatically - edit \"ossec.conf.d/900.local.conf\" instead -->"
32
    echo
33
    echo "<ossec_config>"
34
35
    if [ "${ossec_type}" != "agent"  ]; then
36
        if cat $@ | remove_comments | grep -q "<rules>"; then
37
            echo "  <rules>"
38
            cat $@ | remove_comments | select_elements_content "rules" | remove_empty_lines
39
            echo "  </rules>"
40
        fi
41
    fi
42
43
    if cat $@ | remove_comments | grep -q "<rootcheck>"; then
44
        echo "  <rootcheck>"
45
        cat $@ | remove_comments | select_elements_content "rootcheck" | remove_empty_lines
46
        echo "  </rootcheck>"
47
    fi
48
49
    if cat $@ | remove_comments | grep -q "<syscheck>"; then
50
        echo "  <syscheck>"
51
        cat $@ | remove_comments | select_elements_content "syscheck" | remove_empty_lines
52
        echo "  </syscheck>"
53
    fi
54
55
    cat $@ | remove_comments | select_elements_content "ossec_config" | remove_elements "rules" | remove_elements "rootcheck" |  remove_elements "syscheck" | remove_empty_lines
56
57
    echo "</ossec_config>"
58
}
59
60
ossec_conf "${ossec_conf_files}"
(-)security/ossec-hids-local-config/files/pkg-deinstall.in (+10 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_home="%%OSSEC_HOME%%"
4
ossec_conf="${ossec_home}/etc/ossec.conf"
5
agent_conf="${ossec_home}/etc/shared/agent.conf"
6
7
if [ "$2" == "DEINSTALL"  ]; then
8
    rm -f "${ossec_conf}"
9
    rm -f "${agent_conf}"
10
fi
(-)security/ossec-hids-local-config/files/pkg-install.in (+32 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
ossec_home="%%OSSEC_HOME%%"
4
ar_bin_dir="${ossec_home}/active-response/bin"
5
ossec_conf="${ossec_home}/etc/ossec.conf"
6
ossec_conf_bak="${ossec_conf}.bak"
7
agent_conf="${ossec_home}/etc/shared/agent.conf"
8
agent_conf_bak="${ossec_home}/etc/agent.conf.bak"
9
10
if [ "$2" == "POST-INSTALL"  ]; then
11
    ln -f "${ar_bin_dir}/%%FW_DROP%%" "${ar_bin_dir}/firewall-drop.sh"
12
13
    if [ -e "${ossec_conf}" ]; then
14
        mv -f "${ossec_conf}" "${ossec_conf_bak}"
15
        echo
16
        echo "WARNING:"
17
        echo "  Existing \"${ossec_conf}\" has been saved to \"${ossec_conf_bak}\"."
18
        echo
19
    fi
20
21
    case "$1" in
22
        ossec-hids-server*)
23
            if [ -e "${agent_conf}" ]; then
24
                mv -f "${agent_conf}" "${agent_conf_bak}"
25
                echo
26
                echo "WARNING:"
27
                echo "  Existing \"${agent_conf}\" has been saved to \"${agent_conf_bak}\"."
28
                echo
29
            fi
30
            ;;
31
    esac
32
fi
(-)security/ossec-hids-local-config/files/rules-cmdout.xml.in (+67 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<group name="ossec,">
3
4
  <rule id="56041" level="1">
5
    <if_sid>530</if_sid>
6
    <match>ossec: output: 'freebsd-last-logins'</match>
7
    <check_diff />
8
    <description>List of the last logged in users.</description> 
9
  </rule>
10
11
  <rule id="56042" level="1">
12
    <if_sid>530</if_sid>
13
    <match>ossec: output: 'freebsd-open-ports-tcp4-all'</match>
14
    <check_diff />
15
    <description>Listening IPv4 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-open-ports-tcp4'</match>
21
    <check_diff />
22
    <description>Listening IPv4 TCP port opened or closed.</description>
23
  </rule>
24
25
  <rule id="56044" level="1">
26
    <if_sid>530</if_sid>
27
    <match>ossec: output: 'freebsd-open-ports-tcp6-all'</match>
28
    <check_diff />
29
    <description>Listening IPv6 TCP port opened or closed.</description>
30
  </rule>
31
32
  <rule id="56045" level="7">
33
    <if_sid>530</if_sid>
34
    <match>ossec: output: 'freebsd-open-ports-tcp6'</match>
35
    <check_diff />
36
    <description>Listening IPv6 TCP port opened or closed.</description>
37
  </rule>
38
39
  <rule id="56046" level="1">
40
    <if_sid>530</if_sid>
41
    <match>ossec: output: 'freebsd-open-ports-udp4-all'</match>
42
    <check_diff />
43
    <description>Listening IPv4 UDP port opened or closed.</description>
44
  </rule>
45
46
  <rule id="56047" level="7">
47
    <if_sid>530</if_sid>
48
    <match>ossec: output: 'freebsd-open-ports-udp4'</match>
49
    <check_diff />
50
    <description>Listening IPv4 UDP port opened or closed.</description>
51
  </rule>
52
53
  <rule id="56048" level="1">
54
    <if_sid>530</if_sid>
55
    <match>ossec: output: 'freebsd-open-ports-udp6-all'</match>
56
    <check_diff />
57
    <description>Listening IPv6 UDP port opened or closed.</description>
58
  </rule>
59
60
  <rule id="56049" level="7">
61
    <if_sid>530</if_sid>
62
    <match>ossec: output: 'freebsd-open-ports-udp6'</match>
63
    <check_diff />
64
    <description>Listening IPv6 UDP port opened or closed.</description>
65
  </rule>
66
67
</group>
(-)security/ossec-hids-local-config/files/rules-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" ignore="10">
5
    <if_group>syscheck</if_group>
6
    <match>%%OSSEC_HOME%%/etc/ossec.conf.d</match>
7
    <description>ossec.conf.d has been modified</description>
8
  </rule>
9
10
  <rule id="56002" level="10" ignore="10">
11
    <if_group>syscheck</if_group>
12
    <match>%%OSSEC_HOME%%/etc/ossec.conf</match>
13
    <description>ossec.conf has been modified</description>
14
  </rule>
15
16
  <rule id="56003" level="10" ignore="10">
17
    <if_group>syscheck</if_group>
18
    <match>/var/ossec/etc/ossec.conf.d</match>
19
    <description>ossec.conf.d 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="56021" level="10" ignore="10">
29
    <if_group>syscheck</if_group>
30
    <match>%%OSSEC_HOME%%/etc/agent.conf.d</match>
31
    <description>agent.conf.d has been modified</description>
32
  </rule>
33
34
  <rule id="56022" level="10" ignore="10">
35
    <if_group>syscheck</if_group>
36
    <match>%%OSSEC_HOME%%/etc/shared/agent.conf</match>
37
    <description>agent.conf has been modified</description>
38
  </rule>
39
40
  <rule id="56023" level="10" ignore="10">
41
    <if_group>syscheck</if_group>
42
    <match>/var/ossec/etc/agent.conf.d</match>
43
    <description>agent.conf.d has been modified</description>
44
  </rule>
45
46
  <rule id="56024" 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>
(-)security/ossec-hids-local-config/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>firewall-drop.sh</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>
(-)security/ossec-hids-local-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-config</name>
6
    <executable>merge-config.sh</executable>
7
    <expect></expect>
8
  </command>
9
10
</template_config>
(-)security/ossec-hids-local-config/files/template-ar-fwdrop.xml.in (+13 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <active-response>
5
    <!-- Block the IP on the firewall. -->
6
    <!-- See: http://www.ossec.net/docs/syntax/head_ossec_config.active-response.html#active-response-options -->
7
    <command>firewall-drop</command>
8
    <location>local</location>
9
    <level>6</level>
10
    <timeout>600</timeout>
11
  </active-response>
12
13
</template_config>
(-)security/ossec-hids-local-config/files/template-ar-hostdeny.xml.in (+12 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <active-response>
5
    <!-- Deny the IP in "/etc/hosts.allow" or "/etc/hosts.deny". -->
6
    <command>host-deny</command>
7
    <location>local</location>
8
    <level>6</level>
9
    <timeout>600</timeout>
10
  </active-response>
11
12
</template_config>
(-)security/ossec-hids-local-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 "ossec.conf.d/*" or "agent.conf.d/*" files change. -->
6
    <command>merge-config</command>
7
    <location>local</location>
8
    <rules_id>56001,56003,56021,56023</rules_id>
9
  </active-response>
10
11
</template_config>
(-)security/ossec-hids-local-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>56002,56004,56022,56024</rules_id>
9
  </active-response>
10
11
</template_config>
(-)security/ossec-hids-local-config/files/template-cmdout-last-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>%%OSSEC_HOME%%/bin/command/last-logins.sh</command>
7
    <alias>freebsd-last-logins</alias>
8
  </localfile>
9
10
</template_config>
(-)security/ossec-hids-local-config/files/template-cmdout-open-ports-tcp.xml.in (+28 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>%%OSSEC_HOME%%/bin/command/open-ports.sh 4 tcp 1-65535</command>
7
    <alias>freebsd-open-ports-tcp4-all</alias>
8
  </localfile>
9
10
  <localfile>
11
    <log_format>full_command</log_format>
12
    <command>%%OSSEC_HOME%%/bin/command/open-ports.sh 4 tcp</command>
13
    <alias>freebsd-open-ports-tcp4</alias>
14
  </localfile>
15
16
  <localfile>
17
    <log_format>full_command</log_format>
18
    <command>%%OSSEC_HOME%%/bin/command/open-ports.sh 6 tcp 1-65535</command>
19
    <alias>freebsd-open-ports-tcp6-all</alias>
20
  </localfile>
21
22
  <localfile>
23
    <log_format>full_command</log_format>
24
    <command>%%OSSEC_HOME%%/bin/command/open-ports.sh 6 tcp</command>
25
    <alias>freebsd-open-ports-tcp6</alias>
26
  </localfile>
27
28
</template_config>
(-)security/ossec-hids-local-config/files/template-cmdout-open-ports-udp.xml.in (+28 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>%%OSSEC_HOME%%/bin/command/open-ports.sh 4 udp 1-65535</command>
7
    <alias>freebsd-open-ports-udp4-all</alias>
8
  </localfile>
9
10
  <localfile>
11
    <log_format>full_command</log_format>
12
    <command>%%OSSEC_HOME%%/bin/command/open-ports.sh 4 udp</command>
13
    <alias>freebsd-open-ports-udp4</alias>
14
  </localfile>
15
16
  <localfile>
17
    <log_format>full_command</log_format>
18
    <command>%%OSSEC_HOME%%/bin/command/open-ports.sh 6 udp 1-65535</command>
19
    <alias>freebsd-open-ports-udp6-all</alias>
20
  </localfile>
21
22
  <localfile>
23
    <log_format>full_command</log_format>
24
    <command>%%OSSEC_HOME%%/bin/command/open-ports.sh 6 udp</command>
25
    <alias>freebsd-open-ports-udp6</alias>
26
  </localfile>
27
28
</template_config>
(-)security/ossec-hids-local-config/files/template-header-disabled.xml.in (+10 lines)
Line 0 Link Here
1
<!-- OSSEC HIDS %%VERSION%% -->
2
3
<!-- DO NOT EDIT - file generated automatically using disabled port options -->
4
5
<!--
6
    You can indirectly edit this file by copying it to the parent directory.
7
    The copied file will not be deleted or modified during port removal or
8
    upgrades.
9
-->
10
(-)security/ossec-hids-local-config/files/template-header-enabled.xml.in (+4 lines)
Line 0 Link Here
1
<!-- OSSEC HIDS %%VERSION%% -->
2
3
<!-- DO NOT EDIT - file generated automatically using enabled port options -->
4
(-)security/ossec-hids-local-config/files/template-header-sample.xml.in (+1 lines)
Line 0 Link Here
1
<!-- Place customized configuration here - it will not be overwritten during upgrades. -->
(-)security/ossec-hids-local-config/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="%%LOGS_APACHE_PROFILE%%">
3
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="%%LOGS_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>
(-)security/ossec-hids-local-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="%%LOGS_NGINX_PROFILE%%">
3
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="%%LOGS_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>
(-)security/ossec-hids-local-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="%%LOGS_RADIUS_PROFILE%%">
3
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="%%LOGS_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>
(-)security/ossec-hids-local-config/files/template-logs-response.xml.in (+18 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%LOGS_RESPONSE_PROFILE%%">
3
4
  <localfile>
5
    <log_format>syslog</log_format>
6
    <location>%%OSSEC_HOME%%/logs/active-responses.log</location>
7
  </localfile>
8
9
</template_config>
10
11
<template_config os="Linux" profile="%%LOGS_RESPONSE_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>
(-)security/ossec-hids-local-config/files/template-logs-system.xml.in (+68 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%LOGS_SYSTEM_PROFILE%%">
3
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="%%LOGS_SYSTEM_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>
(-)security/ossec-hids-local-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="%%LOGS_VSFTPD_PROFILE%%">
3
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="%%LOGS_VSFTPD_PROFILE%%">
12
13
  <localfile>
14
    <log_format>syslog</log_format>
15
    <location>/var/log/vsftpd.log</location>
16
  </localfile>
17
18
</template_config>
(-)security/ossec-hids-local-config/files/template-rootcheck-basic.xml.in (+22 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%ROOTCHECK_BASIC_PROFILE%%">
3
4
  <rootcheck>
5
    <rootkit_files>%%OSSEC_HOME%%/etc/shared/rootkit_files.txt</rootkit_files>
6
    <rootkit_trojans>%%OSSEC_HOME%%/etc/shared/rootkit_trojans.txt</rootkit_trojans>
7
    <system_audit>%%OSSEC_HOME%%/etc/shared/system_audit_rcl.txt</system_audit>
8
    <system_audit>%%OSSEC_HOME%%/etc/shared/system_audit_ssh.txt</system_audit>
9
  </rootcheck>
10
11
</template_config>
12
13
<template_config os="Linux" profile="%%ROOTCHECK_BASIC_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
  </rootcheck>
21
22
</template_config>
(-)security/ossec-hids-local-config/files/template-rootcheck-cis-l1.xml.in (+9 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<template_config os="Linux" profile="%%ROOTCHECK_CIS_L1_PROFILE%%">
4
5
  <rootcheck>
6
    <system_audit>/var/ossec/etc/shared/cis_debianlinux7-8_L1_rcl.txt</system_audit>
7
  </rootcheck>
8
9
</template_config>
(-)security/ossec-hids-local-config/files/template-rootcheck-cis-l2.xml.in (+9 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<template_config os="Linux" profile="%%ROOTCHECK_CIS_L2_PROFILE%%">
4
5
  <rootcheck>
6
    <system_audit>/var/ossec/etc/shared/cis_debianlinux7-8_L2_rcl.txt</system_audit>
7
  </rootcheck>
8
9
</template_config>
(-)security/ossec-hids-local-config/files/template-rootcheck-cis.xml.in (+9 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
3
<template_config os="Linux" profile="%%ROOTCHECK_CIS_PROFILE%%">
4
5
  <rootcheck>
6
    <system_audit>/var/ossec/etc/shared/cis_debian_linux_rcl.txt</system_audit>
7
  </rootcheck>
8
9
</template_config>
(-)security/ossec-hids-local-config/files/template-rules-cmdout.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_cmdout_rules.xml</include>
6
  </rules>
7
8
</template_config>
(-)security/ossec-hids-local-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>
(-)security/ossec-hids-local-config/files/template-rules-default.xml.in (+87 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <rules>
5
    <include>rules_config.xml</include>
6
    <include>ossec_rules.xml</include>
7
    <include>syslog_rules.xml</include>
8
    <include>sendmail_rules.xml</include>
9
    <include>postfix_rules.xml</include>
10
    <include>spamd_rules.xml</include>
11
    <include>imapd_rules.xml</include>
12
    <include>mailscanner_rules.xml</include>
13
    <include>ms-exchange_rules.xml</include>
14
    <include>courier_rules.xml</include>
15
    <include>firewall_rules.xml</include>
16
    <include>pix_rules.xml</include>
17
    <include>netscreenfw_rules.xml</include>
18
    <include>cisco-ios_rules.xml</include>
19
    <include>sonicwall_rules.xml</include>
20
    <include>pam_rules.xml</include>
21
    <include>telnetd_rules.xml</include>
22
    <include>sshd_rules.xml</include>
23
    <include>solaris_bsm_rules.xml</include>
24
    <include>asterisk_rules.xml</include>
25
    <include>ms_dhcp_rules.xml</include>
26
    <include>arpwatch_rules.xml</include>
27
    <include>symantec-av_rules.xml</include>
28
    <include>symantec-ws_rules.xml</include>
29
    <include>trend-osce_rules.xml</include>
30
    <include>hordeimp_rules.xml</include>
31
    <include>roundcube_rules.xml</include>
32
    <include>wordpress_rules.xml</include>
33
    <include>cimserver_rules.xml</include>
34
    <include>dovecot_rules.xml</include>
35
    <include>vmpop3d_rules.xml</include>
36
    <include>vpopmail_rules.xml</include>
37
    <include>ftpd_rules.xml</include>
38
    <include>proftpd_rules.xml</include>
39
    <include>pure-ftpd_rules.xml</include>
40
    <include>vsftpd_rules.xml</include>
41
    <include>ms_ftpd_rules.xml</include>
42
    <include>named_rules.xml</include>
43
    <include>exim_rules.xml</include>
44
    <include>smbd_rules.xml</include>
45
    <include>racoon_rules.xml</include>
46
    <include>vpn_concentrator_rules.xml</include>
47
    <include>msauth_rules.xml</include>
48
    <include>mcafee_av_rules.xml</include>
49
    <include>ms-se_rules.xml</include>
50
    <include>sysmon_rules.xml</include>
51
    <include>ms_ipsec_rules.xml</include>
52
    <include>vmware_rules.xml</include>
53
    <include>ids_rules.xml</include>
54
    <include>apache_rules.xml</include>
55
    <include>web_rules.xml</include>
56
    <include>zeus_rules.xml</include>
57
    <include>nginx_rules.xml</include>
58
    <include>php_rules.xml</include>
59
    <include>web_appsec_rules.xml</include>
60
    <include>squid_rules.xml</include>
61
    <include>attack_rules.xml</include>
62
    <include>systemd_rules.xml</include>
63
    <include>firewalld_rules.xml</include>
64
    <include>mysql_rules.xml</include>
65
    <include>postgresql_rules.xml</include>
66
    <include>dropbear_rules.xml</include>
67
    <include>openbsd_rules.xml</include>
68
    <include>apparmor_rules.xml</include>
69
    <include>clam_av_rules.xml</include>
70
    <include>openbsd-dhcpd_rules.xml</include>
71
    <include>nsd_rules.xml</include>
72
    <include>owncloud_rules.xml</include>
73
    <include>proxmox-ve_rules.xml</include>
74
    <include>opensmtpd_rules.xml</include>
75
    <include>dnsmasq_rules.xml</include>
76
    <include>linux_usbdetect_rules.xml</include>
77
    <include>ms1016_usbdetect_rules.xml</include>
78
    <include>ms_firewall_rules.xml</include>
79
    <include>psad_rules.xml</include>
80
    <include>unbound_rules.xml</include>
81
    <include>local_rules.xml</include>
82
83
    <!-- Files not included by default -->
84
    <!--<include>policy_rules.xml</include>-->
85
  </rules>
86
87
</template_config>
(-)security/ossec-hids-local-config/files/template-sample-agent.xml.in (+14 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
</template_config>
(-)security/ossec-hids-local-config/files/template-sample-database.xml.in (+12 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
  <!-- Run "%%OSSEC_HOME%%/bin/ossec-control enable database" to enable ossec-dbd. -->
4
  <database_output>
5
    <hostname>localhost</hostname>
6
    <username>ossec</username>
7
    <password>secret</password>
8
    <database>ossec</database>
9
    <type>%%DB_TYPE%%</type>
10
  </database_output>
11
12
</template_config>
(-)security/ossec-hids-local-config/files/template-sample-local.xml.in (+17 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
</template_config>
(-)security/ossec-hids-local-config/files/template-sample-server.xml.in (+23 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config>
3
4
  <remote>
5
    <connection>secure</connection>
6
    <!-- OSSEC server listens on all interfacees by default. -->
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
</template_config>
(-)security/ossec-hids-local-config/files/template-syscheck-basic.xml.in (+18 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%SYSCHECK_BASIC_PROFILE%%">
3
4
  <syscheck>
5
    <directories realtime="yes" check_all="yes">/bin,/sbin,/usr/bin,/usr/sbin,%%PREFIX%%/bin,%%PREFIX%%/sbin</directories>
6
    <directories realtime="yes" check_all="yes">/etc,%%PREFIX%%/etc</directories>
7
  </syscheck>
8
9
</template_config>
10
11
<template_config os="Linux" profile="%%SYSCHECK_BASIC_PROFILE%%">
12
13
  <syscheck>
14
    <directories realtime="yes" check_all="yes">/bin,/sbin,/usr/bin,/usr/sbin,/usr/local/bin,/usr/local/sbin</directories>
15
    <directories realtime="yes" check_all="yes">/etc,/usr/local/etc</directories>
16
  </syscheck>
17
18
</template_config>
(-)security/ossec-hids-local-config/files/template-syscheck-hostdeny.xml.in (+16 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD">
3
4
  <syscheck>
5
    <ignore>/etc/hosts.allow</ignore>
6
  </syscheck>
7
8
</template_config>
9
10
<template_config os="Linux">
11
12
  <syscheck>
13
    <ignore>/etc/hosts.deny</ignore>
14
  </syscheck>
15
16
</template_config>
(-)security/ossec-hids-local-config/files/template-syscheck-newfiles.xml.in (+16 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD">
3
4
  <syscheck>
5
    <alert_new_files>yes</alert_new_files>
6
  </syscheck>
7
8
</template_config>
9
10
<template_config os="Linux">
11
12
  <syscheck>
13
    <alert_new_files>yes</alert_new_files>
14
  </syscheck>
15
16
</template_config>
(-)security/ossec-hids-local-config/files/template-syscheck-noauto.xml.in (+16 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD">
3
4
  <syscheck>
5
    <auto_ignore>no</auto_ignore>
6
  </syscheck>
7
8
</template_config>
9
10
<template_config os="Linux">
11
12
  <syscheck>
13
    <auto_ignore>no</auto_ignore>
14
  </syscheck>
15
16
</template_config>
(-)security/ossec-hids-local-config/files/template-syscheck-ossec.xml.in (+18 lines)
Line 0 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<template_config os="FreeBSD" profile="%%SYSCHECK_OSSEC_PROFILE%%">
3
4
  <syscheck>
5
    <directories realtime="yes" check_all="yes">%%OSSEC_SYSCHECK_BIN_DIRS%%</directories>
6
    <directories realtime="yes" check_all="yes">%%OSSEC_SYSCHECK_ETC_DIRS%%</directories>
7
  </syscheck>
8
9
</template_config>
10
11
<template_config os="Linux" profile="%%SYSCHECK_OSSEC_PROFILE%%">
12
13
  <syscheck>
14
    <directories realtime="yes" check_all="yes">/var/ossec/bin,/var/ossec/active-response,/var/ossec/agentless</directories>
15
    <directories realtime="yes" check_all="yes">/var/ossec/etc,/var/ossec/rules</directories>
16
  </syscheck>
17
18
</template_config>
(-)security/ossec-hids-local-config/opt-ar.mk (+46 lines)
Line 0 Link Here
1
AR_MANAGED_CONF=	110.active-response.conf
2
AR_LOCAL_CONF=		510.active-response.local.conf
3
4
AR_DESC=		Active Response
5
6
# Default commands
7
AR_CMDS_DEFAULT_OPTION=	DEFAULT_C
8
AR_CMDS_DEFAULT_DESC=	Commands provided by OSSEC
9
AR_CMDS_DEFAULT_DEFINE=	server local
10
AR_CMDS_DEFAULT_DEFAULT=server local
11
AR_OPTIONS+=		AR_CMDS_DEFAULT
12
13
# Config merge commands
14
AR_CMDS_MERGE_OPTION=	MERGE_C
15
AR_CMDS_MERGE_DESC=	Commands to merge configuration files
16
AR_CMDS_MERGE_DEFINE=	server local
17
AR_CMDS_MERGE_DEFAULT=	server local
18
AR_OPTIONS+=		AR_CMDS_MERGE
19
20
# Config merge active response
21
AR_MERGE_OPTION=	MERGE_AR
22
AR_MERGE_DESC=		Merge configuration files when they change
23
AR_MERGE_DEFINE=	server local
24
AR_MERGE_DEFAULT=	server local
25
AR_OPTIONS+=		AR_MERGE
26
27
# OSSEC restart active response
28
AR_RESTART_OPTION=	RESTART_AR
29
AR_RESTART_DESC=	Restart OSSEC when main configuration files change
30
AR_RESTART_DEFINE=	server local
31
AR_RESTART_DEFAULT=	server local
32
AR_OPTIONS+=		AR_RESTART
33
34
# Host deny active response
35
AR_HOSTDENY_OPTION=	HOSTDENY_AR
36
AR_HOSTDENY_DESC=	Block the attacker's IP using access control files
37
AR_HOSTDENY_DEFINE=	server local
38
AR_HOSTDENY_DEFAULT=
39
AR_OPTIONS+=		AR_HOSTDENY
40
41
# Firewall drop active response
42
AR_FWDROP_OPTION=	FWDROP_AR
43
AR_FWDROP_DESC=		Block the attacker's IP on the firewall
44
AR_FWDROP_DEFINE=	server local
45
AR_FWDROP_DEFAULT=
46
AR_OPTIONS+=		AR_FWDROP
(-)security/ossec-hids-local-config/opt-cmdout.mk (+27 lines)
Line 0 Link Here
1
CMDOUT_MANAGED_CONF=		140.command-output.conf
2
CMDOUT_LOCAL_CONF=		540.command-output.local.conf
3
4
CMDOUT_DESC=			Command Output Monitoring
5
6
CMDOUT_SCRIPTS=			last-logins open-ports
7
8
# Last logins
9
CMDOUT_LAST_LOGINS_OPTION=	LOGINS
10
CMDOUT_LAST_LOGINS_DESC=	Last logins
11
CMDOUT_LAST_LOGINS_DEFINE=	server local agent
12
CMDOUT_LAST_LOGINS_DEFAULT=	server local agent
13
CMDOUT_OPTIONS+=		CMDOUT_LAST_LOGINS
14
15
# Open TCP ports
16
CMDOUT_OPEN_PORTS_TCP_OPTION=	PORTS_TCP
17
CMDOUT_OPEN_PORTS_TCP_DESC=	Open TCP ports
18
CMDOUT_OPEN_PORTS_TCP_DEFINE=	server local agent
19
CMDOUT_OPEN_PORTS_TCP_DEFAULT=	server local agent
20
CMDOUT_OPTIONS+=		CMDOUT_OPEN_PORTS_TCP
21
22
# Open UDP ports
23
CMDOUT_OPEN_PORTS_UDP_OPTION=	PORTS_UDP
24
CMDOUT_OPEN_PORTS_UDP_DESC=	Open UDP ports
25
CMDOUT_OPEN_PORTS_UDP_DEFINE=	server local agent
26
CMDOUT_OPEN_PORTS_UDP_DEFAULT=	server local agent
27
CMDOUT_OPTIONS+=		CMDOUT_OPEN_PORTS_UDP
(-)security/ossec-hids-local-config/opt-logs.mk (+52 lines)
Line 0 Link Here
1
LOGS_MANAGED_CONF=	150.logs.conf
2
LOGS_LOCAL_CONF=	550.logs.local.conf
3
4
LOGS_DESC=		Log Monitoring
5
6
# Default logs support
7
LOGS_SYSTEM_OPTION=	SYSTEM
8
LOGS_SYSTEM_PROFILE=	system-logs
9
LOGS_SYSTEM_DESC=	Default system logs
10
LOGS_SYSTEM_DEFINE=	server local agent pushed
11
LOGS_SYSTEM_DEFAULT=	server local pushed
12
LOGS_OPTIONS+=		LOGS_SYSTEM
13
14
# Active response log support
15
LOGS_RESPONSE_OPTION=	RESPONSE
16
LOGS_RESPONSE_PROFILE=	active-response-logs
17
LOGS_RESPONSE_DESC=	Active response logs
18
LOGS_RESPONSE_DEFINE=	server local agent pushed
19
LOGS_RESPONSE_DEFAULT=	server local pushed
20
LOGS_OPTIONS+=		LOGS_RESPONSE
21
22
# Apache logs support
23
LOGS_APACHE_OPTION=	APACHE
24
LOGS_APACHE_PROFILE=	apache-logs
25
LOGS_APACHE_DESC=	Apache logs
26
LOGS_APACHE_DEFINE=	server local agent pushed
27
LOGS_APACHE_DEFAULT=	pushed
28
LOGS_OPTIONS+=		LOGS_APACHE
29
30
# Nginx logs support
31
LOGS_NGINX_OPTION=	NGINX
32
LOGS_NGINX_PROFILE=	nginx-logs
33
LOGS_NGINX_DESC=	Nginx logs
34
LOGS_NGINX_DEFINE=	server local agent pushed
35
LOGS_NGINX_DEFAULT=	pushed
36
LOGS_OPTIONS+=		LOGS_NGINX
37
38
# Radius logs support
39
LOGS_RADIUS_OPTION=	RADIUS
40
LOGS_RADIUS_PROFILE=	radius-logs
41
LOGS_RADIUS_DESC=	FreeRADIUS logs
42
LOGS_RADIUS_DEFINE=	server local agent pushed
43
LOGS_RADIUS_DEFAULT=	pushed
44
LOGS_OPTIONS+=		LOGS_RADIUS
45
46
# Vsftpd logs support
47
LOGS_VSFTPD_OPTION=	VSFTPD
48
LOGS_VSFTPD_PROFILE=	vsftpd-logs
49
LOGS_VSFTPD_DESC=	Vsftpd logs
50
LOGS_VSFTPD_DEFINE=	server local agent pushed
51
LOGS_VSFTPD_DEFAULT=	pushed
52
LOGS_OPTIONS+=		LOGS_VSFTPD
(-)security/ossec-hids-local-config/opt-rootcheck.mk (+36 lines)
Line 0 Link Here
1
ROOTCHECK_MANAGED_CONF=		120.rootcheck.conf
2
ROOTCHECK_LOCAL_CONF=		520.rootcheck.local.conf
3
4
ROOTCHECK_DESC=			System Audit and Rootkit Detection (rootcheck)
5
6
# Basic
7
ROOTCHECK_BASIC_OPTION=		BASIC_RC
8
ROOTCHECK_BASIC_PROFILE=	basic-rootcheck
9
ROOTCHECK_BASIC_DESC=		Basic audit and rootkits
10
ROOTCHECK_BASIC_DEFINE=		server local agent pushed
11
ROOTCHECK_BASIC_DEFAULT=	server local pushed
12
ROOTCHECK_OPTIONS+=		ROOTCHECK_BASIC
13
14
# CIS default
15
ROOTCHECK_CIS_OPTION=		CIS_RC
16
ROOTCHECK_CIS_PROFILE=		cis-rootcheck
17
ROOTCHECK_CIS_DESC=		CIS benchmark - Legacy
18
ROOTCHECK_CIS_DEFINE=		pushed
19
ROOTCHECK_CIS_DEFAULT=		pushed
20
ROOTCHECK_OPTIONS+=		ROOTCHECK_CIS
21
22
# CIS level 1
23
ROOTCHECK_CIS_L1_OPTION=	CIS_L1_RC
24
ROOTCHECK_CIS_L1_PROFILE=	cis-level1-rootcheck
25
ROOTCHECK_CIS_L1_DESC=		CIS benchmark - Level 1
26
ROOTCHECK_CIS_L1_DEFINE=	pushed
27
ROOTCHECK_CIS_L1_DEFAULT=	pushed
28
ROOTCHECK_OPTIONS+=		ROOTCHECK_CIS_L1
29
30
# CIS level 2
31
ROOTCHECK_CIS_L2_OPTION=	CIS_L2_RC
32
ROOTCHECK_CIS_L2_PROFILE=	cis-level2-rootcheck
33
ROOTCHECK_CIS_L2_DESC=		CIS benchmark - Level 2
34
ROOTCHECK_CIS_L2_DEFINE=	pushed
35
ROOTCHECK_CIS_L2_DEFAULT=	pushed
36
ROOTCHECK_OPTIONS+=		ROOTCHECK_CIS_L2
(-)security/ossec-hids-local-config/opt-rules.mk (+27 lines)
Line 0 Link Here
1
RULES_MANAGED_CONF=	100.rules.conf
2
RULES_LOCAL_CONF=	500.rules.local.conf
3
4
RULES_DESC=		Alerting Rules
5
6
RULES_FILES=		config cmdout
7
8
# Default rules
9
RULES_DEFAULT_OPTION=	DEFAULT_R
10
RULES_DEFAULT_DESC=	Rules provided by OSSEC
11
RULES_DEFAULT_DEFINE=	server local
12
RULES_DEFAULT_DEFAULT=	server local
13
RULES_OPTIONS+=		RULES_DEFAULT
14
15
# Config rules
16
RULES_CONFIG_OPTION=	CONFIG_R
17
RULES_CONFIG_DESC=	Alert changes of the OSSEC main configuration files
18
RULES_CONFIG_DEFINE=	server local
19
RULES_CONFIG_DEFAULT=	server local
20
RULES_OPTIONS+=		RULES_CONFIG
21
22
# Command output rules
23
RULES_CMDOUT_OPTION=	CMDOUT_R
24
RULES_CMDOUT_DESC=	Alert changes of output of the monitored commands
25
RULES_CMDOUT_DEFINE=	server local
26
RULES_CMDOUT_DEFAULT=	server local
27
RULES_OPTIONS+=		RULES_CMDOUT
(-)security/ossec-hids-local-config/opt-syscheck.mk (+42 lines)
Line 0 Link Here
1
SYSCHECK_MANAGED_CONF=		130.syscheck.conf
2
SYSCHECK_LOCAL_CONF=		530.syscheck.local.conf
3
4
SYSCHECK_DESC=			File Integrity Checking (syscheck)
5
6
# Default direcotries
7
SYSCHECK_BASIC_OPTION=		BASIC_SC
8
SYSCHECK_BASIC_PROFILE=		basic-syscheck
9
SYSCHECK_BASIC_DESC=		"bin", "sbin" and "etc"
10
SYSCHECK_BASIC_DEFINE=		server local agent pushed
11
SYSCHECK_BASIC_DEFAULT=		server local pushed
12
SYSCHECK_OPTIONS+=		SYSCHECK_BASIC
13
14
# OSSEC directories
15
SYSCHECK_OSSEC_OPTION=		OSSEC_SC
16
SYSCHECK_OSSEC_PROFILE=		ossec-syscheck
17
SYSCHECK_OSSEC_DESC=		OSSEC directories
18
SYSCHECK_OSSEC_DEFINE=		server local agent pushed
19
SYSCHECK_OSSEC_DEFAULT=		server local pushed
20
SYSCHECK_OPTIONS+=		SYSCHECK_OSSEC
21
22
# Alert new files
23
SYSCHECK_NEWFILES_OPTION=	NEWFILES_SC
24
SYSCHECK_NEWFILES_DESC=		Alert on new files created
25
SYSCHECK_NEWFILES_DEFINE=	server local
26
SYSCHECK_NEWFILES_DEFAULT=	server local
27
SYSCHECK_OPTIONS+=		SYSCHECK_NEWFILES
28
29
# Disable auto_ignore
30
SYSCHECK_NOAUTO_OPTION=		NOAUTO_SC
31
SYSCHECK_NOAUTO_DESC=		Disable auto_ignore feature
32
SYSCHECK_NOAUTO_DEFINE=		server local
33
SYSCHECK_NOAUTO_DEFAULT=	server local
34
SYSCHECK_OPTIONS+=		SYSCHECK_NOAUTO
35
36
# Ignore /etc/hosts.allow
37
SYSCHECK_HOSTDENY_DEPENDS=	AR_HOSTDENY
38
SYSCHECK_HOSTDENY_OPTION=	HOSTDENY_SC
39
SYSCHECK_HOSTDENY_DESC=		Ignore access control files
40
SYSCHECK_HOSTDENY_DEFINE=	server local agent pushed
41
SYSCHECK_HOSTDENY_DEFAULT=	server local pushed
42
SYSCHECK_OPTIONS+=		SYSCHECK_HOSTDENY
(-)security/ossec-hids-local-config/pkg-descr (+9 lines)
Line 0 Link Here
1
OSSEC is a scalable, multi-platform, open source Host-based Intrusion Detection
2
System (HIDS). It has a powerful correlation and analysis engine, integrating
3
log analysis, file integrity checking, Windows registry monitoring, centralized
4
policy enforcement, rootkit detection, real-time alerting and active response.
5
6
This package adds the configuration overlay with samples, additional rules,
7
commands, scripts and support for multiple configuration files.
8
9
WWW: https://ossec.github.io
(-)security/ossec-hids-local-config/pkg-help-agent (+29 lines)
Line 0 Link Here
1
Unless stated otherwise, every option here corresponds to certain configuration
2
block which would be placed in one of the configuration files in "ossec.conf.d"
3
directory. Disabled options will do the same, but for "ossec.conf.d/disabled"
4
directory. All "*.conf" files from the "ossec.conf.d" directory will be merged
5
into "ossec.conf" in alphabetic order. If you are not satisfied with the
6
generated configuration, you can disable the corresponding option and use files
7
from "ossec.conf.d/disabled" directory as samples.
8
9
Most of the options are disabled by default, because it is expected that the
10
server will push the agent configuration using "agent.conf". FreeBSD port of
11
OSSEC server extended with similar "config" port does this by default. If this
12
is the case, then the "ossec.conf" should only enable required profiles.
13
14
Files generated by the port will be overwritten during port upgrades so any
15
additional configuration should be put in separate files.
16
17
Command Output Monitoring:
18
19
  Adds additional commands, the output of which can be monitored. To actually
20
  send alerts about the changing output, the proper rules need to be configured
21
  on the server as well. For security reasons commands cannot be pushed by the
22
  server and thus must be configured locally on every agent.
23
  These commands can be tweaked in "command.conf".
24
25
Active Response Firewall:
26
27
  Creates "firewall-drop.sh" hardlink to one of the scripts shipped with OSSEC.
28
  This option is only meaningful if this OSSEC instance will be the target of
29
  "firewall-drop" active response (configured on the server).
(-)security/ossec-hids-local-config/pkg-help-local (+31 lines)
Line 0 Link Here
1
Unless stated otherwise, every option here corresponds to certain configuration
2
block which would be placed in one of the configuration files in "ossec.conf.d"
3
directory. Disabled options will do the same, but for "ossec.conf.d/disabled"
4
directory. All "*.conf" files from the "ossec.conf.d" directory will be merged
5
into "ossec.conf" in alphabetic order. If you are not satisfied with the
6
generated configuration, you can disable the corresponding option and use files
7
from "ossec.conf.d/disabled" directory as samples.
8
9
Files generated by the port will be overwritten during port upgrades so any
10
additional configuration should be put in separate files.
11
12
File Integrity Checking:
13
14
  NOAUTO_SC:
15
    OSSEC by default will ignore files that change too often (after the third
16
    change). This option disables this feature. Files that change too often
17
    as a result of correct system operation should better be added to ignore
18
    list manually.
19
20
Command Output Monitoring:
21
22
  Adds additional commands, the output of which can be monitored. To actually
23
  send alerts about the changing output, the proper rules need to be configured
24
  as well (see CMDOUT_R option).
25
  These commands can be tweaked in "command.conf".
26
27
Active Response Firewall:
28
29
  Creates "firewall-drop.sh" hardlink to one of the scripts shipped with OSSEC.
30
  This option is only meaningful if "firewall-drop" active response will be
31
  enabled in the configuration.
(-)security/ossec-hids-local-config/pkg-help-server (+46 lines)
Line 0 Link Here
1
Unless stated otherwise, every option here corresponds to certain configuration
2
block which would be placed in one of the configuration files in "ossec.conf.d"
3
directory. Disabled options will do the same, but for "ossec.conf.d/disabled"
4
directory. All "*.conf" files from the "ossec.conf.d" directory will be merged
5
into "ossec.conf" in alphabetic order. If you are not satisfied with the
6
generated configuration, you can disable the corresponding option and use files
7
from "ossec.conf.d/disabled" directory as samples.
8
9
The "pushed" sections (*_P options) relate to configuration pushed to agents
10
using "agent.conf". The generated configuration blocks will be placed in
11
"agent.conf.d" and "agent.conf.d/disabled" directories.
12
Note that the agent needs to enable proper profile to benefit from "agent.conf"
13
configuration pushed by the server. This also means that profiles not enabled
14
on the agent are ignored. This is why all "pushed" options are enabled by
15
default. The port currently contains configuration templates for the following
16
agent systems:
17
18
  - FreeBSD
19
  - Debian Linux
20
21
Consider contributing to the port by contacting the maintainer and providing
22
configuration templates for other operating systems runnig OSSEC agents.
23
24
Files generated by the port will be overwritten during port upgrades so any
25
additional configuration should be put in separate files.
26
27
File Integrity Checking:
28
29
  NOAUTO_SC:
30
    OSSEC by default will ignore files that change too often (after the third
31
    change). This option disables this feature. Files that change too often
32
    as a result of correct system operation should better be added to ignore
33
    list manually.
34
35
Command Output Monitoring:
36
37
  Adds additional commands, the output of which can be monitored. To actually
38
  send alerts about the changing output, the proper rules need to be configured
39
  as well (see CMDOUT_R option).
40
  These commands can be tweaked in "command.conf".
41
42
Active Response Firewall:
43
44
  Creates "firewall-drop.sh" hardlink to one of the scripts shipped with OSSEC.
45
  This option is only meaningful if this OSSEC instance will be the target of
46
  "firewall-drop" active response.
(-)security/ossec-hids-local-config/pkg-plist-agent (+23 lines)
Line 0 Link Here
1
@dir(,ossec,0550) %%OSSEC_HOME%%
2
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response
3
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response/bin
4
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/merge-config.sh
5
@dir(,,0550) %%OSSEC_HOME%%/bin
6
@dir(,,0550) %%OSSEC_HOME%%/bin/command
7
@(,,0550) %%OSSEC_HOME%%/bin/command/last-logins.sh
8
@(,,0550) %%OSSEC_HOME%%/bin/command/open-ports.sh
9
@dir(,,0550) %%OSSEC_HOME%%/bin/config
10
@(,,0550) %%OSSEC_HOME%%/bin/config/ossec-conf
11
@dir(,ossec,0550) %%OSSEC_HOME%%/etc
12
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/command.conf.sample
13
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/ossec.conf.d
14
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/120.rootcheck.conf
15
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/130.syscheck.conf
16
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/140.command-output.conf
17
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/150.logs.conf
18
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/900.local.conf.sample
19
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled
20
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/520.rootcheck.local.conf
21
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/530.syscheck.local.conf
22
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/540.command-output.local.conf
23
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/550.logs.local.conf
(-)security/ossec-hids-local-config/pkg-plist-local (+30 lines)
Line 0 Link Here
1
@dir(,ossec,0550) %%OSSEC_HOME%%
2
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response
3
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response/bin
4
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/merge-config.sh
5
@dir(,,0550) %%OSSEC_HOME%%/bin
6
@dir(,,0550) %%OSSEC_HOME%%/bin/command
7
@(,,0550) %%OSSEC_HOME%%/bin/command/last-logins.sh
8
@(,,0550) %%OSSEC_HOME%%/bin/command/open-ports.sh
9
@dir(,,0550) %%OSSEC_HOME%%/bin/config
10
@(,,0550) %%OSSEC_HOME%%/bin/config/ossec-conf
11
@dir(,ossec,0550) %%OSSEC_HOME%%/etc
12
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/command.conf.sample
13
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/ossec.conf.d
14
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/100.rules.conf
15
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/110.active-response.conf
16
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/120.rootcheck.conf
17
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/130.syscheck.conf
18
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/140.command-output.conf
19
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/150.logs.conf
20
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/900.local.conf.sample
21
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled
22
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/500.rules.local.conf
23
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/510.active-response.local.conf
24
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/520.rootcheck.local.conf
25
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/530.syscheck.local.conf
26
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/540.command-output.local.conf
27
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/550.logs.local.conf
28
@dir(,ossec,0550) %%OSSEC_HOME%%/rules
29
@(,ossec,0640) %%OSSEC_HOME%%/rules/freebsd_cmdout_rules.xml
30
@(,ossec,0640) %%OSSEC_HOME%%/rules/freebsd_config_rules.xml
(-)security/ossec-hids-local-config/pkg-plist-server (+39 lines)
Line 0 Link Here
1
@dir(,ossec,0550) %%OSSEC_HOME%%
2
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response
3
@dir(,ossec,0550) %%OSSEC_HOME%%/active-response/bin
4
@(,ossec,0550) %%OSSEC_HOME%%/active-response/bin/merge-config.sh
5
@dir(,,0550) %%OSSEC_HOME%%/bin
6
@dir(,,0550) %%OSSEC_HOME%%/bin/command
7
@(,,0550) %%OSSEC_HOME%%/bin/command/last-logins.sh
8
@(,,0550) %%OSSEC_HOME%%/bin/command/open-ports.sh
9
@dir(,,0550) %%OSSEC_HOME%%/bin/config
10
@(,,0550) %%OSSEC_HOME%%/bin/config/agent-conf
11
@(,,0550) %%OSSEC_HOME%%/bin/config/ossec-conf
12
@dir(,ossec,0550) %%OSSEC_HOME%%/etc
13
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/agent.conf.d
14
@(,ossec,0640) %%OSSEC_HOME%%/etc/agent.conf.d/120.rootcheck.conf
15
@(,ossec,0640) %%OSSEC_HOME%%/etc/agent.conf.d/130.syscheck.conf
16
@(,ossec,0640) %%OSSEC_HOME%%/etc/agent.conf.d/150.logs.conf
17
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/agent.conf.d/disabled
18
@(,ossec,0640) %%OSSEC_HOME%%/etc/agent.conf.d/disabled/520.rootcheck.local.conf
19
@(,ossec,0640) %%OSSEC_HOME%%/etc/agent.conf.d/disabled/530.syscheck.local.conf
20
@(,ossec,0640) %%OSSEC_HOME%%/etc/agent.conf.d/disabled/550.logs.local.conf
21
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/command.conf.sample
22
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/ossec.conf.d
23
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/100.rules.conf
24
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/110.active-response.conf
25
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/120.rootcheck.conf
26
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/130.syscheck.conf
27
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/140.command-output.conf
28
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/150.logs.conf
29
@sample(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/900.local.conf.sample
30
@dir(,ossec,0550) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled
31
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/500.rules.local.conf
32
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/510.active-response.local.conf
33
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/520.rootcheck.local.conf
34
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/530.syscheck.local.conf
35
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/540.command-output.local.conf
36
@(,ossec,0640) %%OSSEC_HOME%%/etc/ossec.conf.d/disabled/550.logs.local.conf
37
@dir(,ossec,0550) %%OSSEC_HOME%%/rules
38
@(,ossec,0640) %%OSSEC_HOME%%/rules/freebsd_cmdout_rules.xml
39
@(,ossec,0640) %%OSSEC_HOME%%/rules/freebsd_config_rules.xml
(-)security/ossec-hids-local-config/scripts/plist.sh (+113 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
OSSEC_HOME=$2
10
PLIST=$3
11
WORKDIR=$4
12
STAGEDIR=$5
13
14
staged_plist="${WORKDIR}/.staged-plist"
15
fixed_lines=""
16
skip_lines=""
17
skip_paths=""
18
sample_paths="/etc/command.conf.sample /etc/ossec.conf.d/900.local.conf.sample /etc/agent.conf.d/900.local.conf.sample"
19
20
print_path() {
21
    local path="$1"
22
    local command="$2"
23
    local full_path="${STAGEDIR}${OSSEC_HOME}${path}"
24
    if [ -z "${command}" ]; then
25
        command="@"
26
        if [ -d "${full_path}" ]; then
27
            command="@dir"
28
        fi
29
    fi
30
    local user=`stat -f "%Su" "${full_path}"`
31
    if [ "${user}" == "${USER}" ]; then
32
        user=""
33
    fi
34
    local group=`stat -f "%Sg" "${full_path}"`
35
    if [ "${group}" == "${GROUP}" ]; then
36
        group=""
37
    fi
38
    local mode=`stat -f "%p" "${full_path}" | tail -c 5`
39
    echo -e "${command}(${user},${group},${mode}) %%OSSEC_HOME%%${path}" >> "${PLIST}"
40
}
41
42
echo -n > "${PLIST}"
43
44
print_path
45
46
done_paths=""
47
while read line; do
48
    skip_line=""
49
    for e in ${skip_lines}; do
50
        if [ "${e}" == "${line}" ]; then
51
            skip_line="${e}"
52
            break
53
        fi
54
    done
55
    if [ -z "${skip_line}" ]; then
56
        path=""
57
        case $line in
58
            "@dir %%OSSEC_HOME%%"*)
59
                path=`echo "${line}" | sed -e "s|@dir %%OSSEC_HOME%%||g"`
60
                ;;
61
            "%%OSSEC_HOME%%"*)
62
                path=`echo "${line}" | sed -e "s|%%OSSEC_HOME%%||g"`
63
                ;;
64
            "%%"*)
65
                unchanged_lines="${unchanged_lines} ${line}"
66
                ;;
67
        esac
68
        if [ -n "${path}" ]; then
69
            segments=`echo "${path}" | tr "/" "\n"`
70
            path=""
71
            for segment in ${segments}; do
72
                path="${path}/${segment}"
73
                skip_path=""
74
                for e in ${skip_paths}; do
75
                    if [ "${e}" == "${path}" ]; then
76
                        skip_path="${e}"
77
                        break
78
                    fi
79
                done
80
                if [ -n "${skip_path}" ]; then
81
                    break
82
                fi
83
                done_path=""
84
                for e in ${done_paths}; do
85
                    if [ "${e}" == "${path}" ]; then
86
                        done_path="${e}"
87
                        break
88
                    fi
89
                done
90
                if [ -z "${done_path}" ]; then
91
                    done_paths="${done_paths} ${path}"
92
                    sample_path=""
93
                    for e in ${sample_paths}; do
94
                        if [ "${e}" == "${path}" ]; then
95
                            sample_path="${e}"
96
                            break
97
                        fi
98
                    done
99
                    if [ -n "${sample_path}" ]; then
100
                        print_path "${path}" @sample
101
                    else
102
                        print_path "${path}"
103
                    fi
104
                fi
105
            done
106
        fi
107
    fi
108
done < "${staged_plist}"
109
110
unchanged_lines="${unchanged_lines} ${fixed_lines}"
111
for line in ${unchanged_lines}; do
112
    echo "${line}" >> "${PLIST}"
113
done
(-)security/ossec-hids-local-config/scripts/rules.sh (+89 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
# Script generates entries for template-rules-default.xml.in.
4
# Do not use it directly. Use the following command instead:
5
#
6
# make MAINTAINER_MODE=yes rules
7
8
rules_template=$1
9
src_dir=$2
10
11
skip_files="policy_rules.xml local_rules.xml"
12
append_files="local_rules.xml"
13
14
rules=""
15
for file in `find "${src_dir}/etc/rules" -depth 1 -name "*.xml"`; do
16
    file_name="${file##*/}"
17
    skip_file=""
18
    for e in ${skip_files}; do
19
        if [ "${e}" == "${file_name}" ]; then
20
            skip_file="${e}"
21
            break
22
        fi
23
    done
24
    if [ -z "${skip_file}" ]; then
25
        rule_ids=`sed -Ene 's|^.*<rule[[:space:]]+id="([0-9]+)".*$|\1|p' "${file}"`
26
        if [ -n "${rule_ids}" ]; then
27
            min_rule_id=`echo "${rule_ids}" | sort -n | head -n 1`
28
            ref_rule_ids=`sed -Ene 's|^.*<if_sid>([0-9,]+)</if_sid>.*$|\1|p' "${file}" | tr ',' '\n'`
29
            for ref_rule_id in ${ref_rule_ids}; do
30
                found_rule_id=""
31
                for rule_id in ${rule_ids}; do
32
                    if [ "${ref_rule_id}" = "${rule_id}" ]; then
33
                        found_rule_id="${rule_id}"
34
                        break
35
                    fi
36
                done
37
                if [ -z "${found_rule_id}" ]; then
38
                    # The referenced rule id is not present in this file so it must come from another
39
                    if [ ${ref_rule_id} -gt ${min_rule_id} ]; then
40
                        # Ordering by referenced rule id doesn't need to give proper results, but let's hope it does
41
                        min_rule_id=$((ref_rule_id + 1))
42
                    fi
43
                fi
44
            done
45
46
            rules="${rules}${min_rule_id} ${file_name}
47
"
48
        fi
49
    fi
50
done
51
52
echo -n "${rules}" | sort -n
53
54
if [ -n "${rules_template}" ]; then
55
    rules=`echo -n "${rules}" | sort -n | cut -d' ' -f2`
56
    for file_name in ${append_files}; do
57
        rules="${rules}
58
${file_name}"
59
    done
60
61
    echo '<?xml version="1.0" encoding="UTF-8"?>
62
<template_config>
63
64
  <rules>' > "${rules_template}"
65
66
    for rule in ${rules}; do
67
        echo "    <include>${rule}</include>" >> "${rules_template}"
68
    done
69
70
    echo '
71
    <!-- Files not included by default -->' >> "${rules_template}"
72
73
    for skip_file in ${skip_files}; do
74
        append_file=""
75
        for e in ${append_files}; do
76
            if [ "${e}" == "${skip_file}" ]; then
77
                append_file="${e}"
78
                break
79
            fi
80
        done
81
        if [ -z "${append_file}" ]; then
82
            echo "    <!--<include>${skip_file}</include>-->" >> "${rules_template}"
83
        fi
84
    done
85
86
    echo '  </rules>
87
88
</template_config>' >> "${rules_template}"
89
fi
(-)security/ossec-hids-local-config/scripts/template-to-agent.sh (+33 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
if [ $# -lt 3 ]; then
4
    echo "Too few arguments"
5
    echo "Usage: `basename $0` <ossec_type> <ossec_prefix> <ossec_file>"
6
    exit 1
7
fi
8
9
ossec_type="$1"
10
ossec_prefix="$2"
11
ossec_file="$3"
12
13
if [ ! -f "${ossec_file}" ]; then
14
    echo "File \"${ossec_file}\" does not exist"
15
    exit 1
16
fi
17
18
ossec_syscheck_bin_dirs="${ossec_prefix}/bin,${ossec_prefix}/active-response"
19
ossec_syscheck_etc_dirs="${ossec_prefix}/etc"
20
21
replace() {
22
    sed -e 's|<template_config \(.*\)>|<agent_config \1>|' \
23
        -e 's|</template_config>|</agent_config>|' \
24
        -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \
25
        -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \
26
        "${ossec_file}"
27
}
28
29
extract() {
30
    sed -n '/^<agent_config .*>$/,/^<\/agent_config>$/p'
31
}
32
33
replace | extract
(-)security/ossec-hids-local-config/scripts/template-to-ossec.sh (+45 lines)
Line 0 Link Here
1
#!/bin/sh
2
3
if [ $# -lt 3 ]; then
4
    echo "Too few arguments"
5
    echo "Usage: `basename $0` <ossec_type> <ossec_prefix> <ossec_file>"
6
    exit 1
7
fi
8
9
ossec_type="$1"
10
ossec_prefix="$2"
11
ossec_file="$3"
12
13
if [ ! -f "${ossec_file}" ]; then
14
    echo "File \"${ossec_file}\" does not exist"
15
    exit 1
16
fi
17
18
ossec_syscheck_bin_dirs="${ossec_prefix}/bin,${ossec_prefix}/active-response"
19
ossec_syscheck_etc_dirs="${ossec_prefix}/etc"
20
if [ "${ossec_type}" != "agent" ]; then
21
    ossec_syscheck_bin_dirs="${ossec_syscheck_bin_dirs},${ossec_prefix}/agentless"
22
    ossec_syscheck_etc_dirs="${ossec_syscheck_etc_dirs},${ossec_prefix}/rules"
23
fi
24
25
replace() {
26
    if grep -q "<template_config>" "${ossec_file}"; then
27
        sed -e 's|<template_config>|<ossec_config>|' \
28
            -e 's|</template_config>|</ossec_config>|' \
29
            -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \
30
            -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \
31
            "${ossec_file}"
32
    else
33
        sed -e 's|<template_config .*os="FreeBSD".*>|<ossec_config>|' \
34
            -e 's|</template_config>|</ossec_config>|' \
35
            -e "s|%%OSSEC_SYSCHECK_BIN_DIRS%%|${ossec_syscheck_bin_dirs}|" \
36
            -e "s|%%OSSEC_SYSCHECK_ETC_DIRS%%|${ossec_syscheck_etc_dirs}|" \
37
            "${ossec_file}"
38
    fi
39
}
40
41
extract() {
42
    sed -n '/^<ossec_config.*>$/,/^<\/ossec_config>$/p'
43
}
44
45
replace | extract
(-)security/ossec-hids-server/Makefile (-144 / +3 lines)
Lines 1-148 Link Here
1
# Created by: Valerio Daelli <valerio.daelli@gmail.com>
2
# $FreeBSD$
1
# $FreeBSD$
3
2
4
PORTNAME=	ossec-hids
3
OSSEC_TYPE=	server
5
PORTVERSION=	2.8.3
6
DISTVERSIONPREFIX=	v
7
PORTREVISION?=	3
8
CATEGORIES=	security
9
PKGNAMESUFFIX=	-server
10
4
11
MAINTAINER=	dominik.lisiak@bemsoft.pl
5
MASTERDIR=	${.CURDIR}/../ossec-hids-local
12
COMMENT?=	Security tool to monitor and check logs and intrusions
13
6
14
USE_GITHUB=	yes
7
.include "${MASTERDIR}/Makefile"
15
GH_ACCOUNT=	ossec
16
USE_RC_SUBR=	ossec-hids
17
18
CFLAGS+=	-ferror-limit=0
19
20
USES=		readline ssl
21
22
.if defined(MAINTAINER_MODE)
23
UID_FILES+=	../../UIDs
24
GID_FILES+=	../../GIDs
25
.endif
26
USERS=		ossec ossecm ossecr
27
GROUPS=		ossec
28
29
.if !defined(CLIENT_ONLY)
30
OPTIONS_DEFINE=	MYSQL PGSQL
31
32
MYSQL_VARS=	WITH_DB=yes
33
MYSQL_USE=	MYSQL=client
34
MYSQL_PORTDOCS=	mysql.schema
35
36
PGSQL_VARS=	WITH_DB=yes
37
PGSQL_USES=	pgsql
38
PGSQL_PORTDOCS=	postgresql.schema
39
40
RUN_DEPENDS=	expect:lang/expect
41
42
USES+=		shebangfix
43
SHEBANG_LANG=	expect
44
expect_OLD_CMD=	"/usr/bin/env expect"
45
expect_CMD=	${LOCALBASE}/bin/expect
46
SHEBANG_FILES=	src/agentlessd/scripts/main.exp \
47
		src/agentlessd/scripts/ssh.exp \
48
		src/agentlessd/scripts/ssh_asa-fwsmconfig_diff \
49
		src/agentlessd/scripts/ssh_foundry_diff \
50
		src/agentlessd/scripts/ssh_generic_diff \
51
		src/agentlessd/scripts/ssh_integrity_check_bsd \
52
		src/agentlessd/scripts/ssh_integrity_check_linux \
53
		src/agentlessd/scripts/ssh_nopass.exp \
54
		src/agentlessd/scripts/ssh_pixconfig_diff \
55
		src/agentlessd/scripts/sshlogin.exp \
56
		src/agentlessd/scripts/su.exp
57
.endif
58
OPTIONS_DEFINE+=	DOCS
59
60
SUB_LIST=	PORTNAME=${PORTNAME}
61
SUB_FILES=	pkg-message
62
PLIST_SUB=	PORTNAME=${PORTNAME}
63
DOCSFILES=	BUGS CONFIG CONTRIBUTORS INSTALL LICENSE
64
PORTDOCS=	${DOCSFILES}
65
66
BROKEN_aarch64=		Fails to compile: error: use of undeclared identifier __LDPGSZ
67
68
.include <bsd.port.pre.mk>
69
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
71
.if defined(CLIENT_ONLY)
72
SUB_LIST+=	PRECMD=:
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
85
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}|' \
89
		-e 's|-lreadline|& ${LDFLAGS}|' \
90
		${WRKSRC}/src/external/lua-5.2.3/src/Makefile
91
	@${REINPLACE_CMD} -e 's|OPENSSLCMD=|OPENSSLCMD=-L${OPENSSLLIB} |' \
92
		${WRKSRC}/src/Makeall
93
94
do-build:
95
.if defined(WITH_DB)
96
.if defined(CLIENT_ONLY)
97
	@cd ${WRKSRC}/src;${MAKE} setagent;${MAKE} all;${MAKE} build
98
.elif defined(LOCAL_ONLY)
99
	@cd ${WRKSRC}/src;${MAKE} setlocal;${MAKE} setdb;${MAKE} all;${MAKE} build
100
.else
101
	@cd ${WRKSRC}/src;${MAKE} setdb;${MAKE} all;${MAKE} build
102
.endif
103
.else
104
.if defined(CLIENT_ONLY)
105
	@cd ${WRKSRC}/src;${MAKE} setagent;${MAKE} all;${MAKE} build; \
106
		${MAKE} unsetdb
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
113
.endif
114
115
do-install:
116
.if defined(CLIENT_ONLY)
117
	@cd ${WRKSRC}/src; ${MAKE} agent
118
.elif defined(LOCAL_ONLY)
119
	@cd ${WRKSRC}/src; ${MAKE} local
120
.else
121
	@cd ${WRKSRC}/src; ${MAKE} server
122
.endif
123
	@${MKDIR} ${STAGEDIR}${PREFIX}/${PORTNAME}/etc
124
.for file in ${STRIP_FILES}
125
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/ossec-hids/bin/${file}
126
.endfor
127
128
.if defined(CLIENT_ONLY)
129
	@${CP} ${WRKSRC}/etc/ossec-agent.conf ${STAGEDIR}${PREFIX}/${PORTNAME}/etc/ossec.conf.sample
130
.elif defined(LOCAL_ONLY)
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
135
136
post-install-DOCS-on:
137
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
138
	@cd ${WRKSRC} && ${INSTALL_DATA} ${DOCSFILES} ${STAGEDIR}${DOCSDIR}
139
140
post-install-MYSQL-on:
141
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
142
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/mysql.schema ${STAGEDIR}${DOCSDIR}
143
144
post-install-PGSQL-on:
145
	@${MKDIR} ${STAGEDIR}${DOCSDIR}
146
	@cd ${WRKSRC} && ${INSTALL_DATA} src/os_dbd/postgresql.schema ${STAGEDIR}${DOCSDIR}
147
148
.include <bsd.port.post.mk>
(-)security/ossec-hids-server/distinfo (-2 lines)
Lines 1-2 Link Here
1
SHA256 (ossec-ossec-hids-v2.8.3_GH0.tar.gz) = 917989e23330d18b0d900e8722392cdbe4f17364a547508742c0fd005a1df7dd
2
SIZE (ossec-ossec-hids-v2.8.3_GH0.tar.gz) = 1642095
(-)security/ossec-hids-server/files/ossec-hids.in (-65 lines)
Lines 1-65 Link Here
1
#!/bin/sh
2
# 
3
# PROVIDE: ossechids
4
# REQUIRE: DAEMON
5
# BEFORE:  LOGIN
6
# KEYWORD: shutdown
7
8
. /etc/rc.subr
9
10
name="ossechids"
11
rcvar=ossechids_enable
12
13
load_rc_config $name
14
15
: ${ossechids_enable="NO"}
16
: ${ossechids_user="ossec"}
17
: ${ossechids_group="ossec"}
18
19
start_precmd=%%PRECMD%%
20
start_cmd="ossechids_command start"
21
stop_cmd="ossechids_command stop"
22
restart_cmd="ossechids_command restart"
23
status_cmd="ossechids_command status"
24
reload_cmd="ossechids_command reload"
25
26
command="%%PREFIX%%/%%PORTNAME%%/bin/ossec-control"
27
required_files="%%PREFIX%%/%%PORTNAME%%/etc/ossec.conf"
28
extra_commands="reload"
29
30
fts_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/fts-queue
31
ig_queue=%%PREFIX%%/%%PORTNAME%%/queue/fts/ig-queue
32
ossec_log=%%PREFIX%%/%%PORTNAME%%/logs/ossec.log
33
active_responses_log=%%PREFIX%%/%%PORTNAME%%/logs/active-responses.log
34
35
ossechids_start_precmd() {
36
    # These files are not created by the daemons with the correct
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
45
    if [ ! -e ${ig_queue} ]; then
46
        touch ${ig_queue}
47
        chown ${ossechids_user}:${ossechids_group} ${ig_queue}
48
        chmod 640 ${ig_queue}
49
    fi
50
51
    # Ensure logfiles are created with the correct ownership and mode
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
}
60
61
ossechids_command() {
62
	${command} ${rc_arg}
63
}
64
65
run_rc_command "$1"
(-)security/ossec-hids-server/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
 
(-)security/ossec-hids-server/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
 
(-)security/ossec-hids-server/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"
(-)security/ossec-hids-server/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
 
(-)security/ossec-hids-server/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
 
(-)security/ossec-hids-server/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
 
(-)security/ossec-hids-server/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.
(-)security/ossec-hids-server/pkg-descr (-6 lines)
Lines 1-6 Link Here
1
OSSEC is an Open Source Host-based Intrusion Detection System.
2
It performs log analysis, integrity checking, Windows registry
3
monitoring, rootkit detection, time-based alerting and active
4
response.
5
6
WWW: http://www.ossec.net/
(-)security/ossec-hids-server/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%%
(-)security/ossec-hids-server-config/Makefile (+7 lines)
Line 0 Link Here
1
# $FreeBSD$
2
3
OSSEC_TYPE=	server
4
5
MASTERDIR=	${.CURDIR}/../ossec-hids-local-config
6
7
.include "${MASTERDIR}/Makefile"

Return to bug 232794