Skip to content

Importing rules from another firewall

Import Rules: bring your rules from LuLu (rules.json), Little Snitch (.lsrules), a folder of OpenSnitch rules or a Portmaster export, or a hosts file or domain list, into Outbound, with a preview first, every rule left out listed with its reason, and one Undo for the whole import.

Outbound 1.5.3 · Updated

If you are moving to Outbound from LuLu, Little Snitch, OpenSnitch or Portmaster, you can bring the rules you made there, and you can turn a hosts file or a domain list into block rules. Outbound shows a preview before anything is saved, imports only what it can express exactly, and lists every rule it leaves out with the reason.

  • LuLu: the rules.json file LuLu exports (LuLu 2.6.0 and later).
  • Little Snitch: rule files in the .lsrules format, which covers rule groups and rules exported in that format. A copy of the same format saved as .json works too.
  • OpenSnitch: the folder that holds OpenSnitch’s rule files, one rule per file. On Linux it is usually /etc/opensnitchd/rules; copy it to this Mac first. See OpenSnitch folders.
  • Portmaster: an export saved as JSON, of its settings, of one setting (the outgoing rules) or of an app profile. See Portmaster exports.
  • Hosts files and domain lists: a hosts file such as /etc/hosts, a plain list of domain names, an Adblock-style DNS list (||example.com^) or a dnsmasq file. See Hosts files and domain lists below.

A full Little Snitch backup file is not supported, and neither is a Portmaster export saved as YAML. Outbound recognises the format from the file’s contents. It reads LuLu and Little Snitch files up to 32 MB, and hosts files and domain lists up to 64 MB. A JSON object in a file named .lsrules that holds no rules opens an empty preview rather than an error.

In the Rules pane, open More › Import Rules… in the toolbar and choose the file, or the folder for OpenSnitch. If your organization does not let you edit rules on this Mac, the command is dimmed.

While Outbound reads the file and checks the programs it names on this Mac, the sheet says so. Cancel stops it, and nothing has changed.

Nothing changes until you click Import. For a LuLu file the sheet is titled Import Rules from “LuLu”; for a Little Snitch file it is Import Rules from “<name>” when the file names its group, or Import Rules when it does not; for a hosts file or domain list it is Import Rules from “<file name>”. The line under the title says what Outbound read the file as: “Read as LuLu rules.”, “Read as Little Snitch rules.”, “Read as a hosts file or domain list.”, “Read as a folder of OpenSnitch rules.”, “Read as Portmaster settings.”, “Read as one Portmaster setting, the outgoing rules.” or “Read as a Portmaster app profile.”

When the file and your rules differ chooses how the import settles a conflict with a rule you already have:

Choice What it does
Keep my rules (the default) Adds the rules you don’t have. Where the file decides a connection differently from one of your rules, yours stays. Importing the same file again adds nothing.
Use the imported rules Adds the rules you don’t have. Where the file decides a connection differently, your rule takes the file’s decision.
Replace my rules with the file Little Snitch files only. Your rules that a .lsrules file can hold become exactly the file’s; the rest is described on .lsrules rule files.

A LuLu file, an OpenSnitch folder, a Portmaster export, a hosts file and a domain list never offer Replace: none of them holds your other Outbound rules, so replacing would remove them all.

The sheet counts what the import Adds and Changes, what is Already in your rules, entries Repeated in the file and Entries Outbound can’t read, and, for Replace, what it Removes. Below the counts it lists Conflicts with your rules, Added, Removed and Not imported. For a hosts file or domain list, the counts also show Blank, comment and header lines and Reasons some entries were not imported, and the lists are How some entries were read and Not imported, with the reason, each reason with the first lines it applies to. When there is nothing to import, the sheet says “Nothing to import: every rule in the file is already there or left out.” and Import stays dimmed.

Outbound never imports more than the source allowed or blocked. A rule it cannot express exactly is left out rather than made broader, and every rule left out is listed under Not imported with its reason. From a LuLu file, for example:

  • A rule for every program in a folder: Outbound has no folder rules, so it never becomes a rule for every program.
  • An address written as a regular expression: it never becomes a host or a domain rule.
  • A port that is not * or one port number: it never becomes every port.
  • A rule whose program on this Mac is not the one LuLu saw: add it by hand.
  • An allow rule for a program LuLu saw signed by Apple, the App Store or a developer, when Outbound cannot confirm that signature on this Mac: add it by hand. Other rules for a program Outbound cannot check, such as block rules or rules for unsigned programs, are imported for the program’s path.
  • A temporary rule.
  • The rules LuLu made by itself, for example for macOS system programs: these are counted on one line per kind.

An allow rule is never tied to a weaker check of the program than the source had. Each LuLu rule Outbound imports becomes a permanent, enabled, outgoing rule of your own for every protocol. For what a Little Snitch file can and cannot carry, see .lsrules rule files.

Each name Outbound imports from a hosts file or domain list becomes a permanent block rule of your own, for every app, for outgoing connections on every port. A name on a hosts line, or a plain name on its own line, blocks that exact name. An Adblock-style ||example.com^, a dnsmasq name, *.example.com and .example.com block the name and every name below it. On a public suffix such as github.io or co.uk, a *. line is left out and listed under Not imported, and any other entry blocks only that exact name, so a list never blocks every site registered under a suffix. Outbound never makes an allow rule from a list.

A line is imported only when its meaning is certain, and every line left out is counted under Not imported, with the reason:

  • A hosts line that sends a name to another address is left out, because it redirects the name rather than blocking it.
  • An exception such as @@||example.com^ never becomes a rule: it removes the blocks in the file that cover that name.
  • Lines that hide parts of web pages (##) are not name blocks, so they are left out.
  • Link redirectors that Outbound keeps reachable so the links sent through them keep working, such as t.co, are left out.
  • A dnsmasq file with an option other than address, server and local imports nothing, because such an option can change which names the file answers.

One import can add up to 2,000 rules. A list that would add more is refused whole and nothing is imported: subscribe to it in Blocklists instead.

Choose the folder, not one rule file. Outbound reads every file in it whose name ends in .json, and a file of any other name is left out and listed. A single rule file is refused with ““<file>” is a single OpenSnitch rule. Choose the folder that holds OpenSnitch’s rules instead (on Linux, usually /etc/opensnitchd/rules), so Outbound sees every rule that applied alongside it.”

Only block rules are imported. OpenSnitch lets a block rule beat an ordinary allow rule, and Outbound decides by how specific a rule is, so an allow rule taken out of OpenSnitch could let through what OpenSnitch blocked. Allow rules are counted and listed under Not imported.

  • A block rule becomes a permanent, enabled, outgoing block rule of your own, for the program the rule names. It is imported only when everything it says about the connection has an exact equivalent in Outbound. A rule that would block every connection of every program is left out.
  • A block rule for a program that is not on this Mac is left out and listed with its path.
  • OpenSnitch matches program paths without regard to upper and lower case, and Outbound matches a path exactly as written. The preview says so for the rules this affects, because they block less than they did in OpenSnitch.
  • An allow rule that OpenSnitch marked “precedence” won over the block rules whose names sort after its own. The preview says so, because in Outbound the imported block rules apply to those connections too.
  • OpenSnitch keeps one rule per name. A name that more than one file gives is left out, because Outbound cannot tell which rule OpenSnitch kept.
  • A file OpenSnitch certainly could not have loaded, such as one that is not valid JSON or does not hold a rule, is left out with its own reason.
  • If the folder holds a file that OpenSnitch may have loaded but Outbound cannot read exactly, nothing is imported at all, and the sheet names the file to remove or repair. Importing any block rule could otherwise block what OpenSnitch allowed.

A folder with more than 5,000 rule files, a file over 1 MB or more than 64 MB of rule files imports nothing, and block rules past the first 10,000, in name order, are left out.

Outbound reads a Portmaster export saved as JSON and imports the block lines of its outgoing rules only. A line that starts with - is a block line, and one that starts with + is an allow line.

Portmaster checks lines from the top, checks each app’s own list before the global one, and stops at the first line that matches. Outbound decides by how specific a rule is, so allow lines are counted and listed under Not imported, never imported.

  • A block line becomes a permanent, enabled, outgoing block rule of your own, for every app, with the ports and protocol the line gives. It is imported only when its destination, protocol and ports have an exact equivalent in Outbound, and never when it would block every connection of every app.
  • A block line that comes after an allow line that may cover some of the same connections is left out, because imported alone it could block what Portmaster allowed.
  • If a line cannot be read as any form Portmaster accepts, none of the outgoing rules are imported, because Portmaster may have refused that list and then blocked nothing. The sheet names the line.
  • Up to 10,000 lines of the outgoing rules are read.

A settings export does not say where its rules applied, so the preview asks: Where these settings came from in Portmaster, with Global settings, which applied to every app and One app’s settings. Until you choose, the sheet says “Choose where these settings came from to see what Outbound would import.” and Import is dimmed. Global settings show their preview. One app’s settings are refused, because Outbound cannot tell which Mac app that is, and imported as they are the rules would apply to every app. An app profile is one app’s settings from the start, so it is refused too.

Click Import (or Import and Remove when Replace removes rules). The import goes through Outbound’s usual approval: changes that unblock connections need your approval, with Touch ID or your password, before they apply. A banner then reports the result, for example “Imported: 12 added, 0 changed, 0 removed.”

Edit › Undo reverses the whole import in one step.

The sheet shows one sentence that says why, and OK closes it:

Message What it means
“<file>” is not a file Outbound can import rules from. Outbound reads Little Snitch rule groups (.lsrules), the rules LuLu exports (rules.json), hosts files and domain lists, Portmaster exports saved as JSON, and folders of OpenSnitch rules. The file is in none of these formats, for example because it is not text.
“<file>” is a single OpenSnitch rule. Choose the folder that holds OpenSnitch’s rules instead (on Linux, usually /etc/opensnitchd/rules), so Outbound sees every rule that applied alongside it. You chose one rule file from OpenSnitch’s folder.
“<file>” is a Portmaster export saved as YAML. Outbound reads only Portmaster exports saved as JSON. Export it again from Portmaster as JSON.
“<file>” is larger than 32 MB, the most Outbound reads from a rules file. The file is too large: over 32 MB for a LuLu or Little Snitch file, or over 64 MB for a hosts file or domain list. The message names the limit that applied.
“<file>” is not valid JSON, so Outbound cannot read it as a rules file. The file is damaged or is not a rules export; the reader’s detail follows.
Outbound could not read “<file>”. macOS could not open or read the file, for example because you do not have permission to read it; the system’s reason follows.
“<file>” looks like LuLu rules, but Outbound could not read it. A LuLu file with a value of the wrong type; the detail follows.
“<file>” looks like Little Snitch rules, but Outbound could not read it. The same for a Little Snitch file.
“<file>” looks like a folder of OpenSnitch rules, but Outbound could not read it. The same for an OpenSnitch folder; the detail follows.
“<file>” looks like a Portmaster export, but Outbound could not read it. The same for a Portmaster export; the detail follows.
“<file>” is a DNS zone file. Outbound imports hosts files and domain lists, not zone files. The file is a DNS response policy zone, which Outbound does not read.
“<file>” would add <number> rules, more than the 2,000 one import may add, so Outbound imported nothing. To block a list this long, subscribe to it in Blocklists. The list is longer than one import may add.
“<file>” has more than 100,000 entries, too many to read, so Outbound imported nothing. To block a list this long, subscribe to it in Blocklists. The list is far too long to read at all.
“<file>” is not a regular file, so Outbound imported nothing from it. Outbound imports only from a file saved on a disk, not from a pipe or a device. Save the list to a file first, then import that file. You chose something that is not a file, such as a named pipe.
outboundctl rules import-lulu <file> [--merge keep-existing|prefer-imported] [--dry-run]
outboundctl rules import-lsrules <file> [--merge keep-existing|prefer-imported|replace] [--dry-run]
outboundctl rules import-list <file> [--merge keep-existing|prefer-imported] [--dry-run]
outboundctl rules import-opensnitch <folder> [--merge keep-existing|prefer-imported] [--dry-run]
outboundctl rules import-portmaster <file> [--origin global|app] [--merge keep-existing|prefer-imported] [--dry-run]

--dry-run reports what the import would add, change and leave out, and saves nothing. --merge makes the same choice as the preview; import-lulu, import-list, import-opensnitch and import-portmaster refuse replace for the reason above. --origin answers the question the preview asks about a Portmaster settings export, and nothing defaults it: global imports its block lines, and app imports nothing. Leaving it out of a settings export, or giving it for an app profile, is a usage error. Without administrator rights, only keep-existing can be sent for approval. See outboundctl rules.