Skip to content

Commit

Permalink
remove get_rules_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-rs committed Oct 5, 2021
1 parent 26ded6e commit ef46ee1
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions suricata_/suricata_.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import dateutil.parser as dateparser
import hashlib
import json
import os
import subprocess
Expand All @@ -9,10 +8,8 @@
import yaml

from io import StringIO
from pathlib import Path
from retrying import retry, RetryError

from assemblyline.common.digests import get_sha256_for_file
from assemblyline.common.exceptions import RecoverableError
from assemblyline.common.str_utils import safe_str
from assemblyline_v4_service.common.base import ServiceBase
Expand Down Expand Up @@ -75,17 +72,6 @@ def _load_rules(self) -> None:
self.log.warning(f"Ruleset {ruleset['id']}: {ruleset['rules_failed']} rules failed to load."
"This can be due to duplication of rules among muliple rulesets being loaded.")

def _get_rules_hash(self):
self.rules_list = [str(f) for f in Path(self.rules_directory).rglob("*") if os.path.isfile(str(f))]
all_sha256s = [get_sha256_for_file(f) for f in self.rules_list]

self.log.info(f"Suricata will load the following rule files: {self.rules_list}")

if len(all_sha256s) == 1:
return all_sha256s[0][:7]

return hashlib.sha256(' '.join(sorted(all_sha256s)).encode('utf-8')).hexdigest()[:7]

def get_tool_version(self):
"""
Return the version of suricata used for processing
Expand Down

0 comments on commit ef46ee1

Please sign in to comment.