Skip to content
This repository was archived by the owner on Oct 12, 2026. It is now read-only.

iam: add tests for account-based IAM apis - #537

Merged
cbodley merged 22 commits into
ceph:masterfrom
cbodley:wip-iam-user-apis
Apr 12, 2024
Merged

cbodley merged 22 commits into
ceph:masterfrom
cbodley:wip-iam-user-apis

Conversation

@cbodley

@cbodley cbodley commented Dec 19, 2023 •

Copy link
Copy Markdown
Contributor

renames the test_of_iam label to iam_tenant for the existing tenant-based iam tests

adds new [iam root] and [iam alt root] config sections for account root users, and a new set of iam_account and iam_cross_account test cases that use them

adds pytest fixtures iam_root and iam_alt_root that return the corresponding boto client, with cleanup logic to nuke any created users/roles/etc. all iam resources created by the tests have names starting with iam name prefix = s3-tests- and paths starting with iam path prefix = /s3-tests/ so this cleanup logic doesn't nuke anything else in the aws account

adds account-based test cases for the following iam api categories:

  • User
  • AccessKey
  • UserPolicy
  • Group
  • GroupPolicy
  • Role
  • RolePolicy
  • OpenIDConnectProvider

verified to pass against aws when an account root user's credentials are provided in the [iam] section of s3tests.conf (haven't tested iam_cross_account tests yet)

TODO:

  • assuming another account's role uses same-account rules to access that account's resources
  • assuming another account's role uses cross-account rules to access the original user's resources
  • buckets/objects created by the assumed role belong to the role's account
  • test that identity policy can grant non-root users access to iam account apis

@cbodley
cbodley force-pushed the wip-iam-user-apis branch 2 times, most recently from 5ce3342 to 1f14eda Compare December 20, 2023 19:18
@cbodley
cbodley force-pushed the wip-iam-user-apis branch 4 times, most recently from afc402d to ac893c5 Compare January 30, 2024 23:20
@cbodley
cbodley force-pushed the wip-iam-user-apis branch 3 times, most recently from 6645cbb to 69492d4 Compare February 6, 2024 17:47
@cbodley cbodley changed the title iam: add tests for User apis iam: add tests for account-based IAM apis Feb 6, 2024
Comment thread s3tests_boto3/functional/test_iam.py Resolved
Comment thread s3tests_boto3/functional/test_iam.py Resolved
Comment thread s3tests_boto3/functional/test_iam.py Resolved
Comment thread s3tests_boto3/functional/test_iam.py Resolved
Comment thread s3tests_boto3/functional/test_iam.py Resolved
Comment thread s3tests_boto3/functional/test_iam.py Resolved
Comment thread s3tests_boto3/functional/test_iam.py Resolved
@cbodley

cbodley commented Feb 16, 2024

Copy link
Copy Markdown
Contributor Author

@pritha-srivastava thanks for the review! i updated the pr description with a TODO list of test cases to add

@cbodley
cbodley force-pushed the wip-iam-user-apis branch 2 times, most recently from fa13161 to 9fd2f28 Compare February 26, 2024 19:19
@cbodley
cbodley force-pushed the wip-iam-user-apis branch from 0aa5442 to 8d2a47a Compare March 4, 2024 21:22
@cbodley
cbodley requested a review from alimaredia March 7, 2024 20:45
@cbodley

cbodley commented Mar 7, 2024

Copy link
Copy Markdown
Contributor Author

hey @alimaredia, i'm close to getting account stuff passing in teuthology. just wanted to get this on your radar

@cbodley
cbodley force-pushed the wip-iam-user-apis branch from 682d9b2 to 2a18f9b Compare March 8, 2024 14:46
cbodley added 13 commits March 10, 2024 10:45
adds test cases for the following iam actions:
* PutUserPolicy
* GetUserPolicy
* DeleteUserPolicy
* ListUserPolicies

verified to pass against aws when an account root user's credentials are
provided in the [iam] section of s3tests.conf

Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
adds test cases for the following iam actions:
* CreateRole
* GetRole
* ListRoles
* DeleteRole
* UpdateRole

verified to pass against aws when an account root user's credentials are
provided in the [iam] section of s3tests.conf

Signed-off-by: Casey Bodley <[email protected]>
adds test cases for the following iam actions:
* PutRolePolicy
* GetRolePolicy
* DeleteRolePolicy
* ListRolePolicies

verified to pass against aws when an account root user's credentials are
provided in the [iam] section of s3tests.conf

Signed-off-by: Casey Bodley <[email protected]>
Signed-off-by: Casey Bodley <[email protected]>
test the [iam alt root] user's access to buckets owned by [iam root]
using various policy principals and acl grantees

Signed-off-by: Casey Bodley <[email protected]>
aws doesn't consult acls for same-account access. rgw doesn't for
account users either

Fixes: ceph#184

Signed-off-by: Casey Bodley <[email protected]>
@cbodley
cbodley force-pushed the wip-iam-user-apis branch 2 times, most recently from a14065a to 96d6584 Compare March 12, 2024 12:57
@alimaredia

Copy link
Copy Markdown
Contributor

@cbodley are these still underdevelopment? I see you force pushed just a couple hours ago and I don't see a run linked yet. Have these only been run locally?

@cbodley

cbodley commented Mar 12, 2024

Copy link
Copy Markdown
Contributor Author

@alimaredia this is ready for review. i'm still iterating on ceph/ceph#54333 to get a clean run. all tests pass locally but i'm working through differences in configuration between rgw/verify rgw/sts etc

@cbodley

cbodley commented Mar 15, 2024

Copy link
Copy Markdown
Contributor Author

@cbodley

cbodley commented Apr 12, 2024

Copy link
Copy Markdown
Contributor Author

@cbodley
cbodley merged commit 54c1488 into ceph:master Apr 12, 2024
@cbodley
cbodley deleted the wip-iam-user-apis branch April 15, 2024 18:10
@cbodley

cbodley commented Apr 15, 2024

Copy link
Copy Markdown
Contributor Author

haven't cherry-picked for master or squid yet. for squid, i still have one batch pending qa. for main, i'll wait til later in the week

@cbodley

cbodley commented Apr 16, 2024

Copy link
Copy Markdown
Contributor Author

cherry-picked for ceph-squid

@cbodley

cbodley commented Apr 17, 2024

Copy link
Copy Markdown
Contributor Author

cherry-picked for ceph-master too

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants