Skip to content

[9.5] (backport #15427) Override fleet.ssl.certificate_authorities from env vars in container mode#15465

Open
mergify[bot] wants to merge 1 commit into
9.5from
mergify/bp/9.5/pr-15427
Open

[9.5] (backport #15427) Override fleet.ssl.certificate_authorities from env vars in container mode#15465
mergify[bot] wants to merge 1 commit into
9.5from
mergify/bp/9.5/pr-15427

Conversation

@mergify

@mergify mergify Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

When in container mode, override fleet.ssl.certificate_authorities from env vars FLEET_CA, KIBANA_CA, and ELASTICSEARCH_CA instead of using saved fleet.enc values.

Follows the same first-set-wins fallback chain used in setup_config.go.

Why is it important?

Without this override, an agent running in container mode will crash during startup if fleet.enc still contains a fleet.ssl.certificate_authorities path that no longer exists on disk.

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

N/A

How to test this PR locally

Unit test: TestContainerEnvOverridesFleetTLSPaths
Integration test: TestContainerCMDTLSCertOverride
Manually: Using kind, deploy ECK cluster. Enroll an agent with FLEET_SERVER_CLIENT_AUTH=required and FLEET_CA pointing to a mounted CA bundle. Unmount the CA bundle, unset env vars, and verify that agent restarts healthy.

Related issues

Closes #15408
Relates #14408


This is an automatic backport of pull request #15427 done by Mergify.

… mode (#15427)

Reads fleet.ssl.certificate_authorities from the first-set of FLEET_CA, KIBANA_CA, ELASTICSEARCH_CA over potentially stale fleet.enc values.

(cherry picked from commit 3ca03cf)
@mergify mergify Bot added the backport label Jul 11, 2026
@mergify mergify Bot requested a review from a team as a code owner July 11, 2026 12:45
@mergify mergify Bot requested review from ycombinator and removed request for a team July 11, 2026 12:45
@mergify mergify Bot added the backport label Jul 11, 2026
@mergify mergify Bot requested a review from lorienhu July 11, 2026 12:45
@github-actions github-actions Bot added the bug Something isn't working label Jul 11, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

cc @lorienhu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant