The purpose of this blog post is to provide multiple methods on how to install/setup an Autopsy multi-client cluster. This blog post generated an infrastructure-as-code in the form of an Ansible playbook, Docker-compose, and manual instructions for setting up a cluster. In addition, this blog post will demonstrate how to setup the Autopsy client to connect to the Autopsy cluster and how to ingest disk images.
Background
What is Autopsy?
Autopsy is the premier end-to-end open source digital forensics platform. Built by Basis Technology with the core features you expect in commercial forensic tools, Autopsy is a fast, thorough, and efficient hard drive investigation solution that evolves with your needs.
What is an Autopsy cluster?
Autopsy can be setup to work in an environment where multiple users on different computers can have the same case open at the same time. To set up this type of environment, you will need to configure additional (free and open source) network-based services.
Install Autopsy cluster with Docker-compose v2.x
WARNING
The Docker-compose v2.x setup is for development use ONLY. The setup contains hard-coded credentials in configs and environment variables. For a more secure Docker deployment please skip to the next section to use Docker Swarm which implements Docker secrets.
WARNING
Spin up stack
git clone https://github.com/CptOfEvilMinions/Autopsy-Automation.git
cd Autopsy-Automation
vim .env
ACTIVEMQ_VERSION
– Set the version of ActiveMQ to usePOSTGRES_VERSION
– Set the version of Postgres to useSOLR_VERSION
– Set the version of Solr to useZOOKEEPER_VERSION
– Set the version of Zookeeper to useAUTOPSY_USERNAME
– Set the usernameAUTOPSY_PASSWORD
– Set the password
docker-compose build
docker-compose up -d
- SOLR_VERSION=$(cat .env | grep SOLR_VERSION | awk -F= ‘{print $2}’)
- Create environment vari
SOLR_VERSION=$(cat .env | grep SOLR_VERSION | awk -F= '{print $2}')
docker exec -it autopsy-solr bin/solr create_collection -c autopsy -d /tmp/SOLR_${SOLR_VERSION}_AutopsyService/solr-${SOLR_VERSION}/server/solr/configsets/AutopsyConfig/conf
- Create a Solr collection for Autopsy
Install Autopsy cluster with Ansible
Setup Ansible playbook
git clone https://github.com/CptOfEvilMinions/Autopsy-Automation.git
cd Autopsy-Automation
vim hosts.ini
and IP address of server under[autopsy]
vim group_vars/all.yml
and set:base_domain
– Set the domain of the networktimezone
– Set the machine to a timezone – default UTC +0hostname
– Set hostname of the servercert_country
– Set the country this server resides in for the self-signed certcert_state
– Set the state this server resides in for the self-signed certcert_local
– Set the city this server resides in for the self-signed certcert_org
– Set the organization this server resides in for the self-signed certcert_ou
– Set the organization unit this server resides in for the self-signed certcert_common_name
– Set the common name for the self-signed cert- Save and exit
vim group_vars/autopsy.yml
and set:- Zookeeper
zookeeper_version
– Set the version of Zookeeper to install
- ActiveMQ
activemq_version
– Set the version of ActiveMQ to installactivemq_autopsy_username
– Set username for remote accessactivemq_autopsy_password
– Set password for remote access
- Samba
samba_path
– Set path to store Autopsy casessamba_user
– Linux user to create for SAMBA auth and file permissionssamba_group
– Linux group to create for SAMBA auth and file permissionssamba_password
– Password for user
- Solr
solr_version
– Set the version Solr to install – DO NOT CHANGE UNLESS the Autopsy Solr versions match
- Postgres
pg_user
– Set username for remote accesspg_password
– Set password for remote accesspg_max_conns
– A rule of thumb is add 100 connections for each Automated Ingest Node and 100 connections for each Reviewer node you plan to have in the networkpg_version
– Set the version of Postgres to install
- Save and exit
- Zookeeper
Run playbook
ansible-playbook -i hosts.ini deploy_autopsy_cluster.yml -u superadmin -K
Manual install of Autopsy cluster on Ubuntu 20.04
Install/Setup Zookeeper v3.5.7
sudo su
apt update -y && apt upgrade -y && reboot
apt-get install default-jdk zip -y
- Install Java
useradd --system -s /usr/sbin/nologin zookeeper
- Create a system user for zookeeper
mkdir -p /var/lib/zookeeper
- Create directory for Zookeeper data
chown -R zookeeper:zookeeper /var/lib/zookeeper
- Set owner of the data directory
cd /opt && curl https://archive.apache.org/dist/zookeeper/zookeeper-3.5.7/apache-zookeeper-3.5.7-bin.tar.gz --output apache-zookeeper-3.5.7-bin.tar.gz
- Download Zookeeper
mkdir /opt/zookeeper && tar -xvzf apache-zookeeper-3.5.7-bin.tar.gz -C /opt/zookeeper --strip-components 1
- Create directory for zookeeper and UNtar to it
curl https://raw.githubusercontent.com/CptOfEvilMinions/Autopsy-Automation/main/conf/ansible/zookeeper/zoo.cfg --output /opt/zookeeper/conf/zoo.cfg
- Download Zookeeper config
sed -i "s#{{ zookeeper_data_dir }}#/var/lib/zookeeper#g" /opt/zookeeper/conf/zoo.cfg
- Set Zookeeper data directory
chown zookeeper:zookeeper -R /opt/zookeeper
- Set permissions
curl https://raw.githubusercontent.com/CptOfEvilMinions/Autopsy-Automation/main/conf/ansible/zookeeper/zookeeper.service --output /etc/systemd/system/zookeeper.service
- Download Zookeeper service file
systemctl start zookeeper
systemctl enable zookeeper
Install/Setup Solr v8.6.3
cd /tmp && curl https://archive.apache.org/dist/lucene/solr/8.6.3/solr-8.6.3.tgz --output solr-8.6.3.tgz
- Download Solr v8.6.3
tar -xvzf solr-8.6.3.tgz
- UNtar Solr
bash solr-8.6.3/bin/install_solr_service.sh solr-8.6.3.tgz
- Install Apache Solr
sed -i "s/#ZK_HOST=""/ZK_HOST="127.0.0.1"/g" /etc/default/solr.in.sh
- Enable Solr cloud mode
chown solr:solr -R /opt/solr
- Set permissions of Solr directory
systemctl restart solr
systemctl enable solr
cd /tmp && curl -L https://sourceforge.net/projects/autopsy/files/CollaborativeServices/Solr/SOLR_8.6.3_AutopsyService.zip/download --output SOLR_8.6.3_AutopsyService.zip
- Download Solr v8.6.3 configured by Autopsy
unzip SOLR_8.6.3_AutopsyService.zip
- UNzip Solr v8.6.3 configured by Autopsy
su solr
- Switch to Solr user
/opt/solr/bin/solr create_collection -c autopsy -d /tmp/SOLR_8.6.3_AutopsyService/solr-8.6.3/server/solr/configsets/AutopsyConfig/conf
- Create/setup Autopsy collection on Solr
- Open web browser to
http://<IP addr>:8983/solr/#/~cloud?view=tree
Install/Setup ActiveMQ v5.14.0
useradd --system -s /usr/sbin/nologin activemq
- Create ActiveMQ user
curl https://archive.apache.org/dist/activemq/5.14.0/apache-activemq-5.14.0-bin.tar.gz --output apache-activemq-5.14.0-bin.tar.gz
- Download ActiveMQ
mkdir /opt/activemq && tar -xvzf apache-activemq-5.14.0-bin.tar.gz -C /opt/activemq --strip-components 1
- Create directory for ActiveMQ install
curl https://raw.githubusercontent.com/CptOfEvilMinions/Autopsy-Automation/main/conf/ansible/activemq/activemq.xml --output /opt/activemq/conf/activemq.xml
sed -i "s#{{ activemq_autopsy_username }}#<autopsy username>#g" /opt/activemq/conf/activemq.xml
sed -i "s#{{ activemq_autopsy_password }}#<autopsy password>#g" /opt/activemq/conf/activemq.xml
- Download active.xml config and set username and password
- curl https://raw.githubusercontent.com/CptOfEvilMinions/Autopsy-Automation/main/conf/ansible/activemq/groups.properties –output /opt/activemq/conf/groups.properties
- Download groups.properties
curl https://raw.githubusercontent.com/CptOfEvilMinions/Autopsy-Automation/main/conf/ansible/activemq/users.properties --output /opt/activemq/conf/users.properties
sed -i "s#sslclient=CN=.*#CN=<cert_common_name>, OU=<cert_ou>, O=<cert_org>, L=<cert_local>, ST=<cert_state>, C=<cert_country>#g" /opt/activemq/conf/users.properties
- Download users.properties and set self-signed certificate
chown activemq:activemq -R /opt/activemq
- Set perms of install dir
curl https://raw.githubusercontent.com/CptOfEvilMinions/Autopsy-Automation/main/conf/ansible/activemq/activemq.service --output /etc/systemd/system/activemq.service
- Download ActiveMQ service
systemctl restart activemq
systemctl enable activemq
Install/Setup Postgres v9.5.3
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
- Add postgres repo
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- Add Postgres GPG key
apt update -y && apt install postgresql-9.5 python3-pip libpg-dev -y
- Install PostgresSQL
sed -i "s/#fsync =.*/fsync = off/g" /etc/postgresql/9.5/main/postgresql.conf
- Disable fsync
sed -i "s/#synchronous_commit =.*/synchronous_commit = off/g" /etc/postgresql/9.5/main/postgresql.conf
- Disable sync_commit
sed -i "s/#full_page_writes =.*/full_page_writes = off/g" /etc/postgresql/9.5/main/postgresql.conf
- Disable full_page_writes
sed -i "s/max_connections =.*/max_connections = <connections>/g" /etc/postgresql/9.5/main/postgresql.conf
- Set max connections
sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '0.0.0.0'/g" /etc/postgresql/9.5/main/postgresql.conf
- Set Postgres to listen on all interfaces
sed -i "s#host all all 127.0.0.1/32 md5#host all all 0.0.0.0/0 md5#g" /etc/postgresql/9.5/main/pg_hba.conf
- Enable MD5 authentication on all interfaces
systemctl enable postgresql
systemctl restart postgresql
- Restart Postgres
sudo -u postgres psql
- Enter postgres
create user autopsy with encrypted password '<password>';
- Create postgres user
ALTER USER autopsy CREATEDB;
- Allow user to create databases
\q
- Exit postgres
Install/Setup Samba file share server
apt install samba cifs-utils smbclient libpam-winbind -y
- Install Samba
groupadd forensicanalysts
- Create
forensicanalysts
group
- Create
useradd --no-create-home autopsy -G forensicanalysts
- Create autopsy user and add them to newly created group
passwd autopsy
- Set password for user
smbpasswd -a autopsy
- Set Samba password for autopsy user
mkdir -p /var/samba/autopsy
chown autopsy:forensicanalysts -R /var/samba/autopsy
- Create directory to store Autopsy cases
curl https://raw.githubusercontent.com/CptOfEvilMinions/Autopsy-Automation/main/conf/ansible/samba/smb.conf --output /etc/samba/smb.conf
sed -i "s#{{ samba_path }}#/var/samba/autopsy#g" /etc/samba/smb.conf
sed -i "s#{{ samba_user }}#autopsy#g" /etc/samba/smb.conf
sed -i "s#{{ samba_group }}#forensicanalysts#g" /etc/samba/smb.conf
- Download Samba config and set settings
systemctl enable smbd nmbd
systemctl restart smbd nmbd
- Enable and restart Samba
Setup UFW
ufw allow 'OpenSSH'
ufw allow 5432/tcp
- Allow PostgresSQL
ufw allow 2181/tcp
- Allow Zookeeper
ufw allow 8983/tcp
- Allow Solr
ufw allow 61616/tcp
- Allow ActiveMQ
ufw allow samba
ufw enable
Install/Setup Autopsy on Windows 10
- Open Windows File Exporer
- Select “This PC” on the left
- Select “Computer” tab at the top
- Select “Map network drive”
- Select
Z:
for Drive letter - Enter
\\<IP addr of Samba server>\Autopsy
for folder - Enter credentials for the autopsy user
- Select
- Open Powershell as Administrator
cd $ENV:TEMP
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri https://github.com/sleuthkit/autopsy/releases/download/autopsy-4.18.0/autopsy-4.18.0-64bit.msi -OutFile autopsy-4.18.0-64bit.msi
- Download Autopsy v4.18.0
msiexec.exe /i .\autopsy-4.18.0-64bit.msi /quiet /qn
- Install Autopsy
- Double-click the Autopsy icon on the Desktop
- Tools (toolbar at the top) > Options > Multi-user
- Check “Enable multi-user cases”
- Database
- Enter
<Docker IP addr>
into hostname/IP addr - Enter
5432
into port number - Enter
autopsy
into username - Enter
<Autopsy password>
into password - Select “Test connection”
- Enter
- ActiveMQ
- Enter
<Docker IP addr>
into hostname/IP addr - Enter
61616
into port number - Enter
autopsy
into username - Enter
<Autopsy password>
into password - Select “Test connection”
- Enter
- Solr 8
- Enter
<Docker IP addr>
into hostname/IP addr - Enter
8983
into port number - Select “Test connection”
- Enter
- Leave the Solr 4 section blank
- Zookeeper
- Enter
<Docker IP addr>
into hostname/IP addr - Enter
2181
into port number - Select “Test connection”
- Enter
- Select “Yes” to create a Central Repository Database
- Select “Apply” then “OK”
Create a new case and add data source
Create a new case
- Case (top right) > New Case
- Case information
- Enter
test-case
into case name - Select
Z:\
for Base Directory - Select
Multi-user
for case type - Next
- Enter
- Optional information
- Enter optional information
- Select “Finish”
- Case information
Add data source
- Download Hacking Case – Disk Image
- Copy the disk image to
Z:\<case name>\<disk image>
- Back to Autopsy
- Select Type of data Source To Ad
- Select “Disk image or VM File”
- Select Data Source
- Select disk image on samba server
- Configure Ingest Modules
- Leave all ingest modules set to default
- Add data source
Lessons learned
I am currently reading a book called “Cracking the Coding Interview” and it is a great book. One interesting part of the book is their matrix to describe projects you worked on and the matrix contains the following sections which are: challenges, mistakes/failures, enjoyed, leadership, conflicts, and what would you do differently. I am going to try and use this model at the end of my blog posts to summarize and reflect on the things I learn. I don’t blog to post things that I know, I blog to learn new things and to share the knowledge of my security research.
New skills/knowledge
- Learned about servlet containers (tomcat and Jetty)
- Configured Jetty to serve Solr
- Learned how to setup and configure Solr v4 and v8
- Learned how to setup and configure Zookeeper
- Learned how to setup and configure ActiveMQ
References
- Package jetty is not available
- A step-by-step guide on how to install the Solr search engine on your Ubuntu server
- Solr Downloads
- Index of /dist/lucene/solr/4.10.3
- Autopsy – Setting Up Multi-user Environment
- Index of /dist/activemq/5.11.1
- How to Install Apache ActiveMQ on Ubuntu 18.04 | 16.04
- Autopsy – Install and Configure ActiveMQ
- Configure PostgreSQL to allow remote connection
- Installing Postgres on Ubuntu:
- Linux downloads (Ubuntu)
- Hacking case – disk image