-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathschema.json
More file actions
612 lines (612 loc) · 19.5 KB
/
schema.json
File metadata and controls
612 lines (612 loc) · 19.5 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
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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Version",
"description": "Event is the complete structure that Polycorder (Polyverse-hosted zero-day detection service) understands. This structure is also the reference schema/format for all detect-efforts.\n\nAs such, it is encouraged to have many detectors that emit data in this structure.\n\nDifferent implementations of the structure may very. Various fields may come or go.\n\nAll parsers are encouraged to first test the \"Version\" field and then parse the correct structure. The field `version` is guaranteed to exist on ALL versions and instances of Event. Any structure/data that does not contain the version field, is considered invalid.",
"anyOf": [
{
"description": "Version is guaranteed to exist. All other fields may change or not exist, and it is recommended to use a different version when making breaking changes to all other fields. It allows parsers to test on version and determine if they know what to do with the rest. For this particular variant, set DeviceVersion to a fixed value \"V1\"",
"type": "object",
"required": [
"event",
"timestamp",
"version"
],
"properties": {
"event": {
"description": "Platform records fields specific to a specific mechanism/platform.",
"allOf": [
{
"$ref": "#/definitions/EventType"
}
]
},
"hostname": {
"type": [
"string",
"null"
]
},
"timestamp": {
"description": "This is universal and important for all events. They occur at a time.",
"type": "string",
"format": "date-time"
},
"version": {
"type": "string",
"enum": [
"V1"
]
}
}
}
],
"definitions": {
"EventType": {
"description": "The Platform this event originated on.",
"anyOf": [
{
"description": "An analytics-detected internal event based on other events",
"type": "object",
"required": [
"justification",
"message",
"procname",
"register",
"type"
],
"properties": {
"justification": {
"description": "The raw events which justify this analytics event.",
"allOf": [
{
"$ref": "#/definitions/RegisterProbeJustification"
}
]
},
"message": {
"description": "What does this probe mean? What interpretation could this particular register probe have?",
"type": "string"
},
"procname": {
"type": "string"
},
"register": {
"description": "Which register was being probed?",
"type": "string"
},
"type": {
"type": "string",
"enum": [
"RegisterProbe"
]
}
}
},
{
"description": "The Linux platform and event details in the Linux context A Kernel Trap event - the kernel stops process execution for attempting something stupid",
"type": "object",
"required": [
"errcode",
"facility",
"ip",
"level",
"pid",
"procname",
"sp",
"trap",
"type"
],
"properties": {
"errcode": {
"description": "The error code for the trap",
"allOf": [
{
"$ref": "#/definitions/SegfaultErrorCode"
}
]
},
"facility": {
"description": "A Log-facility - most OSes would have one, but this is Linux-specific for now",
"allOf": [
{
"$ref": "#/definitions/LogFacility"
}
]
},
"file": {
"description": "(Optional) File in which the trap occurred (could be the main executable or library).",
"type": [
"string",
"null"
]
},
"ip": {
"description": "Instruction Pointer (what memory address was executing)",
"type": "integer",
"format": "uint",
"minimum": 0.0
},
"level": {
"description": "The type of kernel trap triggered A Log-level for this event - was it critical?",
"allOf": [
{
"$ref": "#/definitions/LogLevel"
}
]
},
"pid": {
"description": "Process ID",
"type": "integer",
"format": "uint",
"minimum": 0.0
},
"procname": {
"description": "Name of the process in which the trap occurred",
"type": "string"
},
"sp": {
"description": "Stack Pointer",
"type": "integer",
"format": "uint",
"minimum": 0.0
},
"trap": {
"$ref": "#/definitions/KernelTrapType"
},
"type": {
"type": "string",
"enum": [
"LinuxKernelTrap"
]
},
"vmasize": {
"description": "(Optional) The Virtual Memory Size of this file's mapping.",
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0.0
},
"vmastart": {
"description": "(Optional) The Virtual Memory Address where this file (main executable or library) was mapped (with ASLR could be arbitrary).",
"type": [
"integer",
"null"
],
"format": "uint",
"minimum": 0.0
}
}
},
{
"description": "A Fatal Signal from the process because the process did something stupid",
"type": "object",
"required": [
"facility",
"level",
"signal",
"stack_dump",
"type"
],
"properties": {
"facility": {
"description": "A Log-facility - most OSes would have one, but this is Linux-specific for now",
"allOf": [
{
"$ref": "#/definitions/LogFacility"
}
]
},
"level": {
"description": "A Log-level for this event - was it critical?",
"allOf": [
{
"$ref": "#/definitions/LogLevel"
}
]
},
"signal": {
"description": "The type of Fatal triggered",
"allOf": [
{
"$ref": "#/definitions/FatalSignalType"
}
]
},
"stack_dump": {
"description": "An Optional Stack Dump if one was found and parsable. Do not place these in CEF format since ArcSight/Microfocus needs explicit field mappings. No telling what a real dump of registers/values might be contained here. Best to be safe. If you care about these values, use JSON/Text logging.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"type": {
"type": "string",
"enum": [
"LinuxFatalSignal"
]
}
}
},
{
"description": "Information about a suppressed callback i.e. when a particular type of error happens so much it is suppressed 'n' times.\n\nThis captures what the log was, and how many times it was suppressed.\n\nThis is a crucial data point because under Blind ROP attacks an error might happen thousands of times but may only be logged once, with all the remaining attempts being suppressed.",
"type": "object",
"required": [
"count",
"facility",
"function_name",
"level",
"type"
],
"properties": {
"count": {
"description": "Number of times it was suppressed.",
"type": "integer",
"format": "uint",
"minimum": 0.0
},
"facility": {
"description": "A Log-facility - most OSes would have one, but this is Linux-specific for now",
"allOf": [
{
"$ref": "#/definitions/LogFacility"
}
]
},
"function_name": {
"description": "Name of the function being suppressed/folded.",
"type": "string"
},
"level": {
"description": "A Log-level for this event - was it critical?",
"allOf": [
{
"$ref": "#/definitions/LogLevel"
}
]
},
"type": {
"type": "string",
"enum": [
"LinuxSuppressedCallback"
]
}
}
},
{
"description": "This is a zerotect-internal event. zerotect can be commanded to set and ensure certain configuration settings to capture events, such as enabling kernel fatal-signals, or core dumps.\n\nThis event is triggered when, after zerotect has configured a machine as commanded, the configuration later mismatched. It means someone attempted to undo those changes.\n\nThis event usually tells an observer they may not be seeing other events because they may be disabled.",
"type": "object",
"required": [
"expected_value",
"key",
"observed_value",
"type"
],
"properties": {
"expected_value": {
"description": "The value zerotect configured and thus expected.",
"type": "string"
},
"key": {
"description": "The key in question whose values mismatched.",
"type": "string"
},
"observed_value": {
"description": "The value zerotect observed.",
"type": "string"
},
"type": {
"type": "string",
"enum": [
"ConfigMismatch"
]
}
}
}
]
},
"FatalSignalType": {
"description": "The type of Fatal Signal detected Comprehensive list of POSIX signals in the linux kernel can be found int he kernel source tree: https://github.com/torvalds/linux/blob/master/include/linux/signal.h#L339\n\nA bit more detail may be found in the man-pages: http://man7.org/linux/man-pages/man7/signal.7.html",
"type": "string",
"enum": [
"SIGHUP",
"SIGINT",
"SIGQUIT",
"SIGILL",
"SIGTRAP",
"SIGIOT",
"SIGBUS",
"SIGFPE",
"SIGKILL",
"SIGUSR1",
"SIGSEGV",
"SIGUSR2",
"SIGPIPE",
"SIGALRM",
"SIGTERM",
"SIGSTKFLT",
"SIGCHLD",
"SIGCONT",
"SIGSTOP",
"SIGTSTP",
"SIGTTIN",
"SIGTTOU",
"SIGURG",
"SIGXCPU",
"SIGXFSZ",
"SIGVTALRM",
"SIGPROF",
"SIGWINCH",
"SIGIO",
"SIGPWR"
]
},
"KernelTrapType": {
"description": "The types of kernel traps understood",
"anyOf": [
{
"description": "This is type zerotect doesn't know how to parse. So it captures and stores the string description.",
"type": "object",
"required": [
"description",
"type"
],
"properties": {
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"Generic"
]
}
}
},
{
"description": "Segfault occurs when an invalid memory access is performed (writing to read-only memory, executing non-executable memory, etc.)",
"type": "object",
"required": [
"location",
"type"
],
"properties": {
"location": {
"type": "integer",
"format": "uint",
"minimum": 0.0
},
"type": {
"type": "string",
"enum": [
"Segfault"
]
}
}
},
{
"description": "Invalid Opcode occurs when the processor doesn't understand an opcode. This usually occurs when execution jumps to an otherwise data segment, or in the wrong byte within an instruction.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"InvalidOpcode"
]
}
}
},
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"type": "string",
"enum": [
"GeneralProtectionFault"
]
}
}
}
]
},
"LogFacility": {
"description": "Linux kmesg (kernel message buffer) Log Facility.",
"type": "string",
"enum": [
"Kern",
"User",
"Mail",
"Daemon",
"Auth",
"Syslog",
"Lpr",
"News",
"UUCP",
"Cron",
"AuthPriv",
"FTP"
]
},
"LogLevel": {
"description": "Linux kmesg (kernel message buffer) Log Level.",
"type": "string",
"enum": [
"Emergency",
"Alert",
"Critical",
"Error",
"Warning",
"Notice",
"Info",
"Debug"
]
},
"RegisterProbeJustification": {
"anyOf": [
{
"type": "object",
"required": [
"FullEvents"
],
"properties": {
"FullEvents": {
"type": "array",
"items": {
"$ref": "#/definitions/Version"
}
}
}
},
{
"type": "object",
"required": [
"RegisterValues"
],
"properties": {
"RegisterValues": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
{
"type": "object",
"required": [
"EventCount"
],
"properties": {
"EventCount": {
"type": "integer",
"format": "uint",
"minimum": 0.0
}
}
}
]
},
"SegfaultAccessMode": {
"description": "The context under which the Segmentation Fault was triggered",
"type": "string",
"enum": [
"Kernel",
"User"
]
},
"SegfaultAccessType": {
"description": "The type of Access that triggered this Segmentation Fault",
"type": "string",
"enum": [
"Read",
"Write"
]
},
"SegfaultErrorCode": {
"description": "Segmentation Fault ErrorCode flags parsed into a structure See more: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/include/asm/traps.h#n167 See more: https://utcc.utoronto.ca/~cks/space/blog/linux/KernelSegfaultMessageMeaning",
"type": "object",
"required": [
"access_mode",
"access_type",
"instruction_fetch",
"protection_keys_block_access",
"reason",
"use_of_reserved_bit"
],
"properties": {
"access_mode": {
"description": "The mode under which access was performed",
"allOf": [
{
"$ref": "#/definitions/SegfaultAccessMode"
}
]
},
"access_type": {
"description": "The type of access causing the fault",
"allOf": [
{
"$ref": "#/definitions/SegfaultAccessType"
}
]
},
"instruction_fetch": {
"description": "fault was an instruction fetch, not data read or write",
"type": "boolean"
},
"protection_keys_block_access": {
"description": "Memory Protection Keys related. Not sure what exactly triggers this. See more: https://lore.kernel.org/patchwork/patch/633070/",
"type": "boolean"
},
"reason": {
"description": "The reason for the segmentation fault",
"allOf": [
{
"$ref": "#/definitions/SegfaultReason"
}
]
},
"use_of_reserved_bit": {
"description": "use of reserved bits in the page table entry detected (the kernel will panic if this happens)",
"type": "boolean"
}
}
},
"SegfaultReason": {
"description": "The reason for the Segmentation Fault",
"type": "string",
"enum": [
"NoPageFound",
"ProtectionFault"
]
},
"Version": {
"description": "Event is the complete structure that Polycorder (Polyverse-hosted zero-day detection service) understands. This structure is also the reference schema/format for all detect-efforts.\n\nAs such, it is encouraged to have many detectors that emit data in this structure.\n\nDifferent implementations of the structure may very. Various fields may come or go.\n\nAll parsers are encouraged to first test the \"Version\" field and then parse the correct structure. The field `version` is guaranteed to exist on ALL versions and instances of Event. Any structure/data that does not contain the version field, is considered invalid.",
"anyOf": [
{
"description": "Version is guaranteed to exist. All other fields may change or not exist, and it is recommended to use a different version when making breaking changes to all other fields. It allows parsers to test on version and determine if they know what to do with the rest. For this particular variant, set DeviceVersion to a fixed value \"V1\"",
"type": "object",
"required": [
"event",
"timestamp",
"version"
],
"properties": {
"event": {
"description": "Platform records fields specific to a specific mechanism/platform.",
"allOf": [
{
"$ref": "#/definitions/EventType"
}
]
},
"hostname": {
"type": [
"string",
"null"
]
},
"timestamp": {
"description": "This is universal and important for all events. They occur at a time.",
"type": "string",
"format": "date-time"
},
"version": {
"type": "string",
"enum": [
"V1"
]
}
}
}
]
}
}
}