The .lsrules file format

An .lsrules file describes a rule group in JSON syntax. Remote rule groups use this format, and you can import such a file into a rule group, too. To get one, export it from the Little Snitch app, or write it yourself with a text editor or a script. This page describes the format.

A simple example

This file contains one rule, which allows LaunchBar to check for software updates:

{
  "name": "LaunchBar Software Update",
  "description": "This rule allows LaunchBar to check for updates.",
  "rules": [
    {
      "action": "allow",
      "process": "/Applications/LaunchBar.app/Contents/MacOS/LaunchBar",
      "remote-hosts": "sw-update.obdev.at"
    }
  ]
}

Blocklists

Older versions of Little Snitch couldn’t read the usual blocklist formats, so blocklists had to be written as remote rule groups. The .lsrules format still supports a short form for them. With the syntax above, you’d have to repeat "process": "any" and "action": "deny" for every domain, hostname, or IP address. With thousands of entries, the file would get unnecessarily large, and every user of the rule group would have to download it.

The short form is much more compact:

{
    "name": "Social Media Blocklist",
    "description": "Blocks access to popular social media sites.",
    "denied-remote-domains": ["facebook.com", "twitter.com", "youtube.com"]
}

Top-level keys

The top level of an .lsrules file is a JSON dictionary with the following keys:

Key Type Description
name String The name of the group.
description String A description of the rule group.
rules Array of Dictionaries The list of rules. For the keys of a rule, see below.

For blocklists, you can use the following keys:

Key Type Description
denied-remote-domains Array of Strings A list of domain names.
denied-remote-hosts Array of Strings A list of hostnames.
denied-remote-addresses Array of Strings A list of IP addresses or ranges.
denied-remote-notes String The notes for each rule. Little Snitch replaces the placeholder %REMOTE% with the domain, hostname, or IP address of the rule.

You can combine all of these keys in one .lsrules file. A single file can contain any rules in a rules array, plus a list of domains in denied-remote-domains and a list of IP addresses in denied-remote-addresses.

Rule keys

Each rule in the file is a JSON dictionary with the following keys.

Specify the process

To say which processes a rule matches, give the executable of the process with these keys:

A rule can identify a process by its absolute path or by its Code ID. To give a Code ID, add the prefix identifier., which tells Little Snitch that the value is a Code ID and not a path. The format is identifier.DEV_TEAM_ID/IDENTIFIER. The Code ID of Little Snitch, for example, is MLZF7K7B5R/at.obdev.littlesnitch, so you write identifier.MLZF7K7B5R/at.obdev.littlesnitch.

Specify the remote endpoint

There are several ways to give the remote endpoint of a rule. Use exactly one of these keys:

Other keys

Key Type Description
direction String, optional The connection direction: "incoming" or "outgoing". The default is "outgoing".
action String, optional The rule action: "allow", "deny", or "ask". The default is "ask".
priority String, optional The rule priority: "regular" or "high". The default is "regular".
disabled Boolean, optional Whether the rule is disabled by default. The default is false.
ports String, optional The ports that the rule matches: "any" for any port (the default), one port (for example "443"), a range of ports (for example "123-456"), or a list of ports and ranges, separated by commas (for example "20-30, 80, 443").
protocol String, optional The protocol that the rule matches: a number as defined in /etc/protocols, for example "6" for TCP, or the name of the protocol, for example "tcp". The default is any protocol.
notes String, optional The notes for the rule.

© 2016-2026 by Objective Development Software GmbH