-
Notifications
You must be signed in to change notification settings - Fork 224
WIP Add TLS key log to okta and duo libs, use in add
#133
Conversation
I'd argue that MITM is much more secure. Takes more of a conscious effort to install a root CA. |
cmd/root.go
Outdated
@@ -21,6 +22,12 @@ var ( | |||
ErrFailedToValidateCredentials = errors.New("Failed to validate credentials") | |||
) | |||
|
|||
// if non-zero, will log TLS keys to this file | |||
var UseTLSKeyLogFile = "yes" |
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'll disable this by default in the real PR
I dunno, the limited scope of key logging to me says more secure? At any rate, I'd argue it takes a pretty conscious effort to
Plus it limits your ability to shoot yourself in the foot by only logging for this invocation. You can still have a standard installation of |
Can we setup a docker image with aws-okta and a root CA installed? That would keep the scope of the root CA to only aws-okta, and might be able to work without needing custom code inside the application. Could be a reasonable pattern for debugging other apps as well if we can make it run smoothly for aws-okta. |
Yep, that's reasonable. You'd only be able to test the Linux version, but I can't imagine the HTTP behaviour would be that different |
If it requires recompiling with a build flag then that seems like a reasonable compromise. In any case, MITM proxies are pretty typical for debugging TLS both in normal development and in the security community. Lots of options that don't require adding it as a global root certificate to your personal keychain. Even that isn't too bad though since it's only trusted by you and can only be used by you to access websites you're trying to debug. |
I did a write up of the two methods here. |
This is a POC to show how TLS key logging might look, addressing #129. TLS key logging works by logging TLS session keys to a log file, which can then be used to decrypt a packet capture, even in the face of perfect forward secrecy.
go build -ldflags='-X cmd.UseTLSKeyLogFile=yes'
; this would be disabled in general releaseSSLKEYLOGFILE=./keylog aws-okta add
ssl && http
to see decrypted SSL.I believe this would be fairly straightforward way for advanced users to be able to debug their raw HTTP traffic.
Alternatives:
Setting up a MITM with omni-CA a la Charles
MITM's all traffic and requires installing a root CA. Not very 🔒
Dump all HTTP traffic to a file instead