-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat: Implementing certificate expiry detail in security dashboard #3000
Conversation
Hardikl
commented
Jun 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other comments shared in chat
@@ -1900,14 +1900,185 @@ | |||
], | |||
"type": "stat" | |||
}, | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this dashboard, root SVMs are excluded by default. Are we sure that root SVM certificates also need to be excluded for certificates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, While checking the security/certificates
Rest call, there are no certificates records for root svms. We are good to go here.
Also, I would be adding the scope
field, which shows cluster
or svm
to help customer to see the scope of the certificate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you saying:
a) that root SVMs do not have certificates or
b) that ONTAP does not return certificates for root SVMs
I think you're saying that root SVM have certificates, but ONTAP is not returning them? If that's the case, we should check the expiry for root SVM certificates some other way
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, there is little correction on my above note.
- Out of
admin
andnode
svm (which we treat asroot svm
),admin
svm can have certificates - But, It's cluster scope and not svm scope, (
scope
is only in Rest) which means we don't get svm name in certificate in Rest calls. - We would do little more work to get those detail in Rest, which we are already doing in existing plugin, and we have this comment as well for that reference.
// Admin SVM certificate is cluster scoped, but the REST API does not return the SVM name in its response. Add here for ZAPI parity
- As there are cluster scoped and svm scoped certificates in table, I need to remove the svm filter from query,
So, even the SVM drop down have limited svms but this table shows certificates from all of them.
Screenshot from .127 system
Just to note, Above the table the stats count is showing those admin svm's certificates only(admin svm is unique in cluster) and not all of them.
conf/rest/9.12.0/certificate.yaml
Outdated
- name | ||
- svm | ||
- uuid | ||
instance_labels: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we need to write a Prometheus alert for expiry time, what should the query be?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is label, it's quite difficult to write alert, Let me explore to handle this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to use metric instead of label for this:
This is the alert query for certificates expiring within 1 month:
0 < (certificate_expiry_time{} - time()) < (30*24*3600)
I will add sample warning alert as well for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks good. Also let's add a alert for expired certificates.
security_certificate.yml creates 2 metrics, one
So, to re-use this existing template, only one change is required in dashboard where passing |