Microsoft Windows Remote Management (WinRM) enables you to remotely perform various management tasks, such as running batch scripts, PowerShell scripts, and uploading files.
Microsoft WinRM connector is for the WinRM service that allows you to invoke commands on targeted Windows machines from any machine that can run Python.
This document provides information about the Microsoft WinRM connector, which provides an interface to connect with a Windows server and remotely execute commands on a Microsoft WinRM server using FortiSOAR™ playbooks. Add the Microsoft WinRM connector as a step in FortiSOAR™ playbooks and perform automated operations, such as executing commands, PowerShell (PS) commands, and scripts, and uploading a script file to a windows machine.
Connector Version: 2.0.0
FortiSOAR™ Version Tested on: 7.6.0-5012
Microsoft WinRM Version Tested on:
Authored By: Fortinet
Certified: Yes
Following enhancements have been made to the Microsoft WinRM connector in version 2.0.0:
Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.
You can also use the yum command as a root user to install the connector:
yum install cyops-connector-microsoft-winrm
For the procedure to configure a connector, click here
In FortiSOAR™, on the Connectors page, click the Microsoft WinRM connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:
| Parameter | Description |
|---|---|
| Protocol | Select the protocol to use for the remote connection. You can choose from the following options:
|
| Host | Specify the IP address of the windows machine on which to execute the command. |
| Port | Specify the port number to connect to the Windows server. Default port for http is 5985, and for https is 5986. |
| Authentication Type | Specify the type for authentication. Authentication type can be basic, ntlm, or credssp.
NOTE: You may encounter an error when using |
| Username | Username used to connect to the Windows server to which you will connect and perform automated operations. |
| Password | Password used to connect to the Windows server to which you will connect and perform automated operations. |
| Verify SSL | Specifies whether the SSL certificate for the server is to be verified. By default, this option is selected, i.e., set to true. |
You can use the following automated operations in playbooks and also use the annotations to access operations:
| Function | Description | Annotation and Category |
|---|---|---|
| Get File | Gets a file from windows machine that you have specified. | get_file Miscellaneous |
| Run Command | Runs the specified command on the configured Windows machine. | execute_command Miscellaneous |
| Run Powershell Command | Executes the given Powershell command on the configured Windows machine. | execute_command Miscellaneous |
| Run Inline Powershell Script | Execute a series of Powershell commands on multiple lines without saving the script as an Attachment record. | execute_ps_script Miscellaneous |
| Run Script | Executes the script you specify on the configured Windows machine. | execute_command Miscellaneous |
| Upload File To Endpoint | Uploads the specified file to the specified remote location on the Windows machine. | upload_file_to_endpoint Miscellaneous |
| Parameter | Description |
|---|---|
| Absolute File Path | Specify the filepath on the remote machine from which to fetch the file. |
| Create Attachment | (Optional) Select to create the file as an attachment in FortiSOAR's Attachments module. By default, this option is selected, i.e. set to True. Clear this checkbox to create the copied file as a file record. |
The output contains the following populated JSON schema:
Output schema when you choose "Create Attachment" as "true":
{
"id": "",
"@id": "",
"file": {
"id": "",
"@id": "",
"size": "",
"uuid": "",
"@type": "",
"assignee": "",
"filename": "",
"metadata": [],
"mimeType": "",
"thumbnail": "",
"uploadDate": ""
},
"name": "",
"type": "",
"uuid": "",
"@type": "",
"tasks": [],
"alerts": [],
"assets": [],
"owners": [],
"people": [],
"@context": "",
"assignee": "",
"comments": [],
"warrooms": [],
"incidents": [],
"createDate": "",
"createUser": {
"id": "",
"@id": "",
"name": "",
"uuid": "",
"@type": "",
"avatar": "",
"userId": "",
"userType": "",
"createDate": "",
"createUser": "",
"modifyDate": "",
"modifyUser": ""
},
"indicators": [],
"modifyDate": "",
"modifyUser": {
"id": "",
"@id": "",
"name": "",
"uuid": "",
"@type": "",
"avatar": "",
"userId": "",
"userType": "",
"createDate": "",
"createUser": "",
"modifyDate": "",
"modifyUser": ""
},
"recordTags": [],
"userOwners": [],
"workspaces": [],
"description": ""
}
Output schema when you choose "Create Attachment" as "false":
{
"id": "",
"@id": "",
"size": "",
"uuid": "",
"@type": "",
"@context": "",
"assignee": "",
"filename": "",
"metadata": {
"md5": "",
"sha1": "",
"sha256": ""
},
"mimeType": "",
"thumbnail": "",
"uploadDate": ""
}
| Parameter | Description |
|---|---|
| Command | Specify the command to execute remotely on the Windows machine. |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Command | Specify the command to execute remotely on the Windows machine's PowerShell. |
| Convert to JSON | (Optional) Select this option to convert the command output to the JSON format. By default, this is selected, i.e., set to True. |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Powershell Script | Specify the inline powershell script to execute on the specified endpoint |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Attachment IRI/ File IRI | Specify the Attachment IRI or File IRI of the script file to submit files directly from the FortiSOAR™'s Attachments module to the Windows server. |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Absolute File Path | Specify the filepath on the remote machine on which to upload the file. |
| Attachment IRI/ File IRI | Specify the Attachment IRI or File IRI of the script file to upload files directly from the FortiSOAR™'s Attachments module to the Windows server. |
No output schema is available at this time.
The Sample - Microsoft WinRM - 2.0.0 playbook collection comes bundled with the Microsoft WinRM connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the Microsoft WinRM connector.
Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.
To use this connector, you must configure WinRM on the Windows server to which you want to connect. To configure WinRM, do the following:
c:\> winrm quickconfigc:\> winrm e winrm/config/listenerc:\> winrm get winrm/config/service
Run the following command to enable basic authentication.
c:\> winrm set winrm/config/service/auth @{Basic="true"}
Run the following command to allow transfer of unencrypted data on the WinRM service.
c:\> winrm set winrm/config/service @{AllowUnencrypted="true"}
If the channel binding token hardening level of the WinRM service is set to strict, change its value to relaxed.
c:\> winrm set winrm/config/service/auth @{CbtHardeningLevel="relaxed"}
Enable basic authentication on the WinRM client.
Run the following command to check whether basic authentication is allowed.
c:\> winrm get winrm/config/client
Run the following command to enable basic authentication.
c:\> winrm set winrm/config/client/auth @{Basic="true"}
Run the following command to allow the transfer of unencrypted data on the WinRM client.
c:\> winrm set winrm/config/client @{AllowUnencrypted="true"}
If the WinRM host machine is in an external domain, run the following command to specify the trusted hosts.
c:\> winrm set winrm/config/client @{TrustedHosts="host1, host2, host3"}
Run the following command to test the connector to the WinRM service.
c:\> winrm identity -r:http://winrm_server:5985 -auth:basic -u:user_name -p:password -encoding:utf-8
Microsoft Windows Remote Management (WinRM) enables you to remotely perform various management tasks, such as running batch scripts, PowerShell scripts, and uploading files.
Microsoft WinRM connector is for the WinRM service that allows you to invoke commands on targeted Windows machines from any machine that can run Python.
This document provides information about the Microsoft WinRM connector, which provides an interface to connect with a Windows server and remotely execute commands on a Microsoft WinRM server using FortiSOAR™ playbooks. Add the Microsoft WinRM connector as a step in FortiSOAR™ playbooks and perform automated operations, such as executing commands, PowerShell (PS) commands, and scripts, and uploading a script file to a windows machine.
Connector Version: 2.0.0
FortiSOAR™ Version Tested on: 7.6.0-5012
Microsoft WinRM Version Tested on:
Authored By: Fortinet
Certified: Yes
Following enhancements have been made to the Microsoft WinRM connector in version 2.0.0:
Use the Content Hub to install the connector. For the detailed procedure to install a connector, click here.
You can also use the yum command as a root user to install the connector:
yum install cyops-connector-microsoft-winrm
For the procedure to configure a connector, click here
In FortiSOAR™, on the Connectors page, click the Microsoft WinRM connector row (if you are in the Grid view on the Connectors page) and in the Configurations tab enter the required configuration details:
| Parameter | Description |
|---|---|
| Protocol | Select the protocol to use for the remote connection. You can choose from the following options:
|
| Host | Specify the IP address of the windows machine on which to execute the command. |
| Port | Specify the port number to connect to the Windows server. Default port for http is 5985, and for https is 5986. |
| Authentication Type | Specify the type for authentication. Authentication type can be basic, ntlm, or credssp.
NOTE: You may encounter an error when using |
| Username | Username used to connect to the Windows server to which you will connect and perform automated operations. |
| Password | Password used to connect to the Windows server to which you will connect and perform automated operations. |
| Verify SSL | Specifies whether the SSL certificate for the server is to be verified. By default, this option is selected, i.e., set to true. |
You can use the following automated operations in playbooks and also use the annotations to access operations:
| Function | Description | Annotation and Category |
|---|---|---|
| Get File | Gets a file from windows machine that you have specified. | get_file Miscellaneous |
| Run Command | Runs the specified command on the configured Windows machine. | execute_command Miscellaneous |
| Run Powershell Command | Executes the given Powershell command on the configured Windows machine. | execute_command Miscellaneous |
| Run Inline Powershell Script | Execute a series of Powershell commands on multiple lines without saving the script as an Attachment record. | execute_ps_script Miscellaneous |
| Run Script | Executes the script you specify on the configured Windows machine. | execute_command Miscellaneous |
| Upload File To Endpoint | Uploads the specified file to the specified remote location on the Windows machine. | upload_file_to_endpoint Miscellaneous |
| Parameter | Description |
|---|---|
| Absolute File Path | Specify the filepath on the remote machine from which to fetch the file. |
| Create Attachment | (Optional) Select to create the file as an attachment in FortiSOAR's Attachments module. By default, this option is selected, i.e. set to True. Clear this checkbox to create the copied file as a file record. |
The output contains the following populated JSON schema:
Output schema when you choose "Create Attachment" as "true":
{
"id": "",
"@id": "",
"file": {
"id": "",
"@id": "",
"size": "",
"uuid": "",
"@type": "",
"assignee": "",
"filename": "",
"metadata": [],
"mimeType": "",
"thumbnail": "",
"uploadDate": ""
},
"name": "",
"type": "",
"uuid": "",
"@type": "",
"tasks": [],
"alerts": [],
"assets": [],
"owners": [],
"people": [],
"@context": "",
"assignee": "",
"comments": [],
"warrooms": [],
"incidents": [],
"createDate": "",
"createUser": {
"id": "",
"@id": "",
"name": "",
"uuid": "",
"@type": "",
"avatar": "",
"userId": "",
"userType": "",
"createDate": "",
"createUser": "",
"modifyDate": "",
"modifyUser": ""
},
"indicators": [],
"modifyDate": "",
"modifyUser": {
"id": "",
"@id": "",
"name": "",
"uuid": "",
"@type": "",
"avatar": "",
"userId": "",
"userType": "",
"createDate": "",
"createUser": "",
"modifyDate": "",
"modifyUser": ""
},
"recordTags": [],
"userOwners": [],
"workspaces": [],
"description": ""
}
Output schema when you choose "Create Attachment" as "false":
{
"id": "",
"@id": "",
"size": "",
"uuid": "",
"@type": "",
"@context": "",
"assignee": "",
"filename": "",
"metadata": {
"md5": "",
"sha1": "",
"sha256": ""
},
"mimeType": "",
"thumbnail": "",
"uploadDate": ""
}
| Parameter | Description |
|---|---|
| Command | Specify the command to execute remotely on the Windows machine. |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Command | Specify the command to execute remotely on the Windows machine's PowerShell. |
| Convert to JSON | (Optional) Select this option to convert the command output to the JSON format. By default, this is selected, i.e., set to True. |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Powershell Script | Specify the inline powershell script to execute on the specified endpoint |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Attachment IRI/ File IRI | Specify the Attachment IRI or File IRI of the script file to submit files directly from the FortiSOAR™'s Attachments module to the Windows server. |
The output contains the following populated JSON schema:
{
"op_result": "",
"op_status": ""
}
| Parameter | Description |
|---|---|
| Absolute File Path | Specify the filepath on the remote machine on which to upload the file. |
| Attachment IRI/ File IRI | Specify the Attachment IRI or File IRI of the script file to upload files directly from the FortiSOAR™'s Attachments module to the Windows server. |
No output schema is available at this time.
The Sample - Microsoft WinRM - 2.0.0 playbook collection comes bundled with the Microsoft WinRM connector. These playbooks contain steps using which you can perform all supported actions. You can see bundled playbooks in the Automation > Playbooks section in FortiSOAR™ after importing the Microsoft WinRM connector.
Note: If you are planning to use any of the sample playbooks in your environment, ensure that you clone those playbooks and move them to a different collection since the sample playbook collection gets deleted during connector upgrade and delete.
To use this connector, you must configure WinRM on the Windows server to which you want to connect. To configure WinRM, do the following:
c:\> winrm quickconfigc:\> winrm e winrm/config/listenerc:\> winrm get winrm/config/service
Run the following command to enable basic authentication.
c:\> winrm set winrm/config/service/auth @{Basic="true"}
Run the following command to allow transfer of unencrypted data on the WinRM service.
c:\> winrm set winrm/config/service @{AllowUnencrypted="true"}
If the channel binding token hardening level of the WinRM service is set to strict, change its value to relaxed.
c:\> winrm set winrm/config/service/auth @{CbtHardeningLevel="relaxed"}
Enable basic authentication on the WinRM client.
Run the following command to check whether basic authentication is allowed.
c:\> winrm get winrm/config/client
Run the following command to enable basic authentication.
c:\> winrm set winrm/config/client/auth @{Basic="true"}
Run the following command to allow the transfer of unencrypted data on the WinRM client.
c:\> winrm set winrm/config/client @{AllowUnencrypted="true"}
If the WinRM host machine is in an external domain, run the following command to specify the trusted hosts.
c:\> winrm set winrm/config/client @{TrustedHosts="host1, host2, host3"}
Run the following command to test the connector to the WinRM service.
c:\> winrm identity -r:http://winrm_server:5985 -auth:basic -u:user_name -p:password -encoding:utf-8