Add ctparsewatch
It watches for certificates which we can't fully parse
This commit is contained in:
parent
786e9e3460
commit
81bfa0bbd8
|
@ -0,0 +1 @@
|
||||||
|
/ctparsewatch
|
|
@ -0,0 +1,40 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"src.agwa.name/ctwatch"
|
||||||
|
"src.agwa.name/ctwatch/ct"
|
||||||
|
"src.agwa.name/ctwatch/cmd"
|
||||||
|
)
|
||||||
|
|
||||||
|
func DefaultStateDir () string {
|
||||||
|
if envVar := os.Getenv("CTPARSEWATCH_STATE_DIR"); envVar != "" {
|
||||||
|
return envVar
|
||||||
|
} else {
|
||||||
|
return cmd.DefaultStateDir("ctparsewatch")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var stateDir = flag.String("state_dir", DefaultStateDir(), "Directory for storing state")
|
||||||
|
|
||||||
|
func processEntry (scanner *ctwatch.Scanner, entry *ct.LogEntry) {
|
||||||
|
info := ctwatch.EntryInfo{
|
||||||
|
LogUri: scanner.LogUri,
|
||||||
|
Entry: entry,
|
||||||
|
IsPrecert: ctwatch.IsPrecert(entry),
|
||||||
|
FullChain: ctwatch.GetFullChain(entry),
|
||||||
|
}
|
||||||
|
|
||||||
|
info.CertInfo, info.ParseError = ctwatch.MakeCertInfoFromLogEntry(entry)
|
||||||
|
|
||||||
|
if info.HasParseErrors() {
|
||||||
|
cmd.LogEntry(&info)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
flag.Parse()
|
||||||
|
cmd.Main(*stateDir, processEntry)
|
||||||
|
}
|
Loading…
Reference in New Issue