Repository navigation
Ansible README
Phil Hagen edited this page Jul 7, 2026
·
13 revisions
These are the steps used to create a SOF-ELK instance from scratch. These steps are a good starting point for those wishing to deploy their own SOF-ELK capabilities via these Ansible playbooks. Obviously, you'd need to adjust these instructions to your environment and platform.
- Virtual Machine configuration (only applicable if installing to virtual machine)
- Name:
SOF-ELK- Classroom build:
FOR572 SOF-ELK
- Classroom build:
- Disable shared folders
- Disable Default Application host/guest sharing
- Processors and Memory
- 4 cores
- 4096 MB RAM
- Disable 3D graphics acceleration
- USB 3.1 Controller
- Remove Sound
- Remove Camera
- HDD
- Filename
SOF-ELK x86.vmdkorSOF-ELK ARM.vmdk - Disk size: 500GB
- Bus type: NVMe
- Do not Pre-allocate
- Single file (uncheck "Split into multiple files)
- Filename
- One or more CD/DVD-ROM device(s) as needed
- Classroom build: Three IDE CD/DVD-ROM devices. Disable the two that are not attached to the installer ISO.
- Hardware (compatibility) version: whatever is the latest (should be the default)
- Classroom build: one prior to latest or SROC-designated version
- Isolation
- Disable drag and drop
- Disable copy and paste
- Advanced
- Disable Side Channel Mitigations (x86 only)
- UEFI Firmware
- Name:
- Ubuntu 26.04 install
- The Ansible build process works for x86 or ARM systems
- For x86, use
ubuntu-26.04-live-server-amd64.iso - For ARM, use
ubuntu-24.04-live-server-arm64.iso
- For x86, use
- Language: English (adjust to your preference, of course)
- Update to the new installer if presented with this option
- Keyboard layout and variant: English (again, adjust to your preference)
- Ubuntu Server (minimized)
- Wait for DHCP IP address assignment
- No proxy
- Use default mirror URL
- Disk configuration
- Use an entire disk
- Set up this disk as an LVM group
- Create Logical Volumes:
- Name:
swap- Size: 4G
- Format:
swap - Mount: N/A
- Name:
root- Size: 200G
- Format:
ext4 - Mount:
/
- Name:
elasticsearch- Size: remainder of LVM allocation
- Format:
ext4 - Mount: Other -
/var/lib/elasticsearch
- Name:
- Profile configuration
- Your name:
SOF-ELK User - Your servers name:
sof-elk - Pick a username:
elk_user - Choose/config password: Set a preferred password. Public and classroom builds use
forensics.
- Your name:
- Ubuntu Pro: Skip
- Install OpenSSH server
- Do not install any server snaps
- Allow installation to complete
- Reboot the VM (You may need to re-connect the CD/DVD to allow the
ejectcommand to complete)
- The Ansible build process works for x86 or ARM systems
- Log in as the
elk_useruser-
sudo apt -y install ansible git(provide the password set above when prompted) - Determine what version of SOF-ELK you wish to install. At this time, the latest public version (which is almost certainly what you want) is
public/v20251010. This value will be used in the remaining instructions. If a different version is required, adjust commands accordingly. sudo git clone https://github.com/philhagen/sof-elk --branch public/v20251010 --single-branch /usr/local/sof-elk- Determine if you want to install your own MaxMind GeoIP databases
- By default, the installation includes December 2022 databases, which have an appropriate license for distribution.
- If you wish to install the latest databases, a free MaxMind GeoIP account ID and license key are needed.
- You can also install the 2022 databases now, then run
sudo geoip_bootstrap.shafter installation is complete to install your own MaxMind account ID and license key.
- An Ansible inventory file is provided if you wish to build a single instance with all of the various components co-installed to one VM/system. If you have a more elaborate environment that in any way differs from the single-host model, you'll need to create an appropriate inventory file, which is beyond the scope of this documentation.
cd /usr/local/sof-elk/ansible/- Run the playbook.
- If you are installing the default MaxMind databases, run
ansible-playbook -K -i local_build.yml sof-elk_single_vm.yml - If you wish to install the latest MaxMind databases using your own MaxMind account information as detailed above, run
ansible-playbook -K -i local_build.yml sof-elk_single_vm.yml -e "geoip_account=<%MAXMIND_ACCOUNT_ID%> geoip_key=<%MAXMIND_GEOIP_KEY%>" - In either case, the playbook will ask for the
elk_useruser's password at theBECOME password:prompt
- If you are installing the default MaxMind databases, run
- Allow the playbook to run
-
NOTE: These steps are NOT required for a typical VM build. These are only used for VMs used in SANS courses.
- Change the sequence for step 3 above to the following:
- Use a branch such as
class/aaa123/v* - Run
ansible-playbook -K -i local_build.yml -e "course_build=aaa123 course_version=Z99" sof-elk_single_vm.yml(altering course_build and course_version values as needed)
- Use a branch such as
- After step 4 above, perform any course-specific steps needed to stage evidence files, pre-load data, etc.
NOTE: These steps are NOT required for a typical VM build. These are only used for VMs used in SANS courses.
- Boot the public distribution of the VM.
- Create a new branch for the course-specific build (e.g.
class/aaa123/v20250321) and push to GitHub origin - Change to the new branch
- Run
ansible-playbook -K -i local_build.yml -e "course_build=aaa123 course_version=Z99" -t pub2course sof-elk_single_vm.yml(altering course_build and course_version values as needed)- This will use course-specific build instructions, remove sample data, etc.
- Create a new branch for the course-specific build (e.g.
- Perform any course-specific steps needed to state evidence files, pre-load data, etc.
- Run preparation script
- Log in as
elk_user -
set +o history(this disables subsequent history tracking) sudo su --
set +o history(in the root shell) -
./distro_prep.sh(in the root shell while in~/) - Follow prompts
- Log in as
- Set VM comment with version and username/password
- Halt (
haltas root) and power down the VM - Take a release candidate snapshot
- Reboot
- Test:
- Data load (
syslog,httpdlog,netflow,passivedns) sof-elk_clear.py -i list
- Data load (
- Delete the release candidate snapshot
- Manually fix the
.vmxfile:- Delete
uuid.bios - Delete
uuid.location - Add
uuid.action = "create" - For the following settings, the name may differ depending on CD/DVD device - for example, it could be
sata:1.*oride0:1.*. These settings must also be applied to each CD/DVD device, if there are more than one.sata0:1.present = "TRUE"sata0:1.deviceType = "cdrom-image"sata0:1.fileName = "auto detect"sata0:1.autodetect = "TRUE"sata0:1.startConnected = "FALSE"
- Delete
- Create 7z archive for distribution (max compression)
- Ensure the VMware Workstation/Fusion interface does not have the VM selected as
- Only include
.vmxand*.vmdkfiles
- Run preparation script
- Log in as
elk_user -
set +o history(this disables subsequent history tracking) sudo su --
set +o history(in the root shell) -
./distro_prep.sh -cloud(in the root shell while in~/) - Follow prompts
- Log in as
- Halt (
haltas root) and power down the VM
All content ©2025 Lewes Technology Consulting, LLC unless otherwise indicated.