Skip to content

Commit 8f2b2ad

Browse files
authored
Merge pull request ceph#63212 from pritha-srivastava/wip-rgw-sts-key-default-val
rgw/sts: removing default value of rgw sts key and adding checks to return error when it is not set in config options Reviewed-by: Casey Bodley <[email protected]> Reviewed-by: Matt Benjamin <[email protected]>
2 parents cbdc221 + fc57ec7 commit 8f2b2ad

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

src/common/options/rgw.yaml.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3470,7 +3470,6 @@ options:
34703470
generated by the command 'openssl rand -hex 16'. All radosgw instances
34713471
in a zone should use the same key. In multisite configurations, all
34723472
zones in a realm should use the same key.
3473-
default: sts
34743473
services:
34753474
- rgw
34763475
with_legacy: true

src/rgw/rgw_rest_s3.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6983,6 +6983,10 @@ rgw::auth::s3::STSEngine::get_session_token(const DoutPrefixProvider* dpp, const
69836983
return -EINVAL;
69846984
}
69856985
string secret_s = cct->_conf->rgw_sts_key;
6986+
if (secret_s.empty()) {
6987+
ldpp_dout(dpp, 1) << "ERROR: rgw sts key not set" << dendl;
6988+
return -EINVAL;
6989+
}
69866990
buffer::ptr secret(secret_s.c_str(), secret_s.length());
69876991
int ret = 0;
69886992
if (ret = cryptohandler->validate_secret(secret); ret < 0) {

src/rgw/rgw_sts.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ int Credentials::generateCredentials(const DoutPrefixProvider *dpp,
7777
return -EINVAL;
7878
}
7979
string secret_s = cct->_conf->rgw_sts_key;
80+
if (secret_s.empty()) {
81+
ldpp_dout(dpp, 1) << "ERROR: rgw sts key not set" << dendl;
82+
return -EINVAL;
83+
}
84+
8085
buffer::ptr secret(secret_s.c_str(), secret_s.length());
8186
int ret = 0;
8287
if (ret = cryptohandler->validate_secret(secret); ret < 0) {

0 commit comments

Comments
 (0)