Home>
The main task is to block all connections, including outgoing ones, except for the specified IP and a pair of sites (ru.archive.ubuntu.com, api.vk.com, discord.com).
I am coping with the first part, but I have not been able to provide access to specific sites for several days already, I hope for your help.
Tried it :
- Allow access for a specific IP site (
iptables -A OUTPUT -d IP -j ACCEPT
). - Allow "route" access from
host -t a Site
->whois IP
. - Try to allow access by domain (
iptables -A OUTPUT -d DOMEN -j ACCEPT
, iptables didn't).
Commands used:
iptables -F
iptables -X
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -s xx.xx.xx.xx -d "$ SERVERIP" -j ACCEPT
iptables -A OUTPUT -s "$ SERVERIP" -d xx.xx.xx.xx -j ACCEPT
@Total Pusher, in my case, it is necessary to specifically block all outgoing messages so that through some hole (ala Log4jExploit) it was impossible to download a file and download data bypassing SSH /FTP.
NyashMyash992022-01-10 09:44:37Better to use an enterprise solution. IP tables solution is knee-length, and for the poor. PS. And prone to turning into noodles as rules are added
Total Pusher2022-01-10 09:47:34Related questions
- linux : Forward client traffic through a different interface and forward the port
- linux : MongoDB, Connection Attempt Failed: SocketException: Error Connecting EconnRefused
- mysql : Write error messages when restoring the database in the log file
- linux : Ubuntu 21.04 automatically disables USB 3.0 port
- linux : I want to know the command to check only the number of lines in which the sentence is written
- linux : CTRL C, Ctrl Z, Ctrl P in Atom
- Segmentation error (memory stack is reset to disk) c++
- linux : What DNS uses WGET? Unable to Resolve Host Address)
- linux : How to create a VSFTPD user and give it access to /VAR /WWW?
If we simplify the task to "block all http, except for a few sites", then you can use a specialized tool -squid
Total Pusher2022-01-10 09:41:29