You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/configure-database-authentication-authorization/8-knowledge-check.yml
+15-15Lines changed: 15 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -22,55 +22,55 @@ quiz:
22
22
choices:
23
23
- content: "Kerberos"
24
24
isCorrect: false
25
-
explanation: "That's incorrect. Microsoft Entra ID uses HTTPS protocols like SAML and OpenID Connect for authentication and uses OAuth for authorization."
25
+
explanation: "Incorrect. Microsoft Entra ID uses HTTPS protocols like SAML and OpenID Connect for authentication and uses OAuth for authorization."
26
26
- content: "LDAP"
27
27
isCorrect: false
28
-
explanation: "That's incorrect. Microsoft Entra ID uses HTTPS protocols like SAML and OpenID Connect for authentication and uses OAuth for authorization."
28
+
explanation: "Incorrect. Microsoft Entra ID uses HTTPS protocols like SAML and OpenID Connect for authentication and uses OAuth for authorization."
29
29
- content: "OAuth"
30
30
isCorrect: true
31
-
explanation: "That's correct. Microsoft Entra ID uses HTTPS protocols like SAML and OpenID Connect for authentication and uses OAuth for authorization."
31
+
explanation: "Correct. Microsoft Entra ID uses HTTPS protocols like SAML and OpenID Connect for authentication and uses OAuth for authorization."
32
32
- content: "Which database stores the information about logins in SQL Server?"
33
33
choices:
34
34
- content: "master"
35
35
isCorrect: true
36
-
explanation: "That's correct. Logins are stored in the master database."
36
+
explanation: "Correct. Logins are stored in the master database."
37
37
- content: "model"
38
38
isCorrect: false
39
-
explanation: "That's incorrect. The model database doesn't store any user or job information."
39
+
explanation: "Incorrect. The `model` database doesn't store any user or job information."
40
40
- content: "msdb"
41
41
isCorrect: false
42
-
explanation: "That's incorrect. The MSDB database stores data related to the SQL Server Agent."
42
+
explanation: "Incorrect. The `msdb` database stores data related to the SQL Server Agent."
43
43
- content: "Which role allows users to create users within a database?"
44
44
choices:
45
45
- content: "db_datareader"
46
46
isCorrect: false
47
-
explanation: "That's incorrect. This role only allows users to read all of the data in a given database, but not write any data."
47
+
explanation: "Incorrect. This role only allows users to read all of the data in a given database, but not write any data."
48
48
- content: "db_accessadmin"
49
49
isCorrect: true
50
-
explanation: "That's correct. Access admin can add users to the database and create them."
50
+
explanation: "Correct. Access admin can add users to the database and create them."
51
51
- content: "db_securityadmin"
52
52
isCorrect: false
53
-
explanation: "That's incorrect. The security admin role is privileged, but can't create logins and users."
53
+
explanation: "Incorrect. The security admin role is privileged, but can't create logins and users."
54
54
- content: "Which permission allows the user to perform any option against a database object?"
55
55
choices:
56
56
- content: "Control"
57
57
isCorrect: true
58
-
explanation: "That's correct. Control allows the user to drop or modify an object."
58
+
explanation: "Correct. Control allows the user to drop or modify an object."
59
59
- content: "Delete"
60
60
isCorrect: false
61
-
explanation: "That's incorrect. The delete permission only allows for deletion of data in a table."
61
+
explanation: "Incorrect. The `DELETE` permission only allows for deletion of data in a table."
62
62
- content: "View Definition"
63
63
isCorrect: false
64
-
explanation: "That's incorrect. View definition only allows the user to see the DDL for the object."
64
+
explanation: "Incorrect. View definition only allows the user to see the DDL for the object."
65
65
- content: "What feature allows a user to execute a stored procedure without having permission to access the tables referenced in the stored procedure?"
66
66
choices:
67
67
- content: "Ownership chaining"
68
68
isCorrect: true
69
-
explanation: "That's correct. Ownership chaining effectively gives the user temporary access to the objects called by the procedure."
69
+
explanation: "Correct. Ownership chaining effectively gives the user temporary access to the objects called by the procedure."
70
70
- content: "Principle of least privilege"
71
71
isCorrect: false
72
-
explanation: "That's incorrect. The principle of least privilege is a concept and not a functional action."
72
+
explanation: "Incorrect. The principle of least privilege is a concept and not a functional action."
73
73
- content: "Granular security"
74
74
isCorrect: false
75
-
explanation: "That's incorrect. Granular security would involve granting access to the procedure, but not actual manage the privileges."
75
+
explanation: "Incorrect. Granular security would involve granting access to the procedure, but not actual manage the privileges."
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/configure-database-authentication-authorization/includes/1-introduction.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
1
Azure SQL offerings provide several authentication and authorization options that differ from those in SQL Server. This is because Azure SQL Database and Azure SQL Managed Instance rely on Microsoft Entra ID instead of Windows Server Active Directory.
2
2
3
-
This module explores best practices for granting permissions and the various permissions available within a database. It also delves into the concept of *least privilege*. While built-in roles in SQL Server and other database engines offer broad security privileges, many applications require more granular security on database objects.
3
+
You'll explore the best practices for granting permissions and the various permissions available within a database. It also delves into the concept of *least privilege*. While built-in roles in SQL Server and other database engines offer broad security privileges, many applications require more granular security on database objects.
4
4
5
5
## Learning objectives
6
6
7
-
In this module you will learn about:
7
+
In this module you'll learn about:
8
8
9
9
- Explain authentication options for Azure SQL offerings
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/configure-database-authentication-authorization/includes/3-describe-authentication-identities.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ Microsoft Entra ID authentication is more secure and simplifies user management.
4
4
5
5
Azure SQL Database also supports SQL Server authentication and Microsoft Entra authentication. Microsoft Entra authentication uses the same credentials for other resources like the Azure portal or Microsoft 365.
6
6
7
-
Microsoft Entra ID can sync with on-premises Active Directory, providing consistent credentials for both environments. It also supports multi-factor authentication (MFA) for added security. MFA options include push notifications via the Microsoft Authenticator app, text messages, or access codes. Users with MFA must use the Universal Authentication with MFA option in SQL Server Management Studio.
7
+
Microsoft Entra ID can sync with on-premises Active Directory, providing consistent credentials for both environments. It also supports multifactor authentication (MFA) for added security. MFA options include push notifications via the Microsoft Authenticator app, text messages, or access codes. Users with MFA must use the Universal Authentication with MFA option in SQL Server Management Studio.
8
8
9
9
You can set SQL admin permissions on an Azure SQL Database using the Azure portal.
10
10
11
11
:::image type="content" source="../media/module-33-security-final-02.png" alt-text="Screenshot showing how to set admin permissions on a SQL Database.":::
12
12
13
-
It is a best practice to make this account a Microsoft Entra group, so access is not dependent on a single login. The Microsoft Entra admin account grants special permissions and allows the account or group that holds that permission to have `sysadmin` like access to the server and all of the databases within the server. The admin account is only set using Azure Resource Manager and not at the database level. In order to change the account or group, you have to use the Azure portal, PowerShell, or Azure CLI.
13
+
It's a best practice to make this account a Microsoft Entra group, so access isn't dependent on a single login. The Microsoft Entra admin account grants special permissions and allows the account or group that holds that permission to have `sysadmin` like access to the server and all of the databases within the server. The admin account is only set using Azure Resource Manager and not at the database level. In order to change the account or group, you have to use the Azure portal, PowerShell, or Azure CLI.
14
14
15
-
## Role-based access control
15
+
## Role-based access control (RBAC)
16
16
17
17
All Azure types of operations for Azure SQL Database are controlled through role-based access control (RBAC). RBAC is currently decoupled from Azure SQL security, but you can think of it as security rights outside of your database in SQL Database, with a scope that includes subscription, resource group, and resource. The rights apply to operations in the Azure portal, the Azure CLI, and Azure PowerShell. RBAC allows for separation of duties between deployment, management, and usage.
Copy file name to clipboardExpand all lines: learn-pr/wwl-data-ai/configure-database-authentication-authorization/includes/4-describe-security-principals.md
+9-11Lines changed: 9 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,31 +1,29 @@
1
1
Security principals are entities that can request SQL Server resources and to which you can (usually) grant permissions. There are several sets of security principals in SQL Server. Security principals exist at either the server level or the database level and can be either individuals or collections. Some sets have a membership controlled by the SQL Server administrators, and some have a fixed membership.
2
2
3
-
At the database level, we’ll look at users, database roles, application roles.
4
-
5
3
> [!NOTE]
6
-
>New logins can be added by administrators on Azure SQL Database, but new server roles cannot be created.
4
+
>New logins can be added by administrators on Azure SQL Database, but new server roles can't be created.
7
5
8
6
## Schemas and securables
9
7
10
8
Before we look at the details of security principals, we need to understand the concepts of securables and schemas. SQL Server and Azure SQL Database have three scopes for securables. Securables are the resources within the database to which the authorization system manages access. For example, a table is a securable. To simplify access control, SQL Server contains securables in nested hierarchies called scopes. The three securable scopes are the server, the database, and the schema. A schema is a collection of objects within your database, which allows objects to be grouped into separate namespaces.
11
9
12
-
Every user has a default schema. If a user tries to access an object without specifying a schema name, as in: `SELECT name FROM customers`, it's assumed the object is in the user’s default schema. If there's no such object in the default schema, SQL Server will check to see if the object is in the pre-defined dbo schema. If there's no object of the specified name in either the user’s default schema, or in the dbo schema, the user will receive an error message. It's considered best practice to always specify the schema name when accessing objects, so the previous select would be something like:
10
+
Every user has a default schema. If a user tries to access an object without specifying a schema name, as in: `SELECT name FROM customers`, it's assumed the object is in the user’s default schema. If there's no such object in the default schema, SQL Server checks to see if the object is in the predefined dbo schema. If there's no object of the specified name in either the user’s default schema, or in the dbo schema, the user receives an error message. It's a best practice to specify the schema name when accessing objects, so the previous select would be something like:
13
11
`SELECT name FROM SalesSchema.customers`. If a user hasn't been given a default schema, their default schema is set to dbo.
14
12
15
-
By default, if no schema is specified when a user creates an object, SQL Server will attempt to create it in the user’s default schema. If the user hasn't been granted permission to create objects in their default schema, the object can't be created.
13
+
By default, if no schema is specified when a user creates an object, SQL Server attempts to create it in the user’s default schema. If the user hasn't been granted permission to create objects in their default schema, the object can't be created.
16
14
17
15
## Logins and users
18
16
19
-
No matter the mode of authentication that is used, a login name used to access your SQL database is set up as a login within the instance. Those logins are set up at the instance level of SQL Server and stored in the master database. However, you can configure contained users, which are added at the database level. These users can be configured as SQL Server Authentication users as well as either Windows Authentication users or Microsoft Entra users (depending on which platform you're using). In order to create these users, the database must be configured for partial containment, which is configured by default in Azure SQL Database, and optionally configurable in SQL Server.
17
+
No matter the mode of authentication that is used, a login name used to access your SQL database is set up as a login within the instance. Those logins are set up at the instance level of SQL Server and stored in the master database. However, you can configure contained users, which are added at the database level. These users can be configured as SQL Server Authentication users and either Windows Authentication users or Microsoft Entra users (depending on which platform you're using). In order to create these users, the database must be configured for partial containment, which is configured by default in Azure SQL Database, and optionally configurable in SQL Server.
20
18
21
-
These users only have access to the database that the user is set up with. For the purposes of Azure SQL Database, it's considered a best practice to create users at the scope of the user database, and not in the master database as shown below.
19
+
These users only have access to the database that the user is set up with. For the purposes of Azure SQL Database, it's a best practice to create users at the scope of the user database, and not in the master database.
22
20
23
21
```sql
24
22
CREATE USER [dba@contoso.com] FROM EXTERNAL PROVIDER;
25
23
GO
26
24
```
27
25
28
-
The `CREATE USER` statement is executed in the context of the user database. In the example above, the user is a Microsoft Entra user as indicated with the `FROM EXTERNAL PROVIDER` syntax.
26
+
The `CREATE USER` statement is executed in the context of the user database. In the example, the user is a Microsoft Entra user as indicated with the `FROM EXTERNAL PROVIDER` syntax.
29
27
30
28
If logins are created at the instance level in SQL Server, a user should then be created within the database, which maps the user to the server-based login as shown in the following example.
31
29
@@ -53,7 +51,7 @@ As you can imagine, database security can get complicated for applications with
53
51
54
52
SQL Server and Azure SQL Database both include built-in roles that are defined by Microsoft, and also provide the option to create custom roles. Custom roles can be created at the server or database level. However, server roles can't be granted access to objects within a database directly. Server roles are only available in SQL Server and Azure SQL Managed Instance, not in Azure SQL Database.
55
53
56
-
Within a database, permissions can be granted to the users that exist within the database. If multiple users all need the same permissions, you can create a database role within the database and grant the needed permissions to this role. Users can be added as members of the database role. The members of the database role will inherit the permissions of the database role.
54
+
Within a database, permissions can be granted to the users that exist within the database. If multiple users all need the same permissions, you can create a database role within the database and grant the needed permissions to this role. Users can be added as members of the database role. The member of the database role inherits the permissions of the database role.
57
55
58
56
```sql
59
57
CREATE USER [DP300User1] WITH PASSWORD ='Pa55.w.rd'
@@ -79,11 +77,11 @@ In the above example, you can see that two users are created, and then a role ca
79
77
80
78
## Application roles
81
79
82
-
Application roles can also be created within a SQL Server database or Azure SQL Database. Unlike database roles, users aren't made members of an application role. An application role is activated by the user, by supplying the pre-configured password for the application role. Once the role is activated the permissions that are applied to the application role are applied to the user until that role is deactivated.
80
+
Application roles can also be created within a SQL Server database or Azure SQL Database. Unlike database roles, users aren't made members of an application role. An application role is activated by the user, by supplying the preconfigured password for the application role. Once the role is activated the permissions that are applied to the application role are applied to the user until that role is deactivated.
83
81
84
82
## Built-in database roles
85
83
86
-
Microsoft SQL Server contains several fixed database roles within each database for which the permissions are predefined. Users can be added as members of one or more roles. These roles give their members a pre-defined set of permissions. These roles work the same within Azure SQL Database and SQL Server.
84
+
Microsoft SQL Server contains several fixed database roles within each database for which the permissions are predefined. Users can be added as members of one or more roles. These roles give their members a predefined set of permissions. These roles work the same within Azure SQL Database and SQL Server.
0 commit comments