This repository was archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbaseline ubuntu.sh
More file actions
executable file
·58 lines (50 loc) · 1.59 KB
/
baseline ubuntu.sh
File metadata and controls
executable file
·58 lines (50 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
## Baseline Script that is ran on a system to give you a baseline to go from there.
## Written by cjthedj97 on Github
## The Start of the Script
## Checking to see if script was ran as root or with sudo privileges
if [ $(id -u) != 0 ]; then
echo "You're not root. Please run as root."
exit
fi
## Checks the /etc/apt/sources.list and ask if it is correct
echo "Please verify that the source list is correct"
cat /etc/apt/sources.list | less
echo "Is this correct?"
echo "Enter Y or N"
read a
if [[ $a == "Y" || $a == "Y" ]]; then
# If Correct then Runs the following
echo "Starting the Script"
sleep 5
apt update -y &> ~/baseline/update.log
# Installing the Required Software
echo "Installing the required Software"
sleep 5
apt install curl git nano lynx python tmux lynis -y
# Downloads and Runs IR (Incidance Response) program
echo "Installing IR program"
sleep 5
git clone https://github.com/SekoiaLab/Fastir_Collector_Linux
cd Fastir_Collector_Linux
python fastIR_collector_linux.py &> ~/baseline/fastir.log
cp -R output/ ~/baseline/output
# Setting up and Installing Lynis
echo "Starting Lynis"
Sleep 5
lynis audit system
cp /var/log/lynis.log ~/baseline/output/lynis.log
cp /var/log/lynis-report.dat ~/baseline/output/lynis-report.dat
# Updating the system
echo "Upgradeing"
apt upgrade -y
# Check to see if system reboot is required
if [ -f /var/run/reboot-required ]; then
echo 'Reboot Required, please consiter rebooting'
sleep 5
exit
fi
else
echo "You entered N or an incorrct response"
echo "Please try again later"
fi