resource belongs to someone else's tenant.
While parsing the policy it discards the resource element,
but then when an operation is evaluated, since the resource element
is empty, it doesnt evaluate the resource at all and the policy
ends up erroneously allowing actions on resources in other tenants.
Fixes: https://tracker.ceph.com/issues/51219
Signed-off-by: Pritha Srivastava <prsrivas@redhat.com>
(cherry picked from commit
be42b2cf04def671023b98c811e77e1e357eb38e)
a->account = pp->tenant;
(w->id == TokenID::Resource ? t->resource : t->notresource)
.emplace(std::move(*a));
- }
- else
+ } else {
ldout(cct, 0) << "Supplied resource is discarded: " << string(s, l)
<< dendl;
+ return false;
+ }
} else if (w->kind == TokenKind::cond_key) {
auto& t = pp->policy.statements.back();
if (l > 0 && *s == '$') {