This Proxy has beed developed as a result of non-suitable architecture design of the escape-pod and its extensions (this issue). It resolves the problem of need for having multiple clients/extensions conneted to the same escape pod, by creating an additional communication layer, implemented as server-side event streaming service which fires the intent events generated by the escape-pod to all of its subscribed client. Additionally, this proxy also contains an gRPC interface for realtime manipulation of the Escapepod MongoDB intent database, to satisfy the need for dynamic creattion of the intent definitions.
This proxy has been implemented in EscapePod Python SDK and the Cyb3rVector CodeLab application, where the blockly code programs capabilities has been extended with ability to dynamically create an intents with given keywords and phrases and to react to them in the blockly code, by handing the events received from this proxy.
It's use however is not limited to this application and can be used anywhere, wherever there is a need for reacting or altering the escapepod extend intents
client-side.
This repository contains two main branches:
- MASTER - This Extension Proxy, written in go-lang
- Cyb3rPod - Default simple client implementation in c#
This diagram describes the architecture of the orginal escapepod extensibility implementation and its flaws:
Following diagram describes the difference of how the escapepod extensibility has been implemented for the needs of the Cyb3rVector, where the unary grpc server calls are transposed into the gRPC event stream:
This proxy consists of three main submodules:
- ProxyClient - gRPC server handling incomming connection from the Escapepod
- ProxyServer - gRPC server handling connection from clients, notifying them about intent events.
- MongoClient - MongoDB client allowing realtime intent database manipulation
Note: Escapepod binary itself surelly does already contain the interface for the mongoDB intent database manipulation (creating/editing/deleting intents), as this functionality is available in the Escapepod WebUI, but because of the lack of the techincal documentation, it was much easier and quicker to just implement the own custom MongoClient.
This section describes how to build this extension proxy
- Export the related environment variables
Variable | Value | Description |
---|---|---|
CYB3RVECTOR_PROXY_CLIENT_PORT | 8089 | the TCP port the cybervector-proxy connects to escape-pod |
CYB3RVECTOR_PROXY_CLIENT_INSECURE | true | Insecure TLS-free GRPC communication |
CYB3RVECTOR_PROXY_CLIENT_CLIENT_AUTHENTICATION | NoClientCert | Insecure TLS-free GRPC communication |
CYB3RVECTOR_PROXY_SERVER_PORT | 8090 | the TCP port the cybervector-proxy publishes events to clients |
CYB3RVECTOR_PROXY_SERVER_INSECURE | true | Insecure TLS-free GRPC communication |
CYB3RVECTOR_PROXY_SERVER_CLIENT_AUTHENTICATION | NoClientCert | Insecure TLS-free GRPC communication |
- Build the
cybervector-proxy
service binary file
- Linux:
$ make build
- Windows:
build.cmd
The Cyb3rVector application contains an automatic mechanism for deployment of this extension proxy to the EscapePod server.
For the insight how this deployment works, check the sh
script in the Cyb3rPod branch.
This section describes how to deploy the Cyb3rVector Escape-Pod Proxy service to your Escape-Pod.
- Make sure you've added the following lines to your escape pods config (in /etc/escape-pod.conf)
ENABLE_EXTENSIONS=true
ESCAPEPOD_EXTENDER_TARGET=127.0.0.1:8089
ESCAPEPOD_EXTENDER_DISABLE_TLS=true
- Deploy the
cybervector-proxy
binary to your escape pod (i.e /usr/local/escapepod/bin/) - Create service, to run the service during EscapePod boot with all the enviroment varibles initialized (example service here)
- Restart the services / or your Escape-Pod
- Try out the Cyb3rPod client, Cyb3rVector CodeLab or EscapePod Python SDK!
You can test your build either locally, from the enviroment you develope in, or from the docker.
- IP Address
For any case, you need to know the IP address of the machine the extension service will run on, and
modify the ESCAPEPOD_EXTENDER_TARGET
variable in your /etc/escape-pod.conf
file correspondingly.
- Start your application!