Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upadd possibilty to set server_name through relabel config #4827
Comments
This comment has been minimized.
This comment has been minimized.
|
Can you explain more about why you want this? |
This comment has been minimized.
This comment has been minimized.
|
Thank you for fast reply, Brian The use case for this is in kubernetes and I guess other cloud platform where the tls certificate is not issued for the ip address but hostname. if you want to have tls connection to several targets which are using different certificates and you don't want to use the insecure_skip_verify=true then you need to create to job for each target where you set the server_name to hostname. For example if you have 2 pods and they have certificates issued to alfa.io for the first pod and beta.io for the second. To be able to scrape them I need a configuration like |
This comment has been minimized.
This comment has been minimized.
|
I think this can be argumented in a few directions:
I think my personal opinion is that we should have the flexibility to configure this via service discovery, even if I understand to some degree that 1 might be have the best security characteristics. I've tried researching this type of PKI problem a number of times, but was never able to find a clear recommendation for 1 or 2, but I'm more than happy to learn something new |
This comment has been minimized.
This comment has been minimized.
|
Hi, |
This comment has been minimized.
This comment has been minimized.
tsaarni
commented
Nov 29, 2018
|
Using IP address as subject for a certificate is problematic in Kubernetes since pod IPs are ephemeral. Consider an example:
Now two valid certificates exist with SAN IP:10.1.0.24 - one that was associated with pod A and second associated with pod B. Identities based on short lived IP address assignments would require very elaborate automation, including realtime support for revoking certificates and verification of revocation status at each time client connects the server. Therefore I would consider any authentication scheme based on short lived IP address to be a bad match from security perspective. Subject name should be some stable identifier, preferably something provisioned by administrator. Consider another example:
After TLS handshake there is a proof that Pod A is in possession of private key associated to certificate with SAN DNS:A. |
efahale commentedNov 6, 2018
Hi,
Proposal
Would it be possible to request that server_name in the tls config can be set through relabel config.
I was told in it is not possible to do this when asked in prometheus-users mailing list.
https://groups.google.com/forum/#!searchin/prometheus-users/efahale%7Csort:date/prometheus-users/Ca4pE5MEC8g/xxJtXg5qAwAJ
This will simplify the prometheus configuration where the certitificate doesn't contain targets IP address.