landing-zone-accelerator-on-aws: identityCenter: Error Assigning IAM Permissions to Management Account/Root OU

Describe the bug

I encountered an error while testing the AWS IAM Identity Center features of the “landing-zone-accelerator-on-aws” solution. When attempting to assign permissions to the management account :

identityCenter:
 name: idc-lza-glob-01
 delegatedAdminAccount: # Audit, Management or commented does not make it work
 identityCenterPermissionSets:
   - name: ips-lza-it-owners
     policies:
       awsManaged:
         - arn:aws:iam::aws:policy/AdministratorAccess
     sessionDuration: 60
   - name: ips-lza-billing-administrators
     policies:
       awsManaged:
         - arn:aws:iam::aws:policy/job-function/Billing
     sessionDuration: 60
 identityCenterAssignments:
   - name: ica-lza-it-owners
     permissionSetName: ips-lza-it-owners
     principalId: "ec7d0558-60d1-709c-b30d-81f909a1dfe7" # grp-lza-it-owners
     principalType: GROUP
     deploymentTargets:
       organizationalUnits:
         - Infrastructure
         - Testing
         - Root # Doesnt work
   - name: ica-lza-billing-administrators
     permissionSetName: ips-lza-billing-administrators
     principalId: "accd0558-6011-70e0-6533-03bfe0ffd108" #grp-lza-billing-administrators
     principalType: GROUP
     deploymentTargets:
       accounts:
         - Management # Doesnt work

The following error occurs:

Resource handler returned message: "User: arn:aws:sts::987654321012:assumed-role/cdk-accel-cfn-exec-role-987654321012-ca-central-1/AWSCloudFormation is not authorized to perform: sso:CreateAccountAssignment on resource: arn:aws:sso:::account/246801357913 (Service: SsoAdmin, Status Code: 400, Request ID: be277ab6-0b58-4582-a65b-707379a670f3)" (RequestToken: dc067927-de87-8ce6-80b5-5d2ac0e49267, HandlerErrorCode: GeneralServiceException)

Where 987654321012 is my Audit account And 246801357913 my management account (Anonymized numbers)

The bug or limitation prevents the successful assignment of permissions to the management account.

To Reproduce

  1. Deploy the “landing-zone-accelerator-on-aws” solution.
  2. Configure the iam-config.yaml file with the provided example from the official documentation.
  3. Attempt to assign permissions to the management account.
  4. Encounter the mentioned error.

Expected behavior I expected the permissions to be successfully assigned to the management account without any errors.

Please complete the following information about the solution:

  • Version: 1.4.1
  • Region: ca-central-1
  • Was the solution modified from the version published on this repository? No
  • If the answer to the previous question was yes, are the changes available on GitHub?
  • Have you checked your service quotas for the sevices this solution uses? yes
  • Were there any errors in the CloudWatch Logs? The errors are explicit in the CDK output

Additional context Add any other context about the problem here. The error occurs when trying to assign permissions to the management account. Changing the delegated admin account from “Audit” to “Management” results in the following error:

(IdentityCenterAdminidentityCenterAdminEB714AB1) Received response status [FAILED] from custom resource. Message returned: You cannot register the master account/yourself as a delegated administrator for your organization.

I attempted to create a new resource with a different name in order to force the use of the correct delegated account. However, I encountered the following error:

Resource handler returned message: "User: arn:aws:sts::987654321012:assumed-role/cdk-accel-cfn-exec-role-987654321012-ca-central-1/AWSCloudFormation is not authorized to perform: sso:CreateAccountAssignment on resource: arn:aws:sso:::account/246801357913 (Service: SsoAdmin, Status Code: 400, Request ID: be277ab6-0b58-4582-a65b-707379a670f3)" (RequestToken: dc067927-de87-8ce6-80b5-5d2ac0e49267, HandlerErrorCode: GeneralServiceException)

We tried to deregister the delegated administrator account and run the LZA pipeline with delegatedAdminAccount commented out.

identityCenter:
 name: idc-lza-glob-01
 # delegatedAdminAccount:
 identityCenterPermissionSets:

It appear that the solution will automatically assign a delegatedAdminAccount to Audit.

We believe there is a bug or limitation in the AWS IAM Identity Center Assignments feature of the “landing-zone-accelerator-on-aws” solution, preventing the successful assignment of permissions to the management account and by extention to the Root OU. Is there a way to properly manage IAM Identity Center Assigment on Mangement account through LZA ?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 11
  • Comments: 18 (7 by maintainers)

Most upvoted comments

Hello @priolix, and thanks for your interest in Landing Zone Accelerator on AWS! This is known issue. We have created an issues for our team to work on it. I will update this thread once I have an update on the team’s progress.

Based upon AWS Security Reference Architecture (AWS SRA), we have implemented delegated admin feature and assign any member account (audit account) as a delegated administrator for IAM Identity Center. We deploy all SSO resources through CloudFormation in the delegated admin account. And SSO has a rule that you can’t deploy resources assigned to management in the delegated admin account . There is an option to implement any other account, expect management, in the organization for the delegated admin functionality.

In the meantime, if this is a feature that you need immediately in your environment, I’d suggest implementing this through the customizations layer that is available in LZA. For more information, please reference the documentation.

Thanks again for your support.

Hi! I am happy that somebody else also encountered this issue and marked it as a bug, since there is no documentation about it (or limitation information). Although we could unset the Audit account as a delegated account, the issue still persists. I contacted the AWS Support about it but there is still no answer. Now with this ‘issue’ I can ask further. Attached you can also find a screenshot of the failure in our setup.

Deploy_Operations_action_failure_logs_1

For now the workaround was only to exclude the Management account from the assignment (not real solution). LZA version: 1.4.1 Thanks!

Thank you @erwaxler, I dug deeper and kindly await your reply on a new issue I created (https://github.com/awslabs/landing-zone-accelerator-on-aws/issues/496) as we believe this will affect other customers.

Thanks all for your interest in this functionality. I’m please to announce that in v1.7.0, the LZA moved Identity Center resources into a new independent stack deployed in the management account, regardless of the existence of a delegated administrator. This change will enable customers to deploy IIC resources to the management account using the built-in LZA functionality and mitigate friction when changing the delegated administrator going forward.

Thank you all for your support of the Landing Zone Accelerator, please continue to raise issues to inform the team of how to further improve the solution!

https://github.com/awslabs/landing-zone-accelerator-on-aws/releases/tag/v1.7.0

I like the workaround you presented @richardkeit, thank you we will use that where needed!

However, on this topic:

Delegating to the Audit account I feel is a better process for management of Users (than requiring logging into the Management account)

People writing the identity center resources into lza iam-config.yaml still have to do that in the management account. so they have to go into the management account anyway.

I dont think customers should be forced to use delegated admin (for any service). And assuming that the delegated admin should be the Audit account doesnt make sense to me either - enterprise orgs have different IAM teams than Governance / Risk / Compliance teams. I would like to see some config added under identityCenter to disable the delegated admin. Here are a couple options:

identityCenter:
  delegatedAdminAccount: False
identityCenter:
  enableDelegatedAdmin: False

Note, personally believe this a workable solution:

identityCenter:
 name: identityCenter1
 delegatedAdminAccount: Audit
 identityCenterPermissionSets:
   - name: ValidationPermissionSet
     policies:
       awsManaged:
        - arn:aws:iam::aws:policy/ReadOnlyAccess
     sessionDuration: 60
 identityCenterAssignments:
   - name: ValidationAssignment
     permissionSetName: ValidationPermissionSet
     principalId: "291e64d8-7091-7086-6e25-dd2f88228c0a" #LZAValidationReadOnly
     principalType: GROUP
     deploymentTargets:
       organizationalUnits:
         - Root
       excludedAccounts:
          - Management

One the PermissionSet is created via the Pipeline, Log into the Management Account and do the assignment there.

Delegating to the Audit account I feel is a better process for management of Users (than requiring logging into the Management account)

@bhkhatri221 is that possible to NOT delegate SSO admin? then would it be working in management account. i.e. LZA uses management account directly to deploy permission sets and assignments?