summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Van de Meulebrouck Brendgard <john@sunet.se>2022-04-11 21:11:29 +0200
committerJohn Van de Meulebrouck Brendgard <john@sunet.se>2022-04-11 21:11:29 +0200
commit25ce80ec7dc0d9155962aa96164f01420f2a4cfc (patch)
treea2b4283e16a1189a460f336da3e032870a043f22
parente28a618db0505d8ba6fdd64a1bb5cddb170090f8 (diff)
Added investigation_needed
and made it required to specify either vulnerable or investigation_needed.
-rw-r--r--example_data_1.json7
-rw-r--r--src/schema.py31
2 files changed, 29 insertions, 9 deletions
diff --git a/example_data_1.json b/example_data_1.json
index 51d6a95..61942c4 100644
--- a/example_data_1.json
+++ b/example_data_1.json
@@ -46,6 +46,13 @@
"vulnerable": true,
"reliability": 5,
"description": "Uses RSA instead of elliptic curve."
+ },
+ "possible_webshell": {
+ "display_name": "Webshells (PST)",
+ "investigation_needed": true,
+ "reliability": 1,
+ "description": "A webshell of type PST was confirmed at /test/webshell.php"
}
+
}
}
diff --git a/src/schema.py b/src/schema.py
index 29df4f3..f92a2ea 100644
--- a/src/schema.py
+++ b/src/schema.py
@@ -46,16 +46,29 @@ schema = {
".*": {
"type": "object",
"properties": {
- "display_name": {"type": "string"},
- "vulnerable": {"type": "boolean"},
- "reliability": {"type": "integer"},
- "description": {"type": "string"},
+ "display_name": {"type": "string"},
+ "vulnerable": {"type": "boolean"},
+ "investigation_needed": {"type": "boolean"},
+ "reliability": {"type": "integer"},
+ "description": {"type": "string"},
},
- "required": [
- "display_name",
- "vulnerable",
- # "reliability", # TODO: reliability is required if vulnerable = true
- # "description",
+ "oneOf": [
+ {
+ "required": [
+ "display_name",
+ "vulnerable",
+ # "reliability", # TODO: reliability is required if vulnerable = true
+ # "description",
+ ]
+ },
+ {
+ "required": [
+ "display_name",
+ "investigation_needed",
+ # "reliability", # TODO: reliability is required if investigation_needed = true
+ # "description",
+ ]
+ },
]
},
},