Skip to content

Commit 0a178b9

Browse files
authored
Update version and author in YARA syntax validator
1 parent 0044a03 commit 0a178b9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

misp_modules/modules/expansion/yara_syntax_validator.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
misperrors = {"error": "Error"}
66
mispattributes = {"input": ["yara"], "output": ["text"]}
77
moduleinfo = {
8-
"version": "0.1",
9-
"author": "Dennis Rand",
8+
"version": "0.2",
9+
"author": "Dennis Rand and Theo Geffe",
1010
"description": "An expansion hover module to perform a syntax check on if yara rules are valid or not.",
1111
"module-type": ["hover"],
1212
"name": "YARA Syntax Validator",
@@ -15,6 +15,7 @@
1515
"features": (
1616
"This modules simply takes a YARA rule as input, and checks its syntax. It returns then a confirmation if the"
1717
" syntax is valid, otherwise the syntax error is displayed."
18+
" This modules can compile YARA rule even if there is externals variables or miss modules"
1819
),
1920
"references": ["http://virustotal.github.io/yara/"],
2021
"input": "YARA rule attribute.",
@@ -38,6 +39,7 @@
3839
# will raise "undefined identifier" errors unless the appropriate imports
3940
# are present.
4041

42+
4143
def insert_import_module(rule_text, module_name):
4244
lines = rule_text.strip().splitlines()
4345
if not any(line.strip().startswith(f'import "{module_name}"') for line in lines):
@@ -65,6 +67,7 @@ def insert_import_module(rule_text, module_name):
6567
# - No false negatives caused by missing imports or missing externals
6668
# -------------------------------------------------------------------------
6769

70+
6871
def handler(q=False):
6972
if q is False:
7073
return False
@@ -104,11 +107,9 @@ def handler(q=False):
104107
summary = "Syntax error: Max validation attempts exceeded"
105108
return {"results": [{"types": mispattributes["output"], "values": summary}]}
106109

107-
108110
def introspection():
109111
return mispattributes
110112

111-
112113
def version():
113114
moduleinfo["config"] = moduleconfig
114115
return moduleinfo

0 commit comments

Comments
 (0)