51 lines
1.3 KiB
Bash
51 lines
1.3 KiB
Bash
#!/bin/bash
|
|
# Configure BHIS RITA for Odin
|
|
#
|
|
|
|
echo -e "\e[93m"
|
|
|
|
log() {
|
|
echo -e "\t\e[96m[*]${1}\e[93m"
|
|
}
|
|
|
|
export IP=$(ip route | awk '/src/{print $9}')
|
|
echo "rita" >/etc/hostname
|
|
echo -e "${IP}\trita" >> /etc/hosts
|
|
|
|
deluser -q --remove-home ubuntu
|
|
|
|
apt-get update || exit 1
|
|
apt-get --purge remove snapd lxd -y
|
|
apt-get upgrade -y
|
|
apt-get install -y htop wget unzip
|
|
|
|
wget https://github.com/ocmdev/rita/archive/master.zip
|
|
unzip master.zip
|
|
cd rita-master
|
|
bash install.sh
|
|
cd ../
|
|
rm -rf rita-master master.zip
|
|
systemctl enable mongod
|
|
systemctl start mongod
|
|
|
|
sed -i 's/\/path\/to\/top\/level\/directory\//\/opt\/bro\/logs/g' /root/.rita/config.yaml
|
|
sed -i 's/PrefixForDatabase/rita-/g' /root/.rita/config.yaml
|
|
sed -i 's/UseDates: false/UseDates: true/g' /root/.rita/config.yaml
|
|
sed -i 's/#DefaultDatabase: DefaultDatabaseName/DefaultDatabase: odin/g' /root/.rita/config.yaml
|
|
sed -i 's/DirectoryMap/#DirectoryMap/g' /root/.rita/config.yaml
|
|
sed -i 's/UniqueDir/#UniqueDir/g' /root/.rita/config.yaml
|
|
sed -i 's/UniqueDir2/#UniqueDir2/g' /root/.rita/config.yaml
|
|
|
|
cat >/etc/cron.daily/rita <<EOF
|
|
#!/bin/bash
|
|
export PATH=\$PATH:/root/go/bin
|
|
cd /root
|
|
rita import
|
|
rita analyze
|
|
rita html-report
|
|
EOF
|
|
chmod +x /etc/cron.daily/rita
|
|
systemctl restart cron
|
|
apt-get install -y prometheus-node-exporter
|
|
echo -e "\e[0m"
|