Flussonic Media Server documentation

Contents

Securing Flussonic

In this section you will learn how to limit access to the Flussonic administration panel.
Very important! If hackers get access to your Flussonic administration UI, they will be able to read and modify and file on disk.

Login and password

Flussonic allows you to set two types of access in config: view_auth и edit_auth.

  • view_auth user password; is used for access to readonly API Flussonic functions: getting streams info, status, and statistics.

  • edit_auth user password; is used for full access to Flussonic.

Limiting access by an IP address

Tp restrict access by IP address, enable white list mode in the configuration file:

api_allowed_from 10.0.0.0/8 192.168.4.15;

A separate IP port for HTTP API

You can assign a separate IP port for HTTP API:

admin_http 8090;
admin_http 127.0.0.1:8091;
admin_https 8092;

Now the administrator UI and HTTP API are available only via these ports.

In cluster configuration, for the node with admin_http(s) enabled, you must specify these ports in peer and source directives.

SSL certificates

In order to switch the administrator's web interface to HTTPS, you need to enable the port for HTTPS in the Flussonic configuration. Open the web interface and specify the port for HTTPS in Config > SSL-tunneled protocols, for example, 443.

You can generate your own SSL certificate. To do so, use openssl commands and type the password flussonic for key and certificate generation. Then put the resulting files to /etc/flussonic (/etc/flussonic/flussonic.crt and /etc/flussonic/flussonic.key).

Below are commands that you should run one by one to generate a Flussonic's own self-signed certificate.

Each time the system prompts you to enter the password for the sertificate, type flussonic.

openssl genrsa -des3 -out flussonic.key 1024

openssl req -new -key flussonic.key -out flussonic.csr

mv flussonic.key flussonic.key.org

openssl rsa -in flussonic.key.org -out flussonic.key

openssl x509 -req -days 365 -in flussonic.csr -signkey flussonic.key -out flussonic.crt

Intermediate and CA certificates will be taken from /etc/flussonic/flussonic-ca.crt.

For the most recent OpenSSL commands description, refer to the manual pages in the OpenSSL documentation.

LetsEncrypt certificates

LetsEncrypt is offering free SSL certificates with 1-month expiration since April 2016. The certificate is issued in automatic mode.

We have added the support for LetsEncrypt into Flussonic. How to setup LetsEncrypt

Protecting configuration file

You can prevent the configuration file from being modified via the API (web interface). JFor this you should create the file /etc/flussonic/flussonic.conf.locked by executing the following command:

touch /etc/flussonic/flussonic.conf.locked

With this file in place nobody will be able to change Flussonic settings via the web UI.

Running Flussonic as an unprivileged user

You can run Flussonic as an unprivileged user. Run the following commands:

adduser flussonic --home /var/lib/flussonic --disabled-password
chown -R flussonic /etc/flussonic/
chown -R flussonic /var/lib/flussonic/
echo flussonic > /etc/flussonic/run_as
chown root /etc/flussonic/run_as
chmod 0644 /etc/flussonic/run_as
chown -R flussonic /var/run/flussonic /var/log/flussonic /opt/flussonic/.erlang.cookie
setcap cap_net_bind_service=+ep /opt/flussonic/lib/erlang/erts-*/bin/beam.smp

To make Flussonic run as 'root' again, delete the file /etc/flussonic/run_as.

Activating Flussonic via SOCKS5 proxy

Flussonic can use the SOCKS5 proxy server to communicate with the license server. To enable it, use the systemd's override mechanism:

# systemctl edit flussonic

This command opens a text editor (nano by default). Add these lines in the opened file:

[Service]
Environment=PROXY="socks5://172.20.10.1:1080"

Press Ctrl-X, then Y to save and exit.

Restart Flussonic:

# /etc/init.d/flussonic restart`

Now Flussonic will use the configured proxy to communicate with the license server.

Protecting video from viewing by the administrator

By default, the users with Flussonic administrator rights can play back any stream by using the administration UI. The special administrator's authorization token is used for that.

You may want to prohibit viewing some streams by the administrator — streams protected by authorization.

To prevent the Flussonic administrator from playing back any stream that needs authorization:

  1. Edit Flussonic service unit file (/lib/systemd/system/flussonic.service) — do it by using the systemd's override mechanism.

    # systemctl edit flussonic
    

    This command opens a text editor (nano by default).

  2. Add these lines:

    [Service]
    `Environment=ADMIN_VIEW_DISABLE=true`
    

    Press Ctrl-X, then Y to save and exit.

  3. Restart Flussonic:

    # /etc/init.d/flussonic restart
    

Now if a stream requires authorization, the player in the Flussonic UI will return a 403 error at the attempts to play the stream back with an administrator's token.

Streams without configured authorization will be played back as usual.