Firefox를 다음과 같이 작동하게 하려면 어떻게 해야 합니까?사이트별브라우저?
목표는 구획화를 통한 보안입니다. 특히, 내가 활동하는 시간을 포함하여 내 모든 인터넷 검색 활동을 추적하고 저장하려는 Facebook의 시도를 방해합니다.페이스북 홈페이지에는 없고.
이상적으로는 하나의 브라우저가 작동하도록 하고 싶습니다.오직Facebook에 액세스하고 다른 브라우저는 모든 사이트에 액세스할 수 있도록 작동합니다.제외하고페이스북.
Facebook 전용(단일 사이트) 브라우저로 작동하도록 Firefox를 설정하는 방법을 알려주십시오.
답변1
답변2
firejail
이 작업은 Linux에서 수행할 수 있으며 --netfilter
인수를 사용하여 다음을 수행할 수 있습니다.
[a] Facebook이 소유한 모든 IP 넷블록에 대한 액세스를 차단하는 iptables 규칙을 정의합니다.메인 브라우저그리고
[b] 전체 인터넷에 대한 액세스를 차단하는 iptables 규칙을 정의합니다.제외하고Facebook이 소유한 IP 넷블록Facebook 전용(샌드박스) 브라우저
Facebook이 소유한 IP 넷블록 목록은 Facebook, Inc = AS32934의 whois 자율 시스템(AS) 번호를 사용하여 찾을 수 있습니다.
root@disp355:/home/user# whois -h whois.radb.net -- \
root@disp355:/home/user# '-i origin AS32934'| grep -e "^route:"
...
route: 69.63.176.0/20
route: 66.220.144.0/20
route: 66.220.144.0/21
route: 69.63.184.0/21
route: 69.63.176.0/21
route: 74.119.76.0/22
route: 69.171.255.0/24
route: 173.252.64.0/18
route: 69.171.224.0/19
route: 69.171.224.0/20
root@disp355:/home/user#
그런 다음 전체 목록을 Facebook 전용 브라우저의 netfilter 파일에 넣을 수 있습니다.
sudo bash -c 'cat << EOF > /etc/firejail/facebookOnly.net
################################################################################
# Author: Michael Altfield <[email protected]>
# Created: 2019-03-25
# Updated: 2019-03-25
# Version: 0.1
# Purpose: Permits traffic to/from facebook (and dns) only
################################################################################
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
-A OUTPUT --destination 102.132.96.0/20 -j ACCEPT
-A OUTPUT --destination 102.132.96.0/24 -j ACCEPT
-A OUTPUT --destination 103.4.96.0/22 -j ACCEPT
-A OUTPUT --destination 129.134.0.0/17 -j ACCEPT
-A OUTPUT --destination 157.240.0.0/17 -j ACCEPT
-A OUTPUT --destination 157.240.10.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.1.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.11.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.12.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.13.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.14.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.15.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.18.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.19.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.192.0/18 -j ACCEPT
-A OUTPUT --destination 157.240.193.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.194.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.195.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.20.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.2.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.21.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.22.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.24.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.25.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.26.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.27.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.28.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.29.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.30.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.3.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.6.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.7.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.8.0/24 -j ACCEPT
-A OUTPUT --destination 157.240.9.0/24 -j ACCEPT
-A OUTPUT --destination 173.252.64.0/19 -j ACCEPT
-A OUTPUT --destination 173.252.88.0/21 -j ACCEPT
-A OUTPUT --destination 173.252.96.0/19 -j ACCEPT
-A OUTPUT --destination 179.60.192.0/22 -j ACCEPT
-A OUTPUT --destination 179.60.192.0/24 -j ACCEPT
-A OUTPUT --destination 179.60.193.0/24 -j ACCEPT
-A OUTPUT --destination 179.60.194.0/24 -j ACCEPT
-A OUTPUT --destination 179.60.195.0/24 -j ACCEPT
-A OUTPUT --destination 185.60.216.0/22 -j ACCEPT
-A OUTPUT --destination 185.60.216.0/24 -j ACCEPT
-A OUTPUT --destination 185.60.217.0/24 -j ACCEPT
-A OUTPUT --destination 185.60.218.0/24 -j ACCEPT
-A OUTPUT --destination 185.60.219.0/24 -j ACCEPT
-A OUTPUT --destination 204.15.20.0/22 -j ACCEPT
-A OUTPUT --destination 31.13.24.0/21 -j ACCEPT
-A OUTPUT --destination 31.13.64.0/18 -j ACCEPT
-A OUTPUT --destination 31.13.64.0/19 -j ACCEPT
-A OUTPUT --destination 31.13.64.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.65.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.66.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.67.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.68.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.70.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.71.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.72.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.73.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.74.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.75.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.80.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.81.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.82.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.83.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.84.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.85.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.86.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.87.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.89.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.90.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.91.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.92.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.93.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.94.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.95.0/24 -j ACCEPT
-A OUTPUT --destination 31.13.96.0/19 -j ACCEPT
-A OUTPUT --destination 45.64.40.0/22 -j ACCEPT
-A OUTPUT --destination 66.220.144.0/20 -j ACCEPT
-A OUTPUT --destination 66.220.144.0/21 -j ACCEPT
-A OUTPUT --destination 66.220.152.0/21 -j ACCEPT
-A OUTPUT --destination 69.171.224.0/19 -j ACCEPT
-A OUTPUT --destination 69.171.224.0/20 -j ACCEPT
-A OUTPUT --destination 69.171.239.0/24 -j ACCEPT
-A OUTPUT --destination 69.171.240.0/20 -j ACCEPT
-A OUTPUT --destination 69.171.250.0/24 -j ACCEPT
-A OUTPUT --destination 69.171.255.0/24 -j ACCEPT
-A OUTPUT --destination 69.63.176.0/20 -j ACCEPT
-A OUTPUT --destination 69.63.176.0/21 -j ACCEPT
-A OUTPUT --destination 69.63.184.0/21 -j ACCEPT
-A OUTPUT --destination 74.119.76.0/22 -j ACCEPT
-A OUTPUT -p udp --dport 53 -j ACCEPT
-A OUTPUT -j DROP
-A INPUT -p udp --sport 53 -j ACCEPT
-A INPUT -m state --state ESTABLISHED -j ACCEPT
-A INPUT -j DROP
COMMIT
EOF'
마찬가지로 기본 브라우저에 대한 반대를 만듭니다.
sudo bash -c 'cat << EOF > /etc/firejail/notFacebook.net
################################################################################
# Author: Michael Altfield <[email protected]>
# Created: 2019-03-25
# Updated: 2019-03-25
# Version: 0.1
# Purpose: Permits traffic to/from everything except facebook
################################################################################
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A OUTPUT --destination 102.132.96.0/20 -j DROP
-A OUTPUT --destination 102.132.96.0/24 -j DROP
-A OUTPUT --destination 103.4.96.0/22 -j DROP
-A OUTPUT --destination 129.134.0.0/17 -j DROP
-A OUTPUT --destination 157.240.0.0/17 -j DROP
-A OUTPUT --destination 157.240.10.0/24 -j DROP
-A OUTPUT --destination 157.240.1.0/24 -j DROP
-A OUTPUT --destination 157.240.11.0/24 -j DROP
-A OUTPUT --destination 157.240.12.0/24 -j DROP
-A OUTPUT --destination 157.240.13.0/24 -j DROP
-A OUTPUT --destination 157.240.14.0/24 -j DROP
-A OUTPUT --destination 157.240.15.0/24 -j DROP
-A OUTPUT --destination 157.240.18.0/24 -j DROP
-A OUTPUT --destination 157.240.19.0/24 -j DROP
-A OUTPUT --destination 157.240.192.0/18 -j DROP
-A OUTPUT --destination 157.240.193.0/24 -j DROP
-A OUTPUT --destination 157.240.194.0/24 -j DROP
-A OUTPUT --destination 157.240.195.0/24 -j DROP
-A OUTPUT --destination 157.240.20.0/24 -j DROP
-A OUTPUT --destination 157.240.2.0/24 -j DROP
-A OUTPUT --destination 157.240.21.0/24 -j DROP
-A OUTPUT --destination 157.240.22.0/24 -j DROP
-A OUTPUT --destination 157.240.24.0/24 -j DROP
-A OUTPUT --destination 157.240.25.0/24 -j DROP
-A OUTPUT --destination 157.240.26.0/24 -j DROP
-A OUTPUT --destination 157.240.27.0/24 -j DROP
-A OUTPUT --destination 157.240.28.0/24 -j DROP
-A OUTPUT --destination 157.240.29.0/24 -j DROP
-A OUTPUT --destination 157.240.30.0/24 -j DROP
-A OUTPUT --destination 157.240.3.0/24 -j DROP
-A OUTPUT --destination 157.240.6.0/24 -j DROP
-A OUTPUT --destination 157.240.7.0/24 -j DROP
-A OUTPUT --destination 157.240.8.0/24 -j DROP
-A OUTPUT --destination 157.240.9.0/24 -j DROP
-A OUTPUT --destination 173.252.64.0/19 -j DROP
-A OUTPUT --destination 173.252.88.0/21 -j DROP
-A OUTPUT --destination 173.252.96.0/19 -j DROP
-A OUTPUT --destination 179.60.192.0/22 -j DROP
-A OUTPUT --destination 179.60.192.0/24 -j DROP
-A OUTPUT --destination 179.60.193.0/24 -j DROP
-A OUTPUT --destination 179.60.194.0/24 -j DROP
-A OUTPUT --destination 179.60.195.0/24 -j DROP
-A OUTPUT --destination 185.60.216.0/22 -j DROP
-A OUTPUT --destination 185.60.216.0/24 -j DROP
-A OUTPUT --destination 185.60.217.0/24 -j DROP
-A OUTPUT --destination 185.60.218.0/24 -j DROP
-A OUTPUT --destination 185.60.219.0/24 -j DROP
-A OUTPUT --destination 204.15.20.0/22 -j DROP
-A OUTPUT --destination 31.13.24.0/21 -j DROP
-A OUTPUT --destination 31.13.64.0/18 -j DROP
-A OUTPUT --destination 31.13.64.0/19 -j DROP
-A OUTPUT --destination 31.13.64.0/24 -j DROP
-A OUTPUT --destination 31.13.65.0/24 -j DROP
-A OUTPUT --destination 31.13.66.0/24 -j DROP
-A OUTPUT --destination 31.13.67.0/24 -j DROP
-A OUTPUT --destination 31.13.68.0/24 -j DROP
-A OUTPUT --destination 31.13.70.0/24 -j DROP
-A OUTPUT --destination 31.13.71.0/24 -j DROP
-A OUTPUT --destination 31.13.72.0/24 -j DROP
-A OUTPUT --destination 31.13.73.0/24 -j DROP
-A OUTPUT --destination 31.13.74.0/24 -j DROP
-A OUTPUT --destination 31.13.75.0/24 -j DROP
-A OUTPUT --destination 31.13.80.0/24 -j DROP
-A OUTPUT --destination 31.13.81.0/24 -j DROP
-A OUTPUT --destination 31.13.82.0/24 -j DROP
-A OUTPUT --destination 31.13.83.0/24 -j DROP
-A OUTPUT --destination 31.13.84.0/24 -j DROP
-A OUTPUT --destination 31.13.85.0/24 -j DROP
-A OUTPUT --destination 31.13.86.0/24 -j DROP
-A OUTPUT --destination 31.13.87.0/24 -j DROP
-A OUTPUT --destination 31.13.89.0/24 -j DROP
-A OUTPUT --destination 31.13.90.0/24 -j DROP
-A OUTPUT --destination 31.13.91.0/24 -j DROP
-A OUTPUT --destination 31.13.92.0/24 -j DROP
-A OUTPUT --destination 31.13.93.0/24 -j DROP
-A OUTPUT --destination 31.13.94.0/24 -j DROP
-A OUTPUT --destination 31.13.95.0/24 -j DROP
-A OUTPUT --destination 31.13.96.0/19 -j DROP
-A OUTPUT --destination 45.64.40.0/22 -j DROP
-A OUTPUT --destination 66.220.144.0/20 -j DROP
-A OUTPUT --destination 66.220.144.0/21 -j DROP
-A OUTPUT --destination 66.220.152.0/21 -j DROP
-A OUTPUT --destination 69.171.224.0/19 -j DROP
-A OUTPUT --destination 69.171.224.0/20 -j DROP
-A OUTPUT --destination 69.171.239.0/24 -j DROP
-A OUTPUT --destination 69.171.240.0/20 -j DROP
-A OUTPUT --destination 69.171.250.0/24 -j DROP
-A OUTPUT --destination 69.171.255.0/24 -j DROP
-A OUTPUT --destination 69.63.176.0/20 -j DROP
-A OUTPUT --destination 69.63.176.0/21 -j DROP
-A OUTPUT --destination 69.63.184.0/21 -j DROP
-A OUTPUT --destination 74.119.76.0/22 -j DROP
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -j DROP
COMMIT
EOF'
이제 다음과 같이 첫 번째 netfitler 규칙 세트를 사용하여 Facebook 전용 브라우저를 시작할 수 있습니다.
firejail --dns="1.1.1.1" --dns="9.9.9.9" --dns="8.8.8.8" --net=eth0 --netfilter=/etc/firejail/facebookOnly.net firefox -no-remote -new-instance "https://www.facebook.com"
나머지 웹에서 Facebook 서버로 "콜 홈"할 수 없는 범용 브라우저의 경우:
firejail --dns="1.1.1.1" --dns="9.9.9.9" --dns="8.8.8.8" --net=eth0 --netfilter=/etc/firejail/notFacebok.net firefox -no-remote -new-instance "https://start.duckduckgo.com"
이에 대한 자세한 내용은 다음 문서를 참조하세요.