20764C 01 PDF
20764C 01 PDF
20764C 01 PDF
• Securables
• Objects to which access must be secured
• Principals
• Security identities that access securables and perform actions
• Permissions
• The actions principals can perform on securables
• Logins:
• Create in SQL Server Management Studio (SMSS)
• Create using the CREATE LOGIN statement:
CREATE LOGIN [ADVENTUREWORKS\SalesReps]
FROM WINDOWS
WITH DEFAULT_DATABASE =[salesdb];
• Disable logins:
ALTER LOGIN DanDrayton DISABLE;
• Delete logins:
DROP LOGIN DanDrayton;
Demonstration: Authenticating Logins
• A Schema is:
• A collection of database objects
• Associated with a particular username
• Username = Schema Owner
• A Schema can contain:
• A single table
• Multiple tables
• Lots of objects (no limit by default)
• Configuration:
• Client, server, database server tiers
• Definitions EXEC sp_addlinkedserver@server='RemoteServer',
@srvproduct='',
@provider='SQLOLEDB',
@datasrc='r:\datasource\RemoteServer';
Linked Server Security
• Syntax above:
• ‘RemoteServer’ = Server you’re connecting to
• ‘false’ = Are you authenticating with the current login?
• ‘Domain\Username’ = If I have to explain this one…
• ‘RemoteUserName’ = Username on the other machine
• ‘Password’ = The password of the RemoteUserName
Typical "Double-Hop" Problem
Hop1
Hop2
• Delegation:
• Identity passed to remote servers
• Impersonation:
• Identity used within a domain
• Windows Authentication
• Service-For-User (S4U) – Used when clients are non-Windows
• LogonUser API – Access requested but no delegation trust
• Impersonate users and logins within a SQL Server
instance using EXECUTE AS
Working with Mismatched Security Identifiers
• Considerations:
• Change Tracking, replication not allowed
• Password policy, CREATE USER does not
WHAT?
support bypassing the password policy
• Connection strings must be explicit
• Cross database queries
Lab: Authenticating Users
Logon Information
Virtual machine: 20764C-MIA-SQL
User name: ADVENTUREWORKS\Student
Password: Pa55w.rd