schema: fix optional

"optional" is not part of jsonschema. Instead an array named "required"
is used to list all field names that are required.
pull/8587/head
Jason Ish 3 years ago committed by Victor Julien
parent 49ba378d38
commit bf079c9214

@ -1,9 +1,13 @@
{ {
"type": "object", "type": "object",
"additionalProperties": false,
"required": [
"event_type",
"timestamp"
],
"properties": { "properties": {
"app_proto": { "app_proto": {
"type": "string", "type": "string"
"optional": true
}, },
"app_proto_expected": { "app_proto_expected": {
"type": "string" "type": "string"
@ -24,20 +28,16 @@
"type": "string" "type": "string"
}, },
"dest_ip": { "dest_ip": {
"type": "string", "type": "string"
"optional": true
}, },
"dest_port": { "dest_port": {
"type": "integer", "type": "integer"
"optional": true
}, },
"event_type": { "event_type": {
"type": "string", "type": "string"
"optional": false
}, },
"flow_id": { "flow_id": {
"type": "integer", "type": "integer"
"optional": true
}, },
"icmp_code": { "icmp_code": {
"type": "integer" "type": "integer"
@ -61,19 +61,16 @@
"type": "string" "type": "string"
}, },
"pcap_cnt": { "pcap_cnt": {
"type": "integer", "type": "integer"
"optional": true
}, },
"pcap_filename": { "pcap_filename": {
"type": "string", "type": "string"
"optional": true
}, },
"pkt_src": { "pkt_src": {
"type": "string" "type": "string"
}, },
"proto": { "proto": {
"type": "string", "type": "string"
"optional": true
}, },
"response_icmp_code": { "response_icmp_code": {
"type": "integer" "type": "integer"
@ -85,35 +82,30 @@
"type": "integer" "type": "integer"
}, },
"src_ip": { "src_ip": {
"type": "string", "type": "string"
"optional": true
}, },
"src_port": { "src_port": {
"type": "integer", "type": "integer"
"optional": true
}, },
"stream": { "stream": {
"type": "integer" "type": "integer"
}, },
"timestamp": { "timestamp": {
"type": "string", "type": "string",
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+[+\\-]\\d+$", "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+[+\\-]\\d+$"
"optional": false
}, },
"direction": { "direction": {
"type": "string", "type": "string"
"optional": true
}, },
"tx_id": { "tx_id": {
"type": "integer", "type": "integer"
"optional": true
}, },
"files": { "files": {
"type": "array", "type": "array",
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "object", "type": "object",
"optional": true, "additionalProperties": false,
"properties": { "properties": {
"end": { "end": {
"type": "integer" "type": "integer"
@ -158,8 +150,7 @@
"type": "integer" "type": "integer"
} }
} }
}, }
"additionalProperties": false
} }
}, },
"vlan": { "vlan": {
@ -171,7 +162,6 @@
}, },
"alert": { "alert": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"action": { "action": {
"type": "string" "type": "string"
@ -299,12 +289,10 @@
}, },
"stream_tcp": { "stream_tcp": {
"type": "object", "type": "object",
"optional": true,
"additionalProperties": true "additionalProperties": true
}, },
"anomaly": { "anomaly": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"app_proto": { "app_proto": {
"type": "string" "type": "string"
@ -323,7 +311,6 @@
}, },
"bittorrent_dht": { "bittorrent_dht": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"transaction_id": { "transaction_id": {
"type": "string" "type": "string"
@ -337,60 +324,56 @@
"request": { "request": {
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"optional": true,
"properties": { "properties": {
"id": { "id": {
"type": "string" "type": "string"
}, },
"target": { "target": {
"type": "string", "type": "string"
"optional": true
}, },
"implied_port": { "implied_port": {
"type": "integer" "type": "integer"
}, },
"info_hash": { "info_hash": {
"type": "string", "type": "string"
"optional": true
}, },
"port": { "port": {
"type": "integer" "type": "integer"
}, },
"token": { "token": {
"type": "string", "type": "string"
"optional": true
} }
} }
}, },
"response": { "response": {
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"optional": true, "required": ["id"],
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"optional": false
}, },
"nodes": { "nodes": {
"type": "array", "type": "array",
"optional": true,
"items": { "items": {
"type": "object", "type": "object",
"items": { "items": {
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"required": [
"id",
"ip",
"port"
],
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"optional": false
}, },
"ip": { "ip": {
"type": "string", "type": "string"
"optional": false
}, },
"port": { "port": {
"type": "number", "type": "number"
"optional": false
} }
} }
} }
@ -398,33 +381,32 @@
}, },
"nodes6": { "nodes6": {
"type": "array", "type": "array",
"optional": true,
"items": { "items": {
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"required": [
"id",
"ip",
"port"
],
"properties": { "properties": {
"id": { "id": {
"type": "string", "type": "string"
"optional": false
}, },
"ip": { "ip": {
"type": "string", "type": "string"
"optional": false
}, },
"port": { "port": {
"type": "number", "type": "number"
"optional": false
} }
} }
} }
}, },
"token": { "token": {
"type": "string", "type": "string"
"optional": true
}, },
"values": { "values": {
"type": "array", "type": "array",
"optional": true,
"items": { "items": {
"type": "object" "type": "object"
} }
@ -433,7 +415,6 @@
}, },
"error": { "error": {
"type": "object", "type": "object",
"optional": true,
"additionalProperties": false, "additionalProperties": false,
"properties": { "properties": {
"num": { "num": {
@ -449,7 +430,6 @@
}, },
"dcerpc": { "dcerpc": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"activityuuid": { "activityuuid": {
"type": "string" "type": "string"
@ -490,7 +470,6 @@
}, },
"req": { "req": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"frag_cnt": { "frag_cnt": {
"type": "integer" "type": "integer"
@ -506,7 +485,6 @@
}, },
"res": { "res": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"frag_cnt": { "frag_cnt": {
"type": "integer" "type": "integer"
@ -522,7 +500,6 @@
}, },
"dhcp": { "dhcp": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"assigned_ip": { "assigned_ip": {
"type": "string" "type": "string"
@ -592,7 +569,6 @@
}, },
"dnp3": { "dnp3": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"dst": { "dst": {
"type": "integer" "type": "integer"
@ -952,7 +928,6 @@
}, },
"dns": { "dns": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"aa": { "aa": {
"type": "boolean" "type": "boolean"
@ -999,7 +974,6 @@
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"rdata": { "rdata": {
"type": "string" "type": "string"
@ -1015,7 +989,6 @@
}, },
"srv": { "srv": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"name": { "name": {
"type": "string" "type": "string"
@ -1041,7 +1014,6 @@
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"rdata": { "rdata": {
"type": "string" "type": "string"
@ -1057,7 +1029,6 @@
}, },
"soa": { "soa": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"expire": { "expire": {
"type": "integer" "type": "integer"
@ -1092,7 +1063,6 @@
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"id": { "id": {
"type": "integer" "type": "integer"
@ -1162,7 +1132,6 @@
}, },
"grouped": { "grouped": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"A": { "A": {
"type": "array", "type": "array",
@ -1211,7 +1180,6 @@
"minItems": 1, "minItems": 1,
"items": { "items": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"name": { "name": {
"type": "string" "type": "string"
@ -1247,7 +1215,6 @@
}, },
"drop": { "drop": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"ack": { "ack": {
"type": "boolean" "type": "boolean"
@ -1320,7 +1287,6 @@
}, },
"email": { "email": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"body_md5": { "body_md5": {
"type": "string" "type": "string"
@ -1378,7 +1344,6 @@
}, },
"engine": { "engine": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"error": { "error": {
"type": "string" "type": "string"
@ -1400,7 +1365,6 @@
}, },
"ether": { "ether": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"dest_mac": { "dest_mac": {
"type": "string" "type": "string"
@ -1427,7 +1391,6 @@
}, },
"fileinfo": { "fileinfo": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"end": { "end": {
"type": "integer" "type": "integer"
@ -1480,7 +1443,6 @@
}, },
"flow": { "flow": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"action": { "action": {
"type": "string" "type": "string"
@ -1496,7 +1458,6 @@
}, },
"bypassed": { "bypassed": {
"type": "object", "type": "object",
"optional": false,
"properties": { "properties": {
"pkts_toserver": { "pkts_toserver": {
"type": "integer" "type": "integer"
@ -1587,7 +1548,6 @@
}, },
"ftp": { "ftp": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"command": { "command": {
"type": "string" "type": "string"
@ -1629,7 +1589,6 @@
}, },
"ftp_data": { "ftp_data": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"command": { "command": {
"type": "string" "type": "string"
@ -1642,7 +1601,6 @@
}, },
"http": { "http": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"hostname": { "hostname": {
"type": "string" "type": "string"
@ -1821,7 +1779,6 @@
}, },
"http2": { "http2": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"http_method": { "http_method": {
"type": "string" "type": "string"
@ -5271,7 +5228,6 @@
}, },
"tcp": { "tcp": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"ack": { "ack": {
"type": "boolean" "type": "boolean"
@ -5326,7 +5282,6 @@
}, },
"template": { "template": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"request": { "request": {
"type": "string" "type": "string"
@ -5339,7 +5294,6 @@
}, },
"tftp": { "tftp": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"file": { "file": {
"type": "string" "type": "string"
@ -5355,11 +5309,9 @@
}, },
"tls": { "tls": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"client": { "client": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"fingerprint": { "fingerprint": {
"type": "string" "type": "string"
@ -5414,7 +5366,6 @@
}, },
"ja3": { "ja3": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"hash": { "hash": {
"type": "string" "type": "string"
@ -5427,7 +5378,6 @@
}, },
"ja3s": { "ja3s": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"hash": { "hash": {
"type": "string" "type": "string"
@ -5443,7 +5393,6 @@
}, },
"traffic": { "traffic": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"id": { "id": {
"type": "array", "type": "array",
@ -5464,7 +5413,6 @@
}, },
"tunnel": { "tunnel": {
"type": "object", "type": "object",
"optional": true,
"properties": { "properties": {
"depth": { "depth": {
"type": "integer" "type": "integer"
@ -5494,7 +5442,6 @@
"additionalProperties": false "additionalProperties": false
} }
}, },
"additionalProperties": false,
"$defs": { "$defs": {
"stats_applayer_error": { "stats_applayer_error": {
"type": "object", "type": "object",

Loading…
Cancel
Save