22.21. endpoint-exec - Endpoint Exec

The following documentation is for Endpoint Exec (endpoint-exec) content package at version .

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.

```json {

“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:

```json {

“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.

22.21.1. Object Specific Documentation params

The content package provides the following params. endpoint-exec/action

The specific endpoint-exec action to call. endpoint-exec/actions

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

Additional parameters to pass through to the command endpoint-exec/plugin

The specific endpoint exec plugin to call. stages

The content package provides the following stages. 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:

`json { "true-call": { "Path": "/bin/true" } } ` tasks

The content package provides the following tasks. 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.