Skip to content
Create Little Snitch rule group from list of hostnames
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs add note about updating files. Apr 10, 2019
website clean up branches Apr 9, 2019
.gitignore switch to vanilla bootstrap theme Mar 7, 2019
.gitmodules collapse gh-pages branch into master/docs Apr 9, 2019
LICENSE Create LICENSE Mar 7, 2019
README.md add note about updating files. Apr 10, 2019
snitcher.sh reduce noise Mar 7, 2019
update.sh make the update script location-independent Apr 9, 2019

README.md

Snitcher

Generate a rule group for Little Snitch from one of Steven Black's host blocklists.

We assume the raw host file takes the following form:

# Comment lines
127.0.0.1 normal.hosts

# Blacklist hosts start
0.0.0.0 bad.domain.com
0.0.0.0 another.domain.com

# More blacklist hosts
0.0.0.0 suspicious.org

All blacklist hosts have the IP address 0.0.0.0. The script parses out the hostnames and adds them to a JSON template representing the Little Snitch rule group. This is written to stdout.

The template looks like this:

{
  "description" : "Generated from $URL",
  "name" : "$NAME",
  "denied-remote-hosts" : [
$HOSTS
  ]
}

Usage

./snitcher.sh

Environment variables

The following environment variables affect the behaviour of snitcher:

  • URL: the source URL, which should produce what looks like a regular UNIX hosts file. Defaults to https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts.
  • NAME: the name for this rule group. Defaults to Steven Black.

Generating multiple rules files

The website in the docs/ directory is hosted on GitHub at https://snitcher.dannorth.net. The rules files are hosted on a different server so they can be dynamically updated. The update.sh script rebuilds these files every day based on a cron job.

You can’t perform that action at this time.