improved logging/output options #1168
Replies: 1 comment
-
Thanks for reporting. This code can be improved.
There is no way to do it. Run kube-bench with the
You can see some flags for control log output via run |
Beta Was this translation helpful? Give feedback.
-
Hello,
I get the following error/warning message when running the job at the bottom in a rancher cluster on a worker node (on master I don't get this and the job is similar)
Output
Found that the lines from above are from here: https://github.com/aquasecurity/kube-bench/blob/main/cmd/common.go#L136
From what I could find out fmt in go lang does support fmt.SetOutput to redirect to a file for example https://stackoverflow.com/questions/55149264/how-to-log-fmt-printf-in-custom-file.
I'm doing a decode of the kube-bench run output in json in python, but it fails due to the AuditEnv err which is not in the expected format.
Haven't tried yet --outputfile which should redirect the json to a file, which I can try to read on a later date... but this complicates a bit the whole process...
Do you know if any other options of logging combinations from kube-bench that are able to suppress the lines from above (or any other print message that isn't in json) without having to create a custom filter to suppress this type of output?
Also, not sure if something similar to https://docs.python.org/3/howto/logging.html can be done in golang to implement a more configurable log output. For example in python you can specify stderr/stdout, a file or the level of verbosity and if logging is specified as an option to the script you can have a lot of output possible combinations based on your used options.
Thanks,
Sebastian
Beta Was this translation helpful? Give feedback.
All reactions