New TRP Sample – check certs against the ICSI Notary

New TRP Sample – check certs against the ICSI Notary

The ICSI Certificate Notary project provides a public DNS service where you can validate SSL certificates against what it has seen. All you have to do is send a DNS TXT request for {sha1-of-DER-cert} and deal with the results.

  • NXDOMAIN → this is a never before seen certificate
  • TXT → cert seen. If validate=1 it has also been validated upto root

Let us use the SSL Cert resources and check each one against the notary. This kind of bulk checking begs for automation and there is where the TRP shines. Using a tiny bit of Ruby and the trisulrp and dnsruby gems we have a very neat way to use the DNS service.

 Download and run checknotary.rb. on github The script is well commented. 

Sample output

You can schedule this script to run every hour as the DNS service zone files are updated at that rate.

$ ruby checknotary.rb 12001
Enter PEM pass phrase:
    ^-- not validated NAME:/C=US/O=The Go Daddy Group, Inc./OU=Go Daddy Class 2 Certification Authority
# [OK VALID]  -> Seen and validate=1 in the TXT record
# [OK] -> Seen but validate=0 in TXT record
# [FAILED] -> Received a NXDOMAIN, cert not seen

Scope for further automation

You can automate this even further by pulling the PCAPs for the certificates that dont pass.

Existing Trisul users are encouraged to try this script. If you arent yet using Trisul, you should be. Check out Trisul 3.0