Imported Upstream version 1.20.1
[platform/upstream/krb5.git] / doc / html / admin / lockout.html
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml">
6   <head>
7     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8     <title>Account lockout &#8212; MIT Kerberos Documentation</title>
9     <link rel="stylesheet" href="../_static/agogo.css" type="text/css" />
10     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
11     <link rel="stylesheet" href="../_static/kerb.css" type="text/css" />
12     <script type="text/javascript">
13       var DOCUMENTATION_OPTIONS = {
14         URL_ROOT:    '../',
15         VERSION:     '1.20.1',
16         COLLAPSE_INDEX: false,
17         FILE_SUFFIX: '.html',
18         HAS_SOURCE:  true,
19         SOURCELINK_SUFFIX: '.txt'
20       };
21     </script>
22     <script type="text/javascript" src="../_static/jquery.js"></script>
23     <script type="text/javascript" src="../_static/underscore.js"></script>
24     <script type="text/javascript" src="../_static/doctools.js"></script>
25     <link rel="author" title="About these documents" href="../about.html" />
26     <link rel="index" title="Index" href="../genindex.html" />
27     <link rel="search" title="Search" href="../search.html" />
28     <link rel="copyright" title="Copyright" href="../copyright.html" />
29     <link rel="next" title="Configuring Kerberos with OpenLDAP back-end" href="conf_ldap.html" />
30     <link rel="prev" title="Database types" href="dbtypes.html" /> 
31   </head>
32   <body>
33     <div class="header-wrapper">
34         <div class="header">
35             
36             
37             <h1><a href="../index.html">MIT Kerberos Documentation</a></h1>
38             
39             <div class="rel">
40                 
41         <a href="../index.html" title="Full Table of Contents"
42             accesskey="C">Contents</a> |
43         <a href="dbtypes.html" title="Database types"
44             accesskey="P">previous</a> |
45         <a href="conf_ldap.html" title="Configuring Kerberos with OpenLDAP back-end"
46             accesskey="N">next</a> |
47         <a href="../genindex.html" title="General Index"
48             accesskey="I">index</a> |
49         <a href="../search.html" title="Enter search criteria"
50             accesskey="S">Search</a> |
51     <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__Account lockout">feedback</a>
52             </div>
53         </div>
54     </div>
55
56     <div class="content-wrapper">
57       <div class="content">
58         <div class="document">
59             
60       <div class="documentwrapper">
61         <div class="bodywrapper">
62           <div class="body" role="main">
63             
64   <div class="section" id="account-lockout">
65 <span id="lockout"></span><h1>Account lockout<a class="headerlink" href="#account-lockout" title="Permalink to this headline">¶</a></h1>
66 <p>As of release 1.8, the KDC can be configured to lock out principals
67 after a number of failed authentication attempts within a period of
68 time.  Account lockout can make it more difficult to attack a
69 principal’s password by brute force, but also makes it easy for an
70 attacker to deny access to a principal.</p>
71 <div class="section" id="configuring-account-lockout">
72 <h2>Configuring account lockout<a class="headerlink" href="#configuring-account-lockout" title="Permalink to this headline">¶</a></h2>
73 <p>Account lockout only works for principals with the
74 <strong>+requires_preauth</strong> flag set.  Without this flag, the KDC cannot
75 know whether or not a client successfully decrypted the ticket it
76 issued.  It is also important to set the <strong>-allow_svr</strong> flag on a
77 principal to protect its password from an off-line dictionary attack
78 through a TGS request.  You can set these flags on a principal with
79 <a class="reference internal" href="admin_commands/kadmin_local.html#kadmin-1"><span class="std std-ref">kadmin</span></a> as follows:</p>
80 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">kadmin</span><span class="p">:</span> <span class="n">modprinc</span> <span class="o">+</span><span class="n">requires_preauth</span> <span class="o">-</span><span class="n">allow_svr</span> <span class="n">PRINCNAME</span>
81 </pre></div>
82 </div>
83 <p>Account lockout parameters are configured via <a class="reference internal" href="database.html#policies"><span class="std std-ref">policy objects</span></a>.  There may be an existing policy associated with user
84 principals (such as the “default” policy), or you may need to create a
85 new one and associate it with each user principal.</p>
86 <p>The policy parameters related to account lockout are:</p>
87 <ul class="simple">
88 <li><a class="reference internal" href="database.html#policy-maxfailure"><span class="std std-ref">maxfailure</span></a>: the number of failed attempts
89 before the principal is locked out</li>
90 <li><a class="reference internal" href="database.html#policy-failurecountinterval"><span class="std std-ref">failurecountinterval</span></a>: the
91 allowable interval between failed attempts</li>
92 <li><a class="reference internal" href="database.html#policy-lockoutduration"><span class="std std-ref">lockoutduration</span></a>: the amount of time
93 a principal is locked out for</li>
94 </ul>
95 <p>Here is an example of setting these parameters on a new policy and
96 associating it with a principal:</p>
97 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">kadmin</span><span class="p">:</span> <span class="n">addpol</span> <span class="o">-</span><span class="n">maxfailure</span> <span class="mi">10</span> <span class="o">-</span><span class="n">failurecountinterval</span> <span class="mi">180</span>
98     <span class="o">-</span><span class="n">lockoutduration</span> <span class="mi">60</span> <span class="n">lockout_policy</span>
99 <span class="n">kadmin</span><span class="p">:</span> <span class="n">modprinc</span> <span class="o">-</span><span class="n">policy</span> <span class="n">lockout_policy</span> <span class="n">PRINCNAME</span>
100 </pre></div>
101 </div>
102 </div>
103 <div class="section" id="testing-account-lockout">
104 <h2>Testing account lockout<a class="headerlink" href="#testing-account-lockout" title="Permalink to this headline">¶</a></h2>
105 <p>To test that account lockout is working, try authenticating as the
106 principal (hopefully not one that might be in use) multiple times with
107 the wrong password.  For instance, if <strong>maxfailure</strong> is set to 2, you
108 might see:</p>
109 <div class="highlight-default"><div class="highlight"><pre><span></span>$ kinit user
110 Password for user@KRBTEST.COM:
111 kinit: Password incorrect while getting initial credentials
112 $ kinit user
113 Password for user@KRBTEST.COM:
114 kinit: Password incorrect while getting initial credentials
115 $ kinit user
116 kinit: Client&#39;s credentials have been revoked while getting initial credentials
117 </pre></div>
118 </div>
119 </div>
120 <div class="section" id="account-lockout-principal-state">
121 <h2>Account lockout principal state<a class="headerlink" href="#account-lockout-principal-state" title="Permalink to this headline">¶</a></h2>
122 <p>A principal entry keeps three pieces of state related to account
123 lockout:</p>
124 <ul class="simple">
125 <li>The time of last successful authentication</li>
126 <li>The time of last failed authentication</li>
127 <li>A counter of failed attempts</li>
128 </ul>
129 <p>The time of last successful authentication is not actually needed for
130 the account lockout system to function, but may be of administrative
131 interest.  These fields can be observed with the <strong>getprinc</strong> kadmin
132 command.  For example:</p>
133 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">kadmin</span><span class="p">:</span> <span class="n">getprinc</span> <span class="n">user</span>
134 <span class="n">Principal</span><span class="p">:</span> <span class="n">user</span><span class="nd">@KRBTEST</span><span class="o">.</span><span class="n">COM</span>
135 <span class="o">...</span>
136 <span class="n">Last</span> <span class="n">successful</span> <span class="n">authentication</span><span class="p">:</span> <span class="p">[</span><span class="n">never</span><span class="p">]</span>
137 <span class="n">Last</span> <span class="n">failed</span> <span class="n">authentication</span><span class="p">:</span> <span class="n">Mon</span> <span class="n">Dec</span> <span class="mi">03</span> <span class="mi">12</span><span class="p">:</span><span class="mi">30</span><span class="p">:</span><span class="mi">33</span> <span class="n">EST</span> <span class="mi">2012</span>
138 <span class="n">Failed</span> <span class="n">password</span> <span class="n">attempts</span><span class="p">:</span> <span class="mi">2</span>
139 <span class="o">...</span>
140 </pre></div>
141 </div>
142 <p>A principal which has been locked out can be administratively unlocked
143 with the <strong>-unlock</strong> option to the <strong>modprinc</strong> kadmin command:</p>
144 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">kadmin</span><span class="p">:</span> <span class="n">modprinc</span> <span class="o">-</span><span class="n">unlock</span> <span class="n">PRINCNAME</span>
145 </pre></div>
146 </div>
147 <p>This command will reset the number of failed attempts to 0.</p>
148 </div>
149 <div class="section" id="kdc-replication-and-account-lockout">
150 <h2>KDC replication and account lockout<a class="headerlink" href="#kdc-replication-and-account-lockout" title="Permalink to this headline">¶</a></h2>
151 <p>The account lockout state of a principal is not replicated by either
152 traditional <a class="reference internal" href="admin_commands/kprop.html#kprop-8"><span class="std std-ref">kprop</span></a> or incremental propagation.  Because of
153 this, the number of attempts an attacker can make within a time period
154 is multiplied by the number of KDCs.  For instance, if the
155 <strong>maxfailure</strong> parameter on a policy is 10 and there are four KDCs in
156 the environment (a primary and three replicas), an attacker could make
157 as many as 40 attempts before the principal is locked out on all four
158 KDCs.</p>
159 <p>An administrative unlock is propagated from the primary to the replica
160 KDCs during the next propagation.  Propagation of an administrative
161 unlock will cause the counter of failed attempts on each replica to
162 reset to 1 on the next failure.</p>
163 <p>If a KDC environment uses a replication strategy other than kprop or
164 incremental propagation, such as the LDAP KDB module with multi-master
165 LDAP replication, then account lockout state may be replicated between
166 KDCs and the concerns of this section may not apply.</p>
167 </div>
168 <div class="section" id="kdc-performance-and-account-lockout">
169 <span id="disable-lockout"></span><h2>KDC performance and account lockout<a class="headerlink" href="#kdc-performance-and-account-lockout" title="Permalink to this headline">¶</a></h2>
170 <p>In order to fully track account lockout state, the KDC must write to
171 the the database on each successful and failed authentication.
172 Writing to the database is generally more expensive than reading from
173 it, so these writes may have a significant impact on KDC performance.
174 As of release 1.9, it is possible to turn off account lockout state
175 tracking in order to improve performance, by setting the
176 <strong>disable_last_success</strong> and <strong>disable_lockout</strong> variables in the
177 database module subsection of <a class="reference internal" href="conf_files/kdc_conf.html#kdc-conf-5"><span class="std std-ref">kdc.conf</span></a>.  For example:</p>
178 <div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">dbmodules</span><span class="p">]</span>
179     <span class="n">DB</span> <span class="o">=</span> <span class="p">{</span>
180         <span class="n">disable_last_success</span> <span class="o">=</span> <span class="n">true</span>
181         <span class="n">disable_lockout</span> <span class="o">=</span> <span class="n">true</span>
182     <span class="p">}</span>
183 </pre></div>
184 </div>
185 <p>Of the two variables, setting <strong>disable_last_success</strong> will usually
186 have the largest positive impact on performance, and will still allow
187 account lockout policies to operate.  However, it will make it
188 impossible to observe the last successful authentication time with
189 kadmin.</p>
190 </div>
191 <div class="section" id="kdc-setup-and-account-lockout">
192 <h2>KDC setup and account lockout<a class="headerlink" href="#kdc-setup-and-account-lockout" title="Permalink to this headline">¶</a></h2>
193 <p>To update the account lockout state on principals, the KDC must be
194 able to write to the principal database.  For the DB2 module, no
195 special setup is required.  For the LDAP module, the KDC DN must be
196 granted write access to the principal objects.  If the KDC DN has only
197 read access, account lockout will not function.</p>
198 </div>
199 </div>
200
201
202           </div>
203         </div>
204       </div>
205         </div>
206         <div class="sidebar">
207     <h2>On this page</h2>
208     <ul>
209 <li><a class="reference internal" href="#">Account lockout</a><ul>
210 <li><a class="reference internal" href="#configuring-account-lockout">Configuring account lockout</a></li>
211 <li><a class="reference internal" href="#testing-account-lockout">Testing account lockout</a></li>
212 <li><a class="reference internal" href="#account-lockout-principal-state">Account lockout principal state</a></li>
213 <li><a class="reference internal" href="#kdc-replication-and-account-lockout">KDC replication and account lockout</a></li>
214 <li><a class="reference internal" href="#kdc-performance-and-account-lockout">KDC performance and account lockout</a></li>
215 <li><a class="reference internal" href="#kdc-setup-and-account-lockout">KDC setup and account lockout</a></li>
216 </ul>
217 </li>
218 </ul>
219
220     <br/>
221     <h2>Table of contents</h2>
222     <ul class="current">
223 <li class="toctree-l1"><a class="reference internal" href="../user/index.html">For users</a></li>
224 <li class="toctree-l1 current"><a class="reference internal" href="index.html">For administrators</a><ul class="current">
225 <li class="toctree-l2"><a class="reference internal" href="install.html">Installation guide</a></li>
226 <li class="toctree-l2"><a class="reference internal" href="conf_files/index.html">Configuration Files</a></li>
227 <li class="toctree-l2"><a class="reference internal" href="realm_config.html">Realm configuration decisions</a></li>
228 <li class="toctree-l2"><a class="reference internal" href="database.html">Database administration</a></li>
229 <li class="toctree-l2"><a class="reference internal" href="dbtypes.html">Database types</a></li>
230 <li class="toctree-l2 current"><a class="current reference internal" href="#">Account lockout</a></li>
231 <li class="toctree-l2"><a class="reference internal" href="conf_ldap.html">Configuring Kerberos with OpenLDAP back-end</a></li>
232 <li class="toctree-l2"><a class="reference internal" href="appl_servers.html">Application servers</a></li>
233 <li class="toctree-l2"><a class="reference internal" href="host_config.html">Host configuration</a></li>
234 <li class="toctree-l2"><a class="reference internal" href="backup_host.html">Backups of secure hosts</a></li>
235 <li class="toctree-l2"><a class="reference internal" href="pkinit.html">PKINIT configuration</a></li>
236 <li class="toctree-l2"><a class="reference internal" href="otp.html">OTP Preauthentication</a></li>
237 <li class="toctree-l2"><a class="reference internal" href="spake.html">SPAKE Preauthentication</a></li>
238 <li class="toctree-l2"><a class="reference internal" href="dictionary.html">Addressing dictionary attack risks</a></li>
239 <li class="toctree-l2"><a class="reference internal" href="princ_dns.html">Principal names and DNS</a></li>
240 <li class="toctree-l2"><a class="reference internal" href="enctypes.html">Encryption types</a></li>
241 <li class="toctree-l2"><a class="reference internal" href="https.html">HTTPS proxy configuration</a></li>
242 <li class="toctree-l2"><a class="reference internal" href="auth_indicator.html">Authentication indicators</a></li>
243 <li class="toctree-l2"><a class="reference internal" href="admin_commands/index.html">Administration  programs</a></li>
244 <li class="toctree-l2"><a class="reference internal" href="../mitK5defaults.html">MIT Kerberos defaults</a></li>
245 <li class="toctree-l2"><a class="reference internal" href="env_variables.html">Environment variables</a></li>
246 <li class="toctree-l2"><a class="reference internal" href="troubleshoot.html">Troubleshooting</a></li>
247 <li class="toctree-l2"><a class="reference internal" href="advanced/index.html">Advanced topics</a></li>
248 <li class="toctree-l2"><a class="reference internal" href="various_envs.html">Various links</a></li>
249 </ul>
250 </li>
251 <li class="toctree-l1"><a class="reference internal" href="../appdev/index.html">For application developers</a></li>
252 <li class="toctree-l1"><a class="reference internal" href="../plugindev/index.html">For plugin module developers</a></li>
253 <li class="toctree-l1"><a class="reference internal" href="../build/index.html">Building Kerberos V5</a></li>
254 <li class="toctree-l1"><a class="reference internal" href="../basic/index.html">Kerberos V5 concepts</a></li>
255 <li class="toctree-l1"><a class="reference internal" href="../formats/index.html">Protocols and file formats</a></li>
256 <li class="toctree-l1"><a class="reference internal" href="../mitK5features.html">MIT Kerberos features</a></li>
257 <li class="toctree-l1"><a class="reference internal" href="../build_this.html">How to build this documentation from the source</a></li>
258 <li class="toctree-l1"><a class="reference internal" href="../about.html">Contributing to the MIT Kerberos Documentation</a></li>
259 <li class="toctree-l1"><a class="reference internal" href="../resources.html">Resources</a></li>
260 </ul>
261
262     <br/>
263     <h4><a href="../index.html">Full Table of Contents</a></h4>
264     <h4>Search</h4>
265     <form class="search" action="../search.html" method="get">
266       <input type="text" name="q" size="18" />
267       <input type="submit" value="Go" />
268       <input type="hidden" name="check_keywords" value="yes" />
269       <input type="hidden" name="area" value="default" />
270     </form>
271         </div>
272         <div class="clearer"></div>
273       </div>
274     </div>
275
276     <div class="footer-wrapper">
277         <div class="footer" >
278             <div class="right" ><i>Release: 1.20.1</i><br />
279                 &copy; <a href="../copyright.html">Copyright</a> 1985-2022, MIT.
280             </div>
281             <div class="left">
282                 
283         <a href="../index.html" title="Full Table of Contents"
284             >Contents</a> |
285         <a href="dbtypes.html" title="Database types"
286             >previous</a> |
287         <a href="conf_ldap.html" title="Configuring Kerberos with OpenLDAP back-end"
288             >next</a> |
289         <a href="../genindex.html" title="General Index"
290             >index</a> |
291         <a href="../search.html" title="Enter search criteria"
292             >Search</a> |
293     <a href="mailto:krb5-bugs@mit.edu?subject=Documentation__Account lockout">feedback</a>
294             </div>
295         </div>
296     </div>
297
298   </body>
299 </html>