Firewall

Pubblicità

R3boot

Utente Èlite
Messaggi
1,635
Reazioni
574
Punteggio
72
Ho un pò di confusione
Se non ho capito male, iptables cioè il firewall di *buntu è attivo di default ma non filtra niente, cioè lascia entrare tutto: non filtra niente? E quindi a che serve ? Peggio del firewall di winzozz..ho capito male io ?
Quindi va configurato secondo quanto dice questa guida? Mentre per il traffico in uscita non servono policy perchè non è come winzozz perchè non esistono eventuali malware che inviano dati verso l'esterno.http://wiki.ubuntu-it.org/Sicurezza/Iptables
Chi mi illumina?
 
Quindi se io mi installo gufw e gli do semplicemente in entrata deny e in uscita allow, dovrei essere relativamente tranquillo ?
 
Fai così:
# iptables -P INPUT DROP
# iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT ; necessaria altrimenti ogni pacchetto verrà droppato!
 
:grat: a costo di fare figure del piffero, bisognava fare qualcosa per rendere persistenti le modifiche? Avevo smanettato un attimo con le regole del raspberry per aprire ssh e se non erro bisognava scrivere su un file, ricordo male?
 
:grat: a costo di fare figure del piffero, bisognava fare qualcosa per rendere persistenti le modifiche? Avevo smanettato un attimo con le regole del raspberry per aprire ssh e se non erro bisognava scrivere su un file, ricordo male?
iptables-save > /etc/iptables.rules
Tuttavia non ricordo se fosse possibile cambiare il file principale.
 
scusate ma avete a che fare con un newbie, non sono un utente avanzato e nemmeno medio, quindi ho bisogno di spiegazioni...alla faccia della figura del piffero.
Qui comandi sono comandi da terminale o policy da inserire in gufw?
Nell'eventuale prima ipotesi non basta/non va bene come ho impostato gufw o cosa?
 
Quelli indicati sono comandi da terminale, gufw so che esiste ma non l'ho mai provato
Ok
Ma se io al posto dei comandi da terminale uso questo software "gufw" che si installa tra l'altro dal software center ed ha un'interfaccia semplice e intuitiva per i nabbi come me , ed imposto quelle due regole che ho detto sopra cioè blocca tutto il traffico in ingresso e consenti quello in uscita ( senza regole particolari, almeno finchè non imparerò ad usarlo) non è una buona soluzione o è una c***a?
Per funzionare mi pare che funzioni: ho fatto una piccola prova mettendo deny anche sul traffico in uscita e il browser non andava più.
 
@pacoti dovrei provare. Alla fine è semplicemente un'interfaccia grafica. L'unica cosa è verificare se viene rispettata la specifica "RELATED, ESTABLISHED" indicata da signore del tempo
 
@pacoti dovrei provare. Alla fine è semplicemente un'interfaccia grafica. L'unica cosa è verificare se viene rispettata la specifica "RELATED, ESTABLISHED" indicata da signore del tempo
Allora siccome le idee mi si stanno chiarendo ma ho ancora luci e ombre sull'argomento, aspetto che @signore del tempo mi spieghi quello che ha detto sopra ossia se quei due comandi da terminale li devo dare comunque anche con quel firewall control oppure se sono da dare invece di quello che andrebbe tolto. Se tenessi l'interfaccia come posso verificare che questa specifica RELATED,ESTABLISHED venga rispettata? E ci sono altre regole o impostazioni fondamentali da inserire per il corretto funzionamento? Grazie.
 
Da terminale, posta l'output di:
# iptables -vnL
Non ho mai usato (g)ufw; ho seguito la wiki di ArchLinux. Prova a farlo anche tu, vedrai che risolverai molti dubbi.
 
Da terminale, posta l'output di:
# iptables -vnL
Non ho mai usato (g)ufw; ho seguito la wiki di ArchLinux. Prova a farlo anche tu, vedrai che risolverai molti dubbi.

sudo iptables -vnL
[sudo] password for utente:
Chain INPUT (policy DROP 10 packets, 284 bytes)
pkts bytes target prot opt in out source destination
2285 2112K ufw-before-logging-input all -- * * 0.0.0.0/0 0.0.0.0/0
2285 2112K ufw-before-input all -- * * 0.0.0.0/0 0.0.0.0/0
55 5803 ufw-after-input all -- * * 0.0.0.0/0 0.0.0.0/0
10 284 ufw-after-logging-input all -- * * 0.0.0.0/0 0.0.0.0/0
10 284 ufw-reject-input all -- * * 0.0.0.0/0 0.0.0.0/0
10 284 ufw-track-input all -- * * 0.0.0.0/0 0.0.0.0/0

Chain FORWARD (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ufw-before-logging-forward all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ufw-before-forward all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ufw-after-forward all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ufw-after-logging-forward all -- * * 0.0.0.0/0 0.0.0.0/0
0 0 ufw-reject-forward all -- * * 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT 2 packets, 80 bytes)
pkts bytes target prot opt in out source destination
2123 239K ufw-before-logging-output all -- * * 0.0.0.0/0 0.0.0.0/0
2123 239K ufw-before-output all -- * * 0.0.0.0/0 0.0.0.0/0
349 27612 ufw-after-output all -- * * 0.0.0.0/0 0.0.0.0/0
349 27612 ufw-after-logging-output all -- * * 0.0.0.0/0 0.0.0.0/0
349 27612 ufw-reject-output all -- * * 0.0.0.0/0 0.0.0.0/0
349 27612 ufw-track-output all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-after-forward (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-after-input (1 references)
pkts bytes target prot opt in out source destination
32 3000 ufw-skip-to-policy-input udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:137
9 2231 ufw-skip-to-policy-input udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:138
0 0 ufw-skip-to-policy-input tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:139
0 0 ufw-skip-to-policy-input tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:445
0 0 ufw-skip-to-policy-input udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:67
0 0 ufw-skip-to-policy-input udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:68
4 288 ufw-skip-to-policy-input all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type BROADCAST

Chain ufw-after-logging-forward (1 references)
pkts bytes target prot opt in out source destination
0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-after-logging-input (1 references)
pkts bytes target prot opt in out source destination
10 284 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-after-logging-output (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-after-output (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-before-forward (1 references)
pkts bytes target prot opt in out source destination
0 0 ufw-user-forward all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-before-input (1 references)
pkts bytes target prot opt in out source destination
138 13401 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0
2070 2089K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
0 0 ufw-logging-deny all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 3
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 4
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 11
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 12
0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmptype 8
0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp spt:67 dpt:68
77 10547 ufw-not-local all -- * * 0.0.0.0/0 0.0.0.0/0
22 4744 ACCEPT udp -- * * 0.0.0.0/0 224.0.0.251 udp dpt:5353
0 0 ACCEPT udp -- * * 0.0.0.0/0 239.255.255.250 udp dpt:1900
55 5803 ufw-user-input all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-before-logging-forward (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-before-logging-input (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-before-logging-output (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-before-output (1 references)
pkts bytes target prot opt in out source destination
138 13401 ACCEPT all -- * lo 0.0.0.0/0 0.0.0.0/0
1636 198K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
349 27612 ufw-user-output all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-logging-allow (0 references)
pkts bytes target prot opt in out source destination
0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW ALLOW] "

Chain ufw-logging-deny (2 references)
pkts bytes target prot opt in out source destination
0 0 RETURN all -- * * 0.0.0.0/0 0.0.0.0/0 state INVALID limit: avg 3/min burst 10
0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-not-local (1 references)
pkts bytes target prot opt in out source destination
0 0 RETURN all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL
32 5028 RETURN all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type MULTICAST
45 5519 RETURN all -- * * 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type BROADCAST
0 0 ufw-logging-deny all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 3/min burst 10
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-reject-forward (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-reject-input (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-reject-output (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-skip-to-policy-forward (0 references)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-skip-to-policy-input (7 references)
pkts bytes target prot opt in out source destination
45 5519 DROP all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-skip-to-policy-output (0 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-track-input (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-track-output (1 references)
pkts bytes target prot opt in out source destination
197 11820 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW
150 15712 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW

Chain ufw-user-forward (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-user-input (1 references)
pkts bytes target prot opt in out source destination

Chain ufw-user-limit (0 references)
pkts bytes target prot opt in out source destination
0 0 LOG all -- * * 0.0.0.0/0 0.0.0.0/0 limit: avg 3/min burst 5 LOG flags 0 level 4 prefix "[UFW LIMIT BLOCK] "
0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-port-unreachable

Chain ufw-user-limit-accept (0 references)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0

Chain ufw-user-logging-forward (0 references)
pkts bytes target prot opt in out source destination

Chain ufw-user-logging-input (0 references)
pkts bytes target prot opt in out source destination

Chain ufw-user-logging-output (0 references)
pkts bytes target prot opt in out source destination

Chain ufw-user-output (1 references)
pkts bytes target prot opt in out source destination
 
Pubblicità
Pubblicità
Indietro
Top