Documentation
¶
Overview ¶
Package rce provides a gRPC-based Remote Code Execution client and server. The server (or "agent") runs on a remote host and executes a whitelist of shell commands specified in a config file. The client calls the server to execute whitelist commands. Commands from different clients run concurrently; there are no safeguards against conflicting or incompatible commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ConnectTimeout describes the total timeout for establishing a client // connection to the rceagent server. ConnectTimeout = time.Duration(10) * time.Second // ConnectBackoffMaxDelay configures the dialer to use the // provided maximum delay when backing off after // failed connection attempts. ConnectBackoffMaxDelay = time.Duration(2) * time.Second // KeepaliveTime is the interval at which the client sends keepalive // probes to the server. KeepaliveTime = time.Duration(30) * time.Second // KeepaliveTimeout is the amount of time the client waits to receive // a response from the server after a keepalive probe. KeepaliveTimeout = time.Duration(20) * time.Second )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// Connect to a remote agent.
Open(host, port string) error
// Close connection to a remote agent.
Close() error
// Return hostname and port of remote agent, if connected.
AgentAddr() (string, string)
// Start a command on the remote agent. Must be connected first by calling
// Connect. This call is non-blocking. It returns the ID of the command or
// an error.
Start(cmdName string, args []string) (id string, err error)
// Wait for a command on the remote agent. This call blocks until the command
// completes. It returns the final statue of the command or an error.
Wait(id string) (*pb.Status, error)
// Get the status of a running command. This is safe to call by multiple
// goroutines. ErrNotFound is returned if Wait or Stop has already been
// called.
GetStatus(id string) (*pb.Status, error)
// Stop a running command. ErrNotFound is returne if Wait or Stop has already
// been called.
Stop(id string) error
// Return a list of all running command IDs.
Running() ([]string, error)
}
A Client calls a remote agent (server) to execute commands.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cmd provides command file specs and structures used by an rce.Server.
|
Package cmd provides command file specs and structures used by an rce.Server. |
|
example
|
|
|
client
command
|
|
|
server
command
|
|
|
Package rce is a generated protocol buffer package.
|
Package rce is a generated protocol buffer package. |