|
| 1 | +--- |
| 2 | +title: Manage cluster access in Active Directory mode |
| 3 | +description: Manage access to the big data cluster |
| 4 | +author: NelGson |
| 5 | +ms.author: negust |
| 6 | +ms.reviewer: mikeray |
| 7 | +ms.date: 12/06/2019 |
| 8 | +ms.topic: conceptual |
| 9 | +ms.prod: sql |
| 10 | +ms.technology: big-data-cluster |
| 11 | +--- |
| 12 | + |
| 13 | +# Manage cluster access in Active Directory mode |
| 14 | + |
| 15 | +[!INCLUDE[tsql-appliesto-ssver15-xxxx-xxxx-xxx](../includes/tsql-appliesto-ssver15-xxxx-xxxx-xxx.md)] |
| 16 | + |
| 17 | +This document describes how to update the Active Directory (AD) groups provided upon deployment for clusterAdmins and clusterUsers. |
| 18 | + |
| 19 | +## Two overarching roles in the cluster |
| 20 | + |
| 21 | +AD groups can be provided in the security section of the deployment profile as part of two overarching roles for authorization within the cluster: |
| 22 | + |
| 23 | +* `clusterAdmins` - This parameter takes one AD group. Members of this group will get administrator permissions in the entire cluster. They have `sysadmin` permissions in SQL Server, `superuser` permissions in HDFS and Spark, and administrator rights in controller. |
| 24 | + |
| 25 | +* `clusterUsers` - List of the AD groups that are regular users without administrator permissions in the big data cluster. These users have permissions to login to SQL Server Master Instance, but will have no permissions to objects or data by default. |
| 26 | + |
| 27 | +To grant additional AD groups permissions to the cluster after the deployment, one option is to add any additional users and groups to the already nominated groups upon deployment. |
| 28 | + |
| 29 | +However, it might not always be feasible for the administrators to alter the group memberships inside AD. To grant additional AD groups permissions without altering group memberships inside AD, complete the following steps.s |
| 30 | + |
| 31 | +## Grant additional AD groups administrator permissions |
| 32 | + |
| 33 | +>[!IMPORTANT] |
| 34 | +>This procedure does not grant additional AD groups administrator access to the hadoop components such as Spark and HDFS in the big data cluster. Those components only allow one single AD group as the superuser group, which means that the group specified in `clusterAdmins` upon deployment remain the superuser group even after this step. |
| 35 | +
|
| 36 | +The following steps allow granting administrator access to controller as well as SQL Server master instance. |
| 37 | + |
| 38 | +### Create a login for the AD user or group in master SQL server. |
| 39 | + |
| 40 | +1. Connect to master SQL endpoint using your favorite SQL client. Use any admin login. For example, `AZDATA_USERNAME`, which was provided during the deployment. Alternatively, it could be any AD account that belongs to the AD group provided as `clusterAdmins` in the security configuration. |
| 41 | + |
| 42 | +2. Run the following TSQL to create a login for the AD user/group. |
| 43 | + |
| 44 | + ```sql |
| 45 | + CREATE LOGIN [<domain>\<principal>] FROM WINDOWS; |
| 46 | + ``` |
| 47 | + |
| 48 | + If you are granting admin privileges in SQL Server, then also grant the following permission: |
| 49 | + |
| 50 | + ```sql |
| 51 | + ALTER SERVER ROLE sysadmin ADD MEMBER [<domain>\<principal>]; |
| 52 | + GO |
| 53 | + ``` |
| 54 | + |
| 55 | +### Add the AD user or group to the roles table in the controller database |
| 56 | + |
| 57 | +1. Obtain controller SQL server credentials: |
| 58 | + |
| 59 | + Run the following command as a Kubernetes administrator: |
| 60 | + |
| 61 | + ```bash |
| 62 | + kubectl get secret controller-sa-secret -n <cluster name> -o yaml | grep password |
| 63 | + ``` |
| 64 | + |
| 65 | + Base64 decode the secret: |
| 66 | + |
| 67 | + ```bash |
| 68 | + echo <password from kubectl command> | base64 --decode && echo |
| 69 | + ``` |
| 70 | + |
| 71 | +2. In a separate command window, expose controller database server's port: |
| 72 | + |
| 73 | + ```bash |
| 74 | + kubectl port-forward controldb-0 1433:1433 --address 0.0.0.0 -n <cluster name> |
| 75 | + ``` |
| 76 | + |
| 77 | +3. Use the above connection to insert a row in the roles table. Type the realm value in uppercase. |
| 78 | + |
| 79 | + If you are granting admin privileges, use `bdcAdmin` role in the `<role name>` below. For non-admin user, use the `bdcUser` role. |
| 80 | + |
| 81 | + ```sql |
| 82 | + USE controller; |
| 83 | + GO |
| 84 | + |
| 85 | + INSERT INTO [controller].[auth].[roles] VALUES (N'<user or group name>@<REALM>', N'<role name>') |
| 86 | + GO |
| 87 | + ``` |
| 88 | + |
| 89 | +4. Verify that the members of the group you added has cluster administrator permissions by logging in to controller endpoint and running: |
| 90 | + |
| 91 | + ```bash |
| 92 | + azdata bdc config show |
| 93 | + ``` |
| 94 | + |
| 95 | +5. For non-administrator users, you can verify access by authenticating to SQL Master Instance or to controller using `azdata login`. |
| 96 | + |
| 97 | +## Next steps |
| 98 | + |
| 99 | +- [Security concepts for SQL Server Big Data Clusters](concept-security.md) |
0 commit comments