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

Add debugging messages for trust pinning #818

Closed
wants to merge 1 commit into from

Conversation

dnwake
Copy link

@dnwake dnwake commented Jul 7, 2016

closes #817

Signed-off-by: David Wake dwake@box.com

@docker-jenkins
Copy link

Can one of the admins verify this patch?

closes notaryproject#817

Signed-off-by: David Wake <dwake@box.com>
@dnwake dnwake force-pushed the debug_trust_pinning branch from 4face5f to c52c666 Compare July 7, 2016 23:02
@cyli
Copy link
Contributor

cyli commented Jul 7, 2016

jenkins, test this please

@@ -47,6 +49,7 @@ func NewTrustPinChecker(trustPinConfig TrustPinConfig, gun string) (CertChecker,
caRootPool := x509.NewCertPool()
for _, caCert := range caCerts {
if err = trustmanager.ValidateCertificate(caCert); err != nil {
logrus.Debugf("Trust-pinning validation for child cert failed: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Many apologies - I think the above comment may be out of date. This block only goes over all the CA certs listed in the root CA bundle and ensures that it's not expired and that it has a big enough RSA key, before using it to do any kind of validation of the root certs.

So it may make more sense to either leave out the message entirely or to say "Ignoring root CA certificate ??? in bundle: %s", err" By ??? I mean some way of identifying the cert in the cert bundle - maybe it's fingerprint, or maybe something like 1 of 3, so you can identify which one in the bundle is invalid?

@cyli
Copy link
Contributor

cyli commented Jul 8, 2016

Thank you so much for improving our logs @dnwake! I have some slight phrasing nitpicks, but other than that this LGTM!

@riyazdf
Copy link
Contributor

riyazdf commented Jul 8, 2016

thanks for adding these @dnwake!

LGTM with @cyli's comments -- also this is a nit but would be nice to have debugs start with lowercase for consistency

endophage added a commit that referenced this pull request Jul 29, 2016
@riyazdf
Copy link
Contributor

riyazdf commented Aug 4, 2016

closed by #858

@riyazdf riyazdf closed this Aug 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inadequate debug logging for trust-pinning
6 participants