summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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",
+ ]
+ },
]
},
},