23.20. endpoint-exec - Endpoint Exec

The following documentation is for Endpoint Exec (endpoint-exec) content package at version v4.6.0-beta01.47+gfb4d9d119b24c3ffbb0ec412c8495528d8f92159.

23.20.1. Endpoint Exec

Endpoint Exec (endpoint-exe) provides the ability to execute some restricted commands on the DRP Enpdoint on behalf of the machine.

The machine would execute a task that does a “runaction” that triggers the command and it returns the result of that command.

The result is sent through as a JSON blob.

{
  "ReturnCode": 0,
  "StandardOut": "standard out of command",
  "StandardErr": "standard err of command"
}

The command is specified by the “endpoint-exec/action” parameter. Additional command line args can be sent by setting the “endpoint-exec/parameters” parameter.

The plugin requires those actions map to a structure in the plugin parameter, endpoint-exec/actions.

That structure looks like this:

{
  "my-command": {
    "Path": "/path/to/command.py",
    "BaseArgs": "arg1 arg2"
  }
}

Path defines the path to the command to execute. It should be an absolute path.

BaseArgs defines additional arguments for that command. This is optional.

23.20.2. Object Specific Documentation

23.20.2.1. params

The content package provides the following params.

23.20.2.1.1. endpoint-exec/action

The specific endpoint-exec action to call.

23.20.2.1.2. endpoint-exec/actions

The actions that the endpoint-exec plugin allows to be called.

23.20.2.1.3. endpoint-exec/parameters

Additional parameters to pass through to the command

23.20.2.1.4. endpoint-exec/plugin

The specific endpoint exec plugin to call.

23.20.2.2. stages

The content package provides the following stages.

23.20.2.2.1. endpoint-exec-true-call

This stage will run the command, /bin/true, on the endpoint. This is an example and requires the parameter, endpoint-exec/actions, on the plugin is configured with this json:

{ “true-call”: { “Path”: “/bin/true” } }

23.20.2.3. tasks

The content package provides the following tasks.

23.20.2.3.1. endpoint-exec-task

A task to generate a endpoint-exec call from a stage. The stage should have the endpoint-exec/action parameter set to indicate the action to do.

Optionally, the endpoint-exec/plugin parameter can be used to override which instance of the plugin should be called for execution.