diff options
-rwxr-xr-x | init-sh/level0.sh | 15 | ||||
-rwxr-xr-x | init-sh/level1.sh | 15 | ||||
-rwxr-xr-x | init-sh/level2.sh | 15 | ||||
-rwxr-xr-x | init-sh/level3.sh | 15 | ||||
-rwxr-xr-x | init-sh/level4.sh | 32 | ||||
-rwxr-xr-x | init-sh/level5.sh | 33 | ||||
-rwxr-xr-x | init-sh/levelsnf.sh | 32 |
7 files changed, 157 insertions, 0 deletions
diff --git a/init-sh/level0.sh b/init-sh/level0.sh index 927b6eb..b893546 100755 --- a/init-sh/level0.sh +++ b/init-sh/level0.sh @@ -77,6 +77,21 @@ echo "Adding system users to specific groups :" /usr/share/msec/grpuser.sh --refresh echo -e "done.\n" +# icmp echo +echo "Enabling icmp echo :" +AddRules "net.ipv4.icmp_echo_ignore_all=0" /etc/sysctl.conf +AddRules "net.ipv4.icmp_echo_ignore_broadcasts=0" /etc/sysctl.conf + +# bad error +echo "Disabling bad error message Protection :" +AddRules "net.ipv4.icmp_ignore_bogus_error_responses=0" /etc/sysctl.conf + +# log strange packets +echo "Disabling logging Spoofed Packets, Source Routed Packets, Redirect Packets :" +AddRules "net.ipv4.conf.all.log_martians=0" /etc/sysctl.conf + +LoadSysctl + AllowAutologin # Boot on a shell / authorize ctrl-alt-del diff --git a/init-sh/level1.sh b/init-sh/level1.sh index c8b20a5..a40a22e 100755 --- a/init-sh/level1.sh +++ b/init-sh/level1.sh @@ -78,6 +78,21 @@ echo "Adding system users to specific groups :" grpconv echo -e "done.\n" +# icmp echo +echo "Enabling icmp echo :" +AddRules "net.ipv4.icmp_echo_ignore_all=0" /etc/sysctl.conf +AddRules "net.ipv4.icmp_echo_ignore_broadcasts=0" /etc/sysctl.conf + +# bad error +echo "Disabling bad error message Protection :" +AddRules "net.ipv4.icmp_ignore_bogus_error_responses=0" /etc/sysctl.conf + +# log strange packets +echo "Disabling logging Spoofed Packets, Source Routed Packets, Redirect Packets :" +AddRules "net.ipv4.conf.all.log_martians=0" /etc/sysctl.conf + +LoadSysctl + AllowAutologin # Do not boot on a shell diff --git a/init-sh/level2.sh b/init-sh/level2.sh index 1be954d..8a82518 100755 --- a/init-sh/level2.sh +++ b/init-sh/level2.sh @@ -79,6 +79,21 @@ echo "Adding system users to specifics groups :" grpconv echo -e "done.\n" +# icmp echo +echo "Enabling icmp echo :" +AddRules "net.ipv4.icmp_echo_ignore_all=0" /etc/sysctl.conf +AddRules "net.ipv4.icmp_echo_ignore_broadcasts=0" /etc/sysctl.conf + +# bad error +echo "Disabling bad error message Protection :" +AddRules "net.ipv4.icmp_ignore_bogus_error_responses=0" /etc/sysctl.conf + +# log strange packets +echo "Disabling logging Spoofed Packets, Source Routed Packets, Redirect Packets :" +AddRules "net.ipv4.conf.all.log_martians=0" /etc/sysctl.conf + +LoadSysctl + AllowAutologin # Do not boot on a shell diff --git a/init-sh/level3.sh b/init-sh/level3.sh index 26022fc..83fccf8 100755 --- a/init-sh/level3.sh +++ b/init-sh/level3.sh @@ -76,6 +76,21 @@ echo "Setting umask to 022 (u=rw,g=r,o=r) :" AddRules "UMASK_ROOT=022" /etc/sysconfig/msec AddRules "UMASK_USER=022" /etc/sysconfig/msec +# icmp echo +echo "Enabling icmp echo :" +AddRules "net.ipv4.icmp_echo_ignore_all=0" /etc/sysctl.conf +AddRules "net.ipv4.icmp_echo_ignore_broadcasts=1" /etc/sysctl.conf + +# bad error +echo "Enabling bad error message Protection :" +AddRules "net.ipv4.icmp_ignore_bogus_error_responses=1" /etc/sysctl.conf + +# log strange packets +echo "Enabling logging Spoofed Packets, Source Routed Packets, Redirect Packets :" +AddRules "net.ipv4.conf.all.log_martians=1" /etc/sysctl.conf + +LoadSysctl + # Do not boot on a shell AllowReboot diff --git a/init-sh/level4.sh b/init-sh/level4.sh index 69df158..b4d3d7a 100755 --- a/init-sh/level4.sh +++ b/init-sh/level4.sh @@ -111,6 +111,38 @@ if [[ -f /lib/libsafe.so.2 ]]; then AddRules "/lib/libsafe.so.2" /etc/ld.so.preload fi +# Console timeout +echo "Setting console timeout :" +AddRules "TMOUT=7200" /etc/sysconfig/msec + +# No history file +echo "No history file :" +AddRules "HISTFILESIZE=0" /etc/sysconfig/msec + +# Ip spoofing protection +echo "IP spoofing protection :" +AddRules "nospoof on" /etc/host.conf +AddRules "spoofalert on" /etc/host.conf + +# icmp echo +echo "Ignoring icmp echo :" +AddRules "net.ipv4.icmp_echo_ignore_all=1" /etc/sysctl.conf +AddRules "net.ipv4.icmp_echo_ignore_broadcasts=1" /etc/sysctl.conf + +# bad error +echo "Enabling bad error message Protection :" +AddRules "net.ipv4.icmp_ignore_bogus_error_responses=1" /etc/sysctl.conf + +# log strange packets +echo "Enabling logging Spoofed Packets, Source Routed Packets, Redirect Packets :" +AddRules "net.ipv4.conf.all.log_martians=1" /etc/sysctl.conf + +LoadSysctl + +# issues +echo "Removing /etc/issue.net :" +RemoveIssueNet + # Do not boot on a shell ForbidReboot diff --git a/init-sh/level5.sh b/init-sh/level5.sh index 1fa9a9d..070c770 100755 --- a/init-sh/level5.sh +++ b/init-sh/level5.sh @@ -123,6 +123,39 @@ if [[ -f /lib/libsafe.so.2 ]]; then AddRules "/lib/libsafe.so.2" /etc/ld.so.preload fi +# Console timeout +echo "Setting console timeout :" +AddRules "TMOUT=180" /etc/sysconfig/msec + +# No history file +echo "No history file :" +AddRules "HISTFILESIZE=0" /etc/sysconfig/msec + +# Ip spoofing protection +echo "IP spoofing protection :" +AddRules "nospoof on" /etc/host.conf +AddRules "spoofalert on" /etc/host.conf + +# icmp echo +echo "Ignoring icmp echo :" +AddRules "net.ipv4.icmp_echo_ignore_all=1" /etc/sysctl.conf +AddRules "net.ipv4.icmp_echo_ignore_broadcasts=1" /etc/sysctl.conf + +# bad error +echo "Enabling bad error message Protection :" +AddRules "net.ipv4.icmp_ignore_bogus_error_responses=1" /etc/sysctl.conf + +# log strange packets +echo "Enabling logging Spoofed Packets, Source Routed Packets, Redirect Packets :" +AddRules "net.ipv4.conf.all.log_martians=1" /etc/sysctl.conf + +LoadSysctl + +# issues +echo "Removing /etc/issue and /etc/issue.net :" +RemoveIssue +RemoveIssueNet + # Do not boot on a shell ForbidReboot ForbidAutologin diff --git a/init-sh/levelsnf.sh b/init-sh/levelsnf.sh index 349d200..6aba191 100755 --- a/init-sh/levelsnf.sh +++ b/init-sh/levelsnf.sh @@ -87,6 +87,38 @@ AddRules "0 4 * * * root /usr/share/msec/security.sh" /etc/crontab echo "Setting secure level variable to snf :" AddRules "SECURE_LEVEL=snf" /etc/sysconfig/msec +# Console timeout +echo "Setting console timeout :" +AddRules "TMOUT=180" /etc/sysconfig/msec + +# No history file +echo "No history file :" +AddRules "HISTFILESIZE=0" /etc/sysconfig/msec + +# Ip spoofing protection +echo "IP spoofing protection :" +AddRules "nospoof on" /etc/host.conf +AddRules "spoofalert on" /etc/host.conf + +# icmp echo +echo "Ignoring icmp echo :" +AddRules "net.ipv4.icmp_echo_ignore_all=1" /etc/sysctl.conf +AddRules "net.ipv4.icmp_echo_ignore_broadcasts=1" /etc/sysctl.conf + +# bad error +echo "Enabling bad error message Protection :" +AddRules "net.ipv4.icmp_ignore_bogus_error_responses=1" /etc/sysctl.conf + +# log strange packets +echo "Enabling logging Spoofed Packets, Source Routed Packets, Redirect Packets :" +AddRules "net.ipv4.conf.all.log_martians=1" /etc/sysctl.conf + +LoadSysctl + +# issues +echo "Removing /etc/issue.net :" +RemoveIssueNet + export SECURE_LEVEL=snf IFS=" |