forked from cisagov/icsnpp-enip
-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.bif
397 lines (370 loc) · 21.1 KB
/
events.bif
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
## events.bif
##
## Binpac Ethernet/IP (ENIP) Analyzer - Defines events the analyzer will generate
##
## Author: Stephen Kleinheider
## Contact: stephen.kleinheider@inl.gov
##
## Copyright (c) 2023 Battelle Energy Alliance, LLC. All rights reserved.
###################################################################################################
####################################### LOGGED BY DEFAULT #######################################
###################################################################################################
## ------------------------------------------enip-header-------------------------------------------
## Event Description:
## Event is generated for all Ethernet/IP packets and contains relevant ENIP header data
## Event Data:
## - c: connection -> Zeek Connection Struct
## - command: count -> Ethernet/IP Command (see enip_commands in consts.zeek)
## - length: count -> Length of ENIP data following header
## - session_handle: count -> Session Identifier (session handle)
## - status: count -> Status Code (see enip_statuses in consts.zeek)
## - sender_context string -> Sender Context (used to match request and responses)
## - options: count -> Options flags
## Default Output:
## Writes to log file enip.log
## ------------------------------------------------------------------------------------------------
event enip_header%(c: connection,
is_orig: bool,
command: count,
length: count,
session_handle: count,
status: count,
sender_context: string,
options: count%);
## -------------------------------------------cip-header-------------------------------------------
## Event Description:
## Event is generated for all CIP packets and contains relevant CIP header data
## Event Data:
## - c: connection -> Zeek Connection Struct
## - cip_sequence_count: count -> CIP sequence number for transport (connected data only)
## - service: count -> CIP Service Type (see cip_services in consts.zeek)
## - response: bool -> Request or Response boolean
## - status: count -> CIP Status Code (see cip_statuses in consts.zeek)
## - status_extended: count -> CIP Status Code (see cip_extended_statuses in consts.zeek)
## - class_id count -> CIP Request Path - Class ID
## - instance_id count -> CIP Request Path - Instance ID
## - attribute_id count -> CIP Request Path - Attribute ID
## Default Output:
## Writes to log file cip.log
## ------------------------------------------------------------------------------------------------
event cip_header%(c: connection,
is_orig: bool,
cip_sequence_count: count,
service: count,
response: bool,
status: count,
status_extended: count,
class_id: count,
instance_id: count,
attribute_id: count%);
## ------------------------------------------cip-identity------------------------------------------
## Event Description:
## Event is generated for packets that include a CIP_Identity in a ListServices response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - encapsulation_version:count -> Encapsulation Protocol Version supported
## - socket_address: count -> Socket Address IP Address
## - socket_port: count -> Socket Address Port
## - vendor_id: count -> Vendor ID (see cip_vendors in consts.zeek)
## - device_type: count -> Device type (see cip_device_types in consts.zeek)
## - product_code: count -> Product code assigned to device
## - revision_major: count -> Device revision (major)
## - revision_minor: count -> Device revision (minor)
## - status: count -> Current status of device (see cip_statuses in consts.zeek)
## - serial_number: count -> Serial number of device
## - product_name: string -> Human readable description of device
## - state: count -> Current state of the device
## Default Output:
## Writes to log file cip_identity.log
## ------------------------------------------------------------------------------------------------
event cip_identity%(c: connection,
is_orig: bool,
encapsulation_version: count,
socket_address: count,
socket_port: count,
vendor_id: count,
device_type: count,
product_code: count,
revision_major: count,
revision_minor: count,
status: count,
serial_number: count,
product_name: string,
state: count%);
## ---------------------------------------------cip-io---------------------------------------------
## Event Description:
## Event is generated for all CIP IO packets
## Event Data:
## - c: connection -> Zeek Connection Struct
## - connection_identifier:count -> Connection Identifier
## - sequence_number: count -> Sequence Number within Connection
## - data_length: count -> Length of data field
## - data: count -> CIP IO data
## Default Output:
## Writes to log file cip_io.log
## ------------------------------------------------------------------------------------------------
event cip_io%(c: connection,
is_orig: bool,
connection_identifier: count,
sequence_number: count,
data_length: count,
data: string%);
###################################################################################################
################################### END OF LOGGED BY DEFAULT ####################################
###################################################################################################
###################################################################################################
##################################### NOT LOGGED BY DEFAULT #####################################
###################################################################################################
## ----------------------------------------register-session----------------------------------------
## Event Description:
## Event is generated for ENIP register_session commands
## Event Data:
## - c: connection -> Zeek Connection Struct
## - protocol_version: count -> Version of Protocol (currently 1)
## - options_flags: count -> Options Flag (no public options defined)
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event register_session%(c: connection,
is_orig: bool,
protocol_version: count,
options_flags: count%);
## ------------------------------------------cip-security------------------------------------------
## Event Description:
## Event is generated for packets that include a CIP_Security_Item in a ListServices response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - security_profile: count -> CIP Security Profiles supported
## - cip_security_state: count -> Current state of CIP Security Object
## - enip_security_state: count -> Current state of ENIP Security Object
## - iana_port_state: count -> Current state for ENIP related ports
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event cip_security%(c: connection,
is_orig: bool,
security_profile: count,
cip_security_state: count,
enip_security_state: count,
iana_port_state: count%);
## ----------------------------------------enip-capability-----------------------------------------
## Event Description:
## Event is generated for packets that include a ENIP_Capability_Item in a ListServices response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - enip_profile: count -> Features supported for ENIP transport
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event enip_capability%(c: connection,
is_orig: bool,
enip_profile: count%);
## ------------------------------------------enip-service------------------------------------------
## Event Description:
## Event is generated for packets that include a Service_Item in a ListServices response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - protocol_version: count -> Version of Protocol (currently 1)
## - capability_flags: count -> Capability Flags
## - service_name: string -> Name of Service
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event enip_service%(c: connection,
is_orig: bool,
protocol_version: count,
capability_flags: count,
service_name: string%);
## ---------------------------------------connected-address----------------------------------------
## Event Description:
## Event is generated for packets that include a Connected_Address_Item
## Event Data:
## - c: connection -> Zeek Connection Struct
## - connection_id: count -> Connection Identifier
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event connected_address%(c: connection,
is_orig: bool,
connection_id: count%);
## ---------------------------------------sequenced-address----------------------------------------
## Event Description:
## Event is generated for packets that include a Sequenced_Address_Item
## Event Data:
## - c: connection -> Zeek Connection Struct
## - connection_id: count -> Connection Identifier
## - encap_sequence_num: count -> Encapsulation Sequence Number
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event sequenced_address%(c: connection,
is_orig: bool,
connection_id: count,
encap_sequence_num: count%);
## ------------------------------------unconnected-message-dtls------------------------------------
## Event Description:
## Event is generated for packets that include a Unconnected_Message_DTLS
## Event Data:
## - c: connection -> Zeek Connection Struct
## - unconn_message_type: count -> Type of unconnected message
## - transaction_number: count -> Transaction number for for request/reply matching
## - status: count -> Status (see enip_statuses in consts.zeek)
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event unconnected_message_dtls%(c: connection,
is_orig: bool,
unconn_message_type: count,
transaction_number: count,
status: count%);
## --------------------------------------socket-address-info---------------------------------------
## Event Description:
## Event is generated for packets that include a Socket_Address_Info_Item
## Event Data:
## - c: connection -> Zeek Connection Struct
## - socket_address: count -> Socket Address IP address
## - socket_port: count -> Socket Address Port Number
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event socket_address_info%(c: connection,
is_orig: bool,
socket_address: count,
socket_port: count%);
## -----------------------------------get-attribute-all-response-----------------------------------
## Event Description:
## Event is generated for CIP service Get_Attributes_All_Response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_data: string -> Attribute data based on instance/class
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event get_attribute_all_response%(c: connection,
is_orig: bool,
attribute_data: string%);
## -----------------------------------set-attribute-all-request------------------------------------
## Event Description:
## Event is generated for CIP service Set_Attributes_All_Request
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_data: string -> Attribute data based on instance/class
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event set_attribute_all_request%(c: connection,
is_orig: bool,
attribute_data: string%);
## -----------------------------------get-attribute-list-request-----------------------------------
## Event Description:
## Event is generated for CIP service Get_Attribute_List_Request
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_count: count -> Number of attribute IDs in list
## - attributes: string -> List of attribute IDs
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event get_attribute_list_request%(c: connection,
is_orig: bool,
attribute_count: count,
attributes: string%);
## ----------------------------------get-attribute-list-response-----------------------------------
## Event Description:
## Event is generated for CIP service Get_Attribute_List_Response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_count: count -> Number of attribute structs
## - attributes: string -> Struct of attribute responses
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event get_attribute_list_response%(c: connection,
is_orig: bool,
attribute_count: count,
attributes: string%);
## -----------------------------------set-attribute-list-request-----------------------------------
## Event Description:
## Event is generated for CIP service Set_Attribute_List_Request
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_count: count -> Number of attribute structs
## - attributes: string -> Struct of attribute responses
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event set_attribute_list_request%(c: connection,
is_orig: bool,
attribute_count: count,
attributes: string%);
## ----------------------------------set-attribute-list-response-----------------------------------
## Event Description:
## Event is generated for CIP service Set_Attribute_List_Response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_count: count -> Number of attribute structs
## - attributes: string -> Struct of attribute responses
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event set_attribute_list_response%(c: connection,
is_orig: bool,
attribute_count: count,
attributes: string%);
## ------------------------------------multiple-service-request------------------------------------
## Event Description:
## Event is generated for CIP service Multiple_Service_Packet_Request
## Event Data:
## - c: connection -> Zeek Connection Struct
## - service_count: count -> Number of services included in command
## - services: string -> Comma delimited list of services included
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event multiple_service_request%(c: connection,
is_orig: bool,
service_count: count,
services: string%);
## -----------------------------------multiple-service-response------------------------------------
## Event Description:
## Event is generated for CIP service Multiple_Service_Packet_Response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - service_count: count -> Number of services included in command
## - services: string -> Comma delimited list of services included
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event multiple_service_response%(c: connection,
is_orig: bool,
service_count: count,
services: string%);
## ---------------------------------get-attribute-single-response----------------------------------
## Event Description:
## Event is generated for CIP service Get_Attribute_Single_Response
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_value: string -> Attribute data based on instance/class
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event get_attribute_single_response%(c: connection,
is_orig: bool,
attribute_value: string%);
## ----------------------------------set-attribute-single-request----------------------------------
## Event Description:
## Event is generated for CIP service Set_Attribute_Single_Request
## Event Data:
## - c: connection -> Zeek Connection Struct
## - attribute_id: count -> Identifies the attribute
## - attribute_value: string -> Attribute data based on instance/class
## Default Output:
## No defined log in main.zeek by default
## ------------------------------------------------------------------------------------------------
event set_attribute_single_request%(c: connection,
is_orig: bool,
attribute_id: count,
attribute_value: string%);
###################################################################################################
################################# END OF NOT LOGGED BY DEFAULT ##################################
###################################################################################################