Skip to content

docs(agent): document trusting a private CA for the collector and relay - #850

Open
mayankpande88 wants to merge 2 commits into
mainfrom
docs/agent-private-ca
Open

mayankpande88 wants to merge 2 commits into
mainfrom
docs/agent-private-ca

Conversation

@mayankpande88

Copy link
Copy Markdown
Contributor

Problem

Self-hosted installs where the collector/relay Ingress uses an internally-issued certificate fail on every outbound call:

incremental post failed ... tls: failed to verify certificate: x509: certificate signed by unknown authority

The runner pod stays Running and its probes pass, so the only visible symptom is a cluster that never reports data. Nothing in the docs covered this.

Changes

  • operate/helm_values.md — new "Collector or relay behind a private CA" section: create the ConfigMap, mount it via runner.extraVolumes/extraVolumeMounts, set SSL_CERT_DIR. One setting covers discovery POSTs, the relay WebSocket, task polling and config refresh, since every one of those clients uses the Go default root pool.
  • installation/index.md — the x509 error in the diagnostic quick reference, plus an in-depth scenario with the grep x509 check.
  • onprem-setup.md — short TLS pointer, since self-hosted is where this happens.

Notes captured in the doc

  • Use SSL_CERT_DIR, not SSL_CERT_FILE: the latter replaces the trust store rather than extending it, dropping the public roots the agent needs elsewhere.
  • additional_env_vars replaces the chart's list rather than merging, so the three CLICKHOUSE_* entries have to be restated alongside SSL_CERT_DIR — omitting them breaks the ClickHouse connection.
  • Verification cannot be turned off for the collector or relay. runner.es.sslVerify looks related but only applies to Elasticsearch.

Self-hosted installs behind an internal CA fail with 'x509: certificate
signed by unknown authority' on every discovery POST while the runner pod
stays Running and healthy, so the only visible symptom is a cluster that
never reports data. Nothing in the docs said how to fix it.

Document the CA mount plus SSL_CERT_DIR in helm_values, add the error to
the installation troubleshooting reference, and point the on-prem page at
it. Notes cover why SSL_CERT_FILE is the wrong knob (it replaces the
trust store instead of extending it) and that additional_env_vars
replaces the chart's list, so the ClickHouse variables must be restated.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation for configuring the nudgebee-agent runner when the collector or relay is behind a private CA, including troubleshooting steps and Helm values configuration. The review feedback suggests improving the clarity of the documentation by rewording an awkward sentence about disabling certificate verification and providing a more detailed explanation of why SSL_CERT_DIR is required in Go environments to preserve the default system trust store.

```

**Resolution:**
Mount your CA into the runner and set `SSL_CERT_DIR`. The full recipe is in [Collector or relay behind a private CA](../operate/helm_values.md#collector-or-relay-behind-a-private-ca). Verification cannot be disabled instead.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The phrase 'Verification cannot be disabled instead' is slightly awkward. It would be clearer to state that disabling certificate verification is not supported. For example:

Mount your CA into the runner and set SSL_CERT_DIR. The full recipe is in [Collector or relay behind a private CA](../operate/helm_values.md#collector-or-relay-behind-a-private-ca). Note that disabling certificate verification is not supported.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken — reworded to "Disabling certificate verification is not supported." in 5f6554a.


Notes:

- Use `SSL_CERT_DIR` and keep `/etc/ssl/certs` in the list. `SSL_CERT_FILE` **replaces** the trust store rather than adding to it, which drops the public roots the agent still needs for every other HTTPS target.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

In Go, setting either SSL_CERT_FILE or SSL_CERT_DIR bypasses the loading of default system trust stores entirely. Since SSL_CERT_FILE only supports a single file path, using SSL_CERT_DIR with a colon-separated list is the only way to load both the default system certificates (from /etc/ssl/certs) and your custom CA certificates. Clarifying this helps users understand why SSL_CERT_DIR is required here. Consider updating the note to:

- Use SSL_CERT_DIR and keep /etc/ssl/certs in the list. In Go, setting either SSL_CERT_FILE or SSL_CERT_DIR bypasses the loading of default system trust stores. Since SSL_CERT_FILE only supports a single file path, using SSL_CERT_DIR with a colon-separated list is the only way to load both the default system certificates (from /etc/ssl/certs) and your custom CA certificates.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Half right, so I took the direction but not the wording.

Setting SSL_CERT_DIR does not bypass the default trust store "entirely" — it overrides only the directory list. The default file list (/etc/ssl/certs/ca-certificates.crt, /etc/ssl/cert.pem, …) is still read as long as SSL_CERT_FILE is unset, per crypto/x509/root_unix.go, where the file loop and the directory loop are independent.

Rewritten in 5f6554a to state the mechanism that is actually load-bearing: Go splits SSL_CERT_DIR on : and reads every directory listed, so keeping /etc/ssl/certs in the list loads the system roots alongside the private CA. Also softened the SSL_CERT_FILE claim — it replaces the default bundle with a single path, rather than definitively dropping the public roots.

…ding

State the mechanism rather than a blanket claim: Go splits SSL_CERT_DIR on
':' and reads every listed directory, so keeping /etc/ssl/certs in the list
loads the system roots alongside the private CA. SSL_CERT_FILE takes one
path and replaces the default bundle; whether public roots survive that
then depends on what the base image leaves loose in /etc/ssl/certs, which
is not something to rely on.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant