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

Obfuscate License Key in Agent Logs #362

Merged

Conversation

RichVanderwal
Copy link
Contributor

Security-minded customers have noticed that the Go Agent logs the URL of the agent endpoint at New Relic. This URL includes the customer's license key. This PR removes most of the license key, but keeps the first and last two characters to facilitate troubleshooting.

This work is based on PR #354 submittted by @pete911 . Thanks so much for your contribution!

if n := len(licenseKey); n > 4 {
query.Set("license_key", string(licenseKey[0:2]+".."+licenseKey[n-2:]))
} else {
query.Set("license_key", licenseKey)
Copy link

Choose a reason for hiding this comment

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

this line (else) is redundant, license key is already set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course, thanks!

@RichVanderwal RichVanderwal merged commit ab3bdc1 into newrelic:develop Sep 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants