[ad_1]
Amazon Athena is an interactive question service that makes it simpler to research knowledge immediately in Amazon Easy Storage Service (Amazon S3) utilizing customary SQL. Cloud operation groups can use AWS Identification and Entry Administration (IAM) federation to centrally handle entry to Athena. This simplifies administration by permitting a governing workforce to regulate consumer entry to Athena workgroups from a centrally managed Azure AD linked to an on-premise Energetic Listing. This setup reduces the overhead expertise by cloud operation groups when managing IAM customers. Athena helps federation with Energetic Listing Federation Service (ADFS), PingFederate, Okta, and Microsoft Azure Energetic Listing (Azure AD) federation.
This weblog publish illustrates the way to arrange AWS IAM federation with Azure AD linked to on-premises AD and configure Athena workgroup- stage entry for various customers. We’re going to cowl two eventualities:
- Azure AD managed customers and teams, and on-premises AD.
- On-prem Energetic listing managed customers and teams synchronized to Azure AD.
We don’t cowl the way to setup synchronization between on-premises AD and Azure AD with the assistance of Azure AD join. For extra info on the way to combine Azure AD with an AWS Managed AD , see Allow Workplace 365 with AWS Managed Microsoft AD with out consumer password synchronization and the way to combine Azure AD with an on-premises AD , see Microsoft article Customized set up of Azure Energetic Listing Join.
Resolution overview
This resolution helps you configure IAM federation with Azure AD linked to on-premises AD and configure Athena workgroup-level entry for customers. You possibly can management entry to the workgroup by both an on-premises AD group or Azure AD group. The answer consists of 4 sections:
- Arrange Azure AD as your id supplier (IdP):
- Arrange Azure AD as your SAML IdP for an AWS single-account app.
- Configure the Azure AD app with delegated permissions.
- Arrange your IAM IdP and roles:
- Arrange an IdP trusting Azure AD.
- Arrange an IAM consumer with learn position permission.
- Arrange an IAM position and insurance policies for every Athena workgroup.
- Arrange consumer entry in Azure AD:
- Arrange computerized IAM position provisioning.
- Arrange consumer entry to the Athena workgroup position.
- Entry Athena:
- Entry Athena utilizing the web-based Microsoft My Apps portal.
- Entry Athena utilizing SQL Workbench/J a free, DBMS-independent, cross-platform SQL question software.
The next diagram illustrates the structure of the answer.
The answer workflow contains the next steps:
- The developer workstation connects to Azure AD by way of a SQL Workbench/j JDBC Athena driver to request a SAML token (two-step OAuth course of).
- Azure AD sends authentication site visitors again to on-premises by way of an Azure AD pass-through agent or ADFS.
- The Azure AD pass-through agent or ADFS connects to on-premises DC and authenticates the consumer.
- The pass-through agent or ADFS sends a hit token to Azure AD.
- Azure AD constructs a SAML token containing the assigned IAM position and sends it to the consumer.
- The consumer connects to AWS Safety Token Service (AWS STS) and presents the SAML token to imagine the Athena position and generates short-term credentials.
- AWS STS sends short-term credentials to the consumer.
- The consumer makes use of the short-term credentials to hook up with Athena.
Stipulations
You could meet the next necessities previous to configuring the answer:
- On the Azure AD facet, full the next:
- Arrange the Azure AD Join server and sync with on-premises AD
- Arrange the Azure AD pass-through or Microsoft ADFS federation between Azure AD and on-premises AD
- Create three customers (
user1
,user2
,user3
) and three teams (athena-admin-adgroup
,athena-datascience-adgroup
,athena-developer-adgroup
) for 3 respective Athena workgroups
- On the Athena facet, create three Athena workgroups:
athena-admin-workgroup
,athena-datascience-workgroup
,athena-developer-workgroup
For extra info on utilizing pattern Athena workgroups, see A public knowledge lake for evaluation of COVID-19 knowledge.
Arrange Azure AD
On this part we are going to cowl Azure AD configuration particulars for Athena in Microsoft Azure subscription. Primarily we are going to register an app, configure federation, delegate app permission and generate App secret.
Set Azure AD as SAML IdP for an AWS single-account app
To arrange Azure AD as your SAML IdP, full the next steps:
- Check in to the Azure Portal with Azure AD world admin credentials.
- Select Azure Energetic Listing.
- Select Enterprise functions.
- Select New utility.
- Seek for
Amazon
within the search bar. - Select AWS Single-Account Entry.
- For Title, enter
Athena-App
. - Select Create.
- Within the Getting Began part, underneath Arrange single signal on, select Get began.
- For Choose a single sign-on technique, select SAML.
- For Fundamental SAML Configuration, select Edit.
- For Identifier (Entity ID), enter
https://signin.aws.amazon.com/saml#1
. - Select Save.
- Below SAML Signing Certificates, for Federation Metadata XML, select Obtain.
This file is required to configure your IAM IdP within the subsequent part. Save this file in your native machine to make use of later when configuring IAM on AWS.
Configure your Azure AD app with delegated permissions
To configure your Azure AD app, full the next steps:
- Select Azure Energetic Listing.
- Select App registrations and All Purposes.
- Seek for and select Athena-App.
- Notice the values for Utility (consumer) ID and Listing (tenant) ID.
You want these values within the JDBC connection while you connect with Athena.
- Below API Permissions, select Add a permission.
- Select Microsoft Graph and Delegated permissions.
- For Choose permissions, seek for
consumer.learn
. - For Consumer, select Consumer.Learn.
- Select Add permission.
- Select Grant admin consent and Sure.
- Select Authentication and Add a platform.
- Select Cell and Desktop functions.
- Below Customized redirect URIs, enter
http://localhost/athena
. - Select Configure.
- Select Certificates & secrets and techniques and New consumer secret.
- Enter an outline.
- For Expires, select 24 months.
- Copy the consumer secret worth to make use of when configuring the JDBC connection.
Arrange the IAM IdP and roles
On this part we are going to cowl IAM configuration in AWS account. Primarily we are going to create an IAM consumer, Roles and insurance policies.
Arrange an IdP trusting Azure AD
To arrange your IdP trusting Azure AD, full the next steps:
- On the IAM console, select Identification suppliers within the navigation pane.
- Select Add supplier.
- For Supplier Kind, select SAML.
- For Supplier Title, enter
AzureADAthenaProvider
. - For Metadata Doc, add the file downloaded from Azure Portal.
- Select Add supplier.
Arrange an IAM consumer with learn position permission
To arrange your IAM consumer, full the next steps:
- On the IAM console, select Customers within the navigation pane.
- Select Add consumer.
- For Consumer title, enter
ReadRoleUser
. - For Entry kind, choose Programmatic entry.
- Select Subsequent: Permissions.
- For Set permissions, select Connect present insurance policies immediately.
- Select Create coverage.
- Choose JSON and enter the next coverage, which supplies learn entry to enumerate roles in IAM:
- Select Subsequent: Tags.
- Select Subsequent: Evaluation.
- For Title, enter
readrolepolicy
. - Select Create coverage.
- On the Add Consumer tab, seek for and select the position
readrole
. - Select Subsequent: tags.
- Select Subsequent: Evaluation.
- Select Create consumer.
- Obtain the .csv file containing the entry key ID and secret entry key.
We use these when configuring Azure AD computerized provisioning.
Arrange an IAM position and insurance policies for every Athena workgroup
To arrange IAM roles and insurance policies to your Athena workgroups, full the next steps:
- On the IAM console, select Roles within the navigation pane.
- Select Create position.
- For Choose kind of trusted entity, select SAML 2.0 federation.
- For SAML supplier, select AzureADAthenaProvider.
- Select Enable programmatic and AWS Administration Console entry.
- Below Situation, select Key.
- Choose SAML:aud.
- For Situation, choose StringEquals.
- For Worth, enter
http://localhost/athena
. - Select Subsequent: Permissions.
- Select Create coverage.
- Select JSON and enter the next coverage (present the ARN of your workgroup):
The coverage grants full entry to Athena workgroup. It’s based mostly on the AWS managed coverage AmazonAthenaFullAccess
and workgroup instance insurance policies.
- Select Subsequent: Tags.
- Select Subsequent: Evaluation.
- For Title, enter
athenaworkgroup1policy
. - Select Create coverage.
- On the Create position tab, seek for
athenaworkgroup1policy
and choose the coverage. - Select Subsequent: Tags.
- Select Subsequent: Evaluation.
- Select Create position.
- For Title, enter
athenaworkgroup1role
. - Select Create position.
Arrange consumer entry in Azure AD
On this part we are going to setup Automated provisioning and assign customers to app from Microsoft Azure portal.
Arrange computerized IAM position provisioning
To arrange computerized IAM position provisioning, full the next steps:
- Check in to the Azure Portal with Azure AD world admin credentials.
- Select Azure Energetic Listing.
- Select Enterprise Purposes and select Athena-App.
- Select Provision Consumer Accounts.
- Within the Provisioning part, select Get began.
- For Provisioning Mode, select Automated.
- Broaden Admin credentials and populate clientsecret and Secret Token with the entry key ID and secret entry key of
ReadRoleUser
, respectively. - Select Check Connection and Save.
- Select Begin provisioning.
The preliminary cycle can take a while to finish, after which the IAM roles are populated in Azure AD.
Arrange consumer entry to the Athena workgroup position
To arrange consumer entry to the workgroup position, full the next steps:
- Check in to Azure Portal with Azure AD world admin credentials.
- Select Azure Energetic Listing.
- Select Enterprise Purposes and select Athena-App.
- Select Assign customers and teams and Add consumer/group.
- Below Customers and teams, choose the group that you just need to assign Athena permission to. For this publish, we use
athena-admin-adgroup
; alternatively, you’ll be able to choose user1. - Select Choose.
- For Choose a task, choose the position
athenaworkgroup1role
. - Select Choose.
- Select Assign.
Entry Athena
On this part we are going to display the way to entry Athena from AWS console and developer software SQL Workbench/J
Entry Athena utilizing the web-based Microsoft My Apps portal
To make use of the Microsoft My Apps portal to entry Athena, full the next steps:
- Check in to Azure Portal with Azure AD world admin credentials.
- Select Azure Energetic Listing
- Select Enterprise Purposes and select Athena-App.
- Select
- Properties.
- Copy the worth for Consumer entry URL.
- Open an online browser and enter the URL.
The hyperlink redirects you to an Azure login web page.
- Log in with the on-premises consumer credentials.
You’re redirected to the AWS Administration Console.
Entry Athena utilizing SQL Workbench/J
In extremely regulated organizations, inside customers aren’t allowed to make use of the console to entry Athena. In such instances, you need to use SQL Workbench/J, an open-source software that allows connectivity to Athena utilizing a JDBC driver.
- Obtain the newest Athena JDBC driver (select the suitable driver based mostly in your Java model).
- Obtain and set up SQL Workbench/J.
- Open SQL Workbench/J.
- On the File menu, select Join Window.
- Select Handle Drivers.
- For Title, enter a reputation to your driver.
- Browse to the folder location the place you downloaded and unzipped the driving force.
- Select OK.
Now that we configured the Athena driver, it’s time to hook up with Athena. You must fill out the connection URL, consumer title, and password.
Use the next connection string to hook up with Athena with a consumer account with out MFA (present the values collected earlier within the publish):
To attach utilizing a consumer account with MFA enabled, use the browser Azure AD Credentials Supplier. You must assemble the connection URL and fill out the consumer title Username and password
Use the next connection string to hook up with Athena with a consumer account that has MFA enabled (present the values you collected earlier):
Substitute textual content in crimson with particulars collected earlier within the article.
When the connection is established, you’ll be able to run queries in opposition to Athena.
Proxy configuration
In case you’re connecting to Athena by way of a proxy server, guarantee that the proxy server permits port 444. The consequence set streaming API makes use of port 444 on the Athena server for outbound communications. Set the ProxyHost
property to the IP handle or host title of your proxy server. Set the ProxyPort
property to the variety of the TCP port that the proxy server makes use of to pay attention for consumer connections. See the next code:
Abstract
On this publish, we configured IAM federation with Azure AD linked to on-premises AD and arrange granular entry to an Athena workgroup. We additionally checked out the way to entry Athena by way of the console utilizing the Microsoft My Apps net portal and SQL Workbench/J software. We additionally mentioned how the connection works over a proxy. The identical federation infrastructure can be leveraged for ODBC driver configuration. It’s also possible to use the directions on this publish to arrange SAML-based Azure IdP to allow federated entry to Athena Workgroups.
In regards to the Creator
Niraj Kumar is a Principal Technical Account Supervisor for monetary companies at AWS, the place he helps clients design, architect, construct, function, and assist workloads on AWS in a safe and strong method. He has over 20 years of numerous IT expertise within the fields of enterprise structure, cloud and virtualization, safety, IAM, resolution structure, and data techniques and applied sciences. In his free time, he enjoys mentoring, teaching, trekking, watching documentaries along with his son, and studying one thing completely different day-after-day.
[ad_2]