Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove API key if included in processes metadata payload #3712

Merged
merged 1 commit into from
Mar 20, 2018

Conversation

dixonscottr
Copy link
Contributor

Note: Please remember to review the Datadog Contribution Guidelines
if you have not yet done so.

What does this PR do?

Removes API key if included as part of the processes field in the metadata payload when log level is set to DEBUG

Motivation

Noticed an API key, as part of the processes field, could be sent if DEBUG mode is enabled

Testing Guidelines

An overview on testing
is available in our contribution guidelines.

Additional Notes

Anything else we should know when reviewing?

@@ -529,6 +529,8 @@ def run(self, checksd=None, start_event=True, configs_reloaded=False):
del data['metrics']
del data['events']
del data['service_checks']
if data.get('processes'):
data['processes']['apiKey'] = '*************************' + data['processes'].get('apiKey', '')[-5:]
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor nit: maybe do '*' * 27 to make the scrubbed key the proper length (32)

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't worry since the flare also doesn't output the proper length

lambda key: '*' * 26 + key[-5:],

@dixonscottr dixonscottr merged commit 64a7b15 into master Mar 20, 2018
@dixonscottr dixonscottr deleted the scottdixon/apikey_processes branch March 20, 2018 17:29
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.

None yet

2 participants