Skip to content

Commit

Permalink
Merge pull request #1864 from blacklanternsecurity/badsecrets-customs…
Browse files Browse the repository at this point in the history
…ecrets-tweak

better handling of custom secrets files
  • Loading branch information
liquidsec authored Oct 17, 2024
2 parents 652d08f + 3f1e574 commit 3ff9e8e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bbot/modules/badsecrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ async def setup(self):
self.custom_secrets = None
custom_secrets = self.config.get("custom_secrets", None)
if custom_secrets:
if Path(custom_secrets).is_file():
secrets_path = Path(custom_secrets).expanduser()
if secrets_path.is_file():
self.custom_secrets = custom_secrets
self.info(f"Successfully loaded secrets file [{custom_secrets}]")
else:
self.warning(f"custom secrets file [{custom_secrets}] is not valid")
return None, "Custom secrets file not valid"
return False, "Custom secrets file not valid"
return True

@property
Expand Down

0 comments on commit 3ff9e8e

Please sign in to comment.