-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add SigmahqInvalidAllModifierValidator * Add SigmahqFieldDuplicateValueValidator * Add tests * Update Readme * Update version to 0.5.1 * add missing config and fix SigmahqTitleCase * Move to LF
- Loading branch information
Showing
16 changed files
with
3,138 additions
and
2,843 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Prints code testing coverage as percentage for badge generation. | ||
from defusedxml.ElementTree import parse | ||
|
||
tree = parse("cov.xml") | ||
root = tree.getroot() | ||
coverage = float(root.attrib["line-rate"]) * 100 | ||
print(f"COVERAGE={coverage:3.4}%") | ||
if coverage >= 95.0: | ||
print("COVERAGE_COLOR=green") | ||
elif coverage >= 90.0: | ||
print("COVERAGE_COLOR=yellow") | ||
elif coverage >= 85.0: | ||
print("COVERAGE_COLOR=orange") | ||
else: | ||
print("COVERAGE_COLOR=red") | ||
# Prints code testing coverage as percentage for badge generation. | ||
from defusedxml.ElementTree import parse | ||
|
||
tree = parse("cov.xml") | ||
root = tree.getroot() | ||
coverage = float(root.attrib["line-rate"]) * 100 | ||
print(f"COVERAGE={coverage:3.4}%") | ||
if coverage >= 95.0: | ||
print("COVERAGE_COLOR=green") | ||
elif coverage >= 90.0: | ||
print("COVERAGE_COLOR=yellow") | ||
elif coverage >= 85.0: | ||
print("COVERAGE_COLOR=orange") | ||
else: | ||
print("COVERAGE_COLOR=red") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
from importlib import import_module | ||
from pathlib import Path | ||
from pkgutil import iter_modules | ||
from inspect import getmembers, isabstract, isclass | ||
import re | ||
|
||
from sigma.validators.base import SigmaRuleValidator | ||
from .config import ConfigHq | ||
|
||
validators = { | ||
re.sub("([A-Z]+)", "_\\1", name.replace("Validator", ""))[ | ||
1: | ||
].lower(): cls # NameOfSomeCheckValidator -> name_of_some_check | ||
for _, submodule, _ in iter_modules( | ||
[str(Path(__file__).resolve().parent)] | ||
) # Iterate over modules, str around Path is due to issue with PosixPath from Python 3.10 | ||
for name, cls in getmembers( | ||
import_module(__name__ + "." + submodule, isclass) | ||
) # Iterate over classes | ||
if not isabstract(cls) | ||
and name.endswith("Validator") | ||
and issubclass(cls, SigmaRuleValidator) # Class filtering | ||
} | ||
from importlib import import_module | ||
from pathlib import Path | ||
from pkgutil import iter_modules | ||
from inspect import getmembers, isabstract, isclass | ||
import re | ||
|
||
from sigma.validators.base import SigmaRuleValidator | ||
from .config import ConfigHq | ||
|
||
validators = { | ||
re.sub("([A-Z]+)", "_\\1", name.replace("Validator", ""))[ | ||
1: | ||
].lower(): cls # NameOfSomeCheckValidator -> name_of_some_check | ||
for _, submodule, _ in iter_modules( | ||
[str(Path(__file__).resolve().parent)] | ||
) # Iterate over modules, str around Path is due to issue with PosixPath from Python 3.10 | ||
for name, cls in getmembers( | ||
import_module(__name__ + "." + submodule, isclass) | ||
) # Iterate over classes | ||
if not isabstract(cls) | ||
and name.endswith("Validator") | ||
and issubclass(cls, SigmaRuleValidator) # Class filtering | ||
} |
Oops, something went wrong.