-
Notifications
You must be signed in to change notification settings - Fork 150
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
Sanitize environment #2114
Merged
Merged
Sanitize environment #2114
Conversation
This file contains 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
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2114 +/- ##
============================================
+ Coverage 70.66% 70.70% +0.04%
- Complexity 9964 9984 +20
============================================
Files 840 841 +1
Lines 40251 40288 +37
Branches 6106 6107 +1
============================================
+ Hits 28442 28487 +45
+ Misses 9065 9058 -7
+ Partials 2744 2743 -1 ☔ View full report in Codecov by Sentry. |
jtduffy
requested changes
Oct 30, 2024
newrelic-agent/src/main/java/com/newrelic/agent/config/AgentConfigImpl.java
Outdated
Show resolved
Hide resolved
meiao
approved these changes
Oct 30, 2024
newrelic-agent/src/main/java/com/newrelic/agent/config/ObfuscateJvmPropsConfigImpl.java
Outdated
Show resolved
Hide resolved
meiao
approved these changes
Oct 30, 2024
jtduffy
approved these changes
Oct 30, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #2110
Description
This PR introduces a new configuration stanza
obfuscate_jvm_props
to better protect our customers from sending sensitive data in their JVM args.Prior to this feature, all JVM args were sent by default on agent startup, and were not filtered or checked in any way. Now, we will obfuscate any data contained behind an
=
in a JVM argument by default (with a few exceptions, see below).Details
New .yml configuration stanza with descriptions:
Default allows set by the agent: The agent will send any standard or extended JVM prop (those with an
-X*
prefix) as-is, even if they contain an=
sign. This was done because these props should not contain sensitive data and their values may be used by other New Relic teams, such as the BMDS project.To keep the block/allow list conventions consistent with other similar config settings (such as attribute includes/excludes), priority is always given to the more-specific rule (
-DpropB.extended
will take precedence over-DpropB
, regardless of whether it belongs to the block or allow list).This feature has no affect on JVM args that do not contain an
=
, such as-javaagent
.Example
Setting:
And starting petclinic with:
Sends up to the NR UI:
Implementation
The PR introduces a new config class,
ObfuscateJvmPropsConfig
. It enhances the existingEnvironment
class using anExcludesIncludesFilter
to apply the appropriate rules to JVM properties.