summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkchheda3 <kchheda3@bloomberg.net>2024-05-31 22:22:31 +0200
committerkchheda3 <kchheda3@bloomberg.net>2024-05-31 22:22:31 +0200
commit3840b2c41c2e0e271673707c64af609c9227c4d8 (patch)
treea024ed047a0626bba369d33a11548edaab4432f6
parentMerge PR #57478 into main (diff)
downloadceph-3840b2c41c2e0e271673707c64af609c9227c4d8.tar.xz
ceph-3840b2c41c2e0e271673707c64af609c9227c4d8.zip
rgw/notification: add logic to prevent logging password associated with topics.
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>
-rw-r--r--src/rgw/rgw_common.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc
index 4c920309348..76aadbd06e6 100644
--- a/src/rgw/rgw_common.cc
+++ b/src/rgw/rgw_common.cc
@@ -874,7 +874,17 @@ int RGWHTTPArgs::parse(const DoutPrefixProvider *dpp)
});
}
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);
}