Skip to content

Commit

Permalink
Merge pull request #2025 from kevoreilly/fix_yara
Browse files Browse the repository at this point in the history
Update objects.py
  • Loading branch information
kevoreilly authored Mar 25, 2024
2 parents ab17481 + 7e55c03 commit f22a79b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/cuckoo/common/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,13 +442,12 @@ def init_yara(self):
log.warning("Missing Yara directory: %s?", category_root)
continue

for category_root, _, filenames in os.walk(category_root, followlinks=True):
for filename in filenames:
if not filename.endswith((".yar", ".yara")):
continue
filepath = os.path.join(category_root, filename)
rules[f"rule_{category}_{len(rules)}"] = filepath
indexed.append(filename)
for filename in os.listdir(category_root):
if not filename.endswith((".yar", ".yara")):
continue
filepath = os.path.join(category_root, filename)
rules[f"rule_{category}_{len(rules)}"] = filepath
indexed.append(filename)

# Need to define each external variable that will be used in the
# future. Otherwise Yara will complain.
Expand Down

0 comments on commit f22a79b

Please sign in to comment.