From 3899dce35396ba5984819ab09cf91a833b96551e Mon Sep 17 00:00:00 2001 From: Nex Date: Mon, 20 Jun 2022 23:41:59 +0200 Subject: [PATCH] Hashing files only when MVT_HASH_FILES env is set --- mvt/common/command.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mvt/common/command.py b/mvt/common/command.py index d548d4a..af5e54a 100644 --- a/mvt/common/command.py +++ b/mvt/common/command.py @@ -89,7 +89,9 @@ class Command(object): for coll in self.iocs.ioc_collections: info["ioc_files"].append(coll.get("stix2_file_path", "")) - if self.target_path: + # TODO: Revisit if setting this from environment variable is good + # enough. + if self.target_path and os.environ.get("MVT_HASH_FILES"): if os.path.isfile(self.target_path): h = hashlib.sha256() with open(self.target_path, "rb") as handle: