risk validation

This commit is contained in:
bpatel
2020-09-03 11:30:09 -07:00
parent 20b1130737
commit 637ec487df
2 changed files with 7 additions and 4 deletions
+4 -4
View File
@@ -134,17 +134,17 @@ def validate_standard_fields(object, uuids):
if not isinstance(v, int):
errors.append("ERROR: risk_score not integer value for object: %s" % v)
risk_object_type = ["user","system", "other"]
if k == 'risk_object_type':
if not any(s in v for s in risk_object_type):
errors.append("ERROR: risk_object_type can only contain user,system, other: %s" % v)
if v not in risk_object_type:
errors.append("ERROR: risk_object_type can only contain user, system, other: %s" % v)
if k == 'risk_object':
try:
v.encode('ascii')
except UnicodeEncodeError:
errors.append("ERROR: risk_object not ascii for object: %s" % v)
return errors, uuids
@@ -37,3 +37,6 @@ tags:
- DE.AE
security_domain: network
asset_type: AWS Instance
risk_score: 40
risk_object_type: user
risk_object: userName