Commit Graph

145002 Commits

Author SHA1 Message Date
Casey Bodley
f34b87f8b7
Merge pull request #56785 from cbodley/wip-uninstall-motr
install-deps: remove cortx-motr integration

Reviewed-by: Zack Cerza <zack@redhat.com>
2024-04-11 13:42:59 +01:00
Zac Dover
44d1eeed70 doc/cephfs: refine client-auth (3 of 3)
Refine the final third of doc/cephfs/client-auth.rst.

Signed-off-by: Zac Dover <zac.dover@proton.me>
2024-04-11 21:18:53 +10:00
Rongqi Sun
3aebcc5ae4 test/TestQuiesceAgent: free quiesce_requests Context
When sanitizer is enabled, unittest_mds_quiesce_agent fails as following

```
[==========] Running 5 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 5 tests from QuiesceAgentTest
[ RUN      ] QuiesceAgentTest.ThreadManagement
[       OK ] QuiesceAgentTest.ThreadManagement (3 ms)
[ RUN      ] QuiesceAgentTest.DbUpdates
[       OK ] QuiesceAgentTest.DbUpdates (1 ms)
[ RUN      ] QuiesceAgentTest.QuiesceProtocol
[       OK ] QuiesceAgentTest.QuiesceProtocol (3 ms)
[ RUN      ] QuiesceAgentTest.DuplicateQuiesceRequest
[       OK ] QuiesceAgentTest.DuplicateQuiesceRequest (2 ms)
[ RUN      ] QuiesceAgentTest.TimeoutBeforeComplete
[       OK ] QuiesceAgentTest.TimeoutBeforeComplete (2 ms)
[----------] 5 tests from QuiesceAgentTest (11 ms total)

[----------] Global test environment tear-down
[==========] 5 tests from 1 test suite ran. (11 ms total)
[  PASSED  ] 5 tests.

=================================================================
==3975692==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0xaaaadd81c7c8 in operator new(unsigned long) (/root/ceph/build/bin/unittest_mds_quiesce_agent+0x1fc7c8) (BuildId: 7d45344ba1e43661d9de484f0a5d129377c4d4ae)
    #1 0xaaaadd8878d8 in QuiesceAgent::agent_thread_main() /root/ceph/src/mds/QuiesceAgent.cc:136:68
    #2 0xaaaadd86de38 in QuiesceAgent::AgentThread::entry() /root/ceph/src/mds/QuiesceAgent.h:244:24
    #3 0xffff83d6b554 in Thread::entry_wrapper() /root/ceph/src/common/Thread.cc:87:10
    #4 0xffff83d6b314 in Thread::_entry_func(void*) /root/ceph/src/common/Thread.cc:74:29
    #5 0xffff8154d5c4 in start_thread nptl/./nptl/pthread_create.c:442:8
    #6 0xffff815b5ed8  misc/../sysdeps/unix/sysv/linux/aarch64/clone.S:79

Indirect leak of 120 byte(s) in 1 object(s) allocated from:
    #0 0xaaaadd81c7c8 in operator new(unsigned long) (/root/ceph/build/bin/unittest_mds_quiesce_agent+0x1fc7c8) (BuildId: 7d45344ba1e43661d9de484f0a5d129377c4d4ae)
    #1 0xaaaadd8af4f4 in __gnu_cxx::new_allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long, void const*) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/ext/new_allocator.h:127:27
    #2 0xaaaadd8af3d8 in std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >::allocate(unsigned long) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/allocator.h:185:32
    #3 0xaaaadd8af3d8 in std::allocator_traits<std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> > >::allocate(std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >&, unsigned long) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/alloc_traits.h:464:20
    #4 0xaaaadd8aef00 in std::__allocated_ptr<std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> > > std::__allocate_guarded<std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> > >(std::allocator<std::_Sp_counted_ptr_inplace<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, (__gnu_cxx::_Lock_policy)2> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/allocated_ptr.h:98:21
    #5 0xaaaadd8aec14 in std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(QuiesceAgent::TrackedRoot*&, std::_Sp_alloc_shared_tag<std::allocator<QuiesceAgent::TrackedRoot> >, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:648:19
    #6 0xaaaadd8ae988 in std::__shared_ptr<QuiesceAgent::TrackedRoot, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(std::_Sp_alloc_shared_tag<std::allocator<QuiesceAgent::TrackedRoot> >, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr_base.h:1342:14
    #7 0xaaaadd8ae70c in std::shared_ptr<QuiesceAgent::TrackedRoot>::shared_ptr<std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(std::_Sp_alloc_shared_tag<std::allocator<QuiesceAgent::TrackedRoot> >, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr.h:409:4
    #8 0xaaaadd8ae484 in std::shared_ptr<QuiesceAgent::TrackedRoot> std::allocate_shared<QuiesceAgent::TrackedRoot, std::allocator<QuiesceAgent::TrackedRoot>, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(std::allocator<QuiesceAgent::TrackedRoot> const&, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr.h:862:14
    #9 0xaaaadd88ff0c in std::shared_ptr<QuiesceAgent::TrackedRoot> std::make_shared<QuiesceAgent::TrackedRoot, QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&>(QuiesceState&, std::chrono::duration<unsigned long, std::ratio<1l, 1000000000l> >&) /usr/bin/../lib/gcc/aarch64-linux-gnu/11/../../../../include/c++/11/bits/shared_ptr.h:878:14
    #10 0xaaaadd884a6c in QuiesceAgent::db_update(QuiesceMap&) /root/ceph/src/mds/QuiesceAgent.cc:60:26
    #11 0xaaaadd84a840 in QuiesceAgentTest::update(QuiesceDbVersion, std::initializer_list<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, QuiesceMap::RootInfo> >) /root/ceph/src/test/mds/TestQuiesceAgent.cc:156:18
    #12 0xaaaadd84985c in QuiesceAgentTest::update(unsigned long, std::initializer_list<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, QuiesceMap::RootInfo> >) /root/ceph/src/test/mds/TestQuiesceAgent.cc:165:14
    #13 0xaaaadd8288a8 in QuiesceAgentTest_DbUpdates_Test::TestBody() /root/ceph/src/test/mds/TestQuiesceAgent.cc:213:16
    #14 0xaaaadd977230 in void testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2605:10
    #15 0xaaaadd924590 in void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2641:14
    #16 0xaaaadd8d4a40 in testing::Test::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:2680:5
    #17 0xaaaadd8d6984 in testing::TestInfo::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:2858:11
    #18 0xaaaadd8d7f84 in testing::TestSuite::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:3012:28
    #19 0xaaaadd8f3d48 in testing::internal::UnitTestImpl::RunAllTests() /root/ceph/src/googletest/googletest/src/gtest.cc:5723:44
    #20 0xaaaadd981130 in bool testing::internal::HandleSehExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2605:10
    #21 0xaaaadd92bb64 in bool testing::internal::HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>(testing::internal::UnitTestImpl*, bool (testing::internal::UnitTestImpl::*)(), char const*) /root/ceph/src/googletest/googletest/src/gtest.cc:2641:14
    #22 0xaaaadd8f31c0 in testing::UnitTest::Run() /root/ceph/src/googletest/googletest/src/gtest.cc:5306:10
    #23 0xaaaadd820710 in RUN_ALL_TESTS() /root/ceph/src/googletest/googletest/include/gtest/gtest.h:2486:46
    #24 0xaaaadd81ed3c in main /root/ceph/src/test/unit.cc:45:10
    #25 0xffff814f73f8 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #26 0xffff814f74c8 in __libc_start_main csu/../csu/libc-start.c:392:3
    #27 0xaaaadd76e6ac in _start (/root/ceph/build/bin/unittest_mds_quiesce_agent+0x14e6ac) (BuildId: 7d45344ba1e43661d9de484f0a5d129377c4d4ae)

SUMMARY: AddressSanitizer: 184 byte(s) leaked in 2 allocation(s).
```

quiesce_requests Context should be freed.

Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
2024-04-11 08:18:29 +00:00
Rongqi Sun
137aa4086e test/cephadm: extend timeout limit to fix timeout issue
When run make check(arm64) on omani series servers, eg.
https://jenkins.ceph.com/job/ceph-pull-requests-arm64/54751/.
Shows:
python: timeout after 30 seconds
INFO     root:call_wrappers.py:284 Non-zero exit code 124 from /home/jenkins-build/build/workspace/ceph-pull-requests-arm64/src/cephadm/.tox/py3/bin/python -c for i in range(1000000): print(i, flush=True)

Fixes: https://tracker.ceph.com/issues/65355

Signed-off-by: Rongqi Sun <sunrongqi@huawei.com>
2024-04-11 03:34:19 +00:00
Adam King
7714874efb
Merge pull request #56561 from phlogistonjohn/jjm-issue65122-maint-cmd
cephadm: fix host-maintenance command always exiting with a failure

Reviewed-by: Adam King <adking@redhat.com>
2024-04-10 13:36:43 -04:00
Adam King
d8b4e04a4a
Merge pull request #56716 from adk3798/test_cephadm_images
qa/cephadm: update images for test_cephadm workunit

Reviewed-by: John Mulligan <jmulligan@redhat.com>
2024-04-10 13:34:31 -04:00
Adam King
88a8c7ff94
Merge pull request #56481 from adk3798/test-cephadm-idmap-conf
cephadm: add idmap.conf to nfs sample file

Reviewed-by: John Mulligan <jmulligan@redhat.com>
2024-04-10 13:30:31 -04:00
Adam King
4774249973
Merge pull request #56791 from adk3798/nvmeof-mon-setting
mgr/cephadm: make enable_monitor_client configurable for nvmeof

Reviewed-by: Ernesto Puerta <epuertat@redhat.com>
Reviewed-by: John Mulligan <jmulligan@redhat.com>
2024-04-10 13:20:46 -04:00
Adam King
4cb1ae2ead
Merge pull request #56613 from NitzanMordhai/wip-nitzan-osd-down-ignore-cephadm-suites
suites/rados/cephadm: adding OSD_DOWN to the log-ignorelist

Reviewed-by: Adam King <adking@redhat.com>
2024-04-10 13:17:08 -04:00
Casey Bodley
39a2af56d7 qa/rgw/s3tests: remove 'client.0' from bucket prefix
new sns test cases are using this for topic names, but the '.' is not
allowed there:

> api_params = {'Name': 'test-client.0-n3bdgre5el2jk8v-606'}
> botocore.exceptions.ClientError: An error occurred (InvalidArgument) when calling the CreateTopic operation: Name must be made up of only uppercase and lowercase ASCII letters, numbers, underscores, and hyphens

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:18 -04:00
Casey Bodley
24841fbdde rgw/notify: populate event userIdentity with account ids
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:18 -04:00
Casey Bodley
43ca67b3d8 test/rgw/pubsub: test persistent notifications with account user
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:18 -04:00
Casey Bodley
3a5af5fdfe rgw/notify: support cross-tenant and cross-account notifications
a bucket's notification configuration may refer to topics from several
different tenants or accounts. when publishing to a given topic, look in
the correct namespace for each topic instead of defaulting to the
requesting user's tenant namespace

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:18 -04:00
Casey Bodley
63e164f4d2 rgw/pubsub: forward requests as s->owner instead of s->user
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
64ac1de01f rgw/notify: publish functions use rgw_pubsub_dest::persistent_queue
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
bfae83c865 doc/rgw: warn about topics under account migration
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
4bac81a2bc rgw/pubsub: use rgw_pubsub_dest::persistent_queue for queue oid
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
4c50ad69c3 rgw/pubsub: RGWPubSub::remove_topic() removes persistent queue
move the persistent queue removal into remove_topic() where we have
access to the topic metadata. avoid trying to remove the queue if it
isn't enabled

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
3ef1ab3de2 rgw/pubsub: rgw_pubsub_dest stores persistent queue oid
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
ba2566a5fe rgw/pubsub: add/remove_persistent_topic() takes topic queue, not name
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
a75c3ac8c1 test/rgw/pubsub: topic policy doesn't deny access to owner
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
9b6fe4ac53 rgw/pubsub: CreateTopic consults existing topic policy for overwrite
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
4568b7a0c7 rgw/pubsub: fix DeleteTopic permissions
non-account users now consult identity policies with
verify_user_permission() when the topic doesn't exist

account users now consult topic policy when it does exist

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
8896b22722 rgw/pubsub: CreateTopic consults identity policies when topic doesn't exist
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
7d5b826a4a rgw/pubsub: CreateTopic requires notification_v2 for accounts
the account's topic index is only updated by writes/deletes to v2 topic
metadata

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
70fc1eae8f rgw/pubsub: avoid allocating hash set of strings for attr search
this unordered_set was not static, so we reinitialized it on every call

replace with a constexpr array of string_views so we can search through
sequential memory that's laid out at compile time

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
b5d5c55b54 rgw/pubsub: add ERR_AUTHORIZATION -> AuthorizationError
sns docs specify AuthorizationError as the 403 error code rather than
s3's AccessDenied:

    https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html#API_CreateTopic_Errors

boto3 sns clients can catch this as AuthorizationErrorException

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
2cdddad82e rgw/pubsub: return 404 NotFound instead of NoSuchKey
repurpose the ERR_NOT_FOUND define which was otherwise unused to
customize the error response for sns apis, which return the NotFound
error code instead of NoSuchKey from s3:

    https://docs.aws.amazon.com/sns/latest/api/API_GetTopicAttributes.html#API_GetTopicAttributes_Errors

this allows boto3 sns clients to catch the NotFoundException as expected

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
a72975821f rgw/pubsub: notifications can refer to topics in other accounts/tenants
accounts can use topic policy to grant sns:Publish permissions to other
accounts. the PutBucketNotification op should expect TopicArns from
other accounts. the account name from each TopicArn should be used as
the 'tenant' argument for RGWPubSub's constructor so we look for the
topic in the right namespace

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
5f64631630 rgw/pubsub: customize permissions for account users
for account users, CreateTopic and ListTopics permissions come from
identity policy alone, ignoring the ownership/policy of existing topics

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
e5f5679616 rgw/pubsub: when present, use account id instead of tenant
RGWPubSub provides topic namespace isolation for tenants by adding
prefixes to rados object names and topic metadata keys. accounts use
this the same way

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
47a18487b2 rgw/rados: add index for account topics
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
86da5739e1 rgw/pubsub: verify_topic_permission handles cross-account access
refactor verify_topic_owner_or_policy() to share the same interface
as similar functions like verify_user/bucket/object_permission()
from rgw_common.cc

in addition to the topic resource policy, this now also consults iam
identity policies like user, group, or role policy

for account users, this now implements cross-account policy evaluation.
this only comes into play for sns:Publish permissions though, because
the topics themselves are scoped to the account

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
851161166b rgw/auth: rgw_common.h exposes evaluate_iam_policies()
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
88a35fed35 rgw/pubsub: do init/validation in init_processing()
verify_permission() should do permission checks and nothing else!

admin/system users ignore errors from verify_permission() and go on to
call execute() regardless. that means that execute() can't rely on any
initialization that happened during verify_permission(), at risk of
crashing on admin/system requests. it also means that any permission
checks in execute() won't get overridden for admin/system users,
breaking their superuser access

by moving all parameter validation and initialization into
init_processing(), we can prepare all the state that verify_permission()
will need to do it's thing

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
6fe68c5893 rgw/pubsub: replace log messages with error response
parameter validation errors should be returned to the client instead of
written to the rgw log

also raises the log level for lots of error messages. very few of them
should require admin attention

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
537a87d7ae rgw/pubsub: use existing s->bucket for notification ops
s->bucket is already initialized during rgw_build_bucket_policies(),
called from RGWHandler::do_init_permissions()

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
0d61382f4f rgw/pubsub: make v2-specific calls private
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
339981f8b3 PendingReleaseNotes: announce the rgw user account feature
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
4180724b5a rgw: reject user tenant that looks like an account id
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
9057e70d60 rgw/auth: log each policy that returns Allow or Deny
makes it much easier to debug authorization issues when you can see
exactly which policies led to success/failure

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
750d2d6999 rgw/admin: 'user modify' won't change existing account id
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
664151ef38 rgw/admin: user list accepts --account-id or -name
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
b603359972 rgw: link account root to account user index
account root users were not linked to the account's user index because
they're not visible to iam apis like ListUsers

but now that 'account rm' is prevented from deleting the account while
users are still present, we want account root users to prevent deletion
too

add root users back to the account user index, but filter them out of
the iam user apis

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
405f93305f rgw/auth: expose Identity::get_account()
now that all identities store an optional account, expose that to the
rest of rgw with get_account(). this cleans up lots of code that
otherwise has to deal with the rgw_owner variant

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
119a768ddf rgw: validate account user names
iam apis have specific requirements for the UserName field. enforce
these requirements for 'user create' and 'user modify' admin ops for
account users

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
272a7660ca rgw/auth: add account_id and role_id to ops log
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
315ded4786 rgw/auth: object ops use new verify_bucket_permission() overload
several object operations like PutObject, DeleteObject, etc were handling
policy evaluation manually instead of using the helper functions like
verify_user/bucket/object_permission(), so were missing the cross-policy
evaluation rules for account users

these now call the new 'custom arn' overload of verify_bucket_permission()
for equivalent functionality

the eval_identity_or_session_policies() function is no longer exposed by
rgw_common.h to prevent other ops from adding new logic that doesn't
handle cross-account access

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
071e89b506 rgw/auth: add verify_bucket_permission() overload for custom arn
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:17 -04:00
Casey Bodley
07cdc65579 rgw/auth: WebIdentityApplier doesn't create shadow users for account roles
Signed-off-by: Casey Bodley <cbodley@redhat.com>
2024-04-10 13:09:16 -04:00