Skip to content

Commit

Permalink
Added leak source URL to Slack message alert
Browse files Browse the repository at this point in the history
  • Loading branch information
blupants committed Jul 15, 2024
1 parent 4ad4e71 commit 6d3fb5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/n0s1/controllers/slack_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def post_comment(self, issue, comment):
response = self._client.chat_postMessage(
channel=channel_id,
text=comment,
thread_ts=thread_ts
thread_ts=thread_ts,
unfurl_links=False
)

self.log_message(f"Message sent successfully")
Expand Down
3 changes: 3 additions & 0 deletions src/n0s1/n0s1.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,9 @@ def report_leaked_secret(scan_text_result, controller):
comment_template += f"\n{variable}: {{{variable}}}"
comment = comment_template.format(finding_info=finding_info, bot_name=bot_name, secret_manager=secret_manager,
contact_help=contact_help, label=label)
if controller.get_name().lower() == "Slack".lower():
comment = comment + f"\nLeak source: {url}"

return controller.post_comment(issue_id, comment)
return True

Expand Down

0 comments on commit 6d3fb5d

Please sign in to comment.