### read-preference example with sudo Source: https://help.obdev.at/littlesnitch6/cmd-read-preference Example of reading the 'dontShowDenyConsequencesAgain' preference, which outputs a JSON array. ```bash $ sudo littlesnitch read-preference dontShowDenyConsequencesAgain [ "com.DanPristupov.Fork" ] ``` -------------------------------- ### Minimal LittleSnitchMassDeploymentConfiguration.json example Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Minimal working example of the mass deployment configuration file. Includes license key and owner, global defaults, groups, and empty rules and users arrays. Save as LittleSnitchMassDeploymentConfiguration.json. ```json { "massDeploymentLicenseKey" : "36123456789-715P8-0123456789", "massDeploymentLicenseOwner" : "ACME, Inc.", "globalDefaults" : { "activeSilentMode" : 0, "allowCommandLineAccess" : 1 }, "groups" : { "aaaaac" : { "isActive" : true, "type" : "builtinMacOSServices" }, "aaaaad" : { "isActive" : true, "type" : "builtinICloudServices" } }, "rules" : [ ], "users" : [ ] } ``` -------------------------------- ### Set user defaults for automatic license acceptance and installation Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Sets user defaults to automatically accept the license agreement and perform installation, bypassing user prompts. Must be run for the user running the app, not as root. ```bash defaults write at.obdev.littlesnitch AcceptLicenseAgreementAutomatically YES defaults write at.obdev.littlesnitch PerformInstallationAutomatically YES ``` -------------------------------- ### Example values for preference types Source: https://help.obdev.at/littlesnitch6/cmd-write-preference Lists example values for each supported preference type: boolean, unsigned integer, integer, floating point, date, string, and data (base64 encoded). ```text boolean: true, false unsigned integer: 23, 9953274 integer: -25, 2147483647 floating point: -547.23, 993.13 date: 2021-05-01T13:11:59 string: any text you like data: QmFzZTY0IGVuY29kZWQgZGF0YQo= (base 64 encoded) ``` -------------------------------- ### Import backup as-is Source: https://help.obdev.at/littlesnitch6/cmd-restore-model Imports a backup file without any user mapping, using the example backup file from the documentation. ```bash sudo littlesnitch restore-model ~/LittleSnitch-2019-10-15.xpl ``` -------------------------------- ### Start Little Snitch with command-line defaults Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Alternative to setting user defaults: starts Little Snitch with the same options as command-line arguments. Useful for testing or one-time execution. ```bash /Applications/Little\ Snitch.app/Contents/MacOS/Little\ Snitch -AcceptLicenseAgreementAutomatically YES -PerformInstallationAutomatically YES ``` -------------------------------- ### Show littlesnitch help with --help Source: https://help.obdev.at/littlesnitch6/cmd-overview Displays the built-in help for the littlesnitch command line tool, listing available options and commands. Use this to get a general overview of the tool's capabilities. For details on a specific command, run `littlesnitch --help`. ```bash $ littlesnitch --help usage: littlesnitch [-hv] [-u ] command [] -h, --help Print a short list of available commands and options. -u, --user The command line tool is executed on behalf of a user. You can specify the user here. -v, --version Print the current version of Little Snitch. Commands: list-preferences ... Lists all preferences. read-preference .... Reads a preference value. write-preference ... Writes a preference value. export-model ....... Exports the entire data model in JSON format (backup). restore-model ...... Restores the current data model from backup. debug-categories ... Sets categories to be logged in more detail. log ................ Reads Little Snitch log messages. log-traffic ........ Prints data from traffic log. recrypt-config ..... Copies configuration files changing encryption password. capture-traffic .... Captures traffic of a particular process or process pair. update-rule-groups . Updates factory rule groups with rules for currently installed apps. For more information about a particular command use littlesnitch --help ``` -------------------------------- ### Import entire configuration with restore-model Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Use `sudo littlesnitch restore-model --preserve-terminal-access configuration.lsbackup` to import an entire configuration. The `--preserve-terminal-access` flag ensures command line access after import, even if the imported configuration lacks the `"allowCommandLineAccess"` setting. User-specific settings must be handled separately, and license key and owner are preserved from the original installation. ```bash sudo littlesnitch restore-model --preserve-terminal-access configuration.lsbackup ``` -------------------------------- ### Set an array element with write-preference Source: https://help.obdev.at/littlesnitch6/cmd-write-preference Example of adding an entry to an array by specifying the index in the key. Uses sudo to run the command. ```bash sudo littlesnitch write-preference dontShowDenyConsequencesAgain.1 at.obdev.launchbar ``` -------------------------------- ### Check Little Snitch system extensions Source: https://help.obdev.at/littlesnitch6/intro-uninstall Run in Terminal to show all currently installed system extensions of Little Snitch. When uninstalled, this command should yield an empty result. ```bash systemextensionsctl list | grep activated | grep at.obdev.littlesnitch ``` -------------------------------- ### Suppress welcome tour with user default Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Sets a user default to avoid showing the welcome tour on first start. Useful when managing Little Snitch remotely. Must be run for the user, not as root. ```bash defaults write at.obdev.littlesnitch LastShownWelcomeWindowVersion 2 ``` -------------------------------- ### Sign LittleSnitch.mobileconfig with security cms Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Signs the LittleSnitch.mobileconfig profile with a trusted certificate to enable silent installation on supervised devices. Replace 'My Certificate Name' and the input/output paths as needed. ```bash security cms -S -N "My Certificate Name" -i /path/to/LittleSnitch.mobileconfig -o /path/to/LittleSnitch-signed.mobileconfig ``` -------------------------------- ### littlesnitch export-model --help Source: https://help.obdev.at/littlesnitch6/cmd-export-model Shows the command-line help for the littlesnitch export-model command, including its usage and the -h/--help flag. Run this to see the available options and expected arguments. ```console $ littlesnitch export-model --help usage: littlesnitch export-model [-h] [] -h, --help Print a short help and exit. ``` -------------------------------- ### Simple .lsrules rule for LaunchBar software update Source: https://help.obdev.at/littlesnitch6/adv-lsrules-file-format A minimal .lsrules file that defines a single rule allowing LaunchBar to connect to sw-update.obdev.at. The rule uses the "allow" action, specifies the process by its absolute path, and sets remote-hosts to the update server. ```json { "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" } ] } ``` -------------------------------- ### Map user IDs and import backup Source: https://help.obdev.at/littlesnitch6/cmd-restore-model Shows how to check the current user ID with id -u and then import a backup with a user mapping using the --map-users option. The mapping '0 > 0, 501 > 502' maps backup user 501 to local user 502. ```bash $ id -u 502 $ sudo littlesnitch restore-model --map-users "0 > 0, 501 > 502" ~/LittleSnitch-2019-10-15.xpl ``` -------------------------------- ### restore-model --help output Source: https://help.obdev.at/littlesnitch6/cmd-restore-model Shows the usage and options for the littlesnitch restore-model command. Options include -l/--list-users, -m/--map-users, and -p/--password. ```text $ littlesnitch restore-model --help usage: littlesnitch restore-model [-hl] [-m backupUID > localUID, ...] [-p ] [] -h, --help Print a short help and exit. -l, --list-users Do not actually restore, just list users contained in the file. -m, --map-users backupUID > localUID, ... Provide a mapping between backup and local user-IDs. -p, --password Optional. When importing a configuration.xpl file from a different computer, the "Little Snitch Encryption Key" from the system keychain may be required. ``` -------------------------------- ### littlesnitch recrypt-config --help output Source: https://help.obdev.at/littlesnitch6/cmd-recrypt-config Shows the command-line help for the littlesnitch recrypt-config command, including the -c and -p options. The -c option is required when the daemon connection is not available, and -p defaults to "none". ```text $ littlesnitch recrypt-config --help usage: littlesnitch recrypt-config [-h] [-c ] [-p ] [, ...] -h, --help Print a short help and exit. -c, --current-password Use this password for decrypting current configuration. Required if the daemon connection not available. -p, --password Write out configuration files using this encryption key. Defaults to "none". ``` -------------------------------- ### Display capture-traffic help Source: https://help.obdev.at/littlesnitch6/cmd-capture-traffic Shows the usage, options, and flags available for the capture-traffic command. ```bash $ littlesnitch capture-traffic --help usage: littlesnitch capture-traffic [-hp] [-v ] [] -h, --help Print a short help and exit. -v, --via Capture only if the connecting is made via the given helper process. -p, --pcap Use pcap output format. ``` -------------------------------- ### littlesnitch list-preferences --help Source: https://help.obdev.at/littlesnitch6/cmd-list-preferences Shows the command-line help for littlesnitch list-preferences, including the -g and -u options that limit output to global or user-specific preferences. ```bash $ littlesnitch list-preferences --help usage: littlesnitch list-preferences [-ghu] -h, --help Print a short help and exit. -g, --global-only Show only preferences affecting all users. -u, --user-only Show only preferences affecting the current user. ``` -------------------------------- ### List global preferences with littlesnitch Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Lists all global settings and their current values. Requires sudo and Terminal access enabled. ```bash sudo littlesnitch list-preferences --global-only ``` -------------------------------- ### littlesnitch --help Source: https://help.obdev.at/littlesnitch6/cmd-overview Displays general help information for the littlesnitch command line tool, including usage syntax, options, and a list of available commands. ```APIDOC ## littlesnitch --help ### Description Prints a short list of available commands and options for the littlesnitch command line tool. ### Method CLI ### Endpoint littlesnitch --help ### Parameters None ### Request Example littlesnitch --help ### Response #### Success Response Prints usage information including options and commands. #### Response Example usage: littlesnitch [-hv] [-u ] command [] -h, --help Print a short list of available commands and options. -u, --user The command line tool is executed on behalf of a user. You can specify the user here. -v, --version Print the current version of Little Snitch. Commands: list-preferences ... Lists all preferences. read-preference .... Reads a preference value. write-preference ... Writes a preference value. export-model ....... Exports the entire data model in JSON format (backup). restore-model ...... Restores the current data model from backup. debug-categories ... Sets categories to be logged in more detail. log ................ Reads Little Snitch log messages. log-traffic ........ Prints data from traffic log. recrypt-config ..... Copies configuration files changing encryption password. capture-traffic .... Captures traffic of a particular process or process pair. update-rule-groups . Updates factory rule groups with rules for currently installed apps. For more information about a particular command use littlesnitch --help ``` -------------------------------- ### read-preference help output Source: https://help.obdev.at/littlesnitch6/cmd-read-preference Shows the usage and help options for the littlesnitch read-preference command. ```bash $ littlesnitch read-preference --help usage: littlesnitch read-preference [-h] , ... -h, --help Print a short help and exit. ``` -------------------------------- ### littlesnitch write-preference --help output Source: https://help.obdev.at/littlesnitch6/cmd-write-preference Shows the usage and options for the write-preference command. The -r/--remove option removes the value for the given key. ```text $ littlesnitch write-preference --help usage: littlesnitch write-preference [-hr] [] -h, --help Print a short help and exit. -r, --remove Remove the value for the given key. ``` -------------------------------- ### List users in a backup file Source: https://help.obdev.at/littlesnitch6/cmd-restore-model Lists the users contained in a backup file using the --list-users option. The output shows user IDs, short names, full names, and rule counts, which help identify users for mapping. ```bash $ sudo littlesnitch restore-model --list-users ~/LittleSnitch-2019-10-15.xpl uid: short name full name ---------------------------------------------------------------------- 0: root System Administrator (86 rules) 248: _mbsetupuser - (7 rules) 501: user1 First User (403 rules) 502: user2 Second User (55 rules) ``` -------------------------------- ### littlesnitch --help Source: https://help.obdev.at/littlesnitch6/cmd-overview Displays help information for a specific littlesnitch subcommand, providing detailed usage for that command. ```APIDOC ## littlesnitch --help ### Description Prints detailed help information for a specific littlesnitch subcommand. ### Method CLI ### Endpoint littlesnitch --help ### Parameters #### Path Parameters - **command** (string) - Required - The name of the subcommand to get help for. ### Request Example littlesnitch list-preferences --help ### Response #### Success Response Prints detailed usage information for the specified command. ``` -------------------------------- ### Check Little Snitch running components Source: https://help.obdev.at/littlesnitch6/intro-uninstall Run in Terminal to show all currently running components of Little Snitch. When uninstalled, this command should yield an empty result. ```bash pgrep -lf "Little Snitch|littlesnitch" ``` -------------------------------- ### List user-specific preferences with littlesnitch Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Lists user-specific settings for a given user. The --user parameter can be omitted in a user session as it is derived from SUDO_USER. ```bash sudo littlesnitch --user list-preferences --user-only ``` -------------------------------- ### Write dictionary subkey with key path Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Use `sudo littlesnitch write-preference` with a key path to write to a dictionary subkey. The key path uses a dot to separate the dictionary key and subkey (e.g., `key-to-dictionary.subkey`). ```bash sudo littlesnitch write-preference key-to-dictionary.subkey value-written-to-subkey ``` -------------------------------- ### littlesnitch log-traffic --help output Source: https://help.obdev.at/littlesnitch6/cmd-log-traffic Shows the usage and options for the littlesnitch log-traffic command. Use --begin-date and --end-date to specify a time range, or --stream to view live statistics (incompatible with --end-date). Output is CSV with the first row as field names. ```shell $ littlesnitch log-traffic --help usage: littlesnitch log-traffic [-hs] [-b ] [-e ] -h, --help Print a short help and exit. -b, --begin-date Optional. Where to begin reading logged traffic history. If not specified, no historic data is printed. -e, --end-date Optional. Where to stop reading logged traffic history. -s, --stream Optional, incompatible with --end-date. Stream live traffic statistics. ``` -------------------------------- ### sudo littlesnitch list-preferences output Source: https://help.obdev.at/littlesnitch6/cmd-list-preferences Lists all Little Snitch preference options and their values when run without options. The output is truncated with an ellipsis in the source. ```bash $ sudo littlesnitch list-preferences activeSilentMode = 0 allowCommandLineAccess = true allowGUIScripting = false allowGlobalEditing = true ... ``` -------------------------------- ### littlesnitch debug-categories --help output Source: https://help.obdev.at/littlesnitch6/cmd-debug-categories Shows the usage and options for the littlesnitch debug-categories command. Options include -a/--add, -d/--delete, -s/--set, and -f/--factory-reset. This command is intended for analyzing bugs with support guidance. ```text $ littlesnitch debug-categories --help usage: littlesnitch debug-categories [-adfhls] [, ...] -h, --help Print a short help and exit. -a, --add Add to current set of categories. -d, --delete Delete from current set of categories. -s, --set Set current set of categories. -f, --factory-reset Reset to factory default. ``` -------------------------------- ### Write array element with key path Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Use `sudo littlesnitch write-preference` with a key path to write to an array element. The key path uses an index (e.g., `key-to-array.0`) to specify the position. ```bash sudo littlesnitch write-preference key-to-array.0 value-written-to-index-0 ``` -------------------------------- ### Write a preference with littlesnitch Source: https://help.obdev.at/littlesnitch6/adv-enterprise-deployment Changes a setting to a new value. Requires specifying the user and the key. ```bash sudo littlesnitch --user write-preference ``` -------------------------------- ### littlesnitch update-rule-groups --help output Source: https://help.obdev.at/littlesnitch6/cmd-update-rule-groups Shows the help output for the littlesnitch update-rule-groups command, including usage and options -a (--apple-apps) and -t (--third-party-apps). ```text $ littlesnitch update-rule-groups --help usage: littlesnitch update-rule-groups [-aht] -h, --help Print a short help and exit. -a, --apple-apps Update Apple Applications group only -t, --third-party-apps Update Third Party Applications group only ``` -------------------------------- ### littlesnitch log --help output Source: https://help.obdev.at/littlesnitch6/cmd-log Shows the usage and options for the littlesnitch log command. Use --last with a time interval to see past messages, or --stream to watch live. This command is a frontend to the macOS log command and is available to non-root users without the 'Allow access via Terminal' setting. ```text $ littlesnitch log --help usage: littlesnitch log [-adfhjs] [-l