Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions debian/install.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ echo "set mouse-=a" >> ~/.vimrc
#IPTables
resources/iptables.sh

#NFTables
#resources/nftables.sh

#sngrep
resources/sngrep.sh

Expand Down
Empty file modified debian/pre-install.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/applications.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/arguments.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/backup/fusionpbx-backup
100755 → 100644
Empty file.
Empty file modified debian/resources/backup/fusionpbx-maintenance
100755 → 100644
Empty file.
Empty file modified debian/resources/colors.sh
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion debian/resources/config.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ database_port=5432 # port number
database_backup=false # true or false

# General Settings
php_version=8.2 # PHP version 8.3, 8.2, 8.1
php_version=8.4 # PHP version 8.4, 8.3, 8.2, 8.1
letsencrypt_folder=true # true or false

# Optional Applications
Expand Down
Empty file modified debian/resources/environment.sh
100755 → 100644
Empty file.
14 changes: 13 additions & 1 deletion debian/resources/fail2ban.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ cd "$(dirname "$0")"
. ./colors.sh
. ./environment.sh

FILE_PATH="/etc/iptables/rules.v4"

#send a message
verbose "Installing Fail2ban"

Expand All @@ -26,7 +28,17 @@ cp fail2ban/fusionpbx-mac.conf /etc/fail2ban/filter.d/fusionpbx-mac.conf
cp fail2ban/fusionpbx-404.conf /etc/fail2ban/filter.d/fusionpbx-404.conf
cp fail2ban/nginx-404.conf /etc/fail2ban/filter.d/nginx-404.conf
cp fail2ban/nginx-dos.conf /etc/fail2ban/filter.d/nginx-dos.conf
cp fail2ban/jail.local /etc/fail2ban/jail.local
if [ ! -f "$FILE_PATH" ]; then
echo "Found nftables to be chosen, configuring system for nftables."
cp fail2ban/jail.local.nft /etc/fail2ban/jail.local
sed -i 's/iptables/nftables/g' /etc/fail2ban/jail.conf
else
echo "Default iptables was installed."
cp fail2ban/jail.local /etc/fail2ban/jail.local
fi




#update config if source is being used
#if [ .$switch_source = .true ]; then
Expand Down
Empty file modified debian/resources/fail2ban/freeswitch-ip.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/fail2ban/freeswitch.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/fail2ban/fusionpbx-404.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/fail2ban/fusionpbx.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/fail2ban/jail.local
100755 → 100644
Empty file.
151 changes: 151 additions & 0 deletions debian/resources/fail2ban/jail.local.nft
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
[DEFAULT]
# time is in seconds. 3600 = 1 hour, 86400 = 24 hours (1 day)
#findtime = 10m #Default Value on jail.conf. Uncomment this to use another value.
#bantime = 10m #Default Value on jail.conf. Uncomment this to use another value.
#maxretry = 5 #Default Value on jail.conf. Uncomment this to use another value.
#ignoreip = ip/subnet ip/subnet #Uncomment and add IPs and subnets you don't wish to ban.
# Save your modified copy of this for future use as a drop-in replacement.

[ssh]
enabled = true
port = 22
protocol = ssh
filter = sshd
logpath = /var/log/auth.log
action = nftables-allports[name=sshd, protocol=all]
maxretry = 6
findtime = 60
bantime = 86400

[freeswitch]
enabled = false
port = 5060:5091
protocol = all
filter = freeswitch
logpath = /var/log/freeswitch/freeswitch.log
#logpath = /usr/local/freeswitch/log/freeswitch.log
action = nftables-allports[name=freeswitch, protocol=all]
maxretry = 10
findtime = 60
bantime = 3600
# sendmail-whois[name=FreeSwitch, dest=root, sender=fail2ban@example.org] #no smtp server installed

[freeswitch-acl]
enabled = false
port = 5060:5091
protocol = all
filter = freeswitch-acl
logpath = /var/log/freeswitch/freeswitch.log
#logpath = /usr/local/freeswitch/log/freeswitch.log
action = nftables-allports[name=freeswitch-acl, protocol=all]
maxretry = 900
findtime = 60
bantime = 86400

[freeswitch-ip]
enabled = false
port = 5060:5091
protocol = all
filter = freeswitch-ip
logpath = /var/log/freeswitch/freeswitch.log
#logpath = /usr/local/freeswitch/log/freeswitch.log
action = nftables-allports[name=freeswitch-ip, protocol=all]
maxretry = 1
findtime = 60
bantime = 86400

[auth-challenge-ip]
enabled = false
port = 5060:5091
protocol = all
filter = auth-challenge-ip
logpath = /var/log/freeswitch/freeswitch.log
#logpath = /usr/local/freeswitch/log/freeswitch.log
action = nftables-allports[name=auth-challenge-ip, protocol=all]
maxretry = 1
findtime = 60
bantime = 86400

[sip-auth-challenge]
enabled = false
port = 5060:5091
protocol = all
filter = sip-auth-challenge
logpath = /var/log/freeswitch/freeswitch.log
#logpath = /usr/local/freeswitch/log/freeswitch.log
action = nftables-allports[name=sip-auth-challenge, protocol=all]
maxretry = 100
findtime = 60
bantime = 7200

[sip-auth-failure]
enabled = false
port = 5060:5091
protocol = all
filter = sip-auth-failure
logpath = /var/log/freeswitch/freeswitch.log
#logpath = /usr/local/freeswitch/log/freeswitch.log
action = nftables-allports[name=sip-auth-failure, protocol=all]
maxretry = 6
findtime = 60
bantime = 7200

[fusionpbx-404]
enabled = false
port = 5060:5091
protocol = all
filter = fusionpbx-404
logpath = /var/log/freeswitch/freeswitch.log
#logpath = /usr/local/freeswitch/log/freeswitch.log
action = nftables-allports[name=fusionpbx-404, protocol=all]
maxretry = 6
findtime = 60
bantime = 86400

[fusionpbx]
enabled = true
port = 80,443
protocol = tcp
filter = fusionpbx
logpath = /var/log/auth.log
action = nftables-allports[name=fusionpbx, protocol=all]
# sendmail-whois[name=fusionpbx, dest=root, sender=fail2ban@example.org] #no smtp server installed
maxretry = 20
findtime = 60
bantime = 3600

[fusionpbx-mac]
enabled = true
port = 80,443
protocol = tcp
filter = fusionpbx-mac
logpath = /var/log/syslog
action = nftables-allports[name=fusionpbx-mac, protocol=all]
# sendmail-whois[name=fusionpbx-mac, dest=root, sender=fail2ban@example.org] #no smtp server installed
maxretry = 10
findtime = 60
bantime = 86400

[nginx-404]
enabled = true
port = 80,443
protocol = tcp
filter = nginx-404
logpath = /var/log/nginx/access*.log
action = nftables-allports[name=nginx-404, protocol=all]
bantime = 3600
findtime = 60
maxretry = 300

[nginx-dos]
# Based on apache-badbots but a simple IP check (any IP requesting more than
# 300 pages in 60 seconds, or 5p/s average, is suspicious)
enabled = true
port = 80,443
protocol = tcp
filter = nginx-dos
logpath = /var/log/nginx/access*.log
action = nftables-allports[name=nginx-dos, protocol=all]
findtime = 60
bantime = 86400
maxretry = 800
Empty file modified debian/resources/fail2ban/nginx-404.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/fail2ban/nginx-dos.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/fail2ban/sip-auth-failure.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/finish.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/fusionpbx.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/ioncube.sh
100755 → 100644
Empty file.
5 changes: 5 additions & 0 deletions debian/resources/iptables.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ if [ ."$os_codename" = ."bookworm" ]; then
update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
fi
if [ ."$os_codename" = ."trixie" ]; then
apt-get install -y iptables
update-alternatives --set iptables /usr/sbin/iptables-legacy
update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
fi

#remove ufw
ufw reset
Expand Down
Empty file modified debian/resources/letsencrypt.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/letsencrypt/domain_name.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/monit.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/monit/shell.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/nftables.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/nginx.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/nginx/fusionpbx
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion debian/resources/php.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ else
fi
fi
if [ ."$os_codename" = ."trixie" ]; then
if [ ."$php_version" = ."8.2" ]; then
if [ ."$php_version" = ."8.4" ]; then
/usr/bin/apt -y install apt-transport-https lsb-release ca-certificates curl wget gnupg2
/usr/bin/wget -qO- https://packages.sury.org/php/apt.gpg | gpg --dearmor > /etc/apt/keyrings/sury-php-8.x.gpg
/usr/bin/chmod 644 /etc/apt/keyrings/sury-php-8.x.gpg
Expand Down
Empty file modified debian/resources/postgresql.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/create.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/dsn.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/empty.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/iptables.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/node.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/pg_hba.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/pg_hba.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/postgresql/postgresql.conf
100755 → 100644
Empty file.
Empty file modified debian/resources/random.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/reboot_phones.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/reset_admin_password.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/sngrep.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/conf-copy.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/dsn.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/package-all.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/package-master-all.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/package-master.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/package-permissions.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/package-release.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/package-systemd.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/repo.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source-master.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source-permissions.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source-release.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source-sounds.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source-systemd.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source-to-package.sh
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source/etc.default.freeswitch.package
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source/etc.default.freeswitch.source
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source/freeswitch.service.package
100755 → 100644
Empty file.
Empty file modified debian/resources/switch/source/freeswitch.service.source
100755 → 100644
Empty file.
Empty file modified debian/resources/upgrade/php.sh
100755 → 100644
Empty file.