• Services
  • Migration Topics
  • Integration
    • Capabilities
    • WinRM
      • About the WinRM/Powershell Action Handler
    • Standard ActionHandlers
    • ServiceNow
    • Jira
    • SAP
    • Email
    • CSV
    • Approval
    • Introduction to ActionHandlers and Connectors
  • Concepts
  • Best Practices
  • Api

Introduction

Action Handlers are integration components of the HIRO™ system. They are used to invoke actions on target systems. This document walks you through the configuration procedure of the HIRO™ WinRM/Powershell Action Handler.

From a technical perspective, the HIRO™ WinRM/Powershell Action Handler is a python based custom extension script to the standard HIRO™ Action Handler Docker image.

Prerequisites

Before you can configure the Action Handler, make sure the following prerequisites are fulfilled:

  1. You have followed the instructions in Standard Docker image for Action Handlers to setup the Action Handler Docker container. Please make sure that the Action Handler correctly connects to the HIRO API.

  2. You have received the WinRM/Powershell Action Handler custom extension. You can obtain the package from the HIRO Support team.

  3. You have a Windows® machine with administrator priviledges and Powershell®, accessible from the Action Handler host

Register capabilitiy

The WinRM/Powershell Action Handler is using the capabilitiy ExecuteWindowsCommand. You need to register this capability for your Action Handler user. Registration is currently done by the HIRO Support team - please open a ticket, naming the capabilitiy and the Ation Handler user you would like to register it for.

Once the capabilities are correctly assigned in the HIRO™ system, you can proceed with the steps below.

Defining docker composition

Custom build command

The standard Action Handler comes as a Docker image. You need to use docker-compose to configure the Docker container for you individual use. This is done in a file called docker-compose.yml. The docker-compose tool reads this file to instantiate your Docker container from the image.

Rather than using the provided Action Handler Docker image directly, you need to add a custom build command to include the WinRM/Powershell extension.

Example of docker-compose.yml including the custom build command
version: "3.7"
services:
  actionhandler:
    #image: arago/hiro-actionhandler:latest #Please choose the version which serves your purpose.
    build:
        context: ./buildAH
	env_file: HIROUser.env
	[...]

Make sure you place the content of the custom extension package (the buildAH folder in particular) to the same location as your docker-compose.yml.

Adding capability configuration

Sample ExecuteWindowsCommand capability configuration
{
	"name": "Windows Remote Commands",
	"capability": "ExecuteWindowsCommand",
	"implementation": "local",
	"exec": "python3 -u /scripts/windows_remote.py $${host} $${command_type} '$${command}' '$${arguments}'"
}

Adding windows credentials to env-file

Sample HIROUser.env
HIRO_USER=ENTER_USERNAME_HERE
HIRO_PASS=ENTER_PASSWORD_HERE
WINRM_PASSWORD=ENTER_WINDOWS_PASSWORD_HERE
WINRM_USERNAME=ENTER_WINDOWS_USERNAME_HERE

Testing the Action Handler

Sample KI for testing
on
  ogit/_id
when
  ProcessIssue == "Execute Powershell command"
  ? command := "dir"
  ? arguments := "C:\ "
  host
do
  stdout: OUTPUT, stderr: LOCAL::ERROR, exit: LOCAL::RC = action(
    capability: "ExecuteWindowsCommand",
    host: "${host}",
    command:"${command}",
    arguments:"${arguments}"
  )
  log(OUTPUT)
  log.error(LOCAL::ERROR)

  delete(ProcessIssue)