FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

masked sensitive data in logs by akaila-splunk · Pull Request #507 · splunk/splunk-sdk-python · GitHub

Repository navigation

masked sensitive data in logs - #507

Merged
akaila-splunk merged 4 commits into
developfrom
DVPL-11952
Jul 14, 2023
Merged

akaila-splunk merged 4 commits into
developfrom
DVPL-11952

Conversation

akaila-splunk commented Jan 20, 2023 •
edited
Loading

Copy link
Copy Markdown
Contributor

added new method to mask sensitive data in logs like password. changes wrt issue #506

ashah-splunk requested a review from l00py July 10, 2023 15:44

l00py left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Added comments for review

Comment thread splunklib/binding.py
except Exception as ex:
return data

if not isinstance(data, dict):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Duplicate to lines 87-91?

Comment thread splunklib/binding.py Outdated
"HTTPError"
]

SENSITIVE_KEYS = ["password", "token", "Authorization"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

May want to review the request params for the supported endpoints specified here: https://github.com/splunk/splunk-sdk-python/blob/develop/splunklib/client.py#L90-L113

For example:

  • apps/local
    • auth
    • session
  • configs/conf
    • POST to conf files may contain sensitive information, but we can do a best-effort based on the current conf specs, and what files are normally interacted with. It may be best to provide a different logic for masking sensitive information for that specific endpoint.

Comment thread splunklib/binding.py Outdated
all_headers = headers + self.additional_headers + self._auth_headers
logger.debug("%s request to %s (headers: %s, body: %s)",
method, path, str(all_headers), repr(body))
method, path, str(all_headers), mask_sensitive_data(body))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The headers can contain sensitive data, specifically the original headers being passed via the handler in https://github.com/splunk/splunk-sdk-python/blob/develop/splunklib/binding.py#L1443-L1444

- updated keys in SENSITIVE_KEYS list
- masked headers data in logger

l00py left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

akaila-splunk merged commit e1f1855 into develop Jul 14, 2023
akaila-splunk mentioned this pull request Jul 14, 2023
Ickerday deleted the DVPL-11952 branch August 18, 2025 09:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL