Skip to content

Commit 4182214

Browse files
Merge pull request #2288 from domwhewell-sage/shhhh_trufflehog
Change trufflehog output messages
2 parents 050975a + 666776a commit 4182214

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bbot/modules/trufflehog.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
from functools import partial
23
from bbot.modules.base import BaseModule
34

45

@@ -174,7 +175,7 @@ async def execute_trufflehog(self, module, path=None, string=None):
174175
command.append("--delete-cached-data")
175176
command.append("--token=" + self.github_token)
176177

177-
stats_file = self.helpers.tempfile_tail(callback=self.log_trufflehog_status)
178+
stats_file = self.helpers.tempfile_tail(callback=partial(self.log_trufflehog_status, path))
178179
try:
179180
with open(stats_file, "w") as stats_fh:
180181
async for line in self.helpers.run_live(command, stderr=stats_fh):
@@ -200,7 +201,7 @@ async def execute_trufflehog(self, module, path=None, string=None):
200201
finally:
201202
stats_file.unlink()
202203

203-
def log_trufflehog_status(self, line):
204+
def log_trufflehog_status(self, path, line):
204205
try:
205206
line = json.loads(line)
206207
except Exception:
@@ -209,4 +210,5 @@ def log_trufflehog_status(self, line):
209210
message = line.get("msg", "")
210211
ts = line.get("ts", "")
211212
status = f"Message: {message} | Timestamp: {ts}"
212-
self.info(status)
213+
self.verbose(f"Current scan target: {path}")
214+
self.verbose(status)

0 commit comments

Comments
 (0)