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

don't log the license key even in debug/audit #2339

Merged
merged 3 commits into from
Dec 1, 2023
Merged

don't log the license key even in debug/audit #2339

merged 3 commits into from
Dec 1, 2023

Conversation

fallwith
Copy link
Contributor

By default the license key isn't logged given a) the default non-debug log level, and b) the default of not enabling the audit log.

While accuracy in those 2 non-default contexts can be useful in general, the inclusion of the license key does not provide much value and can serve to make log data more sensitive than it needs to be.

Filter out the license key from all contexts.

By default the license key isn't logged given a) the default non-debug
log level, and b) the default of not enabling the audit log.

While accuracy in those 2 non-default contexts can be useful in
general, the inclusion of the license key does not provide much value
and can serve to make log data more sensitive than it needs to be.

Filter out the license key from all contexts.
@tannalynn
Copy link
Contributor

There is actually another area that logs the license key, I'm not sure if you want to include it in this PR, or address it separately, but when in debug level logging, we log all the config values from each source the agent receives, so the license key gets logged that way as well
Example of one of them:

DEBUG : Updating config (add) from NewRelic::Agent::Configuration::YamlSource. Results: { .........

Let me know if there is anything i can help with!

Copy link
Contributor

@kaylareopelle kaylareopelle left a comment

Choose a reason for hiding this comment

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

There is one more place, though this might be covered by the other config change. The audit logs include the license key in the request body payload on connect.

- Ensure the license key is not reported in the settings hash within the
  connect payload
- Ensure the license key is not debug logged via the 'Updating config...' debug
  log entry
- When filtering out the license key from URIs, use an asterisk based mask
lib/new_relic/agent/configuration/manager.rb Show resolved Hide resolved
lib/new_relic/agent/new_relic_service.rb Outdated Show resolved Hide resolved
@@ -3,6 +3,8 @@
# frozen_string_literal: true

module NewRelic
ASTERISK = '*'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice! After this PR, let's consider replacing the two places the agent references '*' with this constant.

given the short/simple evaluation involved, perform logic inline as
opposed to stored its result in a variable and referencing the variable
Copy link
Contributor

github-actions bot commented Dec 1, 2023

SimpleCov Report

Coverage Threshold
Line 94.22% 94%
Branch 82.76% 82%

@fallwith fallwith merged commit 2bbd5e9 into dev Dec 1, 2023
25 checks passed
@fallwith fallwith deleted the plub branch December 1, 2023 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants