Skip to content

Commit dd63835

Browse files
fix: do not log MongoDB passwords
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 27fb4d4 commit dd63835

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

db/slurper_mongodb.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,11 @@ func MakeMongoSlurper(host string, database string, user string, password string
262262
s.TypeDispatch[t] = make(chan types.Entry, 1000)
263263
}
264264
url := fmt.Sprintf("mongodb://%s:%s@%s/%s", s.User, s.Password, s.Host, s.Database)
265-
s.Logger.WithFields(log.Fields{"url": url}).Info("preparing for MongoDB connection")
265+
s.Logger.WithFields(log.Fields{
266+
"host": s.Host,
267+
"database": s.Database,
268+
"user": s.User,
269+
}).Info("preparing for MongoDB connection")
266270
return s
267271
}
268272

0 commit comments

Comments
 (0)