Skip to content

Commit

Permalink
Merge pull request #46 from PaperMtn/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
PaperMtn committed May 5, 2023
2 parents 495f2b3 + 170be56 commit 2ff530f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.0.1] - 2023-05-05
### Changed
- User output in stdout logging now includes display name and email. The accounts for cases where usernames are nonsensical.

## [4.0.0] - 2023-05-03
This major version release brings multiple updates to Slack Watchman in usability, functionality and behind the scenes improvements.

Expand Down
4 changes: 2 additions & 2 deletions src/slack_watchman/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def main():
OUTPUT_LOGGER.log('SUCCESS', 'Successfully authenticated using cookie')
OUTPUT_LOGGER.log('SUCCESS', f"This user's SESSION_TOKEN: {slack_con.session_token}")
OUTPUT_LOGGER.log('SUCCESS',
f'You are authenticated to this workspace as: USER: {auth_data.get("user")}'
f' ID: {auth_data.get("user_id")}')
f'You are authenticated to this workspace as: USER: {calling_user.display_name} '
f'- {calling_user.email} ID: {calling_user.id}')
OUTPUT_LOGGER.log('USER', calling_user, detect_type='User', notify_type='user')
OUTPUT_LOGGER.log('WORKSPACE', workspace_information, detect_type='Workspace', notify_type='workspace')

Expand Down
2 changes: 1 addition & 1 deletion src/slack_watchman/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
]

__title__ = 'Slack Watchman'
__version__ = '4.0.0'
__version__ = '4.0.1'
__summary__ = 'Monitoring and enumerating Slack for exposed secrets'
__author__ = 'PaperMtn'
__email__ = '[email protected]'
Expand Down
2 changes: 2 additions & 0 deletions src/slack_watchman/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class UserSuccinct(object):
id: str
name: str
email: str
display_name: str
has_2fa: str
is_admin: str

Expand Down Expand Up @@ -101,6 +102,7 @@ def create_from_dict(user_dict: Dict,
return UserSuccinct(
id=user_dict.get('id'),
name=user_dict.get('name'),
display_name=user_dict.get('profile').get('display_name'),
has_2fa=user_dict.get('has_2fa'),
is_admin=user_dict.get('is_admin'),
email=user_dict.get('profile').get('email')
Expand Down
8 changes: 5 additions & 3 deletions src/slack_watchman/sw_logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def log(self,
if notify_type == "user":
message = f'USER: \n' \
f' ID: {message.get("id")} \n' \
f' NAME: {message.get("name")} \n' \
f' NAME: {message.get("display_name")} \n' \
f' EMAIL: {message.get("email")} \n' \
f' JOB_TITLE: {message.get("title")} \n' \
f' ADMIN: {message.get("is_admin")} \n' \
Expand All @@ -59,7 +59,8 @@ def log(self,
conversation_type = 'Public Channel'

if isinstance(message.get('message').get('user'), Mapping):
user = message.get('message', {}).get('user', {}).get('email')
user = f"{message.get('message', {}).get('user', {}).get('display_name')} -" \
f" {message.get('message', {}).get('user', {}).get('email')}"
else:
user = message.get('message').get('user')

Expand All @@ -74,7 +75,8 @@ def log(self,

elif message.get('file'):
message = 'POST_TYPE: File' \
f' POSTED_BY: {message.get("user").get("email")}' \
f' POSTED_BY: {message.get("user", {}).get("display_name")} ' \
f'- {message.get("user").get("email")}' \
f' CREATED: {message.get("file").get("created")} \n' \
f' FILE_NAME: {message.get("file").get("name")} \n' \
f' PRIVATE_URL: {message.get("file").get("url_private_download")} \n' \
Expand Down

0 comments on commit 2ff530f

Please sign in to comment.