mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-04-20 19:03:08 +01:00
Merge 14dcf2d2ae31eaf62f54461d7c431904d806bbd3 into 232b45e6a66753cb9ef8cea6f6ea8dcc045434c1
This commit is contained in:
commit
46be8f126b
28
core/tabs/security/firewalld-baselines.sh
Normal file
28
core/tabs/security/firewalld-baselines.sh
Normal file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh -e
|
||||
|
||||
. ../common-script.sh
|
||||
|
||||
configureFirewallD() {
|
||||
printf "%b\n" "${YELLOW}Configuring FirewallD with recommended rules${RC}"
|
||||
|
||||
printf "%b\n" "${YELLOW}Setting default zone to drop (FirewallD)${RC}"
|
||||
"$ESCALATION_TOOL" firewall-cmd --set-default-zone=drop
|
||||
|
||||
printf "%b\n" "${YELLOW}Allowing SSH service (FirewallD)${RC}"
|
||||
"$ESCALATION_TOOL" firewall-cmd --permanent --add-service=ssh
|
||||
|
||||
printf "%b\n" "${YELLOW}Allowing HTTP service (FirewallD)${RC}"
|
||||
"$ESCALATION_TOOL" firewall-cmd --permanent --add-service=http
|
||||
|
||||
printf "%b\n" "${YELLOW}Allowing HTTPS service (FirewallD)${RC}"
|
||||
"$ESCALATION_TOOL" firewall-cmd --permanent --add-service=https
|
||||
|
||||
printf "%b\n" "${YELLOW}Reloading FirewallD configuration${RC}"
|
||||
"$ESCALATION_TOOL" firewall-cmd --reload
|
||||
|
||||
printf "%b\n" "${GREEN}Enabled FirewallD with Baselines!${RC}"
|
||||
}
|
||||
|
||||
checkEnv
|
||||
checkEscalationTool
|
||||
configureFirewallD
|
@ -1,12 +1,23 @@
|
||||
name = "Security"
|
||||
|
||||
[[data]]
|
||||
name = "Firewall Baselines (CTT)"
|
||||
name = "UFW Firewall Baselines (CTT)"
|
||||
description = "Developed to ease iptables firewall configuration, UFW provides a user friendly way to create an IPv4 or IPv6 host-based firewall. This command installs UFW and configures UFW based on CTT's recommended rules. For more information visit: https://christitus.com/linux-security-mistakes"
|
||||
script = "firewall-baselines.sh"
|
||||
script = "ufw-baselines.sh"
|
||||
task_list = "I SS"
|
||||
|
||||
[[data.preconditions]]
|
||||
matches = false
|
||||
data = "command_exists"
|
||||
values = [ "firewalld" ]
|
||||
values = [ "firewall-cmd" ]
|
||||
|
||||
[[data]]
|
||||
name = "FirewallD Firewall Baselines (CTT)"
|
||||
description = "Configure FirewallD with CTT's recommended baseline rules for improved system security. For more information visit: https://christitus.com/linux-security-mistakes"
|
||||
script = "firewalld-baselines.sh"
|
||||
task_list = "I SS"
|
||||
|
||||
[[data.preconditions]]
|
||||
matches = true
|
||||
data = "command_exists"
|
||||
values = [ "firewall-cmd" ]
|
||||
|
@ -12,6 +12,9 @@ installPkg() {
|
||||
apk)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" add ufw
|
||||
;;
|
||||
xbps-install)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" -Sy ufw
|
||||
;;
|
||||
*)
|
||||
"$ESCALATION_TOOL" "$PACKAGER" install -y ufw
|
||||
;;
|
Loading…
x
Reference in New Issue
Block a user