Skip to content
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

[Fleet] Remote Elasticsearch output do not support custom ssl certificate #3490

Closed
nchaulet opened this issue Apr 24, 2024 · 2 comments · Fixed by #3522
Closed

[Fleet] Remote Elasticsearch output do not support custom ssl certificate #3490

nchaulet opened this issue Apr 24, 2024 · 2 comments · Fixed by #3522
Assignees
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Fleet Label for the Fleet team

Comments

@nchaulet
Copy link
Member

nchaulet commented Apr 24, 2024

Description

It seems we do not support remote Elasticsearch output with custom certificate in Fleet server. When creating a remote output with an ES using self signed certificate and providing the ssl configuration in the advanced settings, the output is mark as unhealthy and agent using that policy are not sending data to the new remote ES.

It seems we do not use the whole output configuration when creating the Elasticsearch client to connect to the remote Elastic Search in Fleet Server. This cause Fleet server being unable to verify the output health or to create API keys for other Elastic agent.

Relevant code path, looks like we create the remote output client only with the host and service token, this is probably what need to be fixed. https://github.com/elastic/fleet-server/blob/main/internal/pkg/bulk/engine.go#L200

Workaround

I do not see any workaround, and this probably should be fixed with a new version.

@nchaulet nchaulet added bug Something isn't working Team:Fleet Label for the Fleet team labels Apr 24, 2024
@ycombinator ycombinator added the Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team label Apr 27, 2024
@nchaulet nchaulet self-assigned this May 1, 2024
@nchaulet
Copy link
Member Author

nchaulet commented May 6, 2024

I started to take a look, and I think here

hostsObj := outputMap[outputName]["hosts"]
we can create a config.Elasticsearch structure from the outputMap entry and then use the ToESConfig method to create the client for the remote output @michel-laterman @juliaElastic does it make sense to you?

@juliaElastic
Copy link
Contributor

we can create a config.Elasticsearch structure from the outputMap entry and then use the ToESConfig method to create the client for the remote output @michel-laterman @juliaElastic does it make sense to you?

Sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Fleet Label for the Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants