elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
21 stars 144 forks source link

Make redaction of common keys in diagnostics case insensitive #6109

Open andrzej-stencel opened 1 day ago

andrzej-stencel commented 1 day ago

What does this PR do?

Changes the redaction of common keys like "password" to be case insensitive. This means keys like "PASSWORD" and "PassWord" will also be redacted.

Why is it important?

To prevent leaking secrets into diagnostics.

Checklist

Disruptive User Impact

This may cause keys that were previously not redacted to be redacted after the change. For example, the "Key" substring may be common in configuration keys that don't need redaction.

How to test this PR locally

cd internal/pkg/diagnostics
go test .
andrzej-stencel commented 1 day ago

Should this be backported into 8.16? I marked this as an "enhancement", but maybe it is a bug fix?

elasticmachine commented 1 day ago

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

pkoutsovasilis commented 1 day ago

AFAICT unit-test fail because otel collector never reports healthy (unrelated to this PR) and the serverless ones are due to the BK agent (Error: error creating test runner: error checking region setting: Non-201 status code returned by server: 503)?!

ycombinator commented 1 day ago

Should this be backported into 8.16? I marked this as an "enhancement", but maybe it is a bug fix?

I agree, this feels more like a bug than an enhancement. Added backport labels and bug label instead of enhancement.

ycombinator commented 1 day ago

@andrzej-stencel Please add a changelog fragment to this PR using https://github.com/elastic/elastic-agent-changelog-tool. Thanks!

elastic-sonarqube[bot] commented 2 hours ago

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
100.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube