forked from openbsm/bsmtrace
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbsmtrace.conf
201 lines (181 loc) · 2.93 KB
/
bsmtrace.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
#
# Define our logging channels
#
log-channel $syslog <syslog> {
priority user.notice;
};
log-channel $bsm <bsm> {
directory "/usr/bsm";
};
define set $my_log_channels <logchannel> {
$bsm,
$syslog;
};
#
# Define subject (or user) groupings
#
define set $fwadmins <auid> {
alm,
csjp;
};
#
# Define various event groups that we are interested in
#
define set $execution <auditevent> {
AUE_EXEC,
AUE_EXECVE;
};
define set $login <auditevent> {
AUE_openssh,
AUE_login,
AUE_su;
};
#
# Define our object (or file) groups
#
define set $trusteddirs <path> {
/bin,
/sbin,
/usr/bin,
/usr/sbin,
/usr/local/bin,
/usr/X11R6/bin,
/usr/local/sbin,
/usr/games;
};
define set $opendirs <path> {
/tmp,
/var/tmp;
};
define set $fwtools <path> {
/sbin/ipfw,
/sbin/pfctl,
/sbin/ipf;
};
############################################################
#
# Define our state machines or actual "IDS signatures"
#
############################################################
#
#
# XXX add a sequence which detects system accounts executing code
#
#
sequence firewall.change.attempt {
subject not $fwadmins;
state {
event $execution;
object $fwtools;
status any;
};
};
sequence non.trusted.exec {
subject any;
state {
event $execution;
object not $trusteddirs;
trigger "/usr/bin/logger non.trusted.exec: $subject executed $object";
status success;
};
};
sequence mktemp.race {
subject any;
state {
event <auditevent> { AUE_SYMLINK; };
object $opendirs;
status success;
};
};
sequence login.brute.force {
subject any;
log <logchannel> { $bsm; };
state {
event $login;
status failure;
multiplier 2;
};
state {
event $login;
status success;
};
};
sequence httpd.exec {
subject <auid> { nobody; };
state {
event <auditevent> { AUE_SOCKET; };
status success;
};
state {
event <auditevent> { AUE_BIND; };
status success;
};
state {
event $execution;
status any;
};
};
sequence named.exec {
subject <auid> { bind; };
scope process;
state {
event <auditevent> { AUE_SOCKET; };
status success;
};
state {
event <auditevent> { AUE_BIND; };
status success;
};
state {
event $execution;
status any;
};
};
sequence failed.file.write {
subject <auid> { csjp; };
state {
event <auditclass> { fw; };
status failure;
};
};
#
# This is a comment
#
sequence five.config.file.read {
subject <auid> { csjp; };
serial 2343445445;
timeout 60 seconds;
scope global;
priority 100;
state {
event <auditclass> { fr; };
status any;
object <path> { /etc; };
trigger "/usr/bin/logger config file read";
multiplier 5;
};
};
sequence passwd.access {
subject any;
state {
event <auditclass> { fr; };
status any;
object <pcre> { /etc/pass[Ww][Dd]; };
multiplier 5;
};
};
sequence etc.access {
subject any;
state {
event <auditclass> { fr; };
status any;
object <pcre> { /[Ee][Tt][Cc]/*; };
};
};
sequence coredump {
subject any;
state {
event <auditevent> { AUE_CORE; };
status any;
};
};