SlideShare a Scribd company logo
1 of 39
… the easy way!
Image © Wikimedia CC
Please visit our Gold Sponsor stands,
we couldn't do it without you…
 MCTS in SQL Server and SharePoint
 Over a decade of Microsoft solution development and
architecture
 Lately focused on SQL Server 2012 BI in SharePoint
Integrated Mode
 I like dogs, especially big ones
 Focus on SharePoint + SQL Server
 Why Kerberos
 Service Principal Names
 Delegation options
 Claims & Kerberos
 Testing &Troubleshooting
 Live Demo!
 More secure, Less DC load, interoperability...
 Enables Delegation!
◦ Unified Security at data source level
◦ Data driven security
◦ Personalised reports
NTLM or
Kerberos
SP Farm
or DB server
Kerberos
Delegation
Data Source
NTLM or
Kerberos
SP Farm Data Source
1st “hop”
Any protocol
2nd “hop”
Kerberos only!
Impersonate
user
Identify your data sources
 Service Principle Names
Decide on your delegation
 Constrained or not?
Set delegation type
Allow data sources to be delegated to
Easy, right?
 Service Principal Name
◦ What (Service) and
◦ Where (Computer or “Principal”) to connect to
 Identifies the target
◦ Not the delegating service
◦ Certainly not the client
◦ The Data Source Service!
1
 Service Principal Name
 <service class>/<NetBIOS>[:<port or instance>]
or/and
 <service class>/<FQDN>[:<port or instance>]
setspn.exe -S <SPN> <AccountName>
Service identity:
 Service account as <domainusername>
or
 Host Account if running as Local System
Host identity
1
NetBIOS:
BI-SQL
FQDN:
Hades
.Local
Port: 49753
SQL-DB
Domain
Database service
account identity
SETSPN -S MSSQLSVC/BI-SQL:49753 HADESSQL-DB
BI-SQL.HADES.LOCAL
Database
service class
Host server
OR
SETSPN -S MSOLAPSVC.3/BI-SQL:UDM HADESSQL-SSAS
NetBIOS:
BI-SQL
FQDN:
Hades.
Local SQL-SSAS
Domain
SSAS service
account identity
Analysis Services
Service class
Host server
OR
Instance:
UDM
BI-SQL.HADES.LOCAL
IIS server
SP-WFE FQDN:
Hades.
Local SP-PORTAL
SharePoint Portal
Application Pool identity
SharePoint WFE
Host server
OR
OLYMPUS.HADES.LOCAL
SETSPN -S HTTP/OLYMPUS HADESSP-PORTAL
DNS “A”
record:
OLYMPUS
Port: 80
 Now I can see Delegation tab!
SETSPN -S DUMMYSPN HADESSP-XLS-SVC
? FQDN:
Hades.
Local
SP-XLS-SVC
Domain Delegating account
Arbitrary string
Non-existing service
 Identifies the target
 Stored against target’s identity
 Instance name for Analysis Services
 Arbitrary SPN to show delegation tab
 Don’t forget discovery services for SQL2005
1
 Basic (unconstrained)
◦ To any Service
 Constrained
◦ Only if allowed
2
2


SSRS

SSRS


 Basic
◦ Delegates to any service
◦ Cross-domain delegation
◦ No protocol transition
◦ Can precede constrained
 Constrained
◦ Any service can use
◦ Most require
◦ More secure
◦ Only delegates if
allowed!
◦ Only within a domain
Client
SharePoint
Farm Kerberos Data
Source
NTLM
No
Trust is OK!
MSFT.com
pintoso.MSFT.com
contoso.MSFT.com
Constrained delegation
works!
Client SharePoint
Farm
Basic
Kerberos
Data
Source
NTLM
or Basic
Kerberos
Must have
Two Way Trust
MSFT.com
pintoso.MSFT.comcontoso.MSFT.com
 Use Basic for
◦ SSRS (SQL Reporting Services) to connect to another domain
◦ When security is not critical
 Use Constrained for
◦ Any other case!
2
NTLM or
Kerberos
SP Farm Data Source
Delegating Account SPN Account
 Add a dummy SPN to the Delegating account to bring
up delegation tab in ADUC:
 Allows trust
for constrained
delegation
 Enables protocol
transition
for SharePoint
3
 Select allowed SPNs:
 Use ADUC delegation tab
 Locate SPN’s account
 Click to select SPNs to add
SPN’s account
4
 ADSIEdit (easier):
◦ Same string as in
SETSPN statement
 PowerShell:
◦ Not for wimps
◦ Active Directory Module:
 Set-ADObject
 Get-ADObject
 Set-KCD
 CMD (document):
◦ ldifde
Set your SPNs (inc Dummy and Browser 2005)
 Use “KerberosHelper.xslx” from www.data-united.co.uk
Decide: Basic or Constrained?
Set delegation type
Add Allowed SPNs (for constrained)
Test working, Sit back and relax!
Let me know if it doesn't work 
www.data-united.co.uk
 Claims to Windows Token Service (C2WTS)
◦ SharePoint protocol transition:
Kerberos
Delegation!
NTLM
or
Kerberos
SharePoint
Web
Frontend
SharePoint
Application
Server
Data
Source
STS
Claims
C2WTS
?
UPN
Claim
Windows
Token
 Starts automatically
 Depends on Cryptographic Service
◦ sc config c2wts depend= CryptSvc
 Service Identity is trusted for delegation
◦ Local System by default (and should stay that way)
◦ If changed to Windows Identity, must be a local admin
 Claims-aware services are allowedCaller s
◦ c2wtshost.exe.config
 Use Rodney Viana's little tool c2WTSTest.exe
 “NT Authority/Anonymous” is no more!
 Profiler shows Your login
 Test every service against every data source
SSRS
 15 character limit on
Windows NetBIOS
 Open Port 88 on Firewall
 SPN for SQL 2005
browser/discovery services
 Sensitive Client Account
 Enable Kerberos logging (don’t forget about it!)
 Registry hack http://support.microsoft.com/kb/262177
 Check Kerberos errors in Event log on SP App server and client
 ULS log (SP App server with Verbose)
 Use Event log, Kerbtray and Kerberos helper tools to check
for common errors
 Use Klist –purge to re-test Kerberos
 Use dcdiag to check SPNs
Sponsor Competition
Draws in the Exhibition
Hall 17:15
After…
Community Events
SQL Saturday Edinburgh 7/8 June www.sqlsaturday.com/202/
SQL Relay 17/27 June www.sqlrelay.co.uk
SQL Saturday Dublin 21/22 June www.sqlsaturday.com/229/
SQL Saturday Cambridge27 September www.sqlsaturday.com/228/
UK User Groups All the time www.sqlserverfaq.com
 Please complete feedback
 http://sqlbits.com/SQLBitsXIThursday
 http://sqlbits.com/SQLBitsXIFriday
 http://sqlbits.com/SQLBitsXISaturday
 http://sqlbits.com/SQLBitsXI (General feedback)
We hope you had a great
conference day!
Keep checking
www.sqlbits.com for
slides, videos and news of
the next conference
#SQLBIT
S
 Kerberos: authentication protocol
 Principal – a computer in the Kerberos protocol, usually the
target
 UPN: user principal name
 FQDN: Fully Qualified Domain Name
 WCF: Windows Communication Foundation (.NET)
 C2WTS: WCF service granting windows token for a UPN claim
 How the Kerberos Version 5 Authentication Protocol
Works
http://technet.microsoft.com/en-us/library/cc772815(v=ws.10).aspx
 Overview of Kerberos authentication for Microsoft
SharePoint 2010 Products
http://technet.microsoft.com/en-us/library/gg502594.aspx
 Kerberos Guide for SharePoint 2013
http://blog.blksthl.com/2012/09/26/the-first-kerberos-guide-for-sharepoint-2013-technicians/
 Kerberos Blog and Resources
www.data-united.co.uk
 Kerberos using PowerShell
http://blog.msresource.net/2012/07/12/fim-service-principal-names-and-kerberos-delegation/
 Troubleshooting C2WTS by Rodney Viana
http://blogs.msdn.com/b/rodneyviana/archive/2011/07/19/troubleshooting-claims-to-
windows-nt-token-service-c2wts-in-sharepoint-2010-may-be-difficult-if-you-don-t-know-where-
to-start.aspx
 Kerberos Professional Services
www.data-united.co.uk
 Command Prompt
◦ List all Kerberos Tickets on the principal (a ticket must be present for the
URL, otherwise NTLM is used)
 Klist
◦ Purge Kerberos Tickets (run on all principals to avoid reboot/wait)
 Klist –purge
◦ List all msDS-AllowedToDelegateTo properties for a single account (only
computers with )
 ldifde -f c:tempfilename.txt -d "CN=SA_SVC_C2WTS,OU=Service
Accounts,DC=contoso,DC=msft,DC=com" -l msDS-AllowedToDelegateTo
◦ List all msDS-AllowedToDelegateTo properties all accounts in an OU:
 ldifde -f c:tempfilename.txt -d "OU=Service Accounts,
DC=contoso,DC=msft,DC=com" -l msDS-AllowedToDelegateTo

More Related Content

What's hot

GraniteDS 360|Flex DC
GraniteDS 360|Flex DCGraniteDS 360|Flex DC
GraniteDS 360|Flex DC
wdrai
 

What's hot (20)

What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0? What's New in the Ambassador Edge Stack 1.0?
What's New in the Ambassador Edge Stack 1.0?
 
How Small Can Java Microservices Be?
How Small Can Java Microservices Be?How Small Can Java Microservices Be?
How Small Can Java Microservices Be?
 
Keystone Federation
Keystone Federation Keystone Federation
Keystone Federation
 
GraniteDS 360|Flex DC
GraniteDS 360|Flex DCGraniteDS 360|Flex DC
GraniteDS 360|Flex DC
 
Top Legacy Sins
Top Legacy SinsTop Legacy Sins
Top Legacy Sins
 
Microservices - not just with Java
Microservices - not just with JavaMicroservices - not just with Java
Microservices - not just with Java
 
Aws landing zone. journey to the cloud
Aws landing zone. journey to the cloudAws landing zone. journey to the cloud
Aws landing zone. journey to the cloud
 
K8s hard-way on DigitalOcean
K8s hard-way on DigitalOceanK8s hard-way on DigitalOcean
K8s hard-way on DigitalOcean
 
Reactive Development: Commands, Actors and Events. Oh My!!
Reactive Development: Commands, Actors and Events.  Oh My!!Reactive Development: Commands, Actors and Events.  Oh My!!
Reactive Development: Commands, Actors and Events. Oh My!!
 
Kerberos, Token and Hadoop
Kerberos, Token and HadoopKerberos, Token and Hadoop
Kerberos, Token and Hadoop
 
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up LoftTurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft
 
MicroServices on Azure
MicroServices on AzureMicroServices on Azure
MicroServices on Azure
 
Servicestack
ServicestackServicestack
Servicestack
 
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service FabricTokyo Azure Meetup #5 - Microservices and Azure Service Fabric
Tokyo Azure Meetup #5 - Microservices and Azure Service Fabric
 
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile gamesAkka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile games
 
Shipping logs to splunk from a container in aws howto
Shipping logs to splunk from a container in aws howtoShipping logs to splunk from a container in aws howto
Shipping logs to splunk from a container in aws howto
 
Serverless
ServerlessServerless
Serverless
 
Webinar slides "Building Real-Time Collaborative Web Applications"
Webinar slides "Building Real-Time Collaborative Web Applications"Webinar slides "Building Real-Time Collaborative Web Applications"
Webinar slides "Building Real-Time Collaborative Web Applications"
 
MongoDB.local Seattle 2019: Introduction to MongoDB Atlas for Your Enterprise
MongoDB.local Seattle 2019: Introduction to MongoDB Atlas for Your EnterpriseMongoDB.local Seattle 2019: Introduction to MongoDB Atlas for Your Enterprise
MongoDB.local Seattle 2019: Introduction to MongoDB Atlas for Your Enterprise
 
Global Azure Bootcamp: Azure service fabric
Global Azure Bootcamp: Azure service fabric Global Azure Bootcamp: Azure service fabric
Global Azure Bootcamp: Azure service fabric
 

Similar to Kerberos

SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival Guide
J.D. Wade
 
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint SecurityAUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
Michael Noel
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Mark Broadbent
 
SharePoint in the Extranet Joel Oleson
SharePoint in the Extranet Joel OlesonSharePoint in the Extranet Joel Oleson
SharePoint in the Extranet Joel Oleson
webhostingguy
 

Similar to Kerberos (20)

SPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival GuideSPS Ozarks 2012: Kerberos Survival Guide
SPS Ozarks 2012: Kerberos Survival Guide
 
Amazon RDS for Microsoft SQL: Performance, Security, Best Practices (DAT303) ...
Amazon RDS for Microsoft SQL: Performance, Security, Best Practices (DAT303) ...Amazon RDS for Microsoft SQL: Performance, Security, Best Practices (DAT303) ...
Amazon RDS for Microsoft SQL: Performance, Security, Best Practices (DAT303) ...
 
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint SecurityAUSPC 2013 - Understanding the Five Layers of SharePoint Security
AUSPC 2013 - Understanding the Five Layers of SharePoint Security
 
[Vončina] Configuring SharePoint 2016 for BI Scenarios
[Vončina] Configuring SharePoint 2016 for BI Scenarios[Vončina] Configuring SharePoint 2016 for BI Scenarios
[Vončina] Configuring SharePoint 2016 for BI Scenarios
 
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto EditionEnter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
Enter The Dragon - SQL 2014 on Server Core - SQLSaturday #341 Porto Edition
 
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 EditionEnter the Dragon -  SQL 2014 on Server Core PASS Summit 2014 Edition
Enter the Dragon - SQL 2014 on Server Core PASS Summit 2014 Edition
 
Using Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your databaseUsing Redgate, AKS and Azure to bring DevOps to your database
Using Redgate, AKS and Azure to bring DevOps to your database
 
Using Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your DatabaseUsing Redgate, AKS and Azure to bring DevOps to your Database
Using Redgate, AKS and Azure to bring DevOps to your Database
 
Domino Fitness. Time for a Health Check
Domino Fitness. Time for a Health CheckDomino Fitness. Time for a Health Check
Domino Fitness. Time for a Health Check
 
Kerberos part 2
Kerberos part 2Kerberos part 2
Kerberos part 2
 
All about Kerberos In Microsoft BI
All about Kerberos In Microsoft BIAll about Kerberos In Microsoft BI
All about Kerberos In Microsoft BI
 
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginnersSQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
 
Operations: Security Crash Course — Best Practices for Securing your Company
Operations: Security Crash Course — Best Practices for Securing your CompanyOperations: Security Crash Course — Best Practices for Securing your Company
Operations: Security Crash Course — Best Practices for Securing your Company
 
SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012SharePoint Security in an Insecure World - AUSPC 2012
SharePoint Security in an Insecure World - AUSPC 2012
 
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
apidays LIVE Australia 2021 - Levelling up database security by thinking in A...
 
Best Practice SharePoint Architecture
Best Practice SharePoint ArchitectureBest Practice SharePoint Architecture
Best Practice SharePoint Architecture
 
Moscow MuleSoft meetup May 2021
Moscow MuleSoft meetup May 2021Moscow MuleSoft meetup May 2021
Moscow MuleSoft meetup May 2021
 
SharePoint in the Extranet Joel Oleson
SharePoint in the Extranet Joel OlesonSharePoint in the Extranet Joel Oleson
SharePoint in the Extranet Joel Oleson
 
Operations: Security
Operations: SecurityOperations: Security
Operations: Security
 
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory EnvironmentsTROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
TROOPERS 20 - SQL Server Hacking Tips for Active Directory Environments
 

Kerberos

  • 1. … the easy way! Image © Wikimedia CC
  • 2.
  • 3. Please visit our Gold Sponsor stands, we couldn't do it without you…
  • 4.  MCTS in SQL Server and SharePoint  Over a decade of Microsoft solution development and architecture  Lately focused on SQL Server 2012 BI in SharePoint Integrated Mode  I like dogs, especially big ones
  • 5.  Focus on SharePoint + SQL Server  Why Kerberos  Service Principal Names  Delegation options  Claims & Kerberos  Testing &Troubleshooting  Live Demo!
  • 6.  More secure, Less DC load, interoperability...  Enables Delegation! ◦ Unified Security at data source level ◦ Data driven security ◦ Personalised reports NTLM or Kerberos SP Farm or DB server Kerberos Delegation Data Source
  • 7. NTLM or Kerberos SP Farm Data Source 1st “hop” Any protocol 2nd “hop” Kerberos only! Impersonate user
  • 8. Identify your data sources  Service Principle Names Decide on your delegation  Constrained or not? Set delegation type Allow data sources to be delegated to Easy, right?
  • 9.  Service Principal Name ◦ What (Service) and ◦ Where (Computer or “Principal”) to connect to  Identifies the target ◦ Not the delegating service ◦ Certainly not the client ◦ The Data Source Service! 1
  • 10.  Service Principal Name  <service class>/<NetBIOS>[:<port or instance>] or/and  <service class>/<FQDN>[:<port or instance>] setspn.exe -S <SPN> <AccountName> Service identity:  Service account as <domainusername> or  Host Account if running as Local System Host identity 1
  • 11. NetBIOS: BI-SQL FQDN: Hades .Local Port: 49753 SQL-DB Domain Database service account identity SETSPN -S MSSQLSVC/BI-SQL:49753 HADESSQL-DB BI-SQL.HADES.LOCAL Database service class Host server OR
  • 12. SETSPN -S MSOLAPSVC.3/BI-SQL:UDM HADESSQL-SSAS NetBIOS: BI-SQL FQDN: Hades. Local SQL-SSAS Domain SSAS service account identity Analysis Services Service class Host server OR Instance: UDM BI-SQL.HADES.LOCAL
  • 13. IIS server SP-WFE FQDN: Hades. Local SP-PORTAL SharePoint Portal Application Pool identity SharePoint WFE Host server OR OLYMPUS.HADES.LOCAL SETSPN -S HTTP/OLYMPUS HADESSP-PORTAL DNS “A” record: OLYMPUS Port: 80
  • 14.  Now I can see Delegation tab! SETSPN -S DUMMYSPN HADESSP-XLS-SVC ? FQDN: Hades. Local SP-XLS-SVC Domain Delegating account Arbitrary string Non-existing service
  • 15.  Identifies the target  Stored against target’s identity  Instance name for Analysis Services  Arbitrary SPN to show delegation tab  Don’t forget discovery services for SQL2005 1
  • 16.  Basic (unconstrained) ◦ To any Service  Constrained ◦ Only if allowed 2
  • 17. 2   SSRS  SSRS    Basic ◦ Delegates to any service ◦ Cross-domain delegation ◦ No protocol transition ◦ Can precede constrained  Constrained ◦ Any service can use ◦ Most require ◦ More secure ◦ Only delegates if allowed! ◦ Only within a domain
  • 18. Client SharePoint Farm Kerberos Data Source NTLM No Trust is OK! MSFT.com pintoso.MSFT.com contoso.MSFT.com Constrained delegation works!
  • 19. Client SharePoint Farm Basic Kerberos Data Source NTLM or Basic Kerberos Must have Two Way Trust MSFT.com pintoso.MSFT.comcontoso.MSFT.com
  • 20.  Use Basic for ◦ SSRS (SQL Reporting Services) to connect to another domain ◦ When security is not critical  Use Constrained for ◦ Any other case! 2
  • 21. NTLM or Kerberos SP Farm Data Source Delegating Account SPN Account
  • 22.  Add a dummy SPN to the Delegating account to bring up delegation tab in ADUC:  Allows trust for constrained delegation  Enables protocol transition for SharePoint 3
  • 23.  Select allowed SPNs:  Use ADUC delegation tab  Locate SPN’s account  Click to select SPNs to add SPN’s account 4
  • 24.  ADSIEdit (easier): ◦ Same string as in SETSPN statement  PowerShell: ◦ Not for wimps ◦ Active Directory Module:  Set-ADObject  Get-ADObject  Set-KCD  CMD (document): ◦ ldifde
  • 25. Set your SPNs (inc Dummy and Browser 2005)  Use “KerberosHelper.xslx” from www.data-united.co.uk Decide: Basic or Constrained? Set delegation type Add Allowed SPNs (for constrained) Test working, Sit back and relax! Let me know if it doesn't work  www.data-united.co.uk
  • 26.  Claims to Windows Token Service (C2WTS) ◦ SharePoint protocol transition: Kerberos Delegation! NTLM or Kerberos SharePoint Web Frontend SharePoint Application Server Data Source STS Claims C2WTS ? UPN Claim Windows Token
  • 27.  Starts automatically  Depends on Cryptographic Service ◦ sc config c2wts depend= CryptSvc  Service Identity is trusted for delegation ◦ Local System by default (and should stay that way) ◦ If changed to Windows Identity, must be a local admin  Claims-aware services are allowedCaller s ◦ c2wtshost.exe.config  Use Rodney Viana's little tool c2WTSTest.exe
  • 28.  “NT Authority/Anonymous” is no more!  Profiler shows Your login  Test every service against every data source SSRS
  • 29.  15 character limit on Windows NetBIOS  Open Port 88 on Firewall  SPN for SQL 2005 browser/discovery services  Sensitive Client Account
  • 30.  Enable Kerberos logging (don’t forget about it!)  Registry hack http://support.microsoft.com/kb/262177  Check Kerberos errors in Event log on SP App server and client  ULS log (SP App server with Verbose)  Use Event log, Kerbtray and Kerberos helper tools to check for common errors  Use Klist –purge to re-test Kerberos  Use dcdiag to check SPNs
  • 31.
  • 32. Sponsor Competition Draws in the Exhibition Hall 17:15 After…
  • 33. Community Events SQL Saturday Edinburgh 7/8 June www.sqlsaturday.com/202/ SQL Relay 17/27 June www.sqlrelay.co.uk SQL Saturday Dublin 21/22 June www.sqlsaturday.com/229/ SQL Saturday Cambridge27 September www.sqlsaturday.com/228/ UK User Groups All the time www.sqlserverfaq.com
  • 34.  Please complete feedback  http://sqlbits.com/SQLBitsXIThursday  http://sqlbits.com/SQLBitsXIFriday  http://sqlbits.com/SQLBitsXISaturday  http://sqlbits.com/SQLBitsXI (General feedback)
  • 35. We hope you had a great conference day! Keep checking www.sqlbits.com for slides, videos and news of the next conference #SQLBIT S
  • 36.  Kerberos: authentication protocol  Principal – a computer in the Kerberos protocol, usually the target  UPN: user principal name  FQDN: Fully Qualified Domain Name  WCF: Windows Communication Foundation (.NET)  C2WTS: WCF service granting windows token for a UPN claim
  • 37.  How the Kerberos Version 5 Authentication Protocol Works http://technet.microsoft.com/en-us/library/cc772815(v=ws.10).aspx  Overview of Kerberos authentication for Microsoft SharePoint 2010 Products http://technet.microsoft.com/en-us/library/gg502594.aspx  Kerberos Guide for SharePoint 2013 http://blog.blksthl.com/2012/09/26/the-first-kerberos-guide-for-sharepoint-2013-technicians/  Kerberos Blog and Resources www.data-united.co.uk
  • 38.  Kerberos using PowerShell http://blog.msresource.net/2012/07/12/fim-service-principal-names-and-kerberos-delegation/  Troubleshooting C2WTS by Rodney Viana http://blogs.msdn.com/b/rodneyviana/archive/2011/07/19/troubleshooting-claims-to- windows-nt-token-service-c2wts-in-sharepoint-2010-may-be-difficult-if-you-don-t-know-where- to-start.aspx  Kerberos Professional Services www.data-united.co.uk
  • 39.  Command Prompt ◦ List all Kerberos Tickets on the principal (a ticket must be present for the URL, otherwise NTLM is used)  Klist ◦ Purge Kerberos Tickets (run on all principals to avoid reboot/wait)  Klist –purge ◦ List all msDS-AllowedToDelegateTo properties for a single account (only computers with )  ldifde -f c:tempfilename.txt -d "CN=SA_SVC_C2WTS,OU=Service Accounts,DC=contoso,DC=msft,DC=com" -l msDS-AllowedToDelegateTo ◦ List all msDS-AllowedToDelegateTo properties all accounts in an OU:  ldifde -f c:tempfilename.txt -d "OU=Service Accounts, DC=contoso,DC=msft,DC=com" -l msDS-AllowedToDelegateTo

Editor's Notes

  1. Enables to control security Windows at the data source level – once for all data consumers through various reporting technologies Having security governed at Data Source level allows fine grain security permissions – to object level in the database and down to cell level in the cube. Allows seamless personalisation without compromising security Easier development of personalized reports: you know exactly who the user is at the data source level.
  2. So when do we need Kerberos delegation... This diagram shows a classic double hop situation. Client authenticates to a SharePoint farm server and then accesses a document with an external data source connection. On refresh SharePoint attempts to connect to the external data source. Since the data source is not local to the farm, SharePoint must use some
  3. Install all the software with active directory service accounts Set SPNs including arbitrary SPNs for services requiring delegation to be configured (e.g. Excel Service). Don’t forget to add SPNs for SQL Browser Discovery Service when you establish a connection to a named instance of SQL Server 2005 Analysis Services or Database Services http://support.microsoft.com/kb/950599 (service class MSOLAPDisco and MSSQLBrowser) Configure constrained delegation for SP service Use ADUC (dsa.msc) delegation tab of the service identity to configure delegation type and add SPNs to delegate to for constrained delegation on 2008 functional level domains For pre-2008 domains use ADSIEdit to add target SPNs to msDS-AllowedToDelegateTo attribute of the service identity Use PowerShell in large-scale configurations or development environments
  4. Service Principal Name, helps Kerberos to find the Service and the computer (Principal) Two SPNs can be recorded for the same service: one is mandatory, two is optional. The first resolves connections from within the same domain, the other serves clients from across domains. “Fake” or arbitrary SPNs are set up for non-existing services/accounts just to be able to display Delegation tab for a account in Active Directory User and Computers account properties. Only one SPN required within domain (NetBIOS) Computer FQDN for cross-domain Kerberos
  5. Service class is a string that identifies the general class of service; for example, "SqlServer". There are well-known service class names, such as "www" for a Web service or "ldap" for a directory service. In general, this can be any string that is unique to the service class. Be aware that the SPN syntax uses a forward slash (/) to separate elements, so this character cannot appear in a service class name. This string is not processed during the authentication, it is purely for information only (identifies what type of service it is). Computer name is a NetBIOS name of the computer that Runs the service or an A name of the DNS entry for the HTTP connection Port must be specified if not default, e.g. You do not need to specify the port for HTTP connections on port 80 or connections to default instances of SQL Server on port 1433 For Analysis Services instance MUST BE USED instead of the port number! This works well with dynamic port allocation. Mind the 15 character limit on Microsoft NetBIOS! Remember, it is all about the target!
  6. Environment: FQDN: contoso.msft.com Service name: MSSQLSVC SQL Server Service Account: SQLSVR-SVC SQL Server host A-Name (or cluster resource group name in case of clustered instance): SQLSVR SQL Server instance port (only needed if not running on default port 1433): 64352 Mandatory: SETSPN -S MSSQLSVC/SQLSVR:64352 contoso\SA_BI_SQLSVR Additional, for cross-domain authentication: SETSPN -S MSSQLSVC/P_BI_SQLSVR.contoso.msft.com:64352 contoso\SA_BI_SQLSVR
  7. Environment: FQDN: contoso.msft.com Service name: MSOLAPSvc.3 SQL Server Service Account: SA_BI_SQLUDM SQL Server host A-Name (or cluster resource group name in case of clustered instance): P_BI_SQLAS_UDM SQL Server instance Name (only needed if not running on default port 2383): UDM Mandatory: SETSPN -S MSOLAPSvc.3/P_BI_SQLASUDM:UDM contoso\SA_BI_SQLSVR Additional, for cross-domain authentication: SETSPN -S MSOLAPSvc.3/P_BI_SQLASUDM.contoso.msft.com:UDM contoso\SA_BI_SQLSVR If you are using a named instance of Analysis Services, note that you cannot specify a port after the colon. If you do, it is interpreted as part of the hostname or domain name. Instead, you must use the actual instance name for all functionality to work correctly Discovery Service: An SPN for the SQL Server Browser service is required when you establish a connection to a named instance of SQL Server 2005 Analysis Services or of SQL Server 2005 database http://support.microsoft.com/kb/950599 MSOLAPDisco.3/serverHostName
  8. Purpose: Kerberos authentication to the SharePoint web front end (WFE). This is not necessary for the success of the delegation, but is best practice from security perspective. Environment: FQDN: contoso.msft.com Service name: http IIS Application Pool Identity: SA_BI_SP_APP DNS Forward Lookup Zone A-Name : CONTOSOBI Mandatory: SETSPN -S http/CONTOSOBI contoso\SA_BI_SP_APP Additional, for cross-domain authentication: SETSPN -S http/CONTOSOBI.contoso.msft.com contoso\SA_BI_SP_APP
  9. Identifies the target, the service to connect to Registered against the identity of that service as a Service Principal Name attribute of the account in AD Use Instance name instead of the port number for named instances of Analysis Services Set up arbitrary SPNs to bring up Delegation tab to configure delegating service account
  10. Basic (unconstrained) Only some services can use (e.g. SSRS) Delegation is not restricted (no need to specify a set of SPNs for the delegating service) Allows cross-domain Kerberos authentication for some services (e.g. Reporting Services) Constrained Any SharePoint Service app can use and some require (Excel, Performance Point, etc)! More secure (delegation is restricted) Cannot be followed by basic in protocol transition
  11. Basic (unconstrained) Only some services can use (e.g. SSRS) Delegation is not restricted (no need to specify a set of SPNs for the delegating service) Allows cross-domain Kerberos authentication for some services (e.g. Reporting Services) Constrained Any SharePoint Service app can use and some require (Excel, Performance Point, etc)! More secure (delegation is restricted) Cannot be followed by basic in protocol transition
  12. Basic (unconstrained) Only some services can use (e.g. SSRS) Delegation is not restricted (no need to specify a set of SPNs for the delegating service) Allows cross-domain Kerberos authentication for some services (e.g. Reporting Services) Constrained Any SharePoint Service app can use and some require (Excel, Performance Point, etc)! More secure (delegation is restricted) Cannot be followed by basic in protocol transition
  13. So when do we need Kerberos delegation... This diagram shows a classic double hop situation. Client authenticates to a SharePoint farm server and then accesses a document with an external data source connection. On refresh SharePoint attempts to connect to the external data source. Since the data source is not local to the farm, SharePoint must use some
  14. Use “Active Directory Users and Computers” to set “Trust for delegation to specified services only” with “Any authentication protocol” to allows protocol transition. This must be configured for the service account used for the IIS application pool of the delegating service. If it is running as Local System, the computer name must be used instead.
  15. There are two things I personally find confusing about these. First of all, you need to look up SPNs using the service account you have registered SPNs for, not the host where the service is running. Secondly, once you have located your SPNs using the service account in Add Services dialogue box, you need to click on the SPNs to select the ones you want to add (or click “Select All”) and only then click Ok. Otherwise it adds nothing.
  16. Install all the software with active directory service accounts Set SPNs including arbitrary SPNs for services requiring delegation to be configured (e.g. Excel Service). Don’t forget to add SPNs for SQL Browser Discovery Service when you establish a connection to a named instance of SQL Server 2005 Analysis Services or Database Services http://support.microsoft.com/kb/950599 (service class MSOLAPDisco and MSSQLBrowser) Configure constrained delegation for SP service Use ADUC (dsa.msc) delegation tab of the service identity to configure delegation type and add SPNs to delegate to for constrained delegation on 2008 functional level domains For pre-2008 domains use ADSIEdit to add target SPNs to msDS-AllowedToDelegateTo attribute of the service identity Use PowerShell in large-scale configurations or development environments
  17. Initial authentication can be NTLM or Kerberos, Kerberos is preferable, but NTLM can be used by a client in another domain with no trust across domains. Authenticated user is issued a claims token used to authenticate within SharePoint to all claims –aware services C2WTS extracts UPN from that token to issue a windows token for that user to the service. The SharePoint service, such as Excel Services then uses that Windows Token to delegate user credentials to the data source service using Kerberos protocol.
  18. Kerberos often gets the blame when it is in fact C2WTS that is not working SSRS 2012 is now claims aware – no need to install SQL Server SSRS component on WFE in n-tier architecture: huge saving! It is possible to change C2WTS back to local system if it fails to work with AD identity – but remember to tell SharePoint first: Get-SPServiceInstance | Where {$_.TypeName.StartsWith(“Claims”)} | ForEach-Object {$_.Service.ProcessIdentity.CurrentIdentityType = 0; $_.Service.ProcessIdentity.Update(); $_.Service.ProcessIdentity.Deploy()}
  19. Klist output on the client/app server must have a ticket for the target URL/computer Data Source must see the user account of the user, not a “NT Authority/Anonymous“, stored credentials or service identity: SSAS, SSRS and Secure store provide alternative means of tackling double-hop
  20. If the server name exceeds 15 character limit, configuring Kerberos becomes a real pain. Please consider being less verbose. Please remember to configure Service Principal Names for SQL Browser Service and/or Analysis services discovery service for SQL Server 2005 Make sure “Account is sensitive and cannot be delegated” option for the user account whose credentials are to be delegated is not checked, otherwise delegation is not possible.
  21. Switch verbose logging for the SharePoint service and look out for critical and unexpected events Use Klist –purge on all principals to avoid rebooting the servers (helps if you are domain admin and there is only one DC) ANOTHER SLIDE? Diagnostics: dcdiag /s:dc2.fabrikam.com /v /c > dcdiag.txt dcdiag /test:checksecurityerror http://social.technet.microsoft.com/wiki/contents/articles/717.service-principal-names-spns-setspn-syntax-setspn-exe.aspx