mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(account): refuse the management account as an AccountId target (#8276)
* fix(account): refuse the management account as an AccountId target
This commit is contained in:
1 parent
ad549728df
commit
869a5fcb59
4 files changed
+163
-8
No files matched your search
@@ -150,8 +150,9 @@ public class AccountService implements Resettable, StoredResourceArns {
|
||||
throw new AwsException("AccessDeniedException",
|
||||
"The calling account is not the management account or a delegated administrator.", 403);
|
||||
}
|
||||
if (managementAccount && requestedAccountId.equals(callerAccountId)) {
|
||||
throw validation("The management account cannot specify its own AccountId.");
|
||||
if (requestedAccountId.equals(organization.getMasterAccountId())) {
|
||||
throw new AwsException("AccessDeniedException",
|
||||
"AccountId must name a member account, not the management account of the organization.", 403);
|
||||
}
|
||||
return requestedAccountId;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user