alloy
alloy copied to clipboard
TLS version setting is not documented
What's wrong?
This is per a closed issue: https://github.com/grafana/agent/issues/4698
We installed GA 0.37.2 on Windows Server without changing any configuration, error posted in the log files like below:
When I tried to curl the /metrics, it replied with error:
When I used openssl to connect the server:
Steps to reproduce
- Install GA 0.37.2 on Windows Server 2019
- Configure "windows_certificate_filter" with server and client enabled
- Start GA with https enaled
- curl server with
System information
Windows Server 2019
Software version
Grafana Agent 0.37.2
Configuration
server:
log_level: debug
http_tls_config: &tls_config
windows_certificate_filter:
server:
system_store: LocalMachine
store: My
issuer_common_names:
- "<common name>"
client:
issuer_common_names:
- "<common name>"
grpc_tls_config: *tls_config
Logs
No response
May I know where I could set the TLS version and how? As it stated that TLS version and cipher suites are not restricted in the release notes of 0.37.1.
Hi @mattdurham , could you please help check this one? Thanks.
Does it work, if you omit windows_certificate_filter.client
@jkroepke no, the same error
What about
openssl s_client -connect localhost:12345 -tls1_2
hi @jkroepke , I tried it on the windows server, please check the response:
I exported the cert from windows certstore and tried again:
And what happens, if you are using MS Edge?
Maybe RSA PSS certificates has some issue with go.
Apologies was at kubecon, it is an undocumented set of values you can see them in the code here. https://github.com/grafana/agent/blob/c2c40f8a27abe71e35eedf440ab25ae44bf8a9ff/pkg/server/tls.go#L17 . Under http_tls_config you would have a min_version and max_version flag. Valid values are listed here https://github.com/grafana/agent/blob/c2c40f8a27abe71e35eedf440ab25ae44bf8a9ff/pkg/server/tls.go#L115
If I recall correct you need a specific openssl to work with windows properly. I found it easier to import the certificates into firefox/chrome trust them and then hit the endpoints.
hi @mattdurham , thanks for the reply.
Apologies was at kubecon, it is an undocumented set of values you can see them in the code here.
https://github.com/grafana/agent/blob/c2c40f8a27abe71e35eedf440ab25ae44bf8a9ff/pkg/server/tls.go#L17
. Under http_tls_config you would have a min_version and max_version flag. Valid values are listed here https://github.com/grafana/agent/blob/c2c40f8a27abe71e35eedf440ab25ae44bf8a9ff/pkg/server/tls.go#L115
Yes, I was using this config.
If I recall correct you need a specific openssl to work with windows properly. I found it easier to import the certificates into firefox/chrome trust them and then hit the endpoints.
The error posted when prometheus is trying to scrape it, not just from browser.
And what happens, if you are using MS Edge?
Maybe RSA PSS certificates has some issue with go.
I tried both Edge and Chrome, neither of them could be loaded, I am suspecting the code as well.
Apologies was at kubecon, it is an undocumented set of values you can see them in the code here.
https://github.com/grafana/agent/blob/c2c40f8a27abe71e35eedf440ab25ae44bf8a9ff/pkg/server/tls.go#L17
. Under http_tls_config you would have a min_version and max_version flag. Valid values are listed here https://github.com/grafana/agent/blob/c2c40f8a27abe71e35eedf440ab25ae44bf8a9ff/pkg/server/tls.go#L115
Hi @mattdurham , no matter I set what TLS version is, error like "last octet invalid" will post out.
You may need to limit your suites to the one the certificate is using. The windows certificate store doesnt let you investigate the certificate so its very possible the default cipher suites are not suitable. Are you exporting your keys with the full trust chain?
I documented how to setup from a developer perspective but likely good documentation to review. I generally find the windows certificate store and testing it is extremely particular about what it accepts.
hi @mattdurham ,
Thanks for the doc, as the template is set up already by our security and which is widely used by other teams, I cannot modify it and here is the screenshot:
And here is the config file we are using now:
The cert had been imported to the Edge browser, but it is showing error as below:
Any further thought would be much appreciated.
I wonder if its related to https://github.com/golang/go/issues/45990
I wonder if its related to golang/go#45990
Yes, I checked this one as well but found it is almost one year ago, so :P
@mattdurham would like to test or try anything else if there is any, thanks
Its so hard to test, since its certificates and you cant really share that. Does it work if you dont use the certificate store but instead export them and reference them via files?
Thanks @mattdurham , I tried it that way and which looks good:
config file snippet with TLS specified:
able to access the metrics/windows_exporter endpoint:
hi @mattdurham , may I know if there is any update on this issue?
No I cant recreate. So mostly at a dead end on my side. If its possible to share the certificates or dummy generated ones maybe I could dig into it from that angle.
@mattdurham sure, how could I send it to you? Though it is a test one, I would like to send it in a safe way, an email would be better.
Community slack channel is likely the best way, mattd there
Thanks @mattdurham , have sent the cert and key to ya via slack channel
This issue has not had any activity in the past 30 days, so the needs-attention
label has been added to it.
If the opened issue is a bug, check to see if a newer release fixed your issue. If it is no longer relevant, please feel free to close this issue.
The needs-attention
label signals to maintainers that something has fallen through the cracks. No action is needed by you; your issue will be kept open and you do not have to respond to this comment. The label will be removed the next time this job runs if there is new activity.
Thank you for your contributions!
Hi All, Is there any update on this issue? We are rolling out Grafana Agent to windows servers in production environment and this is becoming an blocker for now. Appreciate if there is any further help.
We have tried 0.39.2, issue still persisted.
Thanks @mattdurham for the great help, the modified version (https://github.com/mattdurham/agent/releases/tag/cerstore2) fixed the cert store issue, but there is some limitation, here is the workable config:
If we set tls version to 1.3, even it is a max one, the connection will be broken:
Besides, though I set the cipher_suites in the config (), when I tried to connect it with another cipher, the connection is still set up:
The windows server we are running on is 2019, it does support TLS1.2 only, but how about the cipher suites? I think Grafana Agent should only support the connection with the listed ones but deny the connection with others.
Please help on this one.
Thanks.
Hi there :wave:
On April 9, 2024, Grafana Labs announced Grafana Alloy, the spirital successor to Grafana Agent and the final form of Grafana Agent flow mode. As a result, Grafana Agent has been deprecated and will only be receiving bug and security fixes until its end-of-life around November 1, 2025.
To make things easier for maintainers, we're in the process of migrating all issues tagged variant/flow to the Grafana Alloy repository to have a single home for tracking issues. This issue is likely something we'll want to address in both Grafana Alloy and Grafana Agent, so just because it's being moved doesn't mean we won't address the issue in Grafana Agent :)
@rfratto @mattdurham the TLS cipher issue is still pending for resolution, may I have any update on this? The deadline from our security team is around July 14th.