CAUTION: The examples below are intended to be serve as general guidelines. Your platform or software version may differ, resulting in variations in images, screens, options, or other elements.
You can install a KVM Modular sensor in the following environments:
You will need:
Verify VM Capabilities
Before installing any software, verify whether the system has the VM capabilities required. This can be done from the command line.
cat /proc/cpuinfo | egrep"vmx|svm"
If no lines are listed then VM hardware support is not available. It must be enabled in the system BIOS.
If VM capability is not reported by this command, do not proceed until it is enabled.
Installing KVM and Linux Bridge Tools
The system requires KVM and Linux bridge tools. Install these as follows, depending on your version:
Ubuntu 16.04/18.04
sudo apt-get update
sudo apt-get install -y qemu-kvm libvirt-bin virtinst bridge-utils qemu-utils virtinst virt-viewer genisoimage net-tools cpu-checker
Ubuntu 20.04/22.04/24.04
sudo apt-get update
sudo apt-get install -y qemu-kvm libvirt-daemon-system libvirt-clients virtinst bridge-utils qemu-utils virt-viewer genisoimage net-tools cpu-checker
CentOS
yum install net-tools qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils
systemctl start libvirtd
systemctl enable libvirtd
Verify libvirt Daemon is Active
Use one of the following commands to verify that the libvirt daemon is active:
If libvirtd is not active, start it now with the following command:
sudo systemctl enable --now libvirtd
Installation instructions for Ubuntu 20.04/22.04/24.04:
This section describes how to install a modular sensor in an Ubuntu 20.04/22.04/24.04 environment. Note the following:
Check the Host Resources and Interfaces
Before you start installing the sensor, you should check the configuration of the host Ubuntu server's network interfaces as well as its available system resources. Use the following commands to check the current system resources:
You will need to take all these values under consideration when provisioning resources for the sensor VM later on.
Sample Host Configuration
For our sample installation, the host Ubuntu server has two physical network interfaces (ens160 and ens192) and will be configured as follows:
The figure below summarizes the sample host environment:
Create Bridges for Management and Traffic Monitoring
Use the following procedure to create bridges for management and traffic monitoring:
network:
ethernets:
ens160:
addresses:
- 10.33.2.99/24
gateway4: 10.33.2.1
nameservers:
addresses:
- 8.8.8.8
search: []
version: 2
network:
ethernets:
ens160:
dhcp4: no
dhcp6: no
addresses:
- 10.33.2.99/24
route:
- to: default
via: 10.33.2.1
nameservers:
addresses: [8.8.8.8, 8.8.4.4]
search: []
version: 2
network:
ethernets:
ens160:
dhcp4: true
version: 2
network:
ethernets:
ens160:
dhcp4: yes
dhcp6: no
version: 2
cd /etc/netplan
sudo cp 00-installer-config.yaml 00-installer-config.yaml.orig
Separate examples are provided below for both static IP and DHCP configurations in both Ubuntu 20.04 and Ubuntu 22.04 and later:
Static IP Address (Ubuntu 20.04)
Static IP Address (Ubuntu 22.04 and Later))
DHCP Address (Ubuntu 20.04)
DHCP Address (Ubuntu 22.04 and Later)
sudo netplan apply
root@ubuntu-20-04-kvm:$ brctl show
bridge name bridge id STP enabled interfaces
br0-aio 8000.000c29226a14 no ens160 <<< look here
br0-span 8000.000c29226a1e no ens192 <<<look here
virbr0 8000.525400221195 yes virbr0-nic
aella@ubuntu-20-04-kvm:~$ ip addr
...
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0-mgt state UP group default qlen 1000
link/ether 00:0c:29:22:6a:14 brd ff:ff:ff:ff:ff:ff
...
5: br0-aio: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:22:6a:14 brd ff:ff:ff:ff:ff:ff
inet 10.33.2.99/24 brd 10.33.2.255 scope global br0-mgt
valid_lft forever preferred_lft forever
inet6 fe80::402e:31ff:fe54:f037/64 scope link
valid_lft forever preferred_lft forever
6: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:22:6a:1e brd ff:ff:ff:ff:ff:ff
inet6 fe80::20c:29ff:fe22:6a1e/64 scope link
valid_lft forever preferred_lft forever
...
9: br0-span: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:0c:29:22:6a:1e brd ff:ff:ff:ff:ff:ff
inet6 fe80::88a9:c7ff:feb1:9fc/64 scope link
valid_lft forever preferred_lft forever
Download the Sensor Installation Script
Use the commands below to download the Modular Sensor image. Contact support for login credentials.
curl -k -u login:password https://acps.stellarcyber.ai/release/5.3.0/datasensor/virt_deploy_modular_ds.sh -o virt_deploy_modular_ds.sh
Use the file command to verify that the downloaded script is a Bourne-Again shell script. For example, for the Modular Sensor installation script:
aella@ubuntu-20-04-kvm:~$ file virt_deploy_modular_ds.sh
virt_deploy_modular_ds.sh: Bourne-Again shell script, ASCII text executable, with very long line
Download the Sensor Image
Use the commands below to download the Modular Sensor image. Contact support for login credentials.
To download the image for a Modular sensor:
curl -k -u login:password https://acps.stellarcyber.ai/release/5.3.0/datasensor/aella-modular-ds-5.3.0.qcow2 -o aella-modular-ds-5.3.0.qcow2
To verify the downloaded image is a QEMU QCOW2 image:
Use the file command to verify that the downloaded image is a QEMU QCOW2 image. For example, for the Modular Sensor image:
aella@ubuntu-20-04-kvm:~$ file aella-modular-ds-5.3.0.qcow2
aella-modular-ds-5.3.0.qcow2: QEMU QCOW2 Image (v2), 68718428160 bytes
Create Installation Directory for Virtual Machine
Use the following commands to create an installation directory for your virtual machine and move the image you downloaded in the previous section to it:
Default Directory | sudo mkdir -p /var/lib/libvirt/images/mds/images sudo mv aella-modular-ds-5.3.0.qcow2* /var/lib/libvirt/images/mds/images |
Non-Default Directory | sudo mkdir -p /stellar/mds/images sudo mv aella-modular-ds-5.3.0.qcow2* /stellar/mds/images/ |
Install the Sensor
This section describes how to install the sensor using the image and installation script you previously downloaded. Note the following regarding the example in this section:
The installation example at the end of this procedure provides the exact syntax to declare and pass these variables.
Variable
Comments
version=5.3.0
hostname=mds
Set as desired.
release=5.3.0
installdir=/var/lib/libvirt/images/mds
Set to match the directory where you copied the sensor image in the previous section.
cpus=16
memory=$(expr 32 \* 1024)
32GB
disksize=128 # VM disk size (e.g. DO NOT put G suffix)
nodownload=true
When set to true, the installation script does not download the sensor image but uses the one in the specified installdir.
bridge=br0-aio
Management bridge name.
ip=10.33.2.98
VM IP address.
netmask=255.255.255.0
VM netmask.
gw=10.33.2.1
VM default gateway.
dns=8.8.8.8
VM DNS server address.
printf "\n bash virt_deploy_modular_ds.sh -- --hostname=$hostname --release=$release --CPUS=$cpus --MEM=$memory --DISKSIZE=$disksize --installdir=$installdir --nodownload=$nodownload --bridge=$bridge --ip=$ip --netmask=$netmask --gw=$gw --dns=$dns \n"
bash virt_deploy_modular_ds.sh -- --hostname=$hostname --release=$release --CPUS=$cpus --MEM=$memory --DISKSIZE=$disksize --installdir=$installdir --nodownload=$nodownload --bridge=$bridge --ip=$ip --netmask=$netmask --gw=$gw --dns=$dns
If you already installed the libvirt-daemon-system daemon, you can ignore any errors similar to, "E: Package 'libvirt-bin' has no installation candidate".
Sample Syntax
aella@ubuntu-20-04-kvm:~# version=5.4.0
aella@ubuntu-20-04-kvm:~# hostname=mds
aella@ubuntu-20-04-kvm:~# release=$version
aella@ubuntu-20-04-kvm:~# installdir=/stellar/mds
aella@ubuntu-20-04-kvm:~# cpus=16
aella@ubuntu-20-04-kvm:~# memory=$(expr 32 \* 1024) # 32GB
aella@ubuntu-20-04-kvm:~# disksize=128 # VM disk size (e.g. DO NOT put G suffix)
aella@ubuntu-20-04-kvm:~# nodownload=true # skip to download the modular sensor image
aella@ubuntu-20-04-kvm:~#
aella@ubuntu-20-04-kvm:~# bridge=br0-aio # management bridge name
aella@ubuntu-20-04-kvm:~#
aella@ubuntu-20-04-kvm:~# ip=10.33.2.98 # VM IP address
aella@ubuntu-20-04-kvm:~# netmask=255.255.255.0 # VM IP netmask
aella@ubuntu-20-04-kvm:~# gw=10.33.2.1 # VM IP gateway
aella@ubuntu-20-04-kvm:~# dns=8.8.8.8 # VM DNS server address
aella@ubuntu-20-04-kvm:~# printf "\n bash virt_deploy_modular_ds.sh -- --hostname=$hostname --release=$release --CPUS=$cpus --MEM=$memory --DISKSIZE=$disksize --installdir=$installdir --nodownload=$nodownload --bridge=$bridge --ip=$ip --netmask=$netmask --gw=$gw --dns=$dns \n"
bash virt_deploy_modular_ds.sh -- --hostname=mds --release=5.4.0 --CPUS=8 --MEM=32768 --DISKSIZE=128 --installdir=/stellar/mds --nodownload=true --bridge=br0-aio --ip=10.33.2.98 --netmask=255.255.255.0 --gw=10.33.2.1 --dns=8.8.8.8
aella@ubuntu-20-04-kvm:~# bash virt_deploy_modular_ds.sh -- --hostname=$hostname --release=$release --CPUS=$cpus --MEM=$memory --DISKSIZE=$disksize --installdir=$installdir --nodownload=$nodownload --bridge=$bridge --ip=$ip --netmask=$netmask --gw=$gw --dns=$dns
Changing memory to user customized memory + 32768
Changing cpu to user customized cpu size + 16
Wed, 17 Aug 2022 00:52:31 +0000 Destroying the mds domain (if it exists)...
/stellar/mds/images/aella-modular-ds-5.4.0.qcow2: OK
Checksum for /stellar/mds/images/aella-modular-ds-5.4.0.qcow2 success
Wed, 17 Aug 2022 00:52:34 +0000 Converting Qcow2 image to RAW format...
WARNING: Image format was not specified for 'mds.raw' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
Image resized.
image: mds.raw
file format: raw
virtual size: 128 GiB (137438953472 bytes)
disk size: 2.22 GiB
Wed, 17 Aug 2022 00:52:38 +0000 Installing the domain and adjusting the configuration...
Starting install...
Domain creation completed.
checking host 10.33.2.98
Fail to ping host 10.33.2.98
Waiting for ssh ready.
.ssh - ok
\n
Domain mds defined from domain-xml
Gen uninstall scripts...
Check Host health again after restarting...
checking host 10.33.2.98
ping host - ok
Waiting for ssh ready.
ssh - ok
\n
Wed, 17 Aug 2022 00:53:34 +0000 SSH to mds using 10.33.2.98 with username 'aella'.
Attach a virtual interface to Modular Sensor VM and connect it to the traffic monitoring bridge (br0-span)
virsh attach-interface --domain $hostname --type bridge --source $spanbr --model virtio --config --live --persistent
Set the $hostname to the name you specified for your sensor VM during deployment (mds in this example).
root@ubuntu-20-04-kvm:# virsh domiflist mds
Interface Type Source Model MAC
-------------------------------------------------------------
vnet0 bridge br0-aio virtio 52:54:00:f3:3a:63
vnet1 bridge br0-span virtio 52:54:00:38:11:80 <<< LOOK HERE
Disable TSO on Traffic Mirroring Interface
Modify the qemu script to disable TCP Segmentation Offload (TSO) on the traffic mirroring interface. You will need both the name of your VM (mds in our example) and the name of the interface (ens192 in our example) to make these modifications. If you used other values, change the values in bold in the script below to match your own deployment.
cd /etc/libvirt/hooks
cp qemu qemu.bak
#!/bin/bash
# aella_hook_ds_span_mds_start
if [ "${1}" = "mds" ]; then
if [ "${2}" = "start" ] || [ "${2}" = "reconnect" ]; then
i=0
str="ens192"
for port in $str
do
spanbr="br""${i}""-span"
brctl setfd $spanbr 0
brctl setageing $spanbr 0
ethtool -K $port lro off
ethtool -K $port gro off
i=`expr $i + 1`
done
fi
fi
# aella_hook_ds_span_mds_end
virsh shutdown mds
virsh start mds
Installation instructions for Ubuntu Server 16.04, 18.04, or CentOS 7.3:
Installation Steps: Bridge Mode
Create Bridge
This process creates a Linux bridge named br-aio to be used by the sensor. The installation script takes an existing, configured port and transfers its settings (IP address) to the bridge interface. The VM itself requires a new IP address in the same subnet.
Skip this section if the bridge has already been created due to a prior installation of a Stellar Cyber sensor or data processor (DP).
Contact support for login credentials.
To get a helper script that will create the Linux bridge, use the following curl command:
curl -k -u login:password https://acps.stellarcyber.ai/release/5.3.0/dataprocessor/create_bridge.sh -o create_bridge.sh
The script is executed as follows. In this example the host port eno1 is used. Substitute the correct interface name when used.
bash create_bridge.sh eno1
Because this script reconfigures the network, any connection that uses the network port may become non-responsive for some period of time. This includes the shell session that is executing this procedure if the user is using SSH via the named port. The script will ask for confirmation that this is acceptable.
Install Sensor VM
Contact support for login credentials.
To get the installation script for a modular sensor:
curl -k -u login:password https://acps.stellarcyber.ai/release/5.3.0/datasensor/virt_deploy_modular_ds.sh -o virt_deploy_modular_ds.sh
To complete the installation where the sensor will obtain its management IP address from a DHCP server use the following command. Substitute the desired value in place of ds1 for the hostname.
sudo bash virt_deploy_device_ds.sh -- --hostname=ds1 --release=5.3.0 --span=eno2 --feature=mds --bridge=br0-aio
or
sudo bash virt_deploy_modular_ds.sh -- --hostname=ds1 --release=5.3.0 --span=eno2 --feature=mds --bridge=br0-aio
To configure a static IP address, use the following command:
sudo bash virt_deploy_device_ds.sh -- --hostname=ds1 --release=5.3.0 --bridge=br0-aio|<bridgename> [--ip=192.168.1.223] [--netmask=<netmask>] [--gw=192.168.1.1] [--dns=8.8.8.8] [--dns-search=example.com] [--installdir=<imagedir>] [--span=eno2] --feature=nds
or
sudo bash virt_deploy_modular_ds.sh -- --hostname=ds1 --release=5.3.0 --bridge=br0-aio|<bridgename> [--ip=192.168.1.223] [--netmask=<netmask>] [--gw=192.168.1.1] [--dns=8.8.8.8] [--dns-search=example.com] [--installdir=<imagedir>] [--span=eno2] --feature=nds
The command parameters can be supplied as follows. Note the presence of the -- string in the first parameter position. This is required by the script.
When the script is executed it will download and install the VM, and create a Linux bridge of the name aio-span. The ports in the --span parameter will be added.
Installation Steps: NAT Mode
The process for installation in NAT mode is the same as for bridge mode except that the create bridge.sh script is not run. Instead the VM will connect to the virbr0 bridge that was created by the KVM installation.
The ip and associated parameters will be set to a desired private address.
You must provide the necessary NAT services either through the host iptables system or externally to the box.
To connect the sensor to the Stellar Cyber Platform:
Once complete, please reply to your engineer’s email with the following information so we can confirm that we are seeing the sensor and authorize it.
Sensor Details