1@c $Id: setup.texi 22191 2007-12-06 17:26:30Z lha $ 2 3@node Setting up a realm, Applications, Building and Installing, Top 4 5@chapter Setting up a realm 6 7A 8@cindex realm 9realm is an administrative domain. The name of a Kerberos realm is 10usually the Internet domain name in uppercase. Call your realm the same 11as your Internet domain name if you do not have strong reasons for not 12doing so. It will make life easier for you and everyone else. 13 14@menu 15* Configuration file:: 16* Creating the database:: 17* Modifying the database:: 18* Checking the setup:: 19* keytabs:: 20* Serving Kerberos 4/524/kaserver:: 21* Remote administration:: 22* Password changing:: 23* Testing clients and servers:: 24* Slave Servers:: 25* Incremental propagation:: 26* Encryption types and salting:: 27* Cross realm:: 28* Transit policy:: 29* Setting up DNS:: 30* Using LDAP to store the database:: 31* Providing Kerberos credentials to servers and programs:: 32* Setting up PK-INIT:: 33@end menu 34 35@node Configuration file, Creating the database, Setting up a realm, Setting up a realm 36@section Configuration file 37 38To setup a realm you will first have to create a configuration file: 39@file{/etc/krb5.conf}. The @file{krb5.conf} file can contain many 40configuration options, some of which are described here. 41 42There is a sample @file{krb5.conf} supplied with the distribution. 43 44The configuration file is a hierarchical structure consisting of 45sections, each containing a list of bindings (either variable 46assignments or subsections). A section starts with 47@samp{[@samp{section-name}]}. A binding consists of a left hand side, an equal sign 48(@samp{=}) and a right hand side (the left hand side tag must be 49separated from the equal sign with some whitespace). Subsections have a 50@samp{@{} as the first non-whitespace character after the equal sign. All 51other bindings are treated as variable assignments. The value of a 52variable extends to the end of the line. 53 54@example 55[section1] 56 a-subsection = @{ 57 var = value1 58 other-var = value with @{@} 59 sub-sub-section = @{ 60 var = 123 61 @} 62 @} 63 var = some other value 64[section2] 65 var = yet another value 66@end example 67 68In this manual, names of sections and bindings will be given as strings 69separated by slashes (@samp{/}). The @samp{other-var} variable will thus 70be @samp{section1/a-subsection/other-var}. 71 72For in-depth information about the contents of the configuration file, refer to 73the @file{krb5.conf} manual page. Some of the more important sections 74are briefly described here. 75 76The @samp{libdefaults} section contains a list of library configuration 77parameters, such as the default realm and the timeout for KDC 78responses. The @samp{realms} section contains information about specific 79realms, such as where they hide their KDC@. This section serves the same 80purpose as the Kerberos 4 @file{krb.conf} file, but can contain more 81information. Finally the @samp{domain_realm} section contains a list of 82mappings from domains to realms, equivalent to the Kerberos 4 83@file{krb.realms} file. 84 85To continue with the realm setup, you will have to create a configuration file, 86with contents similar to the following. 87 88@example 89[libdefaults] 90 default_realm = MY.REALM 91[realms] 92 MY.REALM = @{ 93 kdc = my.kdc my.slave.kdc 94 kdc = my.third.kdc 95 @} 96[domain_realm] 97 .my.domain = MY.REALM 98 99@end example 100 101If you use a realm name equal to your domain name, you can omit the 102@samp{libdefaults}, and @samp{domain_realm}, sections. If you have a DNS 103SRV-record for your realm, or your Kerberos server has DNS CNAME 104@samp{kerberos.my.realm}, you can omit the @samp{realms} section too. 105 106@node Creating the database, Modifying the database, Configuration file, Setting up a realm 107@section Creating the database 108 109The database library will look for the database in the directory 110@file{@value{dbdir}}, so you should probably create that directory. 111Make sure the directory has restrictive permissions. 112 113@example 114# mkdir /var/heimdal 115@end example 116 117The keys of all the principals are stored in the database. If you 118choose to, these can be encrypted with a master key. You do not have to 119remember this key (or password), but just to enter it once and it will 120be stored in a file (@file{/var/heimdal/m-key}). If you want to have a 121master key, run @samp{kstash} to create this master key: 122 123@example 124# kstash 125Master key: 126Verifying password - Master key: 127@end example 128 129If you want to generate a random master key you can use the 130@kbd{--random-key} flag to kstash. This will make sure you have a good key 131on which attackers can't do a dictionary attack. 132 133If you have a master key, make sure you make a backup of your master 134key file; without it backups of the database are of no use. 135 136To initialise the database use the @command{kadmin} program, with the 137@kbd{-l} option (to enable local database mode). First issue a 138@kbd{init MY.REALM} command. This will create the database and insert 139default principals for that realm. You can have more than one realm in 140one database, so @samp{init} does not destroy any old database. 141 142Before creating the database, @samp{init} will ask you some questions 143about maximum ticket lifetimes. 144 145After creating the database you should probably add yourself to it. You 146do this with the @samp{add} command. It takes as argument the name of a 147principal. The principal should contain a realm, so if you haven't set up 148a default realm, you will need to explicitly include the realm. 149 150@example 151# kadmin -l 152kadmin> init MY.REALM 153Realm max ticket life [unlimited]: 154Realm max renewable ticket life [unlimited]: 155kadmin> add me 156Max ticket life [unlimited]: 157Max renewable life [unlimited]: 158Attributes []: 159Password: 160Verifying password - Password: 161@end example 162 163Now start the KDC and try getting a ticket. 164 165@example 166# kdc & 167# kinit me 168me@@MY.REALMS's Password: 169# klist 170Credentials cache: /tmp/krb5cc_0 171 Principal: me@@MY.REALM 172 173 Issued Expires Principal 174Aug 25 07:25:55 Aug 25 17:25:55 krbtgt/MY.REALM@@MY.REALM 175@end example 176 177If you are curious you can use the @samp{dump} command to list all the 178entries in the database. It should look something similar to the 179following example (note that the entries here are truncated for 180typographical reasons): 181 182@smallexample 183kadmin> dump 184me@@MY.REALM 1:0:1:0b01d3cb7c293b57:-:0:7:8aec316b9d1629e3baf8 ... 185kadmin/admin@@MY.REALM 1:0:1:e5c8a2675b37a443:-:0:7:cb913ebf85 ... 186krbtgt/MY.REALM@@MY.REALM 1:0:1:52b53b61c875ce16:-:0:7:c8943be ... 187kadmin/changepw@@MY.REALM 1:0:1:f48c8af2b340e9fb:-:0:7:e3e6088 ... 188@end smallexample 189 190@node Modifying the database, Checking the setup, Creating the database, Setting up a realm 191@section Modifying the database 192 193All modifications of principals are done with with kadmin. 194 195A principal has several attributes and lifetimes associated with it. 196 197Principals are added, renamed, modified, and deleted with the kadmin 198commands @samp{add}, @samp{rename}, @samp{modify}, @samp{delete}. 199Both interactive editing and command line flags can be used (use --help 200to list the available options). 201 202There are different kinds of types for the fields in the database; 203attributes, absolute time times and relative times. 204 205@subsection Attributes 206 207When doing interactive editing, attributes are listed with @samp{?}. 208 209The attributes are given in a comma (@samp{,}) separated list. 210Attributes are removed from the list by prefixing them with @samp{-}. 211 212@smallexample 213kadmin> modify me 214Max ticket life [1 day]: 215Max renewable life [1 week]: 216Principal expiration time [never]: 217Password expiration time [never]: 218Attributes [disallow-renewable]: requires-pre-auth,-disallow-renewable 219kadmin> get me 220 Principal: me@@MY.REALM 221[...] 222 Attributes: requires-pre-auth 223@end smallexample 224 225@subsection Absolute times 226 227The format for absolute times are any of the following: 228 229@smallexample 230never 231now 232YYYY-mm-dd 233YYYY-mm-dd HH:MM:SS 234@end smallexample 235 236 237@subsection Relative times 238 239The format for relative times are any of the following combined: 240 241@smallexample 242N year 243M month 244O day 245P hour 246Q minute 247R second 248@end smallexample 249 250@c Describe more of kadmin commands here... 251 252@node Checking the setup, keytabs, Modifying the database, Setting up a realm 253@section Checking the setup 254 255There are two tools that can check the consistency of the Kerberos 256configuration file and the Kerberos database. 257 258The Kerberos configuration file is checked using 259@command{verify_krb5_conf}. The tool checks for common errors, but 260commonly there are several uncommon configuration entries that are 261never added to the tool and thus generates ``unknown entry'' warnings. 262This is usually nothing to worry about. 263 264The database check is built into the kadmin tool. It will check for 265common configuration error that will cause problems later. Common 266check are for existence and flags on important principals. The 267database check by run by the following command : 268 269@example 270kadmin check REALM.EXAMPLE.ORG 271@end example 272 273@node keytabs, Serving Kerberos 4/524/kaserver, Checking the setup, Setting up a realm 274@section keytabs 275 276To extract a service ticket from the database and put it in a keytab, you 277need to first create the principal in the database with @samp{ank} 278(using the @kbd{--random-key} flag to get a random key) and then 279extract it with @samp{ext_keytab}. 280 281@example 282kadmin> add --random-key host/my.host.name 283Max ticket life [unlimited]: 284Max renewable life [unlimited]: 285Attributes []: 286kadmin> ext host/my.host.name 287kadmin> exit 288# ktutil list 289Version Type Principal 290 1 des-cbc-md5 host/my.host.name@@MY.REALM 291 1 des-cbc-md4 host/my.host.name@@MY.REALM 292 1 des-cbc-crc host/my.host.name@@MY.REALM 293 1 des3-cbc-sha1 host/my.host.name@@MY.REALM 294@end example 295 296@node Serving Kerberos 4/524/kaserver, Remote administration, keytabs, Setting up a realm 297@section Serving Kerberos 4/524/kaserver 298 299Heimdal can be configured to support 524, Kerberos 4 or kaserver. All 300these services are turned off by default. Kerberos 4 is always 301supported by the KDC, but the Kerberos 4 client support also depends 302on Kerberos 4 support having been included at compile-time, using 303@kbd{--with-krb4=dir}. 304 305@subsection 524 306 307524 is a service that allows the KDC to convert Kerberos 5 tickets to 308Kerberos 4 tickets for backward compatibility. See also Using 2b 309tokens with AFS in @xref{Things in search for a better place}. 310 311524 can be turned on by adding this to the configuration file 312 313@example 314[kdc] 315 enable-524 = yes 316@end example 317 318@subsection Kerberos 4 319 320Kerberos 4 is the predecessor to to Kerberos 5. It only supports 321single DES@. You should only enable Kerberos 4 support if you have 322needs for compatibility with an installed base of Kerberos 4 323clients/servers. 324 325Kerberos 4 can be turned on by adding this to the configuration file 326 327@example 328[kdc] 329 enable-kerberos4 = yes 330@end example 331 332@subsection kaserver 333 334Kaserver is a Kerberos 4 that is used in AFS@. The protocol has some 335extra features over plain Kerberos 4, but like Kerberos 4, only uses 336single DES@. 337 338You should only enable Kaserver support if you have needs for 339compatibility with an installed base of AFS machines. 340 341Kaserver can be turned on by adding this to the configuration file 342 343@example 344[kdc] 345 enable-kaserver = yes 346@end example 347 348@node Remote administration, Password changing, Serving Kerberos 4/524/kaserver, Setting up a realm 349@section Remote administration 350 351The administration server, @command{kadmind}, can be started by 352@command{inetd} (which isn't recommended) or run as a normal daemon. If you 353want to start it from @command{inetd} you should add a line similar to the 354one below to your @file{/etc/inetd.conf}. 355 356@example 357kerberos-adm stream tcp nowait root /usr/heimdal/libexec/kadmind kadmind 358@end example 359 360You might need to add @samp{kerberos-adm} to your @file{/etc/services} 361as @samp{749/tcp}. 362 363Access to the administration server is controlled by an ACL file, 364(default @file{/var/heimdal/kadmind.acl}.) The file has the following 365syntax: 366@smallexample 367principal [priv1,priv2,...] [glob-pattern] 368@end smallexample 369 370The matching is from top to bottom for matching principals (and if given, 371glob-pattern). When there is a match, the access rights of that line are 372applied. 373 374The privileges you can assign to a principal are: @samp{add}, 375@samp{change-password} (or @samp{cpw} for short), @samp{delete}, 376@samp{get}, @samp{list}, and @samp{modify}, or the special privilege 377@samp{all}. All of these roughly correspond to the different commands 378in @command{kadmin}. 379 380If a @var{glob-pattern} is given on a line, it restricts the access 381rights for the principal to only apply for subjects that match the 382pattern. The patterns are of the same type as those used in shell 383globbing, see @url{none,,fnmatch(3)}. 384 385In the example below @samp{lha/admin} can change every principal in the 386database. @samp{jimmy/admin} can only modify principals that belong to 387the realm @samp{E.KTH.SE}. @samp{mille/admin} is working at the 388help desk, so he should only be able to change the passwords for single 389component principals (ordinary users). He will not be able to change any 390@samp{/admin} principal. 391 392@example 393lha/admin@@E.KTH.SE all 394jimmy/admin@@E.KTH.SE all *@@E.KTH.SE 395jimmy/admin@@E.KTH.SE all */*@@E.KTH.SE 396mille/admin@@E.KTH.SE change-password *@@E.KTH.SE 397@end example 398 399@node Password changing, Testing clients and servers, Remote administration, Setting up a realm 400@section Password changing 401 402To allow users to change their passwords, you should run @command{kpasswdd}. 403It is not run from @command{inetd}. 404 405You might need to add @samp{kpasswd} to your @file{/etc/services} as 406@samp{464/udp}. 407 408@subsection Password quality assurance 409 410It is important that users have good passwords, both to make it harder 411to guess them and to avoid off-line attacks (although 412pre-authentication provides some defence against off-line attacks). 413To ensure that the users choose good passwords, you can enable 414password quality controls in @command{kpasswdd} and @command{kadmind}. 415The controls themselves are done in a shared library or an external 416program that is used by @command{kpasswdd}. To configure in these 417controls, add lines similar to the following to your 418@file{/etc/krb5.conf}: 419 420@example 421[password_quality] 422 policies = external-check builtin:minimum-length module:policyname 423 external_program = /bin/false 424 policy_libraries = @var{library1.so} @var{library2.so} 425@end example 426 427In @samp{[password_quality]policies} the module name is optional if 428the policy name is unique in all modules (members of 429@samp{policy_libraries}). 430 431The built-in polices are 432 433@itemize @bullet 434 435@item external-check 436 437Executes the program specified by @samp{[password_quality]external_program}. 438 439A number of key/value pairs are passed as input to the program, one per 440line, ending with the string @samp{end}. The key/value lines are of 441the form 442@example 443principal: @var{principal} 444new-password: @var{password} 445@end example 446where @var{password} is the password to check for the previous 447@var{principal}. 448 449If the external application approves the password, it should return 450@samp{APPROVED} on standard out and exit with exit code 0. If it 451doesn't approve the password, an one line error message explaining the 452problem should be returned on standard error and the application 453should exit with exit code 0. In case of a fatal error, the 454application should, if possible, print an error message on standard 455error and exit with a non-zero error code. 456 457@item minimum-length 458 459The minimum length password quality check reads the configuration file 460stanza @samp{[password_quality]min_length} and requires the password 461to be at least this length. 462 463@item character-class 464 465The character-class password quality check reads the configuration 466file stanza @samp{[password_quality]min_classes}. The policy requires 467the password to have characters from at least that many character 468classes. Default value if not given is 3. 469 470The four different characters classes are, uppercase, lowercase, 471number, special characters. 472 473@end itemize 474 475If you want to write your own shared object to check password 476policies, see the manual page @manpage{kadm5_pwcheck,3}. 477 478Code for a password quality checking function that uses the cracklib 479library can be found in @file{lib/kadm5/sample_password_check.c} in 480the source code distribution. It requires that the cracklib library 481be built with the patch available at 482@url{ftp://ftp.pdc.kth.se/pub/krb/src/cracklib.patch}. 483 484A sample policy external program is included in 485@file{lib/kadm5/check-cracklib.pl}. 486 487If no password quality checking function is configured, the only check 488performed is that the password is at least six characters long. 489 490To check the password policy settings, use the command 491@command{password-quality} in @command{kadmin} program. The password 492verification is only performed locally, on the client. It may be 493convenient to set the environment variable @samp{KRB5_CONFIG} to point 494to a test version of @file{krb5.conf} while you're testing the 495@samp{[password_quality]} stanza that way. 496 497@node Testing clients and servers, Slave Servers, Password changing, Setting up a realm 498@section Testing clients and servers 499 500Now you should be able to run all the clients and servers. Refer to the 501appropriate man pages for information on how to use them. 502 503@node Slave Servers, Incremental propagation, Testing clients and servers, Setting up a realm 504@section Slave servers, Incremental propagation, Testing clients and servers, Setting up a realm 505 506It is desirable to have at least one backup (slave) server in case the 507master server fails. It is possible to have any number of such slave 508servers but more than three usually doesn't buy much more redundancy. 509 510All Kerberos servers for a realm must have the same database so that 511they present the same service to the users. The 512@pindex hprop 513@command{hprop} program, running on the master, will propagate the database 514to the slaves, running 515@pindex hpropd 516@command{hpropd} processes. 517 518Every slave needs a database directory, the master key (if it was used 519for the database) and a keytab with the principal 520@samp{hprop/@var{hostname}}. Add the principal with the 521@pindex ktutil 522@command{ktutil} command and start 523@pindex hpropd 524@command{hpropd}, as follows: 525 526@example 527slave# ktutil get -p foo/admin hprop/`hostname` 528slave# mkdir /var/heimdal 529slave# hpropd 530@end example 531 532The master will use the principal @samp{kadmin/hprop} to authenticate to 533the slaves. This principal should be added when running @kbd{kadmin -l 534init} but if you do not have it in your database for whatever reason, 535please add it with @kbd{kadmin -l add}. 536 537Then run 538@pindex hprop 539@code{hprop} on the master: 540 541@example 542master# hprop slave 543@end example 544 545This was just an hands-on example to make sure that everything was 546working properly. Doing it manually is of course the wrong way, and to 547automate this you will want to start 548@pindex hpropd 549@command{hpropd} from @command{inetd} on the slave(s) and regularly run 550@pindex hprop 551@command{hprop} on the master to regularly propagate the database. 552Starting the propagation once an hour from @command{cron} is probably a 553good idea. 554 555@node Incremental propagation, Encryption types and salting, Slave Servers, Setting up a realm 556@section Incremental propagation 557 558There is also a newer, and still somewhat experimental, mechanism for 559doing incremental propagation in Heimdal. Instead of sending the whole 560database regularly, it sends the changes as they happen on the master to 561the slaves. The master keeps track of all the changes by assigning a 562version number to every change to the database. The slaves know which 563was the latest version they saw and in this way it can be determined if 564they are in sync or not. A log of all the changes is kept on the master, 565and when a slave is at an older version than the oldest one in the 566log, the whole database has to be sent. 567 568Protocol-wise, all the slaves connect to the master and as a greeting 569tell it the latest version that they have (@samp{IHAVE} message). The 570master then responds by sending all the changes between that version and 571the current version at the master (a series of @samp{FORYOU} messages) 572or the whole database in a @samp{TELLYOUEVERYTHING} message. There is 573also a keep-alive protocol that makes sure all slaves are up and running. 574 575@subsection Configuring incremental propagation 576 577The program that runs on the master is @command{ipropd-master} and all 578clients run @command{ipropd-slave}. 579 580Create the file @file{/var/heimdal/slaves} on the master containing all 581the slaves that the database should be propagated to. Each line contains 582the full name of the principal (for example 583@samp{iprop/hemligare.foo.se@@FOO.SE}). 584 585You should already have @samp{iprop/tcp} defined as 2121, in your 586@file{/etc/services}. Otherwise, or if you need to use a different port 587for some peculiar reason, you can use the @kbd{--port} option. This is 588useful when you have multiple realms to distribute from one server. 589 590Then you need to create those principals that you added in the 591configuration file. Create one @samp{iprop/hostname} for the master and 592for every slave. 593 594 595@example 596master# /usr/heimdal/sbin/ktutil get iprop/`hostname` 597@end example 598 599The next step is to start the @command{ipropd-master} process on the master 600server. The @command{ipropd-master} listens on the UNIX domain socket 601@file{/var/heimdal/signal} to know when changes have been made to the 602database so they can be propagated to the slaves. There is also a 603safety feature of testing the version number regularly (every 30 604seconds) to see if it has been modified by some means that do not raise 605this signal. Then, start @command{ipropd-slave} on all the slaves: 606 607@example 608master# /usr/heimdal/libexec/ipropd-master & 609slave# /usr/heimdal/libexec/ipropd-slave master & 610@end example 611 612To manage the iprop log file you should use the @command{iprop-log} 613command. With it you can dump, truncate and replay the logfile. 614 615@node Encryption types and salting, Cross realm, Incremental propagation, Setting up a realm 616@section Encryption types and salting 617@cindex Salting 618@cindex Encryption types 619 620The encryption types that the KDC is going to assign by default is 621possible to change. Since the keys used for user authentication is 622salted the encryption types are described together with the salt 623strings. 624 625Salting is used to make it harder to pre-calculate all possible 626keys. Using a salt increases the search space to make it almost 627impossible to pre-calculate all keys. Salting is the process of mixing a 628public string (the salt) with the password, then sending it through an 629encryption type specific string-to-key function that will output the 630fixed size encryption key. 631 632In Kerberos 5 the salt is determined by the encryption type, except in 633some special cases. 634 635In @code{des} there is the Kerberos 4 salt 636(none at all) or the afs-salt (using the cell (realm in 637AFS lingo)). 638 639In @code{arcfour} (the encryption type that Microsoft Windows 2000 uses) 640there is no salt. This is to be compatible with NTLM keys in Windows 641NT 4. 642 643@code{[kadmin]default_keys} in @file{krb5.conf} controls 644what salting to use. 645 646The syntax of @code{[kadmin]default_keys} is 647@samp{[etype:]salt-type[:salt-string]}. @samp{etype} is the encryption 648type (des-cbc-crc, arcfour-hmac-md5, aes256-cts-hmac-sha1-96), 649@code{salt-type} is the type of salt (pw-salt or afs3-salt), and the 650salt-string is the string that will be used as salt (remember that if 651the salt is appended/prepended, the empty salt "" is the same thing as 652no salt at all). 653 654Common types of salting include 655 656@itemize @bullet 657@item @code{v4} (or @code{des:pw-salt:}) 658 659The Kerberos 4 salting is using no salt at all. Reason there is colon 660at the end of the salt string is that it makes the salt the empty 661string (same as no salt). 662 663@item @code{v5} (or @code{pw-salt}) 664 665@code{pw-salt} uses the default salt for each encryption type is 666specified for. If the encryption type @samp{etype} isn't given, all 667default encryption will be used. 668 669@item @code{afs3-salt} 670 671@code{afs3-salt} is the salt that is used with Transarc kaserver. It's 672the cell name appended to the password. 673 674@end itemize 675 676@node Cross realm, Transit policy, Encryption types and salting, Setting up a realm 677@section Cross realm 678@cindex Cross realm 679 680Suppose you reside in the realm @samp{MY.REALM}, how do you 681authenticate to a server in @samp{OTHER.REALM}? Having valid tickets in 682@samp{MY.REALM} allows you to communicate with Kerberised services in that 683realm. However, the computer in the other realm does not have a secret 684key shared with the Kerberos server in your realm. 685 686It is possible to share keys between two realms that trust each 687other. When a client program, such as @command{telnet} or @command{ssh}, 688finds that the other computer is in a different realm, it will try to 689get a ticket granting ticket for that other realm, but from the local 690Kerberos server. With that ticket granting ticket, it will then obtain 691service tickets from the Kerberos server in the other realm. 692 693For a two way trust between @samp{MY.REALM} and @samp{OTHER.REALM} 694add the following principals to each realm. The principals should be 695@samp{krbtgt/OTHER.REALM@@MY.REALM} and 696@samp{krbtgt/MY.REALM@@OTHER.REALM} in @samp{MY.REALM}, and 697@samp{krbtgt/MY.REALM@@OTHER.REALM} and 698@samp{krbtgt/OTHER.REALM@@MY.REALM}in @samp{OTHER.REALM}. 699 700In Kerberos 5 the trust can be configured to be one way. So that 701users from @samp{MY.REALM} can authenticate to services in 702@samp{OTHER.REALM}, but not the opposite. In the example above, the 703@samp{krbtgt/MY.REALM@@OTHER.REALM} then should be removed. 704 705The two principals must have the same key, key version number, and the 706same set of encryption types. Remember to transfer the two keys in a 707safe manner. 708 709@example 710vr$ klist 711Credentials cache: FILE:/tmp/krb5cc_913.console 712 Principal: lha@@E.KTH.SE 713 714 Issued Expires Principal 715May 3 13:55:52 May 3 23:55:54 krbtgt/E.KTH.SE@@E.KTH.SE 716 717vr$ telnet -l lha hummel.it.su.se 718Trying 2001:6b0:5:1095:250:fcff:fe24:dbf... 719Connected to hummel.it.su.se. 720Escape character is '^]'. 721Waiting for encryption to be negotiated... 722[ Trying mutual KERBEROS5 (host/hummel.it.su.se@@SU.SE)... ] 723[ Kerberos V5 accepts you as ``lha@@E.KTH.SE'' ] 724Encryption negotiated. 725Last login: Sat May 3 14:11:47 from vr.l.nxs.se 726hummel$ exit 727 728vr$ klist 729Credentials cache: FILE:/tmp/krb5cc_913.console 730 Principal: lha@@E.KTH.SE 731 732 Issued Expires Principal 733May 3 13:55:52 May 3 23:55:54 krbtgt/E.KTH.SE@@E.KTH.SE 734May 3 13:55:56 May 3 23:55:54 krbtgt/SU.SE@@E.KTH.SE 735May 3 14:10:54 May 3 23:55:54 host/hummel.it.su.se@@SU.SE 736 737@end example 738 739@node Transit policy, Setting up DNS, Cross realm, Setting up a realm 740@section Transit policy 741@cindex Transit policy 742 743If you want to use cross realm authentication through an intermediate 744realm, it must be explicitly allowed by either the KDCs or the server 745receiving the request. This is done in @file{krb5.conf} in the 746@code{[capaths]} section. 747 748When the ticket transits through a realm to another realm, the 749destination realm adds its peer to the "transited-realms" field in the 750ticket. The field is unordered, since there is no way to know if 751know if one of the transited-realms changed the order of the list. 752 753The syntax for @code{[capaths]} section: 754 755@example 756[capaths] 757 CLIENT-REALM = @{ 758 SERVER-REALM = PERMITTED-CROSS-REALMS ... 759 @} 760@end example 761 762The realm @code{STACKEN.KTH.SE} allows clients from @code{SU.SE} and 763@code{DSV.SU.SE} to cross it. Since @code{STACKEN.KTH.SE} only has 764direct cross realm setup with @code{KTH.SE}, and @code{DSV.SU.SE} only 765has direct cross realm setup with @code{SU.SE} they need to use both 766@code{SU.SE} and @code{KTH.SE} as transit realms. 767 768@example 769[capaths] 770 SU.SE = @{ 771 STACKEN.KTH.SE = KTH.SE 772 @} 773 DSV.SU.SE = @{ 774 STACKEN.KTH.SE = SU.SE KTH.SE 775 @} 776 777@end example 778 779The order of the @code{PERMITTED-CROSS-REALMS} is not important when 780doing transit cross realm verification. 781 782However, the order is important when the @code{[capaths]} section is used 783to figure out the intermediate realm to go to when doing multi-realm 784transit. When figuring out the next realm, the first realm of the list 785of @code{PERMITTED-CROSS-REALMS} is chosen. This is done in both the 786client kerberos library and the KDC. 787 788@c To test the cross realm configuration, use: 789@c kmumble transit-check client server transit-realms ... 790 791@node Setting up DNS, Using LDAP to store the database, Transit policy, Setting up a realm 792@section Setting up DNS 793@cindex Setting up DNS 794 795@subsection Using DNS to find KDC 796 797If there is information about where to find the KDC or kadmind for a 798realm in the @file{krb5.conf} for a realm, that information will be 799preferred, and DNS will not be queried. 800 801Heimdal will try to use DNS to find the KDCs for a realm. First it 802will try to find a @code{SRV} resource record (RR) for the realm. If no 803SRV RRs are found, it will fall back to looking for an @code{A} RR for 804a machine named kerberos.REALM, and then kerberos-1.REALM, etc 805 806Adding this information to DNS minimises the client configuration (in 807the common case, resulting in no configuration needed) and allows the 808system administrator to change the number of KDCs and on what machines 809they are running without caring about clients. 810 811The downside of using DNS is that the client might be fooled to use the 812wrong server if someone fakes DNS replies/data, but storing the IP 813addresses of the KDC on all the clients makes it very hard to change 814the infrastructure. 815 816An example of the configuration for the realm @code{EXAMPLE.COM}: 817 818@example 819 820$ORIGIN example.com. 821_kerberos._tcp SRV 10 1 88 kerberos.example.com. 822_kerberos._udp SRV 10 1 88 kerberos.example.com. 823_kerberos._tcp SRV 10 1 88 kerberos-1.example.com. 824_kerberos._udp SRV 10 1 88 kerberos-1.example.com. 825_kpasswd._udp SRV 10 1 464 kerberos.example.com. 826_kerberos-adm._tcp SRV 10 1 749 kerberos.example.com. 827 828@end example 829 830More information about DNS SRV resource records can be found in 831RFC-2782 (A DNS RR for specifying the location of services (DNS SRV)). 832 833@subsection Using DNS to map hostname to Kerberos realm 834 835Heimdal also supports a way to lookup a realm from a hostname. This to 836minimise configuration needed on clients. Using this has the drawback 837that clients can be redirected by an attacker to realms within the 838same cross realm trust and made to believe they are talking to the 839right server (since Kerberos authentication will succeed). 840 841An example configuration that informs clients that for the realms 842it.example.com and srv.example.com, they should use the realm 843EXAMPLE.COM: 844 845@example 846 847$ORIGIN example.com. 848_kerberos.it TXT "EXAMPLE.COM" 849_kerberos.srv TXT "EXAMPLE.COM" 850 851@end example 852 853@node Using LDAP to store the database, Providing Kerberos credentials to servers and programs, Setting up DNS, Setting up a realm 854@section Using LDAP to store the database 855@cindex Using the LDAP backend 856 857This document describes how to install the LDAP backend for 858Heimdal. Note that before attempting to configure such an 859installation, you should be aware of the implications of storing 860private information (such as users' keys) in a directory service 861primarily designed for public information. Nonetheless, with a 862suitable authorisation policy, it is possible to set this up in a 863secure fashion. A knowledge of LDAP, Kerberos, and C is necessary to 864install this backend. The HDB schema was devised by Leif Johansson. 865 866Requirements: 867 868@itemize @bullet 869 870@item 871A current release of Heimdal, configured with 872@code{--with-openldap=/usr/local} (adjust according to where you have 873installed OpenLDAP). 874 875You can verify that you manage to configure LDAP support by running 876@file{kdc --builtin-hdb}, and checking that @samp{ldap:} is one entry 877in the list. 878 879Its also possible to configure the ldap backend as a shared module, 880see option --hdb-openldap-module to configure. 881 882@item 883OpenLDAP 2.0.x. Configure OpenLDAP with @kbd{--enable-local} to enable the 884local transport. (A patch to support SASL EXTERNAL authentication is 885necessary in order to use OpenLDAP 2.1.x.) 886 887@item 888Add the hdb schema to the LDAP server, it's included in the source-tree 889in @file{lib/hdb/hdb.schema}. Example from slapd.conf: 890 891@example 892include /usr/local/etc/openldap/schema/hdb.schema 893@end example 894 895@item 896Configure the LDAP server ACLs to accept writes from clients over the 897local transport. For example: 898 899@example 900access to * 901 by dn.exact="uid=heimdal,dc=services,dc=example,dc=com" write 902 ... 903 904sasl-regexp "uidNumber=0\\\+gidNumber=.*,cn=peercred,cn=external,cn=auth" 905 "uid=heimdal,dc=services,dc=example,dc=com" 906 907@end example 908 909The sasl-regexp is for mapping between the SASL/EXTERNAL and a user in 910a tree. The user that the key is mapped to should be have a 911krb5Principal aux object with krb5PrincipalName set so that the 912``creator'' and ``modifier'' is right in @file{kadmin}. 913 914Another option is to create an admins group and add the dn to that 915group. 916 917Since Heimdal talks to the LDAP server over a UNIX domain socket, and 918uses external sasl authentication, it's not possible to require 919security layer quality (ssf in cyrus-sasl lingo). So that requirement 920has to be turned off in OpenLDAP @command{slapd} configuration file 921@file{slapd.conf}. 922 923@example 924sasl-secprops minssf=0 925@end example 926 927@item 928 929Start @command{slapd} with the local listener (as well as the default TCP/IP 930listener on port 389) as follows: 931 932@example 933 slapd -h "ldapi:/// ldap:///" 934@end example 935 936Note: These is a bug in @command{slapd} where it appears to corrupt the krb5Key 937binary attribute on shutdown. This may be related to our use of the V3 938schema definition syntax instead of the old UMich-style, V2 syntax. 939 940@item 941You should specify the distinguished name under which your 942principals will be stored in @file{krb5.conf}. Also you need to 943enter the path to the kadmin acl file: 944 945 946@example 947[kdc] 948 database = @{ 949 dbname = ldap:ou=KerberosPrincipals,dc=example,dc=com 950 hdb-ldap-structural-object = inetOrgPerson 951 acl_file = /path/to/kadmind.acl 952 mkey_file = /path/to/mkey 953 @} 954@end example 955 956@samp{mkey_file} can be excluded if you feel that you trust your ldap 957directory to have the raw keys inside it. The 958hdb-ldap-structural-object is not necessary if you do not need Samba 959comatibility. 960 961 962 963@item 964Once you have built Heimdal and started the LDAP server, run kadmin 965(as usual) to initialise the database. Note that the instructions for 966stashing a master key are as per any Heimdal installation. 967 968@example 969kdc# kadmin -l 970kadmin> init EXAMPLE.COM 971Realm max ticket life [unlimited]: 972Realm max renewable ticket life [unlimited]: 973kadmin> ank lukeh 974Max ticket life [1 day]: 975Max renewable life [1 week]: 976Principal expiration time [never]: 977Password expiration time [never]: 978Attributes []: 979lukeh@@EXAMPLE.COM's Password: 980Verifying password - lukeh@@EXAMPLE.COM's Password: 981kadmin> exit 982@end example 983 984Verify that the principal database has indeed been stored in the 985directory with the following command: 986 987@example 988kdc# ldapsearch -L -h localhost -D cn=manager \ 989 -w secret -b ou=KerberosPrincipals,dc=example,dc=com \ 990 'objectclass=krb5KDCEntry' 991@end example 992 993@item 994Now consider adding indexes to the database to speed up the access, at 995least theses should be added to slapd.conf. 996 997@example 998index objectClass eq 999index cn eq,sub,pres 1000index uid eq,sub,pres 1001index displayName eq,sub,pres 1002index krb5PrincipalName eq 1003@end example 1004 1005@end itemize 1006 1007@subsection Troubleshooting guide 1008 1009@url{https://sec.miljovern.no/bin/view/Info/TroubleshootingGuide} 1010 1011 1012@subsection Using Samba LDAP password database 1013@cindex Samba 1014 1015@c @node Using Samba LDAP password database, Providing Kerberos credentials to servers and programs, Using LDAP to store the database, Setting up a realm 1016@c @section Using Samba LDAP password database 1017 1018The Samba domain and the Kerberos realm can have different names since 1019arcfour's string to key functions principal/realm independent. So now 1020will be your first and only chance name your Kerberos realm without 1021needing to deal with old configuration files. 1022 1023First, you should set up Samba and get that working with LDAP backend. 1024 1025Now you can proceed as in @xref{Using LDAP to store the database}. 1026Heimdal will pick up the Samba LDAP entries if they are in the same 1027search space as the Kerberos entries. 1028 1029@node Providing Kerberos credentials to servers and programs, Setting up PK-INIT, Using LDAP to store the database, Setting up a realm 1030@section Providing Kerberos credentials to servers and programs 1031 1032Some services require Kerberos credentials when they start to make 1033connections to other services or need to use them when they have started. 1034 1035The easiest way to get tickets for a service is to store the key in a 1036keytab. Both ktutil get and kadmin ext can be used to get a 1037keytab. ktutil get is better in that way it changes the key/password 1038for the user. This is also the problem with ktutil. If ktutil is used 1039for the same service principal on several hosts, they keytab will only 1040be useful on the last host. In that case, run the extract command on 1041one host and then securely copy the keytab around to all other hosts 1042that need it. 1043 1044@example 1045host# ktutil -k /etc/krb5-service.keytab \ 1046 get -p lha/admin@@EXAMPLE.ORG service-principal@@EXAMPLE.ORG 1047lha/admin@@EXAMPLE.ORG's Password: 1048@end example 1049 1050To get a Kerberos credential file for the service, use kinit in the 1051@kbd{--keytab} mode. This will not ask for a password but instead fetch the 1052key from the keytab. 1053 1054@example 1055service@@host$ kinit --cache=/var/run/service_krb5_cache \ 1056 --keytab=/etc/krb5-service.keytab \ 1057 service-principal@@EXAMPLE.ORG 1058@end example 1059 1060Long running services might need credentials longer then the 1061expiration time of the tickets. kinit can run in a mode that refreshes 1062the tickets before they expire. This is useful for services that write 1063into AFS and other distributed file systems using Kerberos. To run the 1064long running script, just append the program and arguments (if any) 1065after the principal. kinit will stop refreshing credentials and remove 1066the credentials when the script-to-start-service exits. 1067 1068@example 1069service@@host$ kinit --cache=/var/run/service_krb5_cache \ 1070 --keytab=/etc/krb5-service.keytab \ 1071 service-principal@@EXAMPLE.ORG \ 1072 script-to-start-service argument1 argument2 1073@end example 1074 1075 1076@node Setting up PK-INIT, , Providing Kerberos credentials to servers and programs, Setting up a realm 1077@section Setting up PK-INIT 1078 1079PK-INIT is levering the existing PKI infrastructure to use 1080certificates to get the initial ticket, that is usually the krbtgt. 1081 1082To use PK-INIT you must first have a PKI, so if you don't have one, 1083it is time to create it. Note that you should read the whole chapter 1084of the document to see the requirements on the CA software. 1085 1086There needs to exist a mapping between the certificate and what 1087principals that certificate is allowed to use. There are several ways 1088to do this. The administrator can use a configuration file, storing 1089the principal in the SubjectAltName extension of the certificate, or store the 1090mapping in the principals entry in the kerberos database. 1091 1092@section Certificates 1093 1094This section documents the requirements on the KDC and client 1095certificates and the format used in the id-pkinit-san OtherName 1096extention. 1097 1098@subsection KDC certificate 1099 1100The certificate for the KDC have serveral requirements. 1101 1102First the certificate should have an Extended Key Usage (EKU) 1103id-pkkdcekuoid (1.3.6.1.5.2.3.5) set. Second there must be a 1104subjectAltName otherName using oid id-pkinit-san (1.3.6.1.5.2.2) in 1105the type field and a DER encoded KRB5PrincipalName that matches the 1106name of the TGS of the target realm. 1107 1108Both of these two requirements are not required by the standard to be 1109checked by the client if it have external information what the 1110certificate the KDC is supposed to be used. So it's in the interest of 1111minimum amount of configuration on the clients they should be included. 1112 1113Remember that if the client would accept any certificate as the KDC's 1114certificate, the client could be fooled into trusting something that 1115isn't a KDC and thus expose the user to giving away information (like 1116password or other private information) that it is supposed to secret. 1117 1118Also, if the certificate has a nameConstraints extention with a 1119Generalname with dNSName or iPAdress it must match the hostname or 1120adress of the KDC. 1121 1122@subsection Client certificate 1123 1124The client certificate may need to have a EKU id-pkekuoid 1125(1.3.6.1.5.2.3.4) set depending on the certifiate on the KDC. 1126 1127It possible to store the principal (if allowed by the KDC) in the 1128certificate and thus delegate responsibility to do the mapping between 1129certificates and principals to the CA. 1130 1131@subsubsection Using KRB5PrincipalName in id-pkinit-san 1132 1133OtherName extention in the GeneralName is used to do the 1134mapping between certifiate and principal in the certifiate or storing 1135the krbtgt principal in the KDC certificate. 1136 1137The principal is stored in a SubjectAltName in the certificate using 1138OtherName. The oid in the type is id-pkinit-san. 1139 1140@example 1141id-pkinit-san OBJECT IDENTIFIER ::= @{ iso (1) org (3) dod (6) 1142internet (1) security (5) kerberosv5 (2) 2 @} 1143@end example 1144 1145The data part of the OtherName is filled with the following DER 1146encoded ASN.1 structure: 1147 1148@example 1149KRB5PrincipalName ::= SEQUENCE @{ 1150 realm [0] Realm, 1151 principalName [1] PrincipalName 1152@} 1153@end example 1154 1155where Realm and PrincipalName is defined by the Kerberos ASN.1 specification. 1156 1157@section Naming certificate using hx509 1158 1159hx509 is the X.509 software used in Heimdal to handle 1160certificates. hx509 uses different syntaxes to specify the different 1161formats the certificates are stored in and what formats they exist in. 1162 1163There are several formats that can be used, PEM, embedded into PKCS12 1164files, embedded into PKCS11 devices and raw DER encoded certificates. 1165Below is a list of types to use. 1166 1167 1168@table @asis 1169 1170@item DIR: 1171 1172DIR is reading all certificates in a directory that is DER or PEM 1173formatted. 1174 1175The main feature of DIR is that the directory is read on demand when 1176iterating over certificates, that way applictions can for some cases 1177avoid to store all certificates in memory. It's very useful for tests 1178that iterate over larger amount of certificates. 1179 1180Syntax is: 1181 1182@example 1183DIR:/path/to/der/files 1184@end example 1185 1186@item FILE: 1187 1188FILE: is used to have the lib pick up a certificate chain and a 1189private key. The file can be either a PEM (openssl) file or a raw DER 1190encoded certificate. If it's a PEM file it can contain several keys and 1191certificates and the code will try to match the private key and 1192certificate together. 1193 1194Its useful to have one PEM file that contains all the trust anchors. 1195 1196Syntax is: 1197 1198@example 1199FILE:certificate.pem,private-key.key,other-cert.pem,.... 1200@end example 1201 1202@item PKCS11: 1203 1204PKCS11: is used to handle smartcards via PKCS11 drivers, for example 1205soft-token, opensc, or muscle. The default is to use all slots on the 1206device/token. 1207 1208Syntax is: 1209 1210@example 1211PKCS11:shared-object.so 1212@end example 1213 1214@item PKCS12: 1215 1216PKCS12: is used to handle PKCS12 files. PKCS12 files commonly have the 1217extension pfx or p12. 1218 1219Syntax is: 1220 1221@example 1222PKCS12:/path/to/file.pfx 1223@end example 1224 1225@end table 1226 1227@section Configure the Kerberos software 1228 1229First configure the client's trust anchors and what parameters to 1230verify, see subsection below how to do that. Now you can use kinit to 1231get yourself tickets. One example how that can look like is: 1232 1233@example 1234$ kinit -C FILE:$HOME/.certs/lha.crt,$HOME/.certs/lha.key lha@@EXAMPLE.ORG 1235Enter your private key passphrase: 1236: lha@@nutcracker ; klist 1237Credentials cache: FILE:/tmp/krb5cc_19100a 1238 Principal: lha@@EXAMPLE.ORG 1239 1240 Issued Expires Principal 1241Apr 20 02:08:08 Apr 20 12:08:08 krbtgt/EXAMPLE.ORG@@EXAMPLE.ORG 1242@end example 1243 1244Using PKCS11 it can look like this instead: 1245 1246@example 1247$ kinit -C PKCS11:/tmp/pkcs11/lib/soft-pkcs11.so lha@@EXAMPLE.ORG 1248PIN code for SoftToken (slot): 1249$ klist 1250Credentials cache: API:4 1251 Principal: lha@@EXAMPLE.ORG 1252 1253 Issued Expires Principal 1254Mar 26 23:40:10 Mar 27 09:40:10 krbtgt/EXAMPLE.ORG@@EXAMPLE.ORG 1255@end example 1256 1257 1258Write about the kdc. 1259 1260@section Configure the client 1261 1262@example 1263[appdefaults] 1264 pkinit_anchors = FILE:/path/to/trust-anchors.pem 1265 1266[realms] 1267 EXAMPLE.COM = @{ 1268 pkinit_require_eku = true 1269 pkinit_require_krbtgt_otherName = true 1270 pkinit_win2k = no 1271 pkinit_win2k_require_binding = yes 1272 @} 1273 1274@end example 1275 1276@section Configure the KDC 1277 1278@example 1279[kdc] 1280 enable-pkinit = yes 1281 pkinit_identity = FILE:/secure/kdc.crt,/secure/kdc.key 1282 pkinit_anchors = FILE:/path/to/trust-anchors.pem 1283 pkinit_pool = PKCS12:/path/to/useful-intermediate-certs.pfx 1284 pkinit_pool = FILE:/path/to/other-useful-intermediate-certs.pem 1285 pkinit_allow_proxy_certificate = false 1286 pkinit_win2k_require_binding = yes 1287@end example 1288 1289@subsection Using pki-mapping file 1290 1291Note that the file name is space sensitive. 1292 1293@example 1294# cat /var/heimdal/pki-mapping 1295# comments starts with # 1296lha@@EXAMPLE.ORG:C=SE,O=Stockholm universitet,CN=Love,UID=lha 1297lha@@EXAMPLE.ORG:CN=Love,UID=lha 1298@end example 1299 1300@subsection Using the Kerberos database 1301 1302@section Use hxtool to create certificates 1303 1304@subsection Generate certificates 1305 1306First you need to generate a CA certificate, change the --subject to 1307something appropriate, the CA certificate will be valid for 10 years. 1308 1309You need to change --subject in the command below. 1310 1311@example 1312hxtool issue-certificate \ 1313 --self-signed \ 1314 --issue-ca \ 1315 --generate-key=rsa \ 1316 --subject="CN=CA,DC=test,DC=h5l,DC=se" \ 1317 --lifetime=10years \ 1318 --certificate="FILE:ca.pem" 1319@end example 1320 1321The KDC needs to have a certificate, so generate a certificate of the 1322type ``pkinit-kdc'' and set the PK-INIT specifial SubjectAltName to the 1323name of the krbtgt of the realm. 1324 1325You need to change --subject and --pk-init-principal in the command below. 1326 1327@example 1328hxtool issue-certificate \ 1329 --ca-certificate=FILE:ca.pem \ 1330 --generate-key=rsa \ 1331 --type="pkinit-kdc" \ 1332 --pk-init-principal="krbtgt/TEST.H5L.SE@@TEST.H5L.SE" \ 1333 --subject="uid=kdc,DC=test,DC=h5l,DC=se" \ 1334 --certificate="FILE:kdc.pem" 1335@end example 1336 1337The users also needs to have a certificate, so generate a certificate 1338of the type ``pkinit-client''. The client doesn't need to have the PK-INIT 1339SubjectAltName set, you can have the Subject DN in the ACL file 1340(pki-mapping) instead. 1341 1342You need to change --subject and --pk-init-principal in the command below. 1343 1344@example 1345hxtool issue-certificate \ 1346 --ca-certificate=FILE:ca.pem \ 1347 --generate-key=rsa \ 1348 --type="pkinit-client" \ 1349 --pk-init-principal="lha@@TEST.H5L.SE" \ 1350 --subject="uid=lha,DC=test,DC=h5l,DC=se" \ 1351 --certificate="FILE:user.pem" 1352@end example 1353 1354@subsection Validate the certificate 1355 1356hxtool also contains a tool that will validate certificates according to 1357rules from the PKIX document. These checks are not complete, but a good test 1358to check if you got all of the basic bits right in your certificates. 1359 1360@example 1361hxtool validate FILE:user.pem 1362@end example 1363 1364@section Use OpenSSL to create certificates 1365 1366This section tries to give the CA owners hints how to create 1367certificates using OpenSSL (or CA software based on OpenSSL). 1368 1369@subsection Using OpenSSL to create certificates with krb5PrincipalName 1370 1371To make OpenSSL create certificates with krb5PrincipalName use 1372@file{openssl.cnf} as described below. To see a complete example of 1373creating client and KDC certificates, see the test-data generation 1374script @file{lib/hx509/data/gen-req.sh} in the source-tree. The 1375certicates it creates are used to test the PK-INIT functionality in 1376@file{tests/kdc/check-kdc.in}. 1377 1378To use this example you have to use OpenSSL 0.9.8a or later. 1379 1380@example 1381 1382[user_certificate] 1383subjectAltName=otherName:1.3.6.1.5.2.2;SEQUENCE:princ_name 1384 1385[princ_name] 1386realm = EXP:0, GeneralString:MY.REALM 1387principal_name = EXP:1, SEQUENCE:principal_seq 1388 1389[principal_seq] 1390name_type = EXP:0, INTEGER:1 1391name_string = EXP:1, SEQUENCE:principals 1392 1393[principals] 1394princ1 = GeneralString:userid 1395 1396@end example 1397 1398Command usage 1399 1400@example 1401openssl x509 -extensions user_certificate 1402openssl ca -extensions user_certificate 1403@end example 1404 1405 1406@c --- ms certificate 1407@c 1408@c [ new_oids ] 1409@c msCertificateTemplateName = 1.3.6.1.4.1.311.20.2 1410@c 1411@c 1412@c [ req_smartcard ] 1413@c keyUsage = digitalSignature, keyEncipherment 1414@c extendedKeyUsage = msSmartcardLogin, clientAuth 1415@c msCertificateTemplateName = ASN1:BMP:SmartcardLogon 1416@c subjectAltName = otherName:msUPN;UTF8:lukeh@dsg.padl.com 1417@c #subjectAltName = email:copy 1418 1419 1420@section Using PK-INIT with Windows 1421 1422@subsection Client configration 1423 1424Clients using a Windows KDC with PK-INIT need configuration since 1425windows uses pre-standard format and this can't be autodetected. 1426 1427The pkinit_win2k_require_binding option requires the reply for the KDC 1428to be of the new, secure, type that binds the request to reply. Before 1429clients should fake the reply from the KDC. To use this option you 1430have to apply a fix from Microsoft. 1431 1432@example 1433[realms] 1434 MY.MS.REALM = @{ 1435 pkinit_win2k = yes 1436 pkinit_win2k_require_binding = no 1437 @} 1438@end example 1439 1440@subsection Certificates 1441 1442The client certificates need to have the extended keyusage ``Microsoft 1443Smartcardlogin'' (openssl have the oid shortname msSmartcardLogin). 1444 1445See Microsoft Knowledge Base Article - 281245 ``Guidelines for Enabling 1446Smart Card Logon with Third-Party Certification Authorities'' for a 1447more extensive description of how set setup an external CA to it 1448includes all information that will make a Windows KDC happy. 1449 1450@subsection Configure Windows 2000 CA 1451 1452To enable Microsoft Smartcardlogin> for certificates in your Windows 14532000 CA, you want to look at Microsoft Knowledge Base Article - 1454313274 ``HOW TO: Configure a Certification Authority to Issue 1455Smart Card Certificates in Windows''. 1456