-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Surface a metric to enable users to alert on when a client's cert age is close to expiring #100699
Comments
@abhinavg6, does identity have a project board on github? |
I don't think so Kevin. @zaneteh-crl - This is a CRDB specific certs related issue which is being escalated by a key SH customer. And based on internal discussions between @duoclikebook and others, Identity team maybe on the hook for such things. So Kevin is asking if he could assign it to a Identity team board on Github. |
I'm not aware of a project board on github for Identity. We can track things through the JIRA ticket. |
Some pointers for the Identity team: There are already some metrics created for some types of certificates here: but there are no metrics for this one, which I assume if the ask for this issue: cockroach/pkg/security/certificate_manager.go Line 124 in 77d9d01
You who is working on this might start on that. |
The pointers look right to me, I imagine it should look something like:
Looks like the mapping |
The tricky part is we'll need to partition the metric by SQL username it seems. The amount of dev work seems light, so I'd estimate it is ~0.5–1 week |
Folk you are forgetting something. The client cert file(s) are stored on the client, not the server. In most installs, the server simply won't see them at all. So we can't get a reliable metric server-side. The best we can do is each time a client connects and presents a client cert look at the expiration and "do something" with it. Then we have another bit of complexity. For any given username, different clients can use different certs. What if different certs have different expiry? What would we want to report in that case? I'd be wary to consider an implementation here until we properly identify what problem needs to be solved and what would be the UX of a solution. |
In any case that sounds like at least 1-2 weeks of analysis and discussion with PM and the customer, plus some extra time for implementation, the complexity of which will depend on the desired semantics. |
Any monitoring we do on the server side will be flawed, but it still seems worth making an effort here if we can get something "good enough" that is substantially easier than setting up monitoring on the client side (where I'm not aware of common tools or practices that we can easily advocate) Here are a few straw proposals to consider:
Another thing worth considering is to encourage some sort of "client instance ID" in a certificate so that we could tell reliably when one certificate completely replaces another instead of having to make guesses about whether or not other copies of the certificate may still be in use. |
Internal discussion here: https://cockroachlabs.slack.com/archives/CGA9F858R/p1682366134421889 |
This issue tracks adding a metric that allows users to alert when client's cert age is close to expiring.
Per Sean-
Hypothetically, a server-side VerifyConnection function such as https://pkg.go.dev/crypto/tls#example-Config-VerifyConnection will allow us to poke at the peer's ConnectionState, which has the NotAfter attribute, and we can use time.Now().Sub(crt.NotAfter) to emit an aggregate time.Duration that can be polled via a prom endpoint that customers can alert on now that this information has been exposed._
Related issue: #99422
Jira issue: CRDB-26585
The text was updated successfully, but these errors were encountered: