kiam icon indicating copy to clipboard operation
kiam copied to clipboard

Info level logs should redact access keys

Open 2rs2ts opened this issue 5 years ago • 4 comments

The info-level logs can be useful but they show access keys in cleartext. Those keys should be redacted unless some debug mode is on.

2rs2ts avatar Feb 27 '19 19:02 2rs2ts

hi @2rs2ts, can you post an example of the access keys being posted (redacted of course). I'd like to know I'm looking at the right function.

mmerrill3 avatar Apr 12 '19 19:04 mmerrill3

Sure thing, here's some output from stern:

kiam-server-5fdd8f777f-ckmdj kiam {"credentials.access.key":"<REDACTED>","credentials.expiration":"2019-04-15T21:15:30Z","credentials.role":"k8s/kube-system/cluster-autoscaler","level":"info","msg":"requested new credentials","time":"2019-04-15T21:00:30Z"}
kiam-server-5fdd8f777f-ckmdj kiam {"credentials.access.key":"<REDACTED>","credentials.expiration":"2019-04-15T21:15:30Z","credentials.role":"k8s/kube-system/cluster-autoscaler","generation.metadata":0,"level":"info","msg":"fetched credentials","pod.iam.role":"k8s/kube
-system/cluster-autoscaler","pod.name":"cluster-autoscaler-58575c4878-7dtdk","pod.namespace":"kube-system","pod.status.ip":"192.168.95.246","pod.status.phase":"Running","resource.version":"111389572","time":"2019-04-15T21:00:30Z"}

I manually redacted the access key from the output here

2rs2ts avatar Apr 15 '19 21:04 2rs2ts

I think access key IDs should not be redacted. They are logged in plaintext in CloudTrail and logging them here is the main way we can correlate logs.

aidansteele avatar Jun 26 '19 11:06 aidansteele

@aidansteele that should be opt-in. Access keys are sensitive data.

2rs2ts avatar Jul 16 '19 22:07 2rs2ts