Skip to content

Commit 0022f2d

Browse files
committed
alphabetize definitions
1 parent 3a8eaa4 commit 0022f2d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

detection_rules/schemas/definitions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646

4747
def string_only_list(obj: List[str]):
4848
"""Validate all records in a list are strings."""
49-
return all([type(r) == str for r in obj])
49+
return all([isinstance(r, str) for r in obj])
5050

5151

5252
BranchVer = NewType('BranchVer', str, validate=validate.Regexp(BRANCH_PATTERN))
@@ -55,8 +55,6 @@ def string_only_list(obj: List[str]):
5555
Date = NewType('Date', str, validate=validate.Regexp(DATE_PATTERN))
5656
FilterLanguages = Literal["kuery", "lucene"]
5757
Interval = NewType('Interval', str, validate=validate.Regexp(INTERVAL_PATTERN))
58-
StringListMaxSizeThree = NewType('StringListMaxSizeThree', list,
59-
validate=validate.And(validate.Length(min=0, max=3), string_only_list))
6058
Markdown = NewType("MarkdownField", CodeString)
6159
Maturity = Literal['development', 'experimental', 'beta', 'production', 'deprecated']
6260
MaxSignals = NewType("MaxSignals", int, validate=validate.Range(min=1))
@@ -69,6 +67,8 @@ def string_only_list(obj: List[str]):
6967
SemVer = NewType('SemVer', str, validate=validate.Regexp(VERSION_PATTERN))
7068
Severity = Literal['low', 'medium', 'high', 'critical']
7169
Sha256 = NewType('Sha256', str, validate=validate.Regexp(SHA256_PATTERN))
70+
StringListMaxSizeThree = NewType('StringListMaxSizeThree', list,
71+
validate=validate.And(validate.Length(min=0, max=3), string_only_list))
7272
SubTechniqueURL = NewType('SubTechniqueURL', str, validate=validate.Regexp(SUBTECHNIQUE_URL))
7373
TacticURL = NewType('TacticURL', str, validate=validate.Regexp(TACTIC_URL))
7474
TechniqueURL = NewType('TechniqueURL', str, validate=validate.Regexp(TECHNIQUE_URL))

0 commit comments

Comments
 (0)