Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 19382  / 3 Years ago, mon, june 7, 2021, 11:47:08

basically I have two machines X and Y.



I want to block "http:// <IP-of-Y-Here> /AFolder/" from machine X on HTTP port 80 using ufw.



Trivially, this can be completed (awfully) using ufw through:



sudo ufw deny out 80


But is it possible to do something along the lines of:



ufw deny from (X IP ADDRESS) port 80 to (Y IP ADDRESS)/AFolder


That will satisfy my requirements?


More From » firewall

 Answers
2

No, you cannot use ufw to block access to some specific pages on a web server but not others.



ufw is a frontend for iptables which controls the netfilter firewall, which is built into the Linux kernel. This is an ordinary firewall--you can use it to filter packets based on their headers.



An IP address and port are included in a packet's headers, but what web document is being retrieved is not. Instead, this information is transmitted in the bodies of packets, after a connection is already established.



As you're probably aware, it is possible to block access to certain websites (though it's usually pretty easy for someone to circumvent the block), and there are utilities that provide the granularity to block specific pages while allowing access to other pages on the same server. But to address what you've asked: ufw will not do this.


[#32132] Tuesday, June 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bearous

Total Points: 226
Total Questions: 116
Total Answers: 136

Location: Guernsey
Member since Sun, Jan 10, 2021
3 Years ago
;