Do ufw
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 2 seconds
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 123 after 2 seconds
This commit is contained in:
parent
703f2bfa9e
commit
2989e82ddf
2 changed files with 23 additions and 0 deletions
18
src/steps-postinstall/15-ufw.sh
Normal file
18
src/steps-postinstall/15-ufw.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
task_begin "Configuring firewall";
|
||||
|
||||
#shellcheck disable=SC2154
|
||||
while read -r rule; do
|
||||
execute ufw ${rule};
|
||||
done < <(cat "${temp_dir}/ufw-rules.txt");
|
||||
|
||||
task_end "$?" "Error: Failed to configure firewall";
|
||||
|
||||
|
||||
# TODO: Make this automatic. For now it's on a prompt to avoid a lockout.
|
||||
if ask_yesno "Enable UFW? Current firewall rules are listed below.\n$(ufw show added)"; then
|
||||
task_begin "Enabling UFW";
|
||||
execute ufw enable;
|
||||
task_end "$?" "Error: Failed to enable UFW"
|
||||
fi
|
5
src/steps-preinstall/15-ufw.sh
Normal file
5
src/steps-preinstall/15-ufw.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
queue_apt_install ufw;
|
||||
|
||||
queue_firewall_rule allow 22/tcp comment ssh;
|
Loading…
Reference in a new issue