From 35c9526ed2746793fdf586c5d1bcf7691dda31a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leonard?= Date: Mon, 16 Nov 2020 12:27:26 +0100 Subject: [PATCH] #900 readme --- utils/flavors/README.md | 43 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 utils/flavors/README.md diff --git a/utils/flavors/README.md b/utils/flavors/README.md new file mode 100644 index 000000000..4916b5d0f --- /dev/null +++ b/utils/flavors/README.md @@ -0,0 +1,43 @@ +# Readme + +Program that help checking and fixing the validity of the JSON file of a flavor. + + +``` +usage: check_json_schema.py [-h] [-r] [-f FILE] [-s SCHEMA] + +optional arguments: + -h, --help show this help message and exit + -r, --report Generate report for all JSON flavors of all Analyzers and responders + -f FILE, --file FILE Validate JSON of the Flavor definition file + -s SCHEMA, --schema SCHEMA + JSON Schema of a flavor +``` + + +## Examples + + +- Check all flavors found in analyzers and responders. From the Cortex-Analyzers folder: + +```bash +python3 utils/flavors/check_json_schema.py -r + +``` + +- Check a specific file: + +```bash +python3 utils/flavors/check_json_schema.py -f analyzers/VirusTotal/VirusTotal_Scan.json -s utils/flavors/flavor_schema.json + +❌ analyzers/VirusTotal/VirusTotal_Scan.json +deque([]): 'registration_required' is a required property +deque([]): 'subscription_required' is a required property +deque([]): 'free_subscription' is a required property +``` + +```bash +python3 utils/flavors/check_json_schema.py -f analyzers/SEKOIAIntelligenceCenter/IntelligenceCenter_Context.json -s utils/flavors/flavor_schema.json + +✅ analyzers/SEKOIAIntelligenceCenter/IntelligenceCenter_Context.json +``` \ No newline at end of file