GithubHelp home page GithubHelp logo

nazgul6 / osxfortress Goto Github PK

View Code? Open in Web Editor NEW

This project forked from essandess/macos-fortress

0.0 1.0 0.0 1.03 MB

Firewall and Privatizing Proxy for Trackers, Attackers, Malware, Adware, and Spammers (PF, squid, privoxy, hphosts, dshield, emergingthreats, hostsfile)

License: MIT License

Shell 92.87% JavaScript 7.13%

osxfortress's Introduction

osxfortress

OS X Fortress: Firewall, Blackhole, and Privatizing Proxy for Trackers, Attackers, Malware, Adware, and Spammers

Kernel-level, OS-level, and client-level security for OS X. Built to address a steady stream of attacks visible on snort and server logs, as well as blocks ads, malicious scripts, and conceal information used to track you around the web. After this package was installed, snort and other detections have fallen to a fraction with a few simple blocking actions. This setup is a lot more capable and effective than using a simple adblocking browser add-on. There's a world of difference between ad-filled web pages with and without a filtering proxy server. It's also saved me from inadvertantly clicking on phishing links.

Tracker blocking

Lightbeam, the tracking tracker Firefox add-on, shows how ad- and tracker-blocking works to prevent third parties monitoring you or your children's online activities. My daughter enjoys the learning exercises at the children's website ABCya!. The Lightbeam graph below on the left shows all the third party trackers after less than a minute of browser activity, without using a privatizing proxy. The graph on the right shows all this tracker activity blocked when this privatizing proxy is used.

Lightbeam graph without proxy Lightbeam graph without proxy
Lightbeam graph without proxy Lightbeam graph with proxy

This problem is the subject of Gary Kovacs's TED talk, Tracking Our Online Trackers:

Tracking our online trackers

Attack blocking

The snort intrusion detection system reports far fewer events when known attack sites are blackholed by the packet filter:

snort+BASE Overview snort+BASE Events
snort+BASE Overview snort+BASE Events

Proxy features

This package uses these features:

  • OS X adaptive firewall
  • Adaptive firewall to brute force attacks
  • IP blocks updated about twice a day from emergingthreats.net (IP blocks, compromised hosts, Malvertisers) and dshield.org’s top-20
  • Host blocks updated about twice a day from hphosts.net
  • Special proxy.pac host blacklisting from hostsfile.org

The install script readme-and-install.sh installs and configures an OS X Firewall and Privatizing Proxy. It will:

  • Prompt you to install Apple's Xcode Command Line Tools and Macports
  • Uses Macports to download and install several key utilities and applications (wget gnupg p7zip squid privoxy nmap)
  • Configure OS X's PF native firewall (man pfctl, man pf.conf), squid, and privoxy
  • Turn on OS X's native Apache webserver to serve the Automatic proxy configuration http://localhost/proxy.pac
  • Networking on the local computer can be set up to use this Automatic Proxy Configuration without breaking App Store or other updates (see squid.conf)
  • Uncomment the nat directive in pf.conf if you wish to set up an OpenVPN server
  • Install and launch daemons that download and regularly update open source IP and host blacklists. The sources are emergingthreats.net (net.emergingthreats.blockips.plist), dshield.org (net.dshield.block.plist), hosts-file.net (net.hphosts.hosts.plist), and securemecca.com (net.securemecca.pac.plist)
  • Installs a user launch daemon that deletes flash cookies not related to Adobe Flash Player settings every half-hour (http://goo.gl/k4BxuH)
  • After installation the connection between clients and the internet looks this this:

Application ➡️port 3128➡️ Squid ➡️port 8118➡️ Privoxy ➡️ Internet

Installation

sudo sh ./readme-and-install.sh

Notes

  • Configure the squid proxy to accept connections on the LAN IP and set LAN device Automatic Proxy Configurations to http://lan_ip/proxy.pac to protect devices on the LAN.
  • Count the number of attacks since boot with the script pf_attacks. ``Attack'' is defined as the number of blocked IPs in PF's bruteforce table plus the number of denied connections from blacklisted IPs in the tables compromised_ips, dshield_block_ip, and emerging_threats.
  • Both squid and Privoxy are configured to forge the User-Agent. The default is an iPad to allow mobile device access. Change this to your local needs if necessary.
  • Whitelist or blacklist specific domain names with the files /usr/local/etc/whitelist.txt and /usr/local/etc/blacklist.txt. After editing these file, use launchctl to unload and load the plist /Library/LaunchDaemons/net.hphosts.hosts.plist, which recreates the hostfile /etc/hosts-hphost and reconfigures the squid proxy to use the updates.
  • Sometimes pf and privoxy do not launch at boot, in spite of the use of the use of their launch daemons. Fix this by hand after boot with the scripts osxfortress_boot_check, or individually using pf_restart, privoxy_restart, and squid_restart. And please post a solution if you find one.
  • All open source updates are done using the wget -N option to save everyone's bandwidth

Security

  • These services are intended to be run on a secure LAN behind a router firewall.
  • The default proxy configuration will only accept connections made from the local computer (localhost). If you change this to accept connections from any client on your LAN, do not configure the router to forward ports 3128 or 8118, or you will be running an open web proxy.

osxfortress's People

Contributors

essandess avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.