# -*- mode: ruby -*-
# vi: set ft=ruby :
#
#
vmname = 'auditd1604'
boxname = 'ubuntu/xenial64'

Vagrant.configure(2) do |config|
  config.vm.hostname = "#{vmname}"
  config.vm.box = "#{boxname}"
  config.vm.network "private_network", type: "dhcp"

  config.vm.provider "virtualbox" do |v|
    v.name = "#{vmname}"
    v.customize ["modifyvm", :id, "--memory","1024" ]
    v.customize ["modifyvm", :id, "--cpus","1" ]
  end

  config.vm.provision "shell", path: "usersetup.sh", privileged: false
  config.vm.provision "file",  source: "replayUserAudit.py", destination: "replayUserAudit.py"

  config.vm.provision "shell", inline: <<-SHELL

sudo apt-get update
sudo apt-get install auditd audispd-plugins -y

sudo auditctl -a exit,always -F arch=b64 -F euid=0 -S execve -k rootcmd
sudo auditctl -a exit,always -F arch=b32 -F euid=0 -S execve -k rootcmd

echo "SUCCESS!"

SHELL

end