Follow-up to commit https://github.com/ceph/ceph/pull/56493/commits/
334009fb7364bea6c4d4ba91901d18641811ac5f as part of PR #56493, add logic to mask the password printed.
Signed-off-by: kchheda3 <kchheda3@bloomberg.net>
});
}
string& val = nv.get_val();
- ldpp_dout(dpp, 10) << "name: " << name << " val: " << val << dendl;
+ static constexpr std::initializer_list<const char*>
+ sensitive_keyword_list = {"password"};
+ bool is_sensitive = false;
+ for (const auto& key : sensitive_keyword_list) {
+ if (name.find(key) != std::string::npos) {
+ is_sensitive = true;
+ break;
+ }
+ }
+ ldpp_dout(dpp, 10) << "name: " << name
+ << " val: " << (is_sensitive ? "****" : val) << dendl;
append(name, val);
}