-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathssh.yaml
More file actions
287 lines (247 loc) · 7.15 KB
/
Copy pathssh.yaml
File metadata and controls
287 lines (247 loc) · 7.15 KB
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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
version: 1
log_family: ssh
pipeline:
classifier:
strategy: aho_corasick
fallback: generic_parser
signatures:
- id: ssh_success
contains:
- "Accepted password for"
- "Accepted publickey for"
- id: ssh_failed
contains:
- "Failed password for"
- "Failed publickey for"
- id: ssh_invalid_user
contains:
- "Invalid user"
- "Illegal user"
- id: ssh_disconnect
contains:
- "Received disconnect"
- id: ssh_connection_closed
contains:
- "Connection closed"
- id: ssh_session_opened
contains:
- "session opened for user"
- id: ssh_session_closed
contains:
- "session closed for user"
- id: ssh_pam_auth_failure
contains:
- "pam_unix(sshd:auth): authentication failure"
- id: ssh_reverse_dns_failure
contains:
- "POSSIBLE BREAK-IN ATTEMPT"
- id: ssh_connection_reset
contains:
- "Connection reset by"
- id: ssh_no_identification
contains:
- "Did not receive identification string"
- id: ssh_protocol_violation
contains:
- "Bad protocol version identification"
- id: ssh_max_auth_attempts
contains:
- "maximum authentication attempts exceeded"
- id: ssh_negotiation_failure
contains:
- "Unable to negotiate"
- id: ssh_banner_exchange
contains:
- "banner exchange"
specialized_parsers:
ssh_success:
strategy: dissect
patterns:
- "Accepted %{?method} for %{user.name:notspace} from %{source.ip:ip} port %{source.port:int}"
ecs:
static:
event.dataset: ssh
event.category: authentication
event.action: login
event.outcome: success
event.type_id: ssh_success
ssh_failed:
strategy: dissect
patterns:
# Most specific first: "Failed password for invalid user X from ..."
# %{?prefix} swallows "invalid user " / "illegal user " / nothing
- "Failed %{?method} for %{?prefix}%{user.name:notspace} from %{source.ip:ip} port %{source.port:int} %{?proto}"
ecs:
static:
event.dataset: ssh
event.category: authentication
event.action: login
event.outcome: failure
event.type_id: ssh_failed
ssh_invalid_user:
strategy: dissect
patterns:
# Handles: Invalid/Illegal/Unknown user X from Y
- "%{?adjective} user %{user.name:notspace} from %{source.ip:ip}"
ecs:
static:
event.dataset: ssh
event.category: authentication
event.action: login
event.outcome: failure
event.reason: invalid_user
event.type_id: ssh_invalid_user
ssh_disconnect:
strategy: dissect
patterns:
- "Received disconnect from %{source.ip:ip} port %{source.port:int}:%{?reason}"
- "Received disconnect from %{source.ip:ip}:%{?reason}"
ecs:
static:
event.dataset: ssh
event.action: disconnect
event.type_id: ssh_disconnect
ssh_connection_closed:
strategy: dissect
patterns:
- "Connection closed by %{?prefix}%{source.ip:ip} port %{source.port:int}"
- "Connection closed by %{?prefix}%{source.ip:ip}"
ecs:
static:
event.dataset: ssh
event.action: connection_closed
event.type_id: ssh_connection_closed
ssh_session_opened:
strategy: dissect
patterns:
- "session opened for user %{user.name:notspace}(%{?rest}"
- "session opened for user %{user.name:notspace}"
ecs:
static:
event.dataset: ssh
event.category: session
event.type: start
event.type_id: ssh_session_opened
ssh_session_closed:
strategy: dissect
patterns:
- "session closed for user %{user.name:notspace}"
ecs:
static:
event.dataset: ssh
event.category: session
event.type: end
event.type_id: ssh_session_closed
ssh_pam_auth_failure:
strategy: dissect
patterns:
- "%{?head}rhost=%{source.ip:notspace} %{?mid}user=%{user.name:notspace}"
- "%{?head}rhost=%{source.ip:notspace}"
ecs:
static:
event.dataset: ssh
event.category: authentication
event.action: login
event.outcome: failure
event.reason: pam_auth_failure
event.type_id: ssh_pam_auth_failure
ssh_reverse_dns_failure:
strategy: dissect
patterns:
- "%{?head}[%{source.ip:ip}]%{?tail}"
ecs:
static:
event.dataset: ssh
event.category: network
event.action: reverse_dns_lookup
event.outcome: failure
event.type_id: ssh_reverse_dns_failure
threat.indicator: true
threat.type: network
ssh_connection_reset:
strategy: dissect
patterns:
- "Connection reset by %{source.ip:ip} port %{source.port:int}"
- "Connection reset by %{source.ip:ip}"
ecs:
static:
event.dataset: ssh
event.category: network
event.action: connection_reset
event.type_id: ssh_connection_reset
ssh_no_identification:
strategy: dissect
patterns: []
ecs:
static:
event.dataset: ssh
event.category: network
event.action: identification_failure
event.type_id: ssh_no_identification
ssh_protocol_violation:
strategy: dissect
patterns: []
ecs:
static:
event.dataset: ssh
event.category: network
event.action: protocol_violation
event.outcome: failure
event.type_id: ssh_protocol_violation
ssh_max_auth_attempts:
strategy: dissect
patterns: []
ecs:
static:
event.dataset: ssh
event.category: authentication
event.action: login
event.outcome: failure
event.reason: max_auth_attempts
event.type_id: ssh_max_auth_attempts
ssh_negotiation_failure:
strategy: dissect
patterns: []
ecs:
static:
event.dataset: ssh
event.category: network
event.action: negotiation_failure
event.outcome: failure
event.type_id: ssh_negotiation_failure
ssh_banner_exchange:
strategy: dissect
patterns: []
ecs:
static:
event.dataset: ssh
event.category: network
event.action: banner_exchange
event.type_id: ssh_banner_exchange
generic_parser:
enabled: true
strategy: regex
patterns:
- name: generic_sshd
regex: 'sshd\[(?P<pid>\d+)\]: (?P<message>.*)'
ecs:
pid: process.pid
message: message
raw_ingestion:
enabled: true
preserve_original: true
fields:
- event.original
- message
- host.name
- process.name
- process.pid
syslog:
bsd_format:
timestamp_fields: 3
hostname_offset: 3
process_offset: 4
iso_format:
timestamp_fields: 1
hostname_offset: 1
process_offset: 2