mirror of
https://github.com/ChrisTitusTech/linutil.git
synced 2025-03-04 13:57:12 +00:00
29 lines
916 B
Bash
29 lines
916 B
Bash
#!/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
|