You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add more Windows Kerberos delegation info (#2779) (#2798)
Adds more information on testing Kerberos delegation on Windows. It
includes a klist.exe example command for showing how to retrieve a
service ticket for a specific service.
(cherry picked from commit 21a526c)
Co-authored-by: Jordan Borean <[email protected]>
Copy file name to clipboardExpand all lines: docs/docsite/rst/os_guide/windows_winrm_kerberos.rst
+31-2Lines changed: 31 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,7 @@ Kerberos delegation allows the credentials to traverse multiple hops. This is us
178
178
* request the connection plugin to allow delegation to the server
179
179
* the AD user is not marked as sensitive and cannot be delegated and is not a member of the ``Protected Users`` group
180
180
* depending on the ``krb5.conf`` configuration, the target server may need to allow unconstrained delegation through its AD object delegation settings
181
+
* the target resource to delegate to must be accessible with Kerberos authentication
181
182
182
183
To request a forwardable TGT, either add the ``-f`` flag to the ``kinit``command or set the ``forwardable = true`` option in the ``[libdefaults]`` section of the ``krb5.conf`` file. If you are using the ``psrp`` or ``winrm`` connection plugin to retrieve the TGT from the user's password in the inventory, it will automatically request a forwardable TGT if the connection plugin is configured to use delegation.
183
184
@@ -243,7 +244,7 @@ To verify that delegation is working, you can use the ``klist.exe`` command on t
243
244
244
245
.. code-block:: shell
245
246
246
-
$ ansible WINHOST -m ansible.windows.win_command -a klist.exe
247
+
$ ansible WINHOST -m ansible.windows.win_command -a C:/Windows/System32/klist.exe
247
248
248
249
WINHOST | CHANGED | rc=0 >>
249
250
@@ -266,7 +267,7 @@ If anything goes wrong, the output for ``klist.exe`` will not have the ``forward
266
267
267
268
.. code-block:: shell
268
269
269
-
$ ansible WINHOST -m ansible.windows.win_command -a klist.exe
270
+
$ ansible WINHOST -m ansible.windows.win_command -a C:/Windows/System32/klist.exe
270
271
271
272
WINHOST | CHANGED | rc=0 >>
272
273
@@ -285,6 +286,34 @@ If anything goes wrong, the output for ``klist.exe`` will not have the ``forward
285
286
Cache Flags: 0x8 -> ASC
286
287
Kdc Called:
287
288
289
+
It is also important to ensure that the target resource to delegate to will work with Kerberos authentication. This means that the target server must have a Service Principal Name (``SPN``) registered in Active Directory (``AD``) and that the outbound authentication attempt on Windows uses the hostname and not an IP address/alias. For example, you should access a fileshare using the path ``\\server.fqdn.com\share`` and not ``\\192.168.1.2\share``. To verify that an SPN is registered and the session Ansible runs under can delegate using Kerberos, you can use the following ``klist.exe`` command to request a service ticket for the target server.
290
+
291
+
.. code-block:: shell
292
+
293
+
$ ansible WINHOST -m ansible.windows.win_command -a 'C:/Windows/System32/klist.exe get cifs/fs.my.domain.com'
294
+
295
+
WINHOST | CHANGED | rc=0 >>
296
+
297
+
Current LogonId is 0:0x225639b
298
+
A ticket to cifs/fs.my.domain.com has been retrieved successfully.
The SPN prefix for the target server depends on the service you are trying to access. The ``cifs`` service if used for file shares, ``http`` for web services, and so on. Make sure to use the correct prefix for testing our Kerberos delegation.
0 commit comments