• Benvenuti su RaspberryItaly!
Benvenuto ospite! Login Login con Facebook Registrati Login with Facebook


Valutazione discussione:
  • 0 voto(i) - 0 media
  • 1
  • 2
  • 3
  • 4
  • 5

[-]
Tags
su rpi firewall 4

Firewall su Rpi 4
#1
Ciao,
sto installando un nuovo Rpi 4 che mi servirà da:

- server NAS
- web server
- VPN server

Ho un router Tim Hub che ha il firewall impostato su medio. Ovviamente dovrò reindirizzare alcune porte esterne sulle corrispondenti del Raspi.

Conosco bene Linux e Python ma non sono un esperto di networking.

Potete gentilmente spigarmi se devo installare un firewall sul Raspi e che rischi corro senza?

Grazie,
Daniele
Risposta
#2
1. imposta una prenotazione dhcp per il raspberry (trovi la voce nei menu)
2. cerca la voce NAT
nat da porta 80, 443, porta vpn e porta usata per i file , verso l'ip del raspberry

https://assistenzatecnica.tim.it/at/ShowBinary?nodeId=/AT_REPOSITORY/486016&versionId=5
Heart Libro  | Blog EnricoSartori.it | Idea YouTube
Se un utente ti è stato utile, aumenta la sua reputazione! premi il Pollicione! 
Risposta
#3
Grazie questo mi è chiaro.
In realtà chiedevo “ Potete gentilmente spigarmi se devo installare un firewall sul Raspi e che rischi corro senza?”
Risposta
#4
basta che installi eppoi configuri fail2ban che per uso privato è più che sufficiente 
a gestirti diversi tipi di attacchi.

Installazione

Codice:
sudo apt-get install fail2ban

creati un file custom dove inserisci le varie regole

Codice:
sudo nano /etc/fail2ban/jail.d/custom.conf

qui dentro ci metti qlc del genere


Codice:
[DEFAULT] bantime = 14400 ignoreip = 127.0.0.1/8 192.168.1.0/24 maxretry = 5 [sshd] enabled = true port    = 22 logpath = %(sshd_log)s backend = %(sshd_backend)s [sshd-ddos] enabled = true port    = 22 logpath = %(sshd_log)s backend = %(sshd_backend)s [dropbear] enabled = true port     = 22 logpath  = %(dropbear_log)s backend  = %(dropbear_backend)s [apache-auth] enabled = true port     = http,https logpath  = %(apache_error_log)s [apache-badbots] enabled = true port     = http,https logpath  = %(apache_access_log)s bantime  = 172800 maxretry = 1 [apache-noscript] enabled = true port     = http,https logpath  = %(apache_error_log)s [apache-overflows] enabled = true port     = http,https logpath  = %(apache_error_log)s maxretry = 2 [apache-nohome] enabled = true port     = http,https logpath  = %(apache_error_log)s maxretry = 2 [apache-botsearch] enabled = true port     = http,https logpath  = %(apache_error_log)s maxretry = 2 [apache-fakegooglebot] port     = http,https logpath  = %(apache_access_log)s maxretry = 1 ignorecommand = %(ignorecommands_dir)s/apache-fakegooglebot <ip> [apache-modsecurity] enabled = true port     = http,https logpath  = %(apache_error_log)s maxretry = 2 [apache-shellshock] enabled = true port    = http,https logpath = %(apache_error_log)s maxretry = 1 [php-url-fopen] enabled = true port    = http,https logpath = %(nginx_access_log)s          %(apache_access_log)s [roundcube-auth] #enabled = true port     = http,https logpath  = %(roundcube_errors_log)s [webmin-auth] enabled = true port    = 10000 logpath = %(syslog_authpriv)s backend = %(syslog_backend)s [vsftpd] enabled = true port     = ftp,ftp-data,ftps,ftps-data logpath  = %(vsftpd_log)s [postfix] #enabled = true port     = smtp,465,submission logpath  = %(postfix_log)s backend  = %(postfix_backend)s [pam-generic] enabled = true banaction = %(banaction_allports)s logpath  = %(syslog_authpriv)s backend  = %(syslog_backend)s

modifica le voci adattandole ai ip della tua rete

Riavvia poi servizio

Codice:
sudo /etc/init.d/fail2ban reload

se non ti da errore è ok (attenzione a tag servizio ftp [vsftpd] se nn installato toglilo tra le regole altrimenti il reload ti va in errore)

non tutte le voci ti serviranno vedi tu quale mettere fra quelle sopra.

se poi vuoi una cosa professionale basta mettere il tuo raspberry  dietro a un firewall ti consiglio pfsense o zeroshell su macchina dedicata
Risposta
#5
[Immagine: es_sicurezza_principale-660x330.jpg]
Heart Libro  | Blog EnricoSartori.it | Idea YouTube
Se un utente ti è stato utile, aumenta la sua reputazione! premi il Pollicione! 
Risposta
  


Vai al forum:


Navigazione: 1 Ospite(i)
Forum con nuovi Post
Forum senza nuovi post
Forum bloccato
Forum Redirect