Hey everybody,
Currently I already have my server runing as desired.
Looking for optimizations and how to keep it hardening, I have found the reference on /etc/rc.ipfw about the book Building Internet Firewalls.
So, try following some examples, I did not got how ipfw works when trying limit it, for example, my old rule works "pretty well":
The book gives the advice about only accept answers using the ACK on TCP and use high ports for navigation (usually only download updates), then I have changed to:
The question is how "OUT" works in details?
From my old way my guess it's bidirecional, so when I use something with OUT on firewall, automaticaly I'm accepting similar rule for IN complete the connection it is? (In another words, I cannot control the TCP handshake is it?)
Because on old way I don't have setup an IN rule and works fine.
And adding the second rule (20) seems that never get touched using
What should be the best approach on this example? (Following the book recomendation to only accept answers with ACK set)
PS.: I am asking about generic rule to download updates, not for webserver like apache or others (on webserver the IN works as desired).
Currently I already have my server runing as desired.
Looking for optimizations and how to keep it hardening, I have found the reference on /etc/rc.ipfw about the book Building Internet Firewalls.
So, try following some examples, I did not got how ipfw works when trying limit it, for example, my old rule works "pretty well":
Bash:
ipfw add 10 -q allow tcp from 10.1.1.100 80 to any 80 out via vmx0 setup keep-state
The book gives the advice about only accept answers using the ACK on TCP and use high ports for navigation (usually only download updates), then I have changed to:
Bash:
ipfw add 10 -q allow tcp from 10.1.1.100 1024-65535 to any 80 out via vmx0 setup keep-state
ipfw add 20 -q allow tcp from any 80 to 10.1.1.100 1024-65535 in via vmx0 tcpflags ack setup keep-state
The question is how "OUT" works in details?
From my old way my guess it's bidirecional, so when I use something with OUT on firewall, automaticaly I'm accepting similar rule for IN complete the connection it is? (In another words, I cannot control the TCP handshake is it?)
Because on old way I don't have setup an IN rule and works fine.
And adding the second rule (20) seems that never get touched using
ipfw show
.What should be the best approach on this example? (Following the book recomendation to only accept answers with ACK set)
PS.: I am asking about generic rule to download updates, not for webserver like apache or others (on webserver the IN works as desired).