-
Notifications
You must be signed in to change notification settings - Fork 83
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
Panic occurs when certificates do not exist on disk #44
Comments
There's also a panic if you set
|
To be clear, we should do this by handling this subcategory of error using https://pkg.go.dev/os#IsNotExist (i.e. not by statting the file first to see if it exists). We should also have a separate useful error for the empty string. |
@pgporada - FWIW setting
@jsha - Perhaps a better way of handling this is simply to not set the ca, cert and key values by default? Changing defaults can break things for sure, but if this exporter is expected to be run on Prometheus targets (ie. hosts running Unbound) then communication between the exporter and unbound-control is local to the host anyway. If I'm interpreting the docs correctly TLS is ignored even when unbound-exporter (9167) -------TLS------> unbound-control (8953) ------->no-TLS------> unbound server (53) ...which is a bit odd. |
The "socket" terminology is a little confusing because there are both TCP sockets and Unix domain sockets. I believe the docs are saying "If you are using TCP sockets, the TLS options are relevant. If you are using Unix domain sockets, the TLS options are ignored." I have a slight preference here for being opinionated, and supporting only the mode of operation that uses Unix domain sockets. It is simpler to configure and (broadly speaking) more secure. That would allow us to remove the certificate options entirely from unbound-exporter. |
I finally got around to testing this and you are correct.
Agreed. TLS seems more valuable inbound to the exporter anyway ( #50 ) where the connection is much less likely to be local to the host. |
Note that I am missing the
-unbound.ca
flag which then defaults to a non-existant file/etc/unbound/unbound_server.pem
. We should detect file existence and not panic.Systemd unit
Logs
The text was updated successfully, but these errors were encountered: