Skip to main content

Arbitrium Sidecar Agent

ASA is the agent used to collect telemetry from within your game server. It does not require any modification to the game server itself. It will simply tap the network interface within the container to track per player stream of communication. It can also be used to tap non-player communication. The following procedure describes how to add this agent to your game server and onto Arbitrium.

The binary package will be sent securely by Edgegap.

Prerequisites#

  • Being Admin or ROOT in the container (since we use RAW Packet)
  • Ubuntu/Centos based image. While this may work with other images, this would need to be tested. We can compile the agent for another release specific OS; please contact Edgegap with your requirements.
  • Optional: Have NMAP installed for Stealth TCP SYN/ACK Ping
  • Optional: “supervisord” package in your container to use as an entry point.

Step 1:#

Add the binary agent file to your container. You can “ADD” or “COPY” the file in your Dockerfile. Refer to the example below if you need assistance to put the file in your container image.

The file will need execution access to be executed.

Step 2:#

Modify your Dockerfile to include executing the asa_agent without any arguments. Those arguments needed will be passed by Arbitrium when starting the containers through environment variables. You can see the list below for your information or if you want to test asa_agent manually. To see if the agent works, you can run it within your container with “./asa_agent -vvv” . In the example below, we use “supervisord” to start both our asa agent and the game server process at the end of the Dockerfile.

Step 3:#

Once you can manually execute your container image and your game servers run properly along with asa agent, you can provision Arbitrium through the dashboard with your new release. Follow the steps in the dashboard section of this documentation. Make sure your application in the dashboard has the Telemetry knob set to “activated.” Once done, you can request an instance of this game server, and the telemetry tab will show in real-time players connecting to this instance.

img

Manual tests#

Copy the binary and start in parallel with your Application.

Example of running the binary alone with console monitoring

export ASA_PORTS=25565,25575
export ASA_DESTINATIONS=76.69.195.150
./asa_agent -vvv

or

./asa_agent -vvv -p 25565 -p 25575 -d 76.69.195.150

To Start the Process without the graphical Console. remove the “-vvv”

Example of the screen you are supposed to see:

--- Arbitrium Sidecar Agent on devops ---
Active Listener On Receiving Communication TO (SERVER):
- INCOMING --> ::1
- INCOMING --> 127.0.0.1
Active Listener On Incoming Communication FROM (INCOMING):
- * --> SERVER
Active Listener On PORT:
- Incoming --> *:*
Active Listener On PORT:
----------------------------------------------
The Reply URL is not set - No Data will be send
The Refresh rate of Data Gathering is every 10 seconds
----------------------------------------------
---- Connections ----
Player: 165.22.232.69:22 [96:4b:48:8b:70:f5] ---> Server: 24.200.71.207:60475 [fe:0:0:0:1:1] --- )
---- Messages ----
NEW CONNECTION --> Player: 165.22.232.69:22 [96:4b:48:8b:70:f5] ---> Server: 24.200.71.207:60475 [fe:0:0:0:1:1]

Examples (using the binary file)#

Teeworlds example#

Example of Dockerfile with Teeworlds Server and “supervisord“ (two parallel deployments)

In this example, we override the ENTRYPOINT to allow “supervisord“ to start both processes

Dockerfile

FROM riftbit/teeworlds #From your existing container
USER root
COPY /path/to/the/binary/file /opt/asa # Copy the binary to the path you will start with supervisord
RUN apt-get update
RUN apt-get install nmap supervisor -y
COPY images/teeworlds-python/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ENTRYPOINT []
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]

supervisord.conf

[supervisord]
nodaemon=true
user=root
[program:asa]
command=/opt/asa/asa
user=root
[program:teeworlds]
command=/docker-entrypoint.sh start # Copy the start command of your existing container CMD or ENTRYPOINT
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
user=root

CSGO example#

Dockerfile

FROM ubuntu:16.04
MAINTAINER Mathieu Duperre <mathieu.duperre@gmail.com>
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN rm /var/cache/debconf/* #no wories it's just a cache folder
RUN apt-get update
RUN dpkg --add-architecture i386
RUN apt-get update && apt-get install -y apt-transport-https
RUN apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y lib32gcc1 libc6-i386 wget lib32stdc++6 wget nmap supervisor
RUN apt-get install -y libtinfo5:i386 libncurses5:i386 libcurl3-gnutls:i386
RUN useradd -ms /bin/bash steam
WORKDIR /home/steam
USER steam
RUN wget http://media.steampowered.com/installer/steamcmd_linux.tar.gz
RUN tar -xvzf steamcmd_linux.tar.gz
# Install CSGO once to speed up container startup
RUN ./steamcmd.sh +login anonymous +force_install_dir ./csgo +app_update 740 validate +quit
ENV CSGO_HOSTNAME Counter-Strike Source Dedicated Server
ENV PUBLIC_IP ""
ENV PRIVATE_IP ""
ENV STEAM_ACCOUNT_TOKEN ""
EXPOSE 27015/udp
EXPOSE 27015
USER root
RUN mkdir /home/steam/.steam/sdk32
RUN ln -s /home/steam/csgo/bin/steamclient.so /home/steam/.steam/sdk32/steamclient.so
USER steam
ADD ./csgo_entrypoint.sh csgo_entrypoint.sh
USER root
ADD ./asa_agent asa_agent
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN ["chmod", "775", "./asa_agent"]
RUN ["chmod", "775", "./csgo_entrypoint.sh"]
#USER steam
#CMD ./csgo_entrypoint.sh
CMD ["/usr/bin/supervisord","-c","/etc/supervisor/conf.d/supervisord.conf"]

Supervisord.conf

[supervisord]
nodaemon=true
user=root
[program:asa]
command=/home/steam/asa_agent
user=root
[program:csgo]
command=/home/steam/csgo_entrypoint.sh # Copy the start command of your existing container CMD or ENTRYPOINT
#stdout_logfile=/dev/fd/1
#stdout_logfile_maxbytes=0
user=steam

Example (using the python agent)#

Minecraft Server Running on the public IP 76.69.195.150, listening to PORT TCP/25565 and TCP/25575 for RECON

You would like to have ASA running on the machine running the Server as root or admin.

# with ENV
export ASA_PORTS=25565,25575
export ASA_DESTINATIONS=76.69.195.150
python run.py
 
# with Args
python run.py -p 25565 -p 25575 -d 76.69.195.150

To have ASA listening to ALL Source and ALL Destination on Port 80 every 45 seconds and replying the data back to your API https://your.api:5000/v1/example

# with ENV
export ASA_PORTS=80
export ASA_TICK_RATE=45
export ASA_REPLY_URL=https://your.api:5000/v1/example
python run.py
 
# with Args
python run.py -p 80 -t 45 -r https://your.api:5000/v1/example

Environment Variables#

You do not have to configure any of those variables in your container image/Docker file. You do not have to configure those either in Arbitrium when creating your application. Those variables will be automatically created and pushed once you activate telemetry in Arbitrium for your application.

ASA_PORTS - Allow specifying the Destination Ports to Listen to, chain them with ‘,’. Default: * (All Ports)

# We strongly recommend to override this one since All Ports can be a lot of Traffic
ASA_PORTS=80,443,8080

ASA_SOURCES - Allow specifying the Source IP to Listen to, chain them with ‘,’.
Default: * (All Sources)

ASA_SOURCES=1.2.3.4,8.8.8.8,127.0.0.1

ASA_DESTINATIONS - Allow to specify the Destination IP to Listen to, chain them with ‘,’.
Default: * (All Destinations)

ASA_DESTINATIONS=4.3.2.1,4.4.4.4,localhost

ASA_REPLY_URL - Allow specifying the Reply URL to send back the Telemetry Data to an External API.
Default: None (Disable the Sending of Data)

ASA_REPLY_URL=https://api.example.com/v1/url

ASA_TICK_RATE - Allow specifying the Speed in the Seconds of the refresh.
Default: 30 seconds

# Every Minute would result in
ASA_TICK_RATE=60

ASA_ENABLED - Allow specifying if the Listening Server

ASA_ENABLED=true

ASA_MAX_DELAY- Timeout in seconds before dropping an inactive connection

ASA_MAX_DELAY=3