From: Casey Bodley Date: Mon, 10 Dec 2018 17:38:01 +0000 (-0500) Subject: rgw: sanitize customer encryption keys from log output in v4 auth X-Git-Tag: v12.2.11~43 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f8f30fc3718d723d58633db4b0ca838c5fa32a12;p=ceph.git rgw: sanitize customer encryption keys from log output in v4 auth Fixes: http://tracker.ceph.com/issues/37847 Signed-off-by: Casey Bodley (cherry picked from commit ba55e2a96c9dfcc7aa2311431beaaa23cb05c30d) --- diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc index 0904e825520e..e685705eec0f 100644 --- a/src/rgw/rgw_auth_s3.cc +++ b/src/rgw/rgw_auth_s3.cc @@ -659,7 +659,8 @@ get_v4_canon_req_hash(CephContext* cct, const auto canonical_req_hash = calc_hash_sha256(canonical_req); - ldout(cct, 10) << "canonical request = " << canonical_req << dendl; + using sanitize = rgw::crypt_sanitize::log_content; + ldout(cct, 10) << "canonical request = " << sanitize{canonical_req} << dendl; ldout(cct, 10) << "canonical request hash = " << buf_to_hex(canonical_req_hash).data() << dendl; diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 3b07327f38d7..6534e254ec23 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3751,8 +3751,9 @@ AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s, boost::optional canonical_headers = \ get_v4_canonical_headers(s->info, signed_hdrs, using_qs); if (canonical_headers) { - ldout(s->cct, 10) << "canonical headers format = " << *canonical_headers - << dendl; + using sanitize = rgw::crypt_sanitize::log_content; + ldout(s->cct, 10) << "canonical headers format = " + << sanitize{*canonical_headers} << dendl; } else { throw -EPERM; }