Skip to content

Commit

Permalink
Merge pull request #418 from newrelic/develop
Browse files Browse the repository at this point in the history
Release 3.15.2
  • Loading branch information
nr-swilloughby authored Dec 7, 2021
2 parents 5be716d + f10a466 commit 4b46fc5
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# ChangeLog
## 3.15.2
### Added
* Strings logged via the Go Agent's built-in logger will have strings of the form `license_key=`*hex-string* changed to `license_key=[redacted]` before they are output, regardless of severity level, where *hex-string* means a sequence of upper- or lower-case hexadecimal digits and dots ('.'). This incorporates [PR #415](https://github.com/newrelic/go-agent/pull/415).

### Support Statement
New Relic recommends that you upgrade the agent regularly to ensure that you’re getting the latest features and performance benefits. Additionally, older releases will no longer be supported when they reach end-of-life.

## 3.15.1

### Fixed
Expand Down
12 changes: 9 additions & 3 deletions v3/internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"io"
"log"
"os"
"regexp"
)

// Logger matches newrelic.Logger to allow implementations to be passed to
Expand Down Expand Up @@ -72,10 +73,15 @@ func (f *logFile) fire(level, msg string, ctx map[string]interface{}) {
msg,
ctx,
})
if nil == err {
f.l.Print(string(js))
if err == nil {
// scrub license keys from any portion of the log message
re := regexp.MustCompile(`license_key=[a-fA-F0-9.]+`)
sanitized := re.ReplaceAllLiteralString(string(js), "license_key=[redacted]")
f.l.Print(sanitized)
} else {
f.l.Printf("unable to marshal log entry: %v", err)
f.l.Printf("unable to marshal log entry")
// error value removed from message to avoid possibility of sensitive
// content being leaked that way
}
}

Expand Down
2 changes: 1 addition & 1 deletion v3/newrelic/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

const (
// Version is the full string version of this Go Agent.
Version = "3.15.1"
Version = "3.15.2"
)

var (
Expand Down

0 comments on commit 4b46fc5

Please sign in to comment.