Blame doc/admin/dictionary.rst

Packit fd8b60
.. _dictionary:
Packit fd8b60
Packit fd8b60
Addressing dictionary attack risks
Packit fd8b60
==================================
Packit fd8b60
Packit fd8b60
Kerberos initial authentication is normally secured using the client
Packit fd8b60
principal's long-term key, which for users is generally derived from a
Packit fd8b60
password.  Using a pasword-derived long-term key carries the risk of a
Packit fd8b60
dictionary attack, where an attacker tries a sequence of possible
Packit fd8b60
passwords, possibly requiring much less effort than would be required
Packit fd8b60
to try all possible values of the key.  Even if :ref:`password policy
Packit fd8b60
objects <policies>` are used to force users not to pick trivial
Packit fd8b60
passwords, dictionary attacks can sometimes be successful against a
Packit fd8b60
significant fraction of the users in a realm.  Dictionary attacks are
Packit fd8b60
not a concern for principals using random keys.
Packit fd8b60
Packit fd8b60
A dictionary attack may be online or offline.  An online dictionary
Packit fd8b60
attack is performed by trying each password in a separate request to
Packit fd8b60
the KDC, and is therefore visible to the KDC and also limited in speed
Packit fd8b60
by the KDC's processing power and the network capacity between the
Packit fd8b60
client and the KDC.  Online dictionary attacks can be mitigated using
Packit fd8b60
:ref:`account lockout <lockout>`.  This measure is not totally
Packit fd8b60
satisfactory, as it makes it easy for an attacker to deny access to a
Packit fd8b60
client principal.
Packit fd8b60
Packit fd8b60
An offline dictionary attack is performed by obtaining a ciphertext
Packit fd8b60
generated using the password-derived key, and trying each password
Packit fd8b60
against the ciphertext.  This category of attack is invisible to the
Packit fd8b60
KDC and can be performed much faster than an online attack.  The
Packit fd8b60
attack will generally take much longer with more recent encryption
Packit fd8b60
types (particularly the ones based on AES), because those encryption
Packit fd8b60
types use a much more expensive string-to-key function.  However, the
Packit fd8b60
best defense is to deny the attacker access to a useful ciphertext.
Packit fd8b60
The required defensive measures depend on the attacker's level of
Packit fd8b60
network access.
Packit fd8b60
Packit fd8b60
An off-path attacker has no access to packets sent between legitimate
Packit fd8b60
users and the KDC.  An off-path attacker could gain access to an
Packit fd8b60
attackable ciphertext either by making an AS request for a client
Packit fd8b60
principal which does not have the **+requires_preauth** flag, or by
Packit fd8b60
making a TGS request (after authenticating as a different user) for a
Packit fd8b60
server principal which does not have the **-allow_svr** flag.  To
Packit fd8b60
address off-path attackers, a KDC administrator should set those flags
Packit fd8b60
on principals with password-derived keys::
Packit fd8b60
Packit fd8b60
    kadmin: add_principal +requires_preauth -allow_svr princname
Packit fd8b60
Packit fd8b60
An attacker with passive network access (one who can monitor packets
Packit fd8b60
sent between legitimate users and the KDC, but cannot change them or
Packit fd8b60
insert their own packets) can gain access to an attackable ciphertext
Packit fd8b60
by observing an authentication by a user using the most common form of
Packit fd8b60
preauthentication, encrypted timestamp.  Any of the following methods
Packit fd8b60
can prevent dictionary attacks by attackers with passive network
Packit fd8b60
access:
Packit fd8b60
Packit fd8b60
* Enabling :ref:`SPAKE preauthentication <spake>` (added in release
Packit fd8b60
  1.17) on the KDC, and ensuring that all clients are able to support
Packit fd8b60
  it.
Packit fd8b60
Packit fd8b60
* Using an :ref:`HTTPS proxy <https>` for communication with the KDC,
Packit fd8b60
  if the attacker cannot monitor communication between the proxy
Packit fd8b60
  server and the KDC.
Packit fd8b60
Packit fd8b60
* Using FAST, protecting the initial authentication with either a
Packit fd8b60
  random key (such as a host key) or with :ref:`anonymous PKINIT
Packit fd8b60
  <anonymous_pkinit>`.
Packit fd8b60
Packit fd8b60
An attacker with active network access (one who can inject or modify
Packit fd8b60
packets sent between legitimate users and the KDC) can try to fool the
Packit fd8b60
client software into sending an attackable ciphertext using an
Packit fd8b60
encryption type and salt string of the attacker's choosing.  Any of the
Packit fd8b60
following methods can prevent dictionary attacks by active attackers:
Packit fd8b60
Packit fd8b60
* Enabling SPAKE preauthentication and setting the
Packit fd8b60
  **disable_encrypted_timestamp** variable to ``true`` in the
Packit fd8b60
  :ref:`realms` subsection of the client configuration.
Packit fd8b60
Packit fd8b60
* Using an HTTPS proxy as described above, configured in the client's
Packit fd8b60
  krb5.conf realm configuration.  If :ref:`KDC discovery
Packit fd8b60
  <kdc_discovery>` is used to locate a proxy server, an active
Packit fd8b60
  attacker may be able to use DNS spoofing to cause the client to use
Packit fd8b60
  a different HTTPS server or to not use HTTPS.
Packit fd8b60
Packit fd8b60
* Using FAST as described above.
Packit fd8b60
Packit fd8b60
If :ref:`PKINIT <pkinit>` or :ref:`OTP <otp_preauth>` are used for
Packit fd8b60
initial authentication, the principal's long-term keys are not used
Packit fd8b60
and dictionary attacks are usually not a concern.