Skip to content

Commit

Permalink
Merge pull request #94 from infstate/new-features-2
Browse files Browse the repository at this point in the history
Added Security Folder
  • Loading branch information
ChrisTitusTech authored Jul 30, 2024
2 parents b6ac4e7 + 29e257b commit b7c3123
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/commands/security/firewall-baselines.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh -e

installPkg() {
echo "Install UFW if not already installed..."
if ! command_exists ufw; then
case ${PACKAGER} in
pacman)
sudo "${PACKAGER}" -S --noconfirm ufw
;;
*)
sudo "${PACKAGER}" install -y ufw
;;
esac
else
echo "UFW is already installed."
fi
echo -e "${GREEN}Using Chris Titus Recommended Firewall Rules${RC}"
sudo ufw limit 22/tcp
echo "Limiting port 22/tcp (UFW)"

sudo ufw allow 80/tcp
echo "Allowing port 80/tcp (UFW)"

sudo ufw allow 443/tcp
echo "Allowing port 443/tcp (UFW)"

sudo ufw default deny incoming
echo "Denying Incoming Packets by Default(UFW)"

sudo ufw default allow outgoing
echo "Allowing Outcoming Packets by Default(UFW)"

sudo ufw enable
echo -e "${GREEN}Enabled Firewall with Baselines!${RC}"

}

checkEnv
installPkg
9 changes: 9 additions & 0 deletions src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ impl CustomList {
command: Command::LocalFile("system-setup/3-global-theme.sh"),
},
},
ListNode {
name: "Security",
command: ""
} => {
ListNode {
name: "Firewall Baselines (CTT)",
command: with_common_script!("commands/security/firewall-baselines.sh"),
}
},
ListNode {
name: "Titus Dotfiles",
command: Command::None
Expand Down

0 comments on commit b7c3123

Please sign in to comment.