| 1 | # Policies by authentication indicators |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Based on the pre-authentication mechanism a user used to acquire the credential, |
| 6 | the KDC can enforce policies such as service access control, |
| 7 | user authentication and ticket lifetime/reissue time policies to achieve a finer control over ticket issuance. |
| 8 | |
| 9 | ## Authentication indicators |
| 10 | |
| 11 | Authentication indicators are attached by KDC to tickets issued to user and depend on |
| 12 | which pre-authentication mechanism used to acquire the credential. |
| 13 | Indicators and corresponding mechanisms are listed below: |
| 14 | |
| 15 | | Authentication indicator | Mechanism | |
| 16 | |:------------------------ | :------------------- | |
| 17 | | radius | RADIUS | |
| 18 | | otp | Two factor authentication (password + OTP) | |
| 19 | | pkinit | PKINIT | |
| 20 | | hardened | Hardened Password (by SPAKE or FAST) | |
| 21 | | idp | External Identity Provider | |
| 22 | |
| 23 | Hardened password means a password authentication with either SPAKE or FAST armoring enabled. |
| 24 | Although it is possible to assign separate indicators to SPAKE and FAST, when both SPAKE and FAST are used, |
| 25 | only the indicator for SPAKE will be applied. |
| 26 | Since there is no practical reason to forbid the use of SPAKE while using FAST armoring, |
| 27 | these two are assigned the same indicator to represent a brute-force hardened form of password authentication. |
| 28 | |
| 29 | By requiring certain authentication indicators to a user, we can force a user to be authenticated with one of |
| 30 | the mechanisms associated with those auth indicators to obtain a ticket. |
| 31 | By defining an allow list of authentication indicators to a service, we can allow a user to use the service |
| 32 | only if the user obtained a ticket with at least one of those indicators included. |
| 33 | |
| 34 | ### Note |
| 35 | |
| 36 | For unattended services (services that is a part of the IPA core system), the authentication indicator should not be set, |
| 37 | or it may break the whole system. Examples for such services are `HTTP/*` (for webUI and IPA API end-points), |
| 38 | `ldap/*` (for user data management etc.), `cifs/*` (for SMB and DCE-RPC services), |
| 39 | also for `host/*` on IPA masters which are used by DCE-RPC services to validate client-server communication. |
| 40 | |
| 41 | ## Available policies and user interface |
| 42 | |
| 43 | ### Connection policy |
| 44 | |
| 45 | Different service may need different security strength and consequently requires different pre-auth mechanism. |
| 46 | |
| 47 | e.g. must have used 2FA or OTP in order to connect to `host/securemachine@REALM` |
| 48 | |
| 49 | Services with no authentication indicator assigned will accept tickets authenticated by any mechanism. |
| 50 | |
| 51 | #### CLI Workflow: |
| 52 | |
| 53 | Administrators can specify required auth indicators for a service via `ipa service-mod` command. |
| 54 | |
| 55 | e.g. `ipa service-mod service/@REALM --auth-ind otp --auth-ind pkinit` |
| 56 | |
| 57 | #### WebUI Workflow: |
| 58 | |
| 59 | Administrators can specify required auth indicator on service settings page. |
| 60 | As default no auth indicator is specified which means all pre-auth mechanism is accepted. |
| 61 | |
| 62 | ### Ticket lifecycle policy |
| 63 | |
| 64 | Administrators may want to define different ticket expiration and renewal values |
| 65 | as well as ticket flags based on the type of the authentication conducted. |
| 66 | |
| 67 | e.g. the lifetime of the OTP based ticket can be longer than for a single-factor |
| 68 | |
| 69 | Tickets without an authentication indicator will have the default lifetime / renewtime. |
| 70 | |
| 71 | #### CLI Workflow: |
| 72 | |
| 73 | Administrators can specify max life and renew for each auth indicator and global default via `ipa krbtpolicy-mod` command. |
| 74 | |
| 75 | e.g. `ipa krbtpolicy-mod --otp-maxlife=604800 --pkinit-maxlife=604800` |
| 76 | |
| 77 | Current `--maxlife` and `--maxrenew` options for `ipa krbtpolicy-mod` will set the default max life / renew respectively. |
| 78 | |
| 79 | After this, the output for `ipa krbtpolicy-show` will look like: |
| 80 | |
| 81 | ``` |
| 82 | Max life: 86400 |
| 83 | OTP max life: 604800 |
| 84 | PKINIT max life: 604800 |
| 85 | Max renew: 604800 |
| 86 | ``` |
| 87 | |
| 88 | #### WebUI Workflow: |
| 89 | |
| 90 | In Policy/Kerberos Ticket Policy tab, there is a table |
| 91 | where administrators can specify max renew and life for each supported auth indicator. |
| 92 | |
| 93 | ### Ticket lifetime jitter |
| 94 | |
| 95 | All TGT lifetimes are varied slightly to avoid overwhelming the KDC with |
| 96 | simultaneous renewal requests. Jitter will reduce lifetimes by up to one hour |
| 97 | from the configured maximum lifetime (per policy). Significantly shorter |
| 98 | requested lifetimes will be unaffected. |
| 99 | |
| 100 | ## Implementation |
| 101 | |
| 102 | Kerberos policy, as krb5 presents it, consists of two interfaces: |
| 103 | the authentication indicator attributes and the kdcpolicy plugin. |
| 104 | Authentication indicator attributes allow us to make boolean access choices |
| 105 | (i.e. allow or deny service principal requests) on the KDC based on configuration in the Kerberos Database (KDB). |
| 106 | The kdcpolicy plugin is a much more powerful hook, allowing refinement of the request itself rather than |
| 107 | a solely boolean decision. |
| 108 | |
| 109 | Connection Policy can be implemented with authentication indicator attribute in krb5 alone, |
| 110 | but ticket lifecycle policy will require LDAP to store relations between authentication indicators |
| 111 | and lifetime information. We have global ticket lifetime and renew time setting stored as attribute |
| 112 | `krbmaxticketlife` and `krbmaxrenewableage` inside the `cn=$REALM,cn=kerberos,$SUFFIX` subtree, |
| 113 | which represents the default lifetime policy. |
| 114 | |
| 115 | Two new multi-valued attributes are added to store an authentication |
| 116 | indicator-specific maximum ticket life and ticket's maximum renewable age. The |
| 117 | type of authentication indicator is specified as LDAP attribute option: |
| 118 | |
| 119 | ``` |
| 120 | krbAuthIndMaxTicketLife;otp: 604800 |
| 121 | krbAuthIndMaxRenewableAge;pkinit: 604800 |
| 122 | ``` |
| 123 | |
| 124 | They are stored in the same policy object in LDAP. |