{"id":13616,"date":"2022-08-03T23:27:03","date_gmt":"2022-08-03T20:27:03","guid":{"rendered":"https:\/\/kifarunix.com\/?p=13616"},"modified":"2024-03-09T21:03:29","modified_gmt":"2024-03-09T18:03:29","slug":"install-malcolm-network-traffic-analysis-tool-on-ubuntu","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-malcolm-network-traffic-analysis-tool-on-ubuntu\/","title":{"rendered":"Install Malcolm Network Traffic Analysis Tool on Ubuntu 22.04"},"content":{"rendered":"\n
Follow through this tutorial to learn how to install Malcolm network traffic analysis tool on Ubuntu 22.04. Malcolm<\/a> is a network traffic analysis tool suite for full packet capture artifacts (PCAP files) and Zeek logs. The PCAP files or Zeek logs can be uploaded to Malcolm via browser, forwarded via the forwarders or can capture live traffic, parses and normalize the traffic for visualization via OpenSearch dashboards or Arkime<\/a>.<\/p>\n\n\n\n Read more about Malcolm network traffic analysis tool and its features on their page.<\/p>\n\n\n\n Malcolm provides scripts that can be used to easy deploy them on a Linux system.<\/p>\n\n\n\n There are two ways in which you can obtain the Malcolm installation script.<\/p>\n\n\n\n In this tutorial, we will use the second method to install Malcolm.<\/p>\n\n\n\n Check Malcolm deployment system requirements.<\/a><\/p>\n\n\n\n In our environment, these are the system resources we are using;<\/p>\n\n\n\n CPU cores;<\/p>\n\n\n\n RAM;<\/p>\n\n\n\n Disk Space;<\/p>\n\n\n\n Create an account to run Malcolm with;<\/p>\n\n\n\n Get the ID of the user as this is required while configuring Malcolm below.<\/p>\n\n\n\n Sample output;<\/p>\n\n\n\n Ensure system package cache is up-to-date.<\/p>\n\n\n\n You will need git to clone the Malcolm Github repository<\/p>\n\n\n\n Run the command below to clone Malcolm Github repository;<\/p>\n\n\n\n Next, change into cloned Malcolm Github repository directory;<\/p>\n\n\n\n Malcolm installation scripts are located under scripts directory. Thus, to launch the installation, execute the command below.<\/p>\n\n\n\n Malcolm runs atop Docker. Thus, when the script runs;<\/p>\n\n\n\n Once the install script above completes, proceed to configure Malcolm;<\/p>\n\n\n\n When configuration starts;<\/p>\n\n\n\n Confirm;<\/p>\n\n\n\n Choose when to restart Malcolm. You have four options here; no, on-failure, always, unless-stopped<\/strong>. Choose the default option, unless-stopped<\/strong>.<\/p>\n\n\n\n Malcolm has now been installed to \/home\/$USER\/Malcolm.<\/p>\n\n\n\n Scripts for starting and stopping Malcolm and changing authentication-related settings can be found in \/home\/$USER\/Malcolm\/scripts.<\/p>\n\n\n\n Run system reboot to apply some of the system changes;<\/p>\n\n\n\n Navigate back to the Malcolm Github repository directory;<\/p>\n\n\n\n Run the authentication setup script;<\/p>\n\n\n\n Next, run the command below to download Malcolm Docker images from the Docker hub.<\/p>\n\n\n\n Depending on your internet speed, this may take a few mins to complete pulling the images.<\/p>\n\n\n\n Once all the required images are downloaded, you can list them as follow;<\/p>\n\n\n\n Sample output;<\/p>\n\n\n\n You can now start Malcolm services using the startup script, The script can be used to start, stop, restart, wipe Malcolm data, etc.<\/p>\n\n\n\n You can simply start Malcolm by executing the start script with no arguments.<\/p>\n\n\n\n It will take a few minutes to start all necessary Malcolm services.<\/p>\n\n\n\n The start script will launch Malcolm in the foreground and populate debug messages to the console.<\/p>\n\n\n\n Press Ctrl+z<\/strong> to run Malcolm in the background. You can always bring it to foreground by just typing fg<\/strong>.<\/p>\n\n\n\n Check the status of Malcolm containers;<\/p>\n\n\n\n Quite a number of ports have been exposed;<\/p>\n\n\n\n You can therefore access various Malcolm services via browser (You can replace the localhost with your system IP address)<\/strong>;<\/p>\n\n\n\n Malcolm Arkime Web Interface<\/p>\n\n\n\n OpenSearch dashboard<\/p>\n\n\n\n Malcolm Capture File and Log Archive Upload page;<\/p>\n\n\n\n Host and Network Segment Name Mapping;<\/p>\n\n\n\n Account Management;<\/p>\n\n\n\n You can now start to analyse your network traffic using Malcolm.<\/p>\n\n\n\n For now, that is just what it takes to install Malcolm network traffic analysis tool on Ubuntu 22.04.<\/p>\n\n\n\n See how to analyze pcap file using Malcolm;<\/p>\n\n\n\n Analyze PCAP Files using Malcolm Network Traffic Analysis tool<\/a><\/p>\n\n\n\n Further reading.<\/p>\n\n\n\n Malcolm QuickStart<\/a><\/p>\n\n\n\n Install Arkime (Moloch) Full Packet Capture tool on Debian 11<\/a><\/p>\n\n\n\nInstall Malcolm on Ubuntu 22.04<\/h2>\n\n\n\n
\n
install.py<\/code> and the
malcolm_YYYYMMDD_HHNNSS_xxxxxxx.tar.gz<\/code> from the Malcolm Github releases page.<\/a><\/li>\n\n\n\n
System Requirements<\/h3>\n\n\n\n
sudo dmidecode -t 4 | grep -i 'core count'<\/code><\/pre>\n\n\n\n
\tCore Count: 4<\/code><\/pre>\n\n\n\n
free -h<\/code><\/pre>\n\n\n\n
total used free shared buff\/cache available\nMem: 15Gi 14Gi 153Mi 7.0Mi 723Mi 372Mi\nSwap: 0B 0B 0B\n<\/code><\/pre>\n\n\n\n
df -hT -P \/<\/code><\/pre>\n\n\n\n
Filesystem Type Size Used Avail Use% Mounted on\n\/dev\/sda1 ext4 150G 14G 131G 10% \/<\/code><\/pre>\n\n\n\n
Create Malcolm System Account<\/h3>\n\n\n\n
useradd -m -d \/opt\/malcolm -s \/bin\/bash -G sudo malcolm<\/code><\/pre>\n\n\n\n
passwd malcolm<\/code><\/pre>\n\n\n\n
id malcolm<\/code><\/pre>\n\n\n\n
uid=1001(malcolm) gid=1001(malcolm) groups=1001(malcolm),27(sudo)<\/code><\/pre>\n\n\n\n
Run system update;<\/h3>\n\n\n\n
sudo apt update<\/code><\/pre>\n\n\n\n
Install Git package on Ubuntu 22.04;<\/h3>\n\n\n\n
sudo apt install git<\/code><\/pre>\n\n\n\n
Clone Malcolm Github Repository<\/h3>\n\n\n\n
su - malcolm<\/code><\/pre>\n\n\n\n
git clone https:\/\/github.com\/idaholab\/Malcolm<\/code><\/pre>\n\n\n\n
Install Required Malcolm Packages and Setup System Tunables<\/h3>\n\n\n\n
cd Malcolm<\/code><\/pre>\n\n\n\n
sudo .\/scripts\/install.py<\/code><\/pre>\n\n\n\n
\n
Installing required packages: ['apache2-utils', 'make', 'openssl', 'python3-dialog']\n\n\"docker info\" failed, attempt to install Docker? (Y\/n): y\n\nAttempt to install Docker using official repositories? (Y\/n): y\nInstalling required packages: ['apt-transport-https', 'ca-certificates', 'curl', 'gnupg-agent', 'software-properties-common']\nInstalling docker packages: ['docker-ce', 'docker-ce-cli', 'containerd.io']\nInstallation of docker packages apparently succeeded\n\nAdd a non-root user to the \"docker\" group?: y\n\nEnter user account: kifarunix \n\nAdd another non-root user to the \"docker\" group?: no\n\n\"docker-compose version\" failed, attempt to install docker-compose? (Y\/n): y\n\nInstall docker-compose directly from docker github? (Y\/n): y\nDownload and installation of docker-compose apparently succeeded\n...\n<\/code><\/pre>\n\n\n\n
\n
fs.file-max increases allowed maximum for file handles\nfs.file-max= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nfs.inotify.max_user_watches increases allowed maximum for monitored files\nfs.inotify.max_user_watches= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nfs.inotify.max_queued_events increases queue size for monitored files\nfs.inotify.max_queued_events= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nfs.inotify.max_user_instances increases allowed maximum monitor file watchers\nfs.inotify.max_user_instances= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nvm.max_map_count increases allowed maximum for memory segments\nvm.max_map_count= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nnet.core.somaxconn increases allowed maximum for socket connections\nnet.core.somaxconn= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nvm.swappiness adjusts the preference of the system to swap vs. drop runtime memory pages\nvm.swappiness= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nvm.dirty_background_ratio defines the percentage of system memory fillable with \"dirty\" pages before flushing\nvm.dirty_background_ratio= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\nvm.dirty_ratio defines the maximum percentage of dirty system memory before committing everything\nvm.dirty_ratio= appears to be missing from \/etc\/sysctl.conf, append it? (Y\/n): y\n\n\n\/etc\/security\/limits.d\/limits.conf increases the allowed maximums for file handles and memlocked segments\n\/etc\/security\/limits.d\/limits.conf does not exist, create it? (Y\/n): y\n<\/code><\/pre>\n\n\n\n
\n
Run Malcolm System Configurations<\/h3>\n\n\n\n
sudo .\/scripts\/install.py --configure<\/code><\/pre>\n\n\n\n
\n
Malcolm processes will run as UID 1000 and GID 1000. Is this OK? (Y\/n): n<\/strong><\/code><\/pre>\n\n\n\n
\n
Enter user ID (UID) for running non-root Malcolm processes; 1001<\/code><\/pre>\n\n\n\n
Enter group ID (GID) for running non-root Malcolm processes; 1001<\/code><\/pre>\n\n\n\n
Malcolm processes will run as UID 998 and GID 998. Is this OK? yes<\/strong><\/code><\/pre>\n\n\n\n
\n
Setting 10g for OpenSearch and 3g for Logstash. Is this OK? yes<\/strong><\/code><\/pre>\n\n\n\n
Setting 3 workers for Logstash pipelines. Is this OK? (Y\/n): yes<\/strong><\/code><\/pre>\n\n\n\n
\n
Restart Malcolm upon system or Docker daemon restart? Yes<\/code><\/pre>\n\n\n\n
\n
\/opt\/malcolm\/<\/strong><\/code>.<\/li>\n\n\n\n
not port 9200 and not port 5044 and not port 8005<\/code><\/strong>.<\/li>\n\n\n\n
sudo systemctl reboot -i<\/code><\/pre>\n\n\n\n
Create Malcolm User Account<\/h3>\n\n\n\n
su - malcolm<\/code><\/pre>\n\n\n\n
cd ~\/Malcolm<\/code><\/pre>\n\n\n\n
.\/scripts\/auth_setup<\/code><\/pre>\n\n\n\n
\n
Download Malcolm Docker Images<\/h3>\n\n\n\n
cd ~\/Malcolm<\/code><\/pre>\n\n\n\n
docker-compose pull<\/code><\/pre>\n\n\n\n
docker images<\/code><\/pre>\n\n\n\n
REPOSITORY TAG IMAGE ID CREATED SIZE\nmalcolmnetsec\/zeek 6.1.0 f866620ebd58 3 weeks ago 1.29GB\nmalcolmnetsec\/dashboards 6.1.0 13775018c809 3 weeks ago 1.08GB\nmalcolmnetsec\/arkime 6.1.0 5b7f6018db22 3 weeks ago 794MB\nmalcolmnetsec\/logstash-oss 6.1.0 a8b93b43dbb3 3 weeks ago 1.46GB\nmalcolmnetsec\/suricata 6.1.0 fa25601e29c4 3 weeks ago 285MB\nmalcolmnetsec\/filebeat-oss 6.1.0 b4d1c83bf3de 3 weeks ago 648MB\nmalcolmnetsec\/file-monitor 6.1.0 fa9438234b42 3 weeks ago 589MB\nmalcolmnetsec\/nginx-proxy 6.1.0 bb9720d9d456 3 weeks ago 124MB\nmalcolmnetsec\/file-upload 6.1.0 fdbd62ce5a92 3 weeks ago 259MB\nmalcolmnetsec\/htadmin 6.1.0 623e193fd419 3 weeks ago 242MB\nmalcolmnetsec\/opensearch 6.1.0 a1bbcaae7647 3 weeks ago 1.21GB\nmalcolmnetsec\/pcap-monitor 6.1.0 0e0cb91f32a1 3 weeks ago 214MB\nmalcolmnetsec\/api 6.1.0 54a99d983b37 3 weeks ago 173MB\nmalcolmnetsec\/pcap-capture 6.1.0 9a1664dc488f 3 weeks ago 121MB\nmalcolmnetsec\/freq 6.1.0 e4691604218f 3 weeks ago 131MB\nmalcolmnetsec\/dashboards-helper 6.1.0 ef14087c003d 3 weeks ago 169MB\nmalcolmnetsec\/name-map-ui 6.1.0 90f49b94bfe3 3 weeks ago 123MB\n<\/code><\/pre>\n\n\n\n
Running Malcolm Service<\/h3>\n\n\n\n
.\/scripts\/start<\/code><\/strong>.<\/p>\n\n\n\n
.\/scripts\/start --help<\/code><\/pre>\n\n\n\n
\nusage: start
.\/scripts\/start<\/code><\/pre>\n\n\n\n
Started Malcolm\n\n\nIn a few minutes, Malcolm services will be accessible via the following URLs:\n------------------------------------------------------------------------------\n - Arkime: https:\/\/localhost\/\n - OpenSearch Dashboards: https:\/\/localhost\/dashboards\/\n - PCAP upload (web): https:\/\/localhost\/upload\/\n - PCAP upload (sftp): sftp:\/\/username@127.0.0.1:8022\/files\/\n - Host and subnet name mapping editor: https:\/\/localhost\/name-map-ui\/\n\n - Account management: https:\/\/localhost:488\/\n\nNAME COMMAND SERVICE STATUS PORTS\nmalcolm-api-1 \"\/usr\/local\/bin\/dock\u2026\" api running (starting) 5000\/tcp\nmalcolm-arkime-1 \"\/usr\/local\/bin\/dock\u2026\" arkime running (starting) 8081\/tcp\nmalcolm-dashboards-1 \"\/usr\/local\/bin\/dock\u2026\" dashboards running (starting) 5601\/tcp\nmalcolm-dashboards-helper-1 \"\/usr\/local\/bin\/dock\u2026\" dashboards-helper running (starting) 28991\/tcp\nmalcolm-file-monitor-1 \"\/usr\/local\/bin\/dock\u2026\" file-monitor running (starting) 8440\/tcp\nmalcolm-filebeat-1 \"\/usr\/local\/bin\/dock\u2026\" filebeat running (starting) 127.0.0.1:5045->5045\/tcp\nmalcolm-freq-1 \"\/usr\/local\/bin\/dock\u2026\" freq running (starting) 10004\/tcp\nmalcolm-htadmin-1 \"\/usr\/local\/bin\/dock\u2026\" htadmin running (starting) 80\/tcp\nmalcolm-logstash-1 \"\/usr\/local\/bin\/dock\u2026\" logstash running (starting) 127.0.0.1:5044->5044\/tcp\nmalcolm-name-map-ui-1 \"\/usr\/local\/bin\/dock\u2026\" name-map-ui running (starting) 8080\/tcp\nmalcolm-nginx-proxy-1 \"\/usr\/local\/bin\/dock\u2026\" nginx-proxy running (starting) 0.0.0.0:443->443\/tcp, 0.0.0.0:488->488\/tcp, 127.0.0.1:5601->5601\/tcp, 127.0.0.1:9200->9200\/tcp\nmalcolm-opensearch-1 \"\/usr\/local\/bin\/dock\u2026\" opensearch running (starting) 9650\/tcp\nmalcolm-pcap-capture-1 \"\/usr\/local\/bin\/dock\u2026\" pcap-capture running \nmalcolm-pcap-monitor-1 \"\/usr\/local\/bin\/dock\u2026\" pcap-monitor running (starting) 30441\/tcp\nmalcolm-suricata-1 \"\/usr\/local\/bin\/dock\u2026\" suricata running (starting) 8711\/tcp\nmalcolm-upload-1 \"\/usr\/local\/bin\/dock\u2026\" upload running (starting) 127.0.0.1:8022->22\/tcp\nmalcolm-zeek-1 \"\/usr\/local\/bin\/dock\u2026\" zeek running (starting) \n....\n<\/code><\/pre>\n\n\n\n
docker ps -a<\/code><\/pre>\n\n\n\n
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n1a164697dc9d malcolmnetsec\/nginx-proxy:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 0.0.0.0:443->443\/tcp, 127.0.0.1:5601->5601\/tcp, 0.0.0.0:488->488\/tcp, 127.0.0.1:9200->9200\/tcp malcolm-nginx-proxy-1\nd94fdbdc5edc malcolmnetsec\/filebeat-oss:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 127.0.0.1:5045->5045\/tcp malcolm-filebeat-1\n41a1664e9863 malcolmnetsec\/suricata:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 8711\/tcp malcolm-suricata-1\n18ddca5a001a malcolmnetsec\/dashboards:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 5601\/tcp malcolm-dashboards-1\n6cc30e2dc8ea malcolmnetsec\/file-upload:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 80\/tcp, 127.0.0.1:8022->22\/tcp malcolm-upload-1\n21de5caca01e malcolmnetsec\/zeek:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) malcolm-zeek-1\nc7d9b3da48e8 malcolmnetsec\/dashboards-helper:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 28991\/tcp malcolm-dashboards-helper-1\nd41224f2d9fc malcolmnetsec\/logstash-oss:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 9001\/tcp, 127.0.0.1:5044->5044\/tcp, 9600\/tcp malcolm-logstash-1\n3de2293aac1b malcolmnetsec\/arkime:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 8000\/tcp, 8005\/tcp, 8081\/tcp malcolm-arkime-1\n286a51eff770 malcolmnetsec\/pcap-monitor:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 30441\/tcp malcolm-pcap-monitor-1\n9372ec08a576 malcolmnetsec\/file-monitor:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 3310\/tcp, 8440\/tcp malcolm-file-monitor-1\n13cb9b77965d malcolmnetsec\/api:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 5000\/tcp malcolm-api-1\ndd079184f941 malcolmnetsec\/pcap-capture:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes malcolm-pcap-capture-1\na00f79a8e1b9 malcolmnetsec\/htadmin:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 80\/tcp malcolm-htadmin-1\n17750ddd1a72 malcolmnetsec\/name-map-ui:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 8080\/tcp malcolm-name-map-ui-1\nadd53463e7f8 malcolmnetsec\/opensearch:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 1 second (health: starting) 9200\/tcp, 9300\/tcp, 9600\/tcp, 9650\/tcp malcolm-opensearch-1\nb84ee0a208a8 malcolmnetsec\/freq:6.1.0 \"\/usr\/local\/bin\/dock\u2026\" 9 minutes ago Up 9 minutes (healthy) 10004\/tcp malcolm-freq-1\n<\/code><\/pre>\n\n\n\n
sudo ss -atlnp | grep -i docker<\/code><\/pre>\n\n\n\n
LISTEN 0 65535 0.0.0.0:488 0.0.0.0:* users:((\"docker-proxy\",pid=8971,fd=4)) \nLISTEN 0 65535 127.0.0.1:9200 0.0.0.0:* users:((\"docker-proxy\",pid=8833,fd=4)) \nLISTEN 0 65535 127.0.0.1:5044 0.0.0.0:* users:((\"docker-proxy\",pid=8307,fd=4)) \nLISTEN 0 65535 127.0.0.1:5045 0.0.0.0:* users:((\"docker-proxy\",pid=6610,fd=4)) \nLISTEN 0 65535 127.0.0.1:8022 0.0.0.0:* users:((\"docker-proxy\",pid=6969,fd=4)) \nLISTEN 0 65535 0.0.0.0:443 0.0.0.0:* users:((\"docker-proxy\",pid=9030,fd=4)) \nLISTEN 0 65535 127.0.0.1:5601 0.0.0.0:* users:((\"docker-proxy\",pid=8922,fd=4))\n<\/code><\/pre>\n\n\n\n
\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
Other Tutorials<\/h3>\n\n\n\n