Original install method (e.g. download page, yum, from source, etc.): ESS
Describe the bug:
Synthetics global parameters will automatically trim line breaks from the defined value. This prohibits the ability to define a PEM encoded certificate within a global parameter as the required line breaks within a PEM certificate will not be parsed.
An example of this can be seen below. The following screenshots demonstrates how one would define a PEM encoded certificate as a global parameter:
When applying the global parameter to a lightweight monitor, the line breaks are removed resulting in an invalid configuration that is applied. Below is an output from the computed config captured from the resulting agent diagnostic:
When applying a global parameter, line breaks should not be removed. As a workaround, one can instead define a certificate manually within the lightweight monitor's yaml file in order to insure line breaks are included within the defined certificate within a certificate authority:
The following error will be displayed within the browser when attempting to pull a certificate authority from a global parameter:
Provide logs and/or server output (if relevant):
{"log.level":"error","@timestamp":"2024-07-29T17:40:49.033Z","message":"Failed to add CA to the cert pool, CA is not a valid PEM document","component":{"binary":"heartbeat","dataset":"elastic_agent.heartbeat","id":"synthetics/http-default","type":"synthetics/http"},"log":{"source":"synthetics/http-default"},"log.origin":{"file.line":230,"file.name":"tlscommon/tls.go","function":"github.com/elastic/elastic-agent-libs/transport/tlscommon.LoadCertificateAuthorities"},"service.name":"heartbeat","ecs.version":"1.6.0","log.logger":"tls","ecs.version":"1.6.0"}
{"log.level":"error","@timestamp":"2024-07-29T17:40:49.033Z","message":"job could not be initialized: file is not a certificate adding inline to the list of known CAs accessing 'streams.0'","component":{"binary":"heartbeat","dataset":"elastic_agent.heartbeat","id":"synthetics/http-default","type":"synthetics/http"},"log":{"source":"synthetics/http-default"},"ecs.version":"1.6.0","log.origin":{"file.line":176,"file.name":"monitors/monitor.go","function":"github.com/elastic/beats/v7/heartbeat/monitors.newMonitorUnsafe"},"service.name":"heartbeat","ecs.version":"1.6.0"}
Kibana version: 8.14.3
Elasticsearch version: 8.14.3
Original install method (e.g. download page, yum, from source, etc.): ESS
Describe the bug:
Synthetics global parameters will automatically trim line breaks from the defined value. This prohibits the ability to define a PEM encoded certificate within a global parameter as the required line breaks within a PEM certificate will not be parsed.
An example of this can be seen below. The following screenshots demonstrates how one would define a PEM encoded certificate as a global parameter:
When applying the global parameter to a lightweight monitor, the line breaks are removed resulting in an invalid configuration that is applied. Below is an output from the computed config captured from the resulting agent diagnostic:
Expected behavior:
When applying a global parameter, line breaks should not be removed. As a workaround, one can instead define a certificate manually within the lightweight monitor's yaml file in order to insure line breaks are included within the defined certificate within a certificate authority:
Screenshots (if relevant):
Errors in browser console (if relevant):
The following error will be displayed within the browser when attempting to pull a certificate authority from a global parameter:
Provide logs and/or server output (if relevant):
Any additional context: