OPTION(mon_mgr_digest_period, OPT_INT, 5) // How frequently to send digests
OPTION(mon_mgr_beacon_grace, OPT_INT, 30) // How long to wait to failover
OPTION(mon_mgr_inactive_grace, OPT_INT, 60) // How long before health WARN -> ERR
+OPTION(rgw_crypt_require_ssl, OPT_BOOL, true) // requests including encryption key headers must be sent over ssl
OPTION(rgw_crypt_default_encryption_key, OPT_STR, "") // base64 encoded key for encryption of rgw objects
OPTION(rgw_crypt_s3_kms_encryption_keys, OPT_STR, "") // extra keys that may be used for aws:kms
// defined as map "key1=YmluCmJvb3N0CmJvb3N0LQ== key2=b3V0CnNyYwpUZXN0aW5nCg=="
if (req_sse_ca != "AES256") {
return -ERR_INVALID_REQUEST;
}
+ if (s->cct->_conf->rgw_crypt_require_ssl &&
+ !s->info.env->exists("SERVER_PORT_SECURE")) {
+ return -ERR_INVALID_REQUEST;
+ }
std::string key_bin = from_base64(
get_crypt_attribute(s->info.env, parts, X_AMZ_SERVER_SIDE_ENCRYPTION_CUSTOMER_KEY) );
if (key_bin.size() != AES_256_CBC::AES_256_KEYSIZE) {
if (req_sse != "aws:kms") {
return -ERR_INVALID_REQUEST;
}
+ if (s->cct->_conf->rgw_crypt_require_ssl &&
+ !s->info.env->exists("SERVER_PORT_SECURE")) {
+ return -ERR_INVALID_REQUEST;
+ }
boost::string_ref key_id =
get_crypt_attribute(s->info.env, parts, X_AMZ_SERVER_SIDE_ENCRYPTION_AWS_KMS_KEY_ID);
if (key_id.empty()) {
std::string stored_mode = get_str_attribute(attrs, RGW_ATTR_CRYPT_MODE);
ldout(s->cct, 15) << "Encryption mode: " << stored_mode << dendl;
if (stored_mode == "SSE-C-AES256") {
+ if (s->cct->_conf->rgw_crypt_require_ssl &&
+ !s->info.env->exists("SERVER_PORT_SECURE")) {
+ return -ERR_INVALID_REQUEST;
+ }
const char *req_cust_alg =
s->info.env->get("HTTP_X_AMZ_SERVER_SIDE_ENCRYPTION_CUSTOMER_ALGORITHM", NULL);
}
if (stored_mode == "SSE-KMS") {
+ if (s->cct->_conf->rgw_crypt_require_ssl &&
+ !s->info.env->exists("SERVER_PORT_SECURE")) {
+ return -ERR_INVALID_REQUEST;
+ }
/* try to retrieve actual key */
std::string key_id = get_str_attribute(attrs, RGW_ATTR_CRYPT_KEYID);
std::string key_selector = get_str_attribute(attrs, RGW_ATTR_CRYPT_KEYSEL);
start = ofs;
- if (!get_data || ofs > end) {
- send_response_data(bl, 0, 0);
+ /* STAT ops don't need data, and do no i/o */
+ if (get_type() == RGW_OP_STAT_OBJ) {
return;
}
goto done_err;
}
+ if (!get_data || ofs > end) {
+ send_response_data(bl, 0, 0);
+ return;
+ }
+
perfcounter->inc(l_rgw_get_b, end - ofs);
ofs_x = ofs;