Kerberos survival guide - SPS Ozarks 2010


Published on

Published in: Technology
  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Kerberos survival guide - SPS Ozarks 2010

  1. 1. Kerberos Survival Guide<br />Presented by:<br />JD Wade, SharePoint Consultant, MCITP<br />Mail:<br />Blog:<br />LinkedIn: JD Wade<br />Twitter:<br />
  2. 2. Agenda<br /><ul><li>Overview
  3. 3. Logon Process
  4. 4. Accessing a Web Site
  5. 5. Troubleshooting
  6. 6. Kerberos Demos
  7. 7. Delegation and Demos</li></li></ul><li>Kerberos<br />Massachusetts Institute of Technology<br />
  8. 8. Details Out of Scope<br /><ul><li>Renewing tickets
  9. 9. Ticket expiration
  10. 10. Keys
  11. 11. Authenticator
  12. 12. TGT Structure
  13. 13. Service Ticket Structure
  14. 14. Encryption/Decryption
  15. 15. Multiple domains/forests</li></li></ul><li>
  16. 16. Dependencies<br />SPN<br />
  17. 17.
  18. 18. Service Principal Name<br />Service Class<br />Host Name<br />Port<br />
  19. 19. Service Classes allowed by host<br />alerter<br />http<br />policyagent<br />scm<br />appmgmt<br />ias<br />protectedstorage<br />seclogon<br />browser<br />iisad<br />rasman<br />snmp<br />cifs<br />min<br />remoteaccess<br />spooler<br />cisvc<br />messenger<br />replicator<br />Tapisrv<br /> <br /> <br />clipsrv<br />msiserver<br />rpc<br />time<br />dcom<br />mcsvc<br />rpclocator<br />trksvr<br />dhcp<br />netdde<br />rpcss<br />trkwks<br />dmserver<br />netddedsm<br />rsvp<br />ups<br />dns<br />netlogon<br />samss<br />w3svc<br />dnscache<br />netman<br />scardsvr<br />wins<br />eventlog<br />nmagent<br />scesrv<br />www<br />eventsystem<br />oakley<br />Schedule<br />fax<br />plugplay<br />
  20. 20. Kerberos<br /><ul><li>Benefits
  21. 21. Delegated Authentication
  22. 22. Interoperability
  23. 23. More Efficient Authentication
  24. 24. Mutual Authentication</li></li></ul><li>Logon Process<br />
  25. 25. KDC<br />AS<br />
  26. 26. KDC<br />AS<br />
  27. 27. KDC<br />TGS<br />AS<br />SPN<br />
  28. 28. KDC<br />TGS<br />
  29. 29. Access Web Site<br />
  30. 30. 401<br />
  31. 31. SPN<br />
  32. 32.
  33. 33. <system.webServer>   <security>      <authentication>         <windowsAuthentication enabled="true" useAppPoolCredentials="true" />      </authentication>   </security></system.webServer><br />
  34. 34.
  35. 35. Troubleshooting<br />
  36. 36.
  37. 37. Demos<br />
  38. 38. Delegation<br />
  39. 39.
  40. 40. FBA<br />Kerberos<br />
  41. 41. References<br /><ul><li>Ken Schaefer’s Multi-Part Kerberos Blog Posts:
  42. 42. What Is Kerberos Authentication?
  43. 43. How the Kerberos Version 5 Authentication Protocol Works
  44. 44. Explained: Windows Authentication in ASP.NET 2.0</li></li></ul><li>References<br /><ul><li>Kerberos Authentication Tools and Settings
  45. 45. How To: Use Protocol Transition and Constrained Delegation in ASP.NET 2.0
  46. 46. Spence Harbar’s Blog</li></li></ul><li>Q & A<br />
  47. 47. Appendix<br />
  48. 48. <ul><li>Kerberos is an open authentication protocol. Kerberos v5 was invented in 1993 at MIT.
  49. 49. Authentication is the process of proving your identity to a remote system.
  50. 50. Your identity is who you are, and authentication is the process of proving that. In many systems your identity is your username, and you use a secret shared between you and the remote system (a password) to prove that your identity.
  51. 51. User password is encrypted as the user key. User key is stored in credentials cache. Once the logon session key is received, the user key is discarded.
  52. 52. Service password is encrypted as the service key.
  53. 53. KDCs are found through a DNS query. Service registered in DNS by DCs.</li></li></ul><li><ul><li>Showing detail behind what is happening inside of KDC but for day-to-day, use can just remember KDC
  54. 54. Another reason for simplification: encryption upon encryption upon encryption…just remember it is encrypted
  55. 55. This is a Windows-centric Kerberos presentation
  56. 56. Load balanced solutions need service account
  57. 57. All web applications hosted using the same SPN have to be hosted with the same account
  58. 58. Use A records, not CNAME records</li></li></ul><li><ul><li>Terms
  59. 59. Key Distribution Center (KDC) – In Windows AD, KDC lives on domain controllers (DC), KDCs share a long term key across all DCs.
  60. 60. KDC security account database – In Windows, it is Active Directory
  61. 61. Authorization Service (AS) – part of the KDC
  62. 62. Ticket Granting Service (TGS) – part of the KDC
  63. 63. Ticket Granting Ticket (TGT) - A user's initial ticket from the authentication service, used to request service tickets, and meant only for use by the ticket granting service. Keeps the user from having to enter password each time a ticket is requested.</li></li></ul><li>Tickets<br /><ul><li>Ticket Granting Ticket (TGT)
  64. 64. A user's initial ticket from the authentication service
  65. 65. Used to request service tickets
  66. 66. Meant only for use by the ticket-granting service.
  67. 67. Service ticket for the KDC (service class = krbtgt)
  68. 68. Service Ticket
  69. 69. Enables the ticket-granting service (TGS) to safely transport the requester's credentials to the target server or service.</li></li></ul><li>Tools<br /><ul><li>Knowledge
  70. 70. SetSPN
  71. 71. Windows Security Logs
  72. 72. Windows 2008 ADUC or ADSIEdit
  73. 73. Kerbtray or Klist
  74. 74. Netmon and Fiddler
  75. 75. IIS Logs and IIS7 Failed Request Tracing
  76. 76. LDP
  77. 77. Kerberos Logging
  78. 78. Event Logging and/or Debug Logs</li></li></ul><li><ul><li>Troubleshooting
  79. 79. Have user logon and logoff if they don’t regularly: TGTs are only renewable for so long and then they expire (7 day default), then password has to be re-entered.
  80. 80. Remember that authenticators contain the current time. Check for time sync issues.</li></li></ul><li><ul><li>Common Issues
  81. 81. Missing SPN
  82. 82. Duplicate SPN
  83. 83. SPN assigned to wrong service account
  84. 84. Times are out of sync
  85. 85. Client TGT expired (7 days)
  86. 86. IE and non-default ports</li></li></ul><li><ul><li>Request TGT (Remember there is even more complexity)</li></ul>User (client) logs into workstation entering their password.<br />Client builds an authentication service request containing the user’s username (KPN), the SPN of the TGS, and encrypts the current time using the user’s password as an authenticator.<br />Client sends these three items to the KDC.<br />KDC get user’s password from AD, decrypts time and verifies it is valid.<br />AS generates a logon session key and encrypts with the user’s password. AS generates a service ticket which contains a logon session key and the user’s KPN encrypted with the AS shared key. This is a special service ticket called a Ticket Granting Ticket (TGT).<br />
  87. 87. <ul><li>Request TGT (Remember there is even more complexity)</li></ul>KDC sends both to the client.<br />Client decrypts logon session key using its password and stores the logon session key in cache. The client stores the TGT in cache.<br />
  88. 88. <ul><li>Access Service (Remember there is even more complexity)</li></ul>User (client) encrypts the current time using the logon session key in cache creating an authenticator and sends the authenticator, the user’s KPN, the name of the target service (SPN), and the TGT to the TGS.<br />TGS decrypts the TGT using its shared key to access the logon session key. The logon session key is used to decrypt the authenticator and confirms the time is valid. <br />TGS extracts the user’s KPN from the TGT. TGS generates a service session key and encrypts the service session key using the logon session key. TGS uses server session key to generate service ticket and encrypts it using service’s password.<br />TGS sends service session key and the service ticket to the client.<br />
  89. 89. <ul><li>Access Service (Remember there is even more complexity)</li></ul>Client decrypts service session key using cached logon session key, adds current time (as well as other items), and encrypts with the service session key to create an authenticator.<br />Client sends ticket and authenticator to remote server which runs service. <br />Service decrypts service ticket accessing the server session key and the KPN. Using the service session key, the service decrypts the authenticator and confirms the current time is valid. A Windows access token is generated<br />(Optional) If client requests mutual authentication, service encrypts current time using the service session key creating an authenticator and sends to the client.<br />Clients decrypts authenticator and validates time.<br />