]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/notification: add logic to prevent logging password associated with topics. 57809/head
authorkchheda3 <kchheda3@bloomberg.net>
Fri, 31 May 2024 20:22:31 +0000 (16:22 -0400)
committerkchheda3 <kchheda3@bloomberg.net>
Fri, 31 May 2024 20:22:31 +0000 (16:22 -0400)
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>
src/rgw/rgw_common.cc

index 4c9203093487e5fa2320cae33c2b60d584dcf7ef..76aadbd06e65b41b826fc409d13e4ce3044b51f7 100644 (file)
@@ -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);
     }