-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
security: added CRL check [WIP] #5968
Conversation
etcdmain/config.go
Outdated
fs.BoolVar(&cfg.ClientAutoTLS, "auto-tls", false, "Client TLS using generated certificates") | ||
fs.StringVar(&cfg.PeerTLSInfo.CAFile, "peer-ca-file", "", "DEPRECATED: Path to the peer server TLS CA file.") | ||
fs.StringVar(&cfg.PeerTLSInfo.CertFile, "peer-cert-file", "", "Path to the peer server TLS cert file.") | ||
fs.StringVar(&cfg.PeerTLSInfo.KeyFile, "peer-key-file", "", "Path to the peer server TLS key file.") | ||
fs.BoolVar(&cfg.PeerTLSInfo.ClientCertAuth, "peer-client-cert-auth", false, "Enable peer client cert authentication.") | ||
fs.StringVar(&cfg.PeerTLSInfo.TrustedCAFile, "peer-trusted-ca-file", "", "Path to the peer server TLS trusted CA file.") | ||
fs.StringVar(&cfg.PeerTLSInfo.CRLFile, "peer-crl-file", "", "Path to the peer server certificate revocation list file.") |
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.
these options should also be available via yaml conf in embed/config.go
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.
done
Can we add a e2e or integration test for this? I think the direction is good! |
embed/etcd.go
Outdated
@@ -272,6 +275,27 @@ func startClientListeners(cfg *Config) (sctxs map[string]*serveCtx, err error) { | |||
return sctxs, nil | |||
} | |||
|
|||
func revokeCheckHandler(req *http.Request, CRLpath string) error { |
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 think this should live in tlsutil
? There's nothing etcd specific here.
Mostly looks good aside from some minor code stuff. Thanks! |
aafbf79
to
03272cd
Compare
Can someone explain me why when I add debug info at the beginning of |
@kayrus I debugged this down to the go standard library. The TLS field is set depending on the |
@heyitsanthony what can we do with this? |
@heyitsanthony nice! #5998 did the trick |
52ab929
to
791f37d
Compare
@@ -31,17 +31,20 @@ type Revoke struct { | |||
// status of a certificate (i.e. due to network failure) causes | |||
// verification to fail (a hard failure). | |||
HardFail bool | |||
// HardFailLck is a Mutex locker for the HardFail | |||
HardFailLck sync.Mutex |
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.
please stick to whatever is in upstream?
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.
Updated.
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.
which rev in the cfssl repo has type Revoke struct
? vendored deps shouldn't diverge from upstream...
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 work on several PRs in parallel. Please refer to the main PR message. It is still in progress I will let you know when it will be merged.
@kayrus Let us know when this is reviewable. Probably separate out the vendor and code commits. Thank you a lot! |
@xiang90 sure. That is why this PR has [WIP] postfix. |
44ca396
to
4301f49
Compare
superseded by #8124 |
resolves #4034, uses patches from cloudflare/cfssl#637
Comments are appreciated.
Test certs: https://github.com/endocode/etcd/raw/kayrus/test_certs/test_certs.tgz
Add
/etc/hosts
entry for test certs:Test commands: