Skip to content

Commit cb96b61

Browse files
authored
Merge pull request #13141 from MikeRayMSFT/20191206-bdc-security
Stage azdata security updates
2 parents 76bf8b8 + 2304632 commit cb96b61

3 files changed

Lines changed: 192 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: Update AZDATA_PASSWORD
3+
description: Update the `AZDATA_PASSWORD` manually
4+
author: NelGson
5+
ms.author: negust
6+
ms.reviewer: mikeray
7+
ms.date: 12/19/2019
8+
ms.topic: conceptual
9+
ms.prod: sql
10+
ms.technology: big-data-cluster
11+
---
12+
13+
# Manually update `AZDATA_PASSWORD`
14+
15+
[!INCLUDE[tsql-appliesto-ssver15-xxxx-xxxx-xxx](../includes/tsql-appliesto-ssver15-xxxx-xxxx-xxx.md)]
16+
17+
No matter if the cluster is operating with Active Directory (AD) integration or not, the `AZDATA_PASSWORD` is set during deployment. It provides a basic authentication to the cluster controller and master instance. This document describes how to manually update the `AZDATA_PASSWORD`.
18+
19+
## Change `AZDATA_PASSWORD` for controller
20+
21+
The following steps are also updating the Gateway (Knox) password in case the cluster is operating in non-AD mode.
22+
23+
1. Obtain controller SQL server credentials
24+
25+
Run the following command as a Kubernetes administrator:
26+
27+
```bash
28+
kubectl get secret controller-sa-secret -n <cluster name> -o yaml | grep password
29+
```
30+
31+
Base64 decode the secret:
32+
33+
```bash
34+
echo <password from kubectl command> | base64 --decode && echo
35+
```
36+
37+
2. In a separate command window, expose controller database server's port
38+
39+
```bash
40+
kubectl port-forward controldb-0 1433:1433 --address 0.0.0.0 -n <cluster name>
41+
```
42+
43+
3. Use the SA password obtained above to connect to controller database server from a SQL client tool
44+
45+
4. Generate a new complex password for `AZDATA_USERNAME` to replace existing `AZDATA_PASSWORD`
46+
47+
To simplify the example, the next steps use "newPassword" as the generated password is "newPassword".
48+
49+
5. Get the `hexsalt` from users table
50+
51+
```sql
52+
SELECT hexsalt FROM [auth].[users] WHERE username = '<username>'
53+
```
54+
55+
`hexsalt` returns a random hex string, for example: `64FC59DF31244FFEE02F457BC0750226`.
56+
57+
58+
6. Install the platform appropriate dotnetcore app
59+
60+
Install the platform appropriate dotnetcore app for [`pbkdf2`](https://helsinki.redmond.corp.microsoft.com/dist/software/pbkdf2/).
61+
62+
The app is self-contained and does not require any prerequisite such as dotnet runtimes.
63+
64+
7. Encrypt the new complex password using the `hexsalt`
65+
66+
```bash
67+
pbkdf2 <password> <hexsalt>
68+
J2y4E4dhlgwHOaRr3HKiiVAKBfjuGDyYmzn88VXmrzM=
69+
```
70+
71+
8. Update the password in the users table
72+
73+
```bash
74+
UPDATE [auth].[users] SET password = 'J2y4E4dhlgwHOaRr3HKiiVAKBfjuGDyYmzn88VXmrzM=' WHERE username = '<username>'
75+
```
76+
77+
## Change `AZDATA_PASSWORD` in SQL Server master instance
78+
79+
1. Connect to master SQL endpoint with any administrator user
80+
81+
2. Run the following TSQL:
82+
83+
Change the password for the login you defined upon deployment in the parameter `AZDATA_USERNAME`.
84+
85+
```sql
86+
ALTER LOGIN <AZDATA_USERNAME> WITH PASSWORD = 'newPassword'
87+
```
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
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)

docs/toc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,12 @@
189189
href: big-data-cluster/manage-notebooks.md
190190
- name: Manage with controller dashboard
191191
href: big-data-cluster/manage-with-controller-dashboard.md
192+
- name: Security
193+
items:
194+
- name: Update AZDATA_PASSWORD
195+
href: big-data-cluster/change-azdata-password.md
196+
- name: Manage user access
197+
href: big-data-cluster/manage-user-access.md
192198
- name: Notebooks
193199
items:
194200
- name: Notebooks overview

0 commit comments

Comments
 (0)