Skip to content
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

Extract end-entity certificate data only #4856

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions plugins/inputs/x509_cert/x509_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,10 @@ func (c *X509Cert) Gather(acc telegraf.Accumulator) error {
"source": location,
}

for _, cert := range certs {
fields := getFields(cert, now)
// Only extract data from the end-entity certificate (first in the chain)
fields := getFields(certs[0], now)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test the length of certs before indexing, just in case.


acc.AddFields("x509_cert", fields, tags)
}
acc.AddFields("x509_cert", fields, tags)
}

return nil
Expand Down