- Notifications
You must be signed in to change notification settings - Fork235
-
When the operator is creating a secret it will log at a debug level something like: 2023-07-27 18:31:50,503 DEBUG [io.jav.ope.pro.dep.AbstractDependentResource] (pool-18-thread-1) Creating dependent Secret(apiVersion=v1, data={username=YWRtaW4=, password=OWI0NDliZjM5MTI1NGNlMzg3OWFkNDBkOGYzM2E5MjE=}, immutable=null, kind=Secret, metadata=ObjectMeta(annotations={}, creationTimestamp=null, deletionGracePeriodSeconds=null, deletionTimestamp=null, ... Should the data / stringData be redacted? |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 4 comments 10 replies
-
Definitely. Seems almost like a weakness in JOSDK, IMHO secrets should never be leaked in a log. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Yep, not on debug level, will issue a fix. |
BetaWas this translation helpful?Give feedback.
All reactions
-
Hmmmm, isn't leaking credentials at any log level considered an antipattern? ;) |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Well, depends, don't have strong opinion on this, historically framework logs for example requests/response pairs (in terms of WS) on trace level. While doing this generally, req/resp might contain any sensitive data. To my knowledge the approach to log such sensitive data on trace level is quite widely accepted. It's true that secret is not just any object but specifically there to hold sensitive data. Not sure if we should make an exception for that. But don't have strong opinion :) fine to have not logging the resource, just this is very handy sometimes. |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
As far as I can tell, it's a good practice any data that's explicitly considered as credentials to be redacted in logs (AFAIK e.g. Jenkins does it). Unless explicitly printed on purpose (initial admin e.g.). |
BetaWas this translation helpful?Give feedback.
All reactions
-
Jenkins replaces the credetial occurences in all logs (with some mask), this makes sense since it is hard to prevent logging the credential into the logs in first place (given the nature how these build scripts work on Jenkins). What I'm saying that for dev purposes logging k8s objects is handy on these cases, and trace level logging should never be turned on in production. |
BetaWas this translation helpful?Give feedback.
All reactions
-
removed the log, just the simplified without the actual data will be logged on debug level |
BetaWas this translation helpful?Give feedback.
All reactions
👍 2
-
@csviri SSABasedGenericKubernetesResourceMatcher has the same issue: Line 93 inf936a51
|
BetaWas this translation helpful?Give feedback.
All reactions
-
ahh, ok but it is really needed there, can't we agree that we will log those on trace levels? |
BetaWas this translation helpful?Give feedback.
All reactions
-
BetaWas this translation helpful?Give feedback.
All reactions
-
maybe something like this as alternative:#2003 |
BetaWas this translation helpful?Give feedback.
All reactions
-
More generally speaking, maybe we should consider reworking the logging in JOSDK for v5 to align better with observability requirements? |
BetaWas this translation helpful?Give feedback.