22.20. endpoint-exec - Endpoint Exec¶
The following documentation is for Endpoint Exec (endpoint-exec) content package at version v4.6.12.
22.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.
22.20.2. Object Specific Documentation¶
22.20.2.1. params¶
The content package provides the following params.
22.20.2.1.1. endpoint-exec/action¶
The specific endpoint-exec action to call.
22.20.2.1.2. endpoint-exec/actions¶
The actions that the endpoint-exec plugin allows to be called.
22.20.2.1.3. endpoint-exec/parameters¶
Additional parameters to pass through to the command
22.20.2.1.4. endpoint-exec/plugin¶
The specific endpoint exec plugin to call.
22.20.2.1.5. endpoint-exec/user¶
The user in dr-provision that the action will run as If this param is empty (the default), the action will have its RS_TOKEN set to the one the plugin has, giving it nearly unlimited authority. If this param is set to ‘asMachine’, the task will run with a machine token equivalent to one that the machine would have while running a task. Otherwise, this param must be set to a username that exists, and the action will be run with a token that contains the same authority that user has.
22.20.2.2. stages¶
The content package provides the following stages.
22.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” } }
22.20.2.3. tasks¶
The content package provides the following tasks.
22.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.