Sigma Validators Issue #125
Replies: 1 comment
-
It appears that there is an issue with your Python environment. Did you installed the pysigma package? Can you ensure that the sigma package is available by running a minimal script that only contains |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Traceback (most recent call last):
File "C:\Sigma\sigma_rule_validator.py", line 3, in
from sigma.validators import validators
ImportError: cannot import name 'validators' from 'sigma.validators' (unknown location)
Code:
import sys
from sigma.collection import SigmaCollection
from sigma.validators import validators
from sigma.validation import SigmaValidator
def main():
if len(sys.argv) != 2:
print("Please provide a Sigma rule file as a command line argument.")
sys.exit(1)
filename = sys.argv[1]
with open(filename, 'r') as file:
content = file.read()
sigma_rules = SigmaCollection.from_yaml(content)
rule_validator = SigmaValidator(validators.values())
issues = rule_validator.validate_rules(sigma_rules)
for issue in issues:
print(issue)
if name == "main":
main()
Beta Was this translation helpful? Give feedback.
All reactions