mirror of
https://github.com/splunk/security_content
synced 2026-06-08 17:32:49 +00:00
Branch was auto-updated.
This commit is contained in:
@@ -4,6 +4,9 @@ detections/*/.yml.example
|
||||
stories/*.yml.example
|
||||
tests/*/*.yml.example
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
|
||||
# usual mac files
|
||||
.DS_Store
|
||||
#vim files
|
||||
|
||||
+5
-8
@@ -47,10 +47,10 @@ def validate_schema(REPO_PATH, type, objects, verbose):
|
||||
print("Error reading {0}".format(manifest_file))
|
||||
error = True
|
||||
continue
|
||||
try:
|
||||
jsonschema.validate(instance=object, schema=schema)
|
||||
except jsonschema.exceptions.ValidationError as json_ve:
|
||||
errors.append("ERROR: {0} at:\n\t{1}".format(json.dumps(json_ve.message), manifest_file))
|
||||
|
||||
validator = jsonschema.Draft7Validator(schema, format_checker=jsonschema.FormatChecker())
|
||||
for schema_error in validator.iter_errors(object):
|
||||
errors.append("ERROR: {0} at:\n\t{1}".format(json.dumps(schema_error.message), manifest_file))
|
||||
error = True
|
||||
|
||||
if type in objects:
|
||||
@@ -70,7 +70,7 @@ def validate_objects(REPO_PATH, objects, verbose):
|
||||
errors = []
|
||||
|
||||
for lookup in objects['lookups']:
|
||||
lookup_errors = validate_lookups_content(REPO_PATH, "lookups/%s", lookup)
|
||||
errors = errors + validate_lookups_content(REPO_PATH, "lookups/%s", lookup)
|
||||
|
||||
objects_array = objects['stories'] + objects['detections'] + objects['baselines'] + objects['response_tasks'] + objects['responses']
|
||||
for object in objects_array:
|
||||
@@ -85,12 +85,9 @@ def validate_objects(REPO_PATH, objects, verbose):
|
||||
for object in objects['baselines']:
|
||||
errors = errors + validate_baseline_search(object, objects['macros'])
|
||||
|
||||
|
||||
for object in objects['tests']:
|
||||
errors = errors + validate_tests(REPO_PATH, object)
|
||||
|
||||
errors = lookup_errors + errors
|
||||
|
||||
return errors
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user