_s->bucket_object_ownership,
_s->perm_mask,
_s->defer_to_bucket_acls,
- _s->bucket_access_conf),
+ _s->public_access_block),
s(_s) {}
std::optional<bool> get_request_payer() const override {
// If RestrictPublicBuckets is enabled and the bucket policy allows public access,
// deny the request if the requester is not in the bucket owner account
- const bool restrict_public_buckets = s->bucket_access_conf && s->bucket_access_conf->restrict_public_buckets();
+ const bool restrict_public_buckets = s->public_access_block && s->public_access_block->restrict_public_buckets();
if (restrict_public_buckets && bucket_policy && rgw::IAM::is_public(*bucket_policy) && !s->identity->is_owner_of(s->bucket_info.owner)) {
ldpp_dout(dpp, 10) << __func__ << ": public policies are blocked by the RestrictPublicBuckets block public access setting" << dendl;
return false;
if (bucket_acl.verify_permission(dpp, *ps->identity, perm, perm,
ps->get_referer(),
- ps->bucket_access_conf &&
- ps->bucket_access_conf->ignore_public_acls())) {
+ ps->public_access_block &&
+ ps->public_access_block->ignore_public_acls())) {
ldpp_dout(dpp, 10) << __func__ << ": granted by bucket acl" << dendl;
if (granted_by_acl) {
*granted_by_acl = true;
// If RestrictPublicBuckets is enabled and the bucket policy allows public access,
// deny the request if the requester is not in the bucket owner account
- const bool restrict_public_buckets = ps->bucket_access_conf && ps->bucket_access_conf->restrict_public_buckets();
+ const bool restrict_public_buckets = ps->public_access_block && ps->public_access_block->restrict_public_buckets();
if (restrict_public_buckets && bucket_policy && rgw::IAM::is_public(*bucket_policy) && !ps->identity->is_owner_of(ps->bucket_info.owner)) {
ldpp_dout(dpp, 10) << __func__ << ": public policies are blocked by the RestrictPublicBuckets block public access setting" << dendl;
return false;
if (ps->bucket_object_ownership != rgw::s3::ObjectOwnership::BucketOwnerEnforced &&
object_acl.verify_permission(dpp, *ps->identity, ps->perm_mask, perm,
nullptr, /* http referrer */
- ps->bucket_access_conf &&
- ps->bucket_access_conf->ignore_public_acls())) {
+ ps->public_access_block &&
+ ps->public_access_block->ignore_public_acls())) {
ldpp_dout(dpp, 10) << __func__ << ": granted by object acl" << dendl;
if (granted_by_acl) {
*granted_by_acl = true;
rgw::IAM::Environment env;
boost::optional<rgw::IAM::Policy> iam_policy;
- boost::optional<PublicAccessBlockConfiguration> bucket_access_conf;
+ boost::optional<PublicAccessBlockConfiguration> public_access_block;
rgw::s3::ObjectOwnership bucket_object_ownership = rgw::s3::ObjectOwnership::ObjectWriter;
std::vector<rgw::IAM::Policy> iam_identity_policies;
rgw::s3::ObjectOwnership bucket_object_ownership;
int perm_mask;
bool defer_to_bucket_acls;
- boost::optional<PublicAccessBlockConfiguration> bucket_access_conf;
+ boost::optional<PublicAccessBlockConfiguration> public_access_block;
perm_state_base(CephContext *_cct,
const rgw::IAM::Environment& _env,
rgw::s3::ObjectOwnership bucket_object_ownership,
int _perm_mask,
bool _defer_to_bucket_acls,
- boost::optional<PublicAccessBlockConfiguration> _bucket_access_conf = boost::none) :
+ boost::optional<PublicAccessBlockConfiguration> _public_access_block = boost::none) :
cct(_cct),
env(_env),
identity(_identity),
bucket_object_ownership(bucket_object_ownership),
perm_mask(_perm_mask),
defer_to_bucket_acls(_defer_to_bucket_acls),
- bucket_access_conf(_bucket_access_conf)
+ public_access_block(_public_access_block)
{}
virtual ~perm_state_base() {}
return -EINVAL;
}
- s->bucket_access_conf = get_public_access_conf_from_attr(s->bucket_attrs);
+ s->public_access_block = get_public_access_conf_from_attr(s->bucket_attrs);
s->bucket_object_ownership = rgw::s3::get_object_ownership(s->bucket_attrs);
}
} /* copy_source */
// reject public canned acls
- if (s->bucket_access_conf && s->bucket_access_conf->block_public_acls() &&
+ if (s->public_access_block && s->public_access_block->block_public_acls() &&
(s->canned_acl == "public-read" ||
s->canned_acl == "public-read-write" ||
s->canned_acl == "authenticated-read")) {
*_dout << dendl;
}
- if (s->bucket_access_conf &&
- s->bucket_access_conf->block_public_acls() &&
+ if (s->public_access_block &&
+ s->public_access_block->block_public_acls() &&
new_policy.is_public(this)) {
op_ret = -EACCES;
return;
s->cct, &s->bucket_tenant, data.to_str(),
s->cct->_conf.get_val<bool>("rgw_policy_reject_invalid_principals"));
rgw::sal::Attrs attrs(s->bucket_attrs);
- if (s->bucket_access_conf &&
- s->bucket_access_conf->block_public_policy() &&
+ if (s->public_access_block &&
+ s->public_access_block->block_public_policy() &&
rgw::IAM::is_public(p)) {
op_ret = -EACCES;
return;