iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
📝

Setting up SSO for AWS with Google Workspace

に公開

In the previous post[1], I set up multi-account management using AWS Organizations. This time, I will set it up so that I can log in to each account using AWS IAM Identity Center (IIC).

Enabling AWS IAM Identity Center

First, I tried to enable and configure IIC, but I was met with the message, "This instance of IAM Identity Center does not have trusted access for the organization."
Since there was a prompt at the bottom to enable trusted access on the AWS Organizations page, let's move to the AWS Organizations console.

I found the IIC item in the AWS Organizations services. However, there was a concerning note:

Note: We recommend that you do not enable trusted access for AWS services here.
Instead, use the console for the other AWS service to enable or disable trusted access in AWS Organizations.
This allows the other service to perform the necessary support tasks for enabling or disabling access with Organizations.
For more information, see the documentation for the AWS service you are using.

For now, I'll select Services -> AWS IAM Identity Center (AWS Single Sign-On).
I'll click on "Enable trusted access" within that.
As shown in the image, a display appeared suggesting that they didn't really want me to enable it here.
Since a button to move to the IIC console appeared, I clicked it, only to see the same console as at the start.
It's an infinite loop. I need to break out of it somewhere.

The options I can think of right now are:

  1. Enable trusted access from the AWS Organizations console
  2. Try using AWS Control Tower

I think I'll go with using AWS Control Tower.
I'm not entirely sure if it's necessary to go that far with a personal account, but I felt like trying it out.
I plan to summarize this in another article. In this article, I'll resume from the point where IIC is already in a usable state.

Integrating with Google Workspace

Basically, what you want to do is described in the documentation provided by AWS, so please refer to that.[2]
At the time of writing this article, the content differs between the Japanese and English versions, so I will proceed by referring to the English documentation.
Also, since we will be going back and forth between the Google Workspace and AWS screens from here on, make sure not to close them in the middle of the process.

Google Workspace Side: Adding the SAML Application

If you are planning to do this, you are likely a Google Workspace user, but you will need to be able to sign in to an account with super administrator privileges.
Log in to the Google Workspace admin console as a super administrator.
From the left menu, select Apps -> Web and mobile apps, then select Add app -> Search for apps.
A search box will appear; type Amazon Web Services and select the one with App: Amazon Web Services, Platform: Web (SAML) from the list.
There seem to be two ways to do this, but this time I'll proceed with Option 1: downloading the IdP metadata. Click the Download Metadata button and download the xml file.
Keep this screen open and open the IIC console.

AWS IIC Side: Changing the Identity Source

Open Settings from the left menu of the IIC console and click Actions -> Change identity source on the settings screen.
Three options will appear; select External identity provider on the far right.
There is an item called Identity provider metadata at the bottom of the "Configure external identity provider" screen. Upload the metadata you just downloaded to IdP SAML metadata.
Since you will enter the Service provider metadata found at the top of this screen into Google Workspace, return to the Google Workspace screen without closing the IIC screen.

Google Workspace Side: Registering the Service Provider

Click Continue on the Google Workspace screen to move to the service provider details screen.
Here, enter the information that was described in the service provider metadata from earlier.
The fields correspond as shown in the table below, so be careful to enter them correctly.

IIC Field Name Google Workspace Field Name
IAM Identity Center Assertion Consumer Service (ACS) URL ACS URL
IAM Identity Center issuer URL Entity ID
AWS access portal sign-in URL Start URL

Set the Name ID as follows:

Name ID Format Name ID
EMAIL Basic Information > Primary email

Once you have entered these, click Continue.

Google Workspace Side: Attribute Mapping

Map the app attributes with Google Directory attributes in the Attributes section.
Configure them as follows:

Google Directory Attribute App Attribute (Already Entered)
Basic Information > Primary email https://aws.amazon.com/SAML/Attributes/RoleSessionName*
Any item
In this case, Employee Details > Department
https://aws.amazon.com/SAML/Attributes/Role*

Once you have finished entering these, click Finish. If a screen like the one in the image appears, the setup on the Google Workspace side is complete.
Let's return to the AWS IIC console screen.

AWS IIC Side: Confirming the Change

Click the Next button displayed at the bottom of the screen.
When you navigate to the "Confirm change" screen, verify that the items displayed are the same as those configured in Step 1 and Step 2.
If there are no issues, type "ACCEPT" in the confirmation input field and click Change identity source.
It is successful if "Identity source successfully changed from IAM Identity Center to external identity provider (IdP)" is displayed.

While the integration between AWS IIC and Google Workspace itself is now complete, this alone does not mean users can actually use it yet. From here, let's configure it so that it is in a usable state.

Getting It to a Usable State

Google Workspace Side: Granting Permissions

In the Google Workspace Admin Console, click Apps -> Web and mobile apps and select Amazon Web Services from the list.
Since user access is currently set to "Off (for everyone)," click within the user access box to navigate to the Service status screen.
In my case, I am the only person in this organization, and I don't expect anyone to be added in the future. Therefore, I could turn it on for all users in this account. However, based on the principle of least privilege, it is better to configure it by organizational unit or group.
Once you have decided on a rule that makes sense for you, change the service status to ON for that specific item.

AWS IIC Side: Enabling Automatic Provisioning for IIC

In the IIC console, open the Settings page and click Enable in the box related to automatic provisioning.
A modal will display the SCIM endpoint and access token, so save the access token.

Google Workspace Side: Configuring Automatic Provisioning

From the Google Workspace Admin Console, click Apps -> Web and mobile apps and select Amazon Web Services from the displayed list.
Click the link labeled Configure automatic provisioning and navigate to the screen to enter the access token.
Enter the access token you obtained earlier and click Continue.
For the endpoint URL, enter the SCIM endpoint value you obtained earlier and click Continue.
On the attribute mapping screen, map the Google Directory attributes to the app attributes.
Confirm that attributes marked with an asterisk (*) in the app attributes are mapped, and if not, perform the appropriate mapping for each. Once the mapping is complete, click Continue.
You can select the provisioning scope, but we will skip this for now and click Continue.
In the deprovisioning section, you can choose how to handle events where access is revoked from a user.
For each case, you can choose to suspend or delete the account, and the duration can be selected from the following four patterns:

  • Within 24 hours
  • 1 day later
  • 7 days later
  • 21 days later

Please be careful when choosing, as deleting an account makes it unrecoverable.
If you select both suspension and deletion, it is better to set the deletion period longer than the suspension period.

Once the settings are finished, click Finish and navigate to the settings screen.
Simply configuring it does not enable automatic provisioning, so click the toggle switch next to the automatic provisioning setting to enable it.
By the way, there might be some inconsistency in the translation at the moment—the text says "turn on," but you should click "Enable."

AWS IIC Side: Confirming User Creation

Select Users from the left menu of the IIC console and check if the corresponding user has been created.
If it hasn't been created yet, it should appear after a short wait. If it still doesn't appear or if an error occurs, check the synchronization logs on the Google Workspace side to identify the cause of the error.

AWS IIC Side: Granting Permissions to Users Created via Google Workspace

Now that the user exists, let's grant them access permissions.
Click Multi-account permissions -> AWS accounts from the left menu of the IIC console. Select the checkbox for the account you want to grant permissions to from the list of accounts in your organization, and click Assign users or groups.
Select the user or group you want to grant permissions to. In this case, I selected a user, but in an organizational setting, it's better to assign groups and add users to those groups to reduce management effort.
Click Next to go to the screen where you select permission sets. If you haven't added any permission sets yet, AWS-defined (predefined) permission sets will be displayed. For now, I used AdministratorAccess since I needed it, but you should create custom permission sets as needed.
Click Next to see the confirmation screen, then click Submit. After a configuration screen is displayed and the process is complete, you will be redirected back to the same screen as when you clicked on the AWS accounts.

Logging in to the AWS Access Portal

With this, you are now ready to SSO into AWS using your Google Workspace account.
To access it, use the AWS access portal URL listed on the IIC dashboard. According to the documentation I'm referring to[2:1], the AWS access portal app should be available in the Google App Launcher (the waffle icon in Chrome or Gmail), but it wasn't added in my environment.
When you access the AWS access portal, a list of accounts you've been granted permissions for will be displayed. Within that, there is a link to access the AWS Management Console with permissions based on the assigned permission set. Use that to enter the console.
If you can enter and appear to have the expected permissions, the procedure was successful.

脚注
  1. Started using AWS Organizations for personal use ↩︎

  2. Configure SAML and SCIM with Google Workspace and IAM Identity Center ↩︎ ↩︎

Discussion