Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Aug 27, 2025

  • Bug

What does this PR do?

Updates diagnostics redaction process to redact secrets from pre-config, computed-config, components-expected and components-actual files in the diagnostics archive

Why is it important?

This pr increases the scope of the redaction to all files where they may be exposed

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in ./changelog/fragments using the changelog tool
  • I have added an integration test or an E2E test

Disruptive User Impact

none

How to test this PR locally

  • Build the agent
  • Create policy with integrations that have secrets, I used aws-cloudwatch
  • Enroll the agent
  • Request diagnostics
  • Validate that the secrets are redacted

This is an automatic backport of pull request #9560 done by [Mergify](https://mergify.com).

* fix(5871): added secret marker func

* fix(5871): added redaction marker test

* fix(5871): added secret marker in coordinator

* fix(5871): added secret marker func in coordinator unit tests

* fix(5871): update redactMap to handle redaction markers

* fix(5871): update redactmap tests

* fix(5871): update diagnostics integration test

* fix(5871): udpate inspect command to inject redaction markers

* fix(5871): add changelog fragment

(cherry picked from commit a44e87a)

# Conflicts:
#	internal/pkg/agent/application/coordinator/coordinator.go
@mergify mergify bot requested a review from a team as a code owner August 27, 2025 09:44
@mergify mergify bot added backport conflicts There is a conflict in the backported pull request labels Aug 27, 2025
@mergify mergify bot requested review from michel-laterman and pchila and removed request for a team August 27, 2025 09:44
Copy link
Contributor Author

mergify bot commented Aug 27, 2025

Cherry-pick of a44e87a has failed:

On branch mergify/bp/9.0/pr-9560
Your branch is up to date with 'origin/9.0'.

You are currently cherry-picking commit a44e87a24.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	new file:   changelog/fragments/1756122869-update-secret-redaction-in-diagnostics.yaml
	modified:   internal/pkg/agent/application/coordinator/coordinator_unit_test.go
	modified:   internal/pkg/agent/cmd/inspect.go
	modified:   internal/pkg/diagnostics/diagnostics.go
	modified:   internal/pkg/diagnostics/diagnostics_test.go
	modified:   testing/integration/ess/diagnostics_test.go

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   internal/pkg/agent/application/coordinator/coordinator.go

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify mergify bot mentioned this pull request Aug 27, 2025
6 tasks
@github-actions github-actions bot added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Aug 27, 2025
@elasticmachine
Copy link
Collaborator

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

@kaanyalti kaanyalti removed the conflicts There is a conflict in the backported pull request label Aug 28, 2025
Copy link

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @kaanyalti

Copy link
Contributor Author

mergify bot commented Sep 1, 2025

This pull request has not been merged yet. Could you please review and merge it @kaanyalti? 🙏

@kaanyalti kaanyalti merged commit 4d6ed93 into 9.0 Sep 2, 2025
20 checks passed
@kaanyalti kaanyalti deleted the mergify/bp/9.0/pr-9560 branch September 2, 2025 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants