logs: redact plugin arguments

may contain sensitive data

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2024-05-30 18:10:12 +02:00
parent 0597bf1047
commit f63bf7093c
4 changed files with 19 additions and 1 deletions

View File

@@ -29,6 +29,11 @@ type HCLogAdapter struct {
// Log emits a message and key/value pairs at a provided log level
func (l *HCLogAdapter) Log(level hclog.Level, msg string, args ...any) {
// Workaround to avoid logging plugin arguments that may contain sensitive data.
// Check everytime we update go-plugin library.
if msg == "starting plugin" {
return
}
var ev *zerolog.Event
switch level {
case hclog.Info: