Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devel:documentation:adm:systems:winrm_ad_connector [2021/11/29 13:37]
kucerar write output
devel:documentation:adm:systems:winrm_ad_connector [2023/11/08 13:46] (current)
kotynekv [Configuration] wwarning
Line 51: Line 51:
 It's better to run it in connector server instead of directly adding dependency to your application(IdM). The reason for this is simple - better security. You can choose user with some limited permissions which will be used as the owner of connector server and then give him access to run only the scripts which you want. It's better to run it in connector server instead of directly adding dependency to your application(IdM). The reason for this is simple - better security. You can choose user with some limited permissions which will be used as the owner of connector server and then give him access to run only the scripts which you want.
  
-It supports basic, ntlm, kerberos and credssp authentication schema for WinRM+It supports basic, ntlm, kerberos and credssp authentication schema for WinRM. To use Kerberos, you need to have properly-configured ''/etc/krb5.conf'' in your system.
  
 It supports HTTP and HTTPS communication. HTTPS communication can be a little bit tricky to configure. You need the right certificate which is used in WinRM listener on Win server. Store the crt to the on the machine where this connector is running and for: **WinRM < 1.0.5**  Edit <nowiki>winrm_wrapper.py</nowiki> to change the path to .pem certificate which is needed for HTTPS connection. It supports HTTP and HTTPS communication. HTTPS communication can be a little bit tricky to configure. You need the right certificate which is used in WinRM listener on Win server. Store the crt to the on the machine where this connector is running and for: **WinRM < 1.0.5**  Edit <nowiki>winrm_wrapper.py</nowiki> to change the path to .pem certificate which is needed for HTTPS connection.
Line 65: Line 65:
  
 **WinRM >= 1.0.5**  there is configuration field called <nowiki>"WinRM___CA trust path"</nowiki> - Path to certificate which will be used in HTTPS communication. E.g /path/to/file/crt.pem Be sure you are using up to date <nowiki>winrm_wrapper.py</nowiki> otherwise this new config property don't work and you will be forced to use previous solution. **WinRM >= 1.0.5**  there is configuration field called <nowiki>"WinRM___CA trust path"</nowiki> - Path to certificate which will be used in HTTPS communication. E.g /path/to/file/crt.pem Be sure you are using up to date <nowiki>winrm_wrapper.py</nowiki> otherwise this new config property don't work and you will be forced to use previous solution.
 +
  
 ===== Schema generation ===== ===== Schema generation =====
Line 151: Line 152:
 We are using encoding otherwise you will have problem with diacritics in powershell when you want to encode the powershell script before sending it via WinRM. We are using encoding otherwise you will have problem with diacritics in powershell when you want to encode the powershell script before sending it via WinRM.
  
-<note important>When connector server is running on Windows all powershell scripts need to you Write-Output function instead of Write-Host</note> +<note important>When connector server is running on Windows all powershell scripts need to you Write-Output function instead of Write-Host</note> <note important>In windows system python was running in encoding cp1252 and I had to use command below to reconfigure to utf8. This command is available from python version 3.7</note>
-<note important>In windows system python was running in encoding cp1252 and I had to use command below to reconfigure to utf8. This command is available from python version 3.7</note>+
  
 <code> <code>
Line 165: Line 165:
 For using WinRM part of this connector you need to install a few things which is needed, otherwise you can skip these steps. For using WinRM part of this connector you need to install a few things which is needed, otherwise you can skip these steps.
  
-  * Install python, tested versions are <del>2.7 </del> (this version is no longer supported by python so use 3.X), 3.6 and 3.9+  * Install python, tested versions are 3.6 and 3.9
   * Install pip for managing Python packages - for linux use package managers based on you distribution and install package python-pip. If you are using windows pip will be installed together with python if you use official installator.   * Install pip for managing Python packages - for linux use package managers based on you distribution and install package python-pip. If you are using windows pip will be installed together with python if you use official installator.
   * Install pywinrm and dependencies. You can follow official guide [[https://github.com/diyan/pywinrm|https://github.com/diyan/pywinrm]] Just don't forget to install additional packages if you want use Kerberos or CredSSP authentication. If you are using windows you need to execute only the commands for pip, you don't need to install other system dependencies.   * Install pywinrm and dependencies. You can follow official guide [[https://github.com/diyan/pywinrm|https://github.com/diyan/pywinrm]] Just don't forget to install additional packages if you want use Kerberos or CredSSP authentication. If you are using windows you need to execute only the commands for pip, you don't need to install other system dependencies.
Line 176: Line 176:
  
 #those only if you need them #those only if you need them
-pip install --user pywinrm[kerberos]+pip install --user pywinrm[kerberos] python-krb5ticket
 pip install --user pywinrm[credssp] pip install --user pywinrm[credssp]
  
Line 263: Line 263:
  
 === Cross domain configuration === === Cross domain configuration ===
 +
 +**<WRAP center round important 60%>\\
 +Adding or removing too many groups at once is not supported. Lenght limitation of environment variable on Windows is 8 191 characters so if combination of all added and removed group's DNs plus comas, doublequotas and the script itself is longer than that cmd.exe just ignores it. The result is no script is being run and no error or exception ocures. Relatively safe is to add or remove about 50-100 groups at once.\\
 +</WRAP>**
  
 IdM 11.2.0 has support for cross domain. You need connector version 1.0.7 IdM 11.2.0 has support for cross domain. You need connector version 1.0.7
Line 273: Line 277:
  
 Scripts can be found on [[https://github.com/bcvsolutions/winrm-ad-connector/tree/develop/scripts_python3/ad|GitHub]] Scripts can be found on [[https://github.com/bcvsolutions/winrm-ad-connector/tree/develop/scripts_python3/ad|GitHub]]
 +
 +=== Send attributes only to WinRM ===
 +
 +In some cases, when you are using AD and WinRM for same operation, you want to use some attributes only in WinRM (powershell).
 +
 +The reason is that is some attribute for script and AD has no clue about this attribute and the AD part will fail.
 +
 +To achieve this, you can specify, which attributes should be send only to WinRM.
 +
 +  * Go to system detail - Configuration
 +  * Go to tab Additional connector configuration
 +  * Click on Manage attributes
 +  * Add new attribute with code attributesForWinRM
 +      * Attribute is Short text and multivalued
 +  * Save it and go back to Additional connector configuration
 +  * Fill attribute names which should be send only to WinRM
 +  * Each name on it's own lane
 +  * Names should be the ones which are in schema.
  
  
  • by kucerar