Explorar el Código

Improve mesh firewall to block common bad guys

Bob Mottram hace 6 años
padre
commit
e6f04a7f60
Se han modificado 1 ficheros con 26 adiciones y 0 borrados
  1. 26
    0
      src/freedombone-utils-firewall

+ 26
- 0
src/freedombone-utils-firewall Ver fichero

@@ -360,6 +360,32 @@ function mesh_firewall {
360 360
     FIREWALL_FILENAME="${rootdir}/etc/systemd/system/meshfirewall.service"
361 361
     MESH_FIREWALL_SCRIPT=${rootdir}/usr/bin/mesh-firewall
362 362
 
363
+    if ! grep -q 'telemetry.mozilla' ${rootdir}/etc/hosts; then
364
+	echo '127.0.0.1       telemetry.mozilla.org' >> ${rootdir}/etc/hosts
365
+	echo '127.0.0.1       incoming.telemetry.mozilla.org' >> ${rootdir}/etc/hosts
366
+    fi
367
+
368
+    if ! grep -q 'facebook' ${rootdir}/etc/hosts; then
369
+	echo { echo '127.0.0.1       www.facebook.com';
370
+	       echo '127.0.0.1       facebook.com';
371
+	       echo '127.0.0.1       static.ak.fbcdn.net';
372
+	       echo '127.0.0.1       www.static.ak.fbcdn.net';
373
+	       echo '127.0.0.1       login.facebook.com';
374
+	       echo '127.0.0.1       www.login.facebook.com';
375
+	       echo '127.0.0.1       fbcdn.net';
376
+	       echo '127.0.0.1       www.fbcdn.net';
377
+	       echo '127.0.0.1       fbcdn.com';
378
+	       echo '127.0.0.1       www.fbcdn.com';
379
+	       echo '127.0.0.1       static.ak.connect.facebook.com';
380
+	       echo '127.0.0.1       www.static.ak.connect.facebook.com'; } >> ${rootdir}/etc/hosts	
381
+    fi
382
+    
383
+    if ! grep -q 'google' ${rootdir}/etc/hosts; then
384
+	{ echo '127.0.0.1       www.google-analytics.com';
385
+	  echo '127.0.0.1       google-analytics.com';
386
+	  echo '127.0.0.1       ssl.google-analytics.com'; } >> ${rootdir}/etc/hosts
387
+    fi    
388
+    
363 389
     { echo '#!/bin/bash';
364 390
       echo 'iptables -P INPUT ACCEPT';
365 391
       echo 'ip6tables -P INPUT ACCEPT';