-
Notifications
You must be signed in to change notification settings - Fork 82
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
Redact static tokens and custom http headers #4182
Redact static tokens and custom http headers #4182
Conversation
This pull request does not have a backport label. Could you fix it @michel-laterman? 🙏
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aside a small nit this LGTM
e9439f4
to
ecdeb34
Compare
anther test failure from #4170 |
internal/pkg/config/config.go
Outdated
for k, v := range redacted.Elasticsearch.ProxyHeaders { | ||
proxyHeaders[k] = v | ||
lk := strings.ToLower(k) | ||
if strings.Contains(lk, "auth") || strings.Contains(lk, "token") || strings.Contains(lk, "key") || strings.Contains(lk, "bearer") { // best-effort scan to redact sensitive headers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a function just to prevent people from forgetting to update both places.
We could also one day split out a lot of our best effort redaction logic into a reusable package.
Quality Gate passedIssues Measures |
Redact sensitive values in headers and static token within the Config.Redact() (cherry picked from commit d0993e8) # Conflicts: # internal/pkg/config/config.go
Redact sensitive values in headers and static token within the Config.Redact() (cherry picked from commit d0993e8) # Conflicts: # internal/pkg/config/config.go
Redact sensitive values in headers and static token within the Config.Redact() (cherry picked from commit d0993e8) # Conflicts: # internal/pkg/config/config.go
…4189) * Redact static tokens and custom http headers (#4182) Redact sensitive values in headers and static token within the Config.Redact() (cherry picked from commit d0993e8) # Conflicts: # internal/pkg/config/config.go * Fix merge conflict --------- Co-authored-by: Michel Laterman <[email protected]> Co-authored-by: michel-laterman <[email protected]>
…4190) * Redact static tokens and custom http headers (#4182) Redact sensitive values in headers and static token within the Config.Redact() (cherry picked from commit d0993e8) # Conflicts: # internal/pkg/config/config.go * Fix merge conflict --------- Co-authored-by: Michel Laterman <[email protected]> Co-authored-by: michel-laterman <[email protected]>
…4191) * Redact static tokens and custom http headers (#4182) Redact sensitive values in headers and static token within the Config.Redact() (cherry picked from commit d0993e8) # Conflicts: # internal/pkg/config/config.go * Fix merge conflict --------- Co-authored-by: Michel Laterman <[email protected]> Co-authored-by: michel-laterman <[email protected]>
What is the problem this PR solves?
Static tokens and (potentially) custom http headers can expose secrets in diagnostic bundles.
How does this PR solve the problem?
Redact sensitive values within the
Config.Redact()
call,Design Checklist
I have ensured my design is stateless and will work when multiple fleet-server instances are behind a load balancer.I have or intend to scale test my changes, ensuring it will work reliably with 100K+ agents connected.I have included fail safe mechanisms to limit the load on fleet-server: rate limiting, circuit breakers, caching, load shedding, etc.