Skip to content

Commit

Permalink
fix/credentials_leaking_in_logs (#403)
Browse files Browse the repository at this point in the history
TTS/STT credentials can be accidentally leaked in LOGS via Session in message.context
  • Loading branch information
JarbasAl authored Jan 24, 2024
1 parent 4e0772f commit 9b03537
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ovos_core/transformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def transform(self, utterances: List[str], context: Optional[dict] = None):
for module in self.plugins:
try:
utterances, data = module.transform(utterances, context)
LOG.debug(f"{module.name}: {data}")
_safe = {k:v for k,v in data.items() if k != "session"} # no leaking TTS/STT creds in logs
LOG.debug(f"{module.name}: {_safe}")
context = merge_dict(context, data)
except Exception as e:
LOG.warning(f"{module.name} transform exception: {e}")
Expand Down Expand Up @@ -111,8 +112,9 @@ def transform(self, context: Optional[dict] = None):

for module in self.plugins:
try:
data = module.transform(context)
LOG.debug(f"{module.name}: {data}")
data = module.transform(context)
_safe = {k:v for k,v in data.items() if k != "session"} # no leaking TTS/STT creds in logs
LOG.debug(f"{module.name}: {_safe}")
context = merge_dict(context, data)
except Exception as e:
LOG.warning(f"{module.name} transform exception: {e}")
Expand Down

0 comments on commit 9b03537

Please sign in to comment.