config is stored in ~/.config/picosnitch/config.json
restart picosnitch if it is currently running for any changes to take effect
{"Bandwidth monitor": true, # Log traffic per connection since last db write"DB retention (days)": 90,# How many days to keep connection logs in snitch.db"DB sql log": true, # Write connection logs to snitch.db (SQLite)"DB sql server": {}, # Write connection logs to a MariaDB, MySQL, or PostgreSQL server"DB text log": false, # Write connection logs to conn.log"DB write limit (seconds)": 10,# Minimum time between writing connection logs# increasing it decreases disk writes by grouping connections into larger time windows# reducing time precision, decreasing database size, and increasing hash latency"Desktop notifications": true, # Try connecting to dbus to show notifications"Every exe (not just conns)": false, # Check every running executable with picosnitch# these are treated as "connections" with a port of -1# this feature is experimental but should work fairly well, errors should be expected as# picosnitch is unable to open file descriptors for some extremely short-lived processes# if you just want logs (no hashes) to trace process hierarchy, see execsnoop or forkstat"Log addresses": true, # Log remote addresses for each connection"Log commands": true, # Log command line args for each executable"Log ignore": [], # List of hashes (str), domains (str), IP subnets (str), or ports (int)# will omit connections that match any of these from the connection log# domains are in reverse domain name notation and will match all subdomains# the process name, executable, and hash will still be recorded in record.json"Perf ring buffer (pages)": 64,# Power of two number of pages for BPF program# only change this if it is giving you errors"Set RLIMIT_NOFILE": null, # Set the maximum number of open file descriptors (int)# it is used for caching process executables and hashes (typical system default is 1024)# this is good enough for most people since caching is based on executable device + inode# fanotify is used to detect if a cached executable is modified to trigger a hash update"VT API key": "", # API key for VirusTotal, leave blank to disable (str)"VT file upload": false, # Upload file if hash not found, only hashes are used by default"VT request limit (seconds)": 15# Number of seconds between requests (free tier quota)}
a log of seen executables is stored in ~/.config/picosnitch/exe.log
this is a history of your notifications
a record of seen executables is stored in ~/.config/picosnitch/record.json
this is used for determining whether to create a notification
it contains known process name(s) by executable, executable(s) by process name, and sha256 hash(es) with VirusTotal results by executable
enable DB sql log (default) to write the full connection log to ~/.config/picosnitch/snitch.db
this is used for picosnitch dash, picosnitch view, or something like DB Browser
note, connection times are based on when the group is processed, so they are accurate to within DB write limit (seconds) at best, and could be delayed if the previous group is slow to hash
notifications are handled by a separate subprocess, so they are not subject to the same delays as the connection log
use DB sql server to write the full connection log to a MariaDB, MySQL, or PostgreSQL server
the error log is stored in ~/.config/picosnitch/error.log
errors will also trigger a notification and are usually caused by far too many or extremely short-lived processes/connections, or suspending your system while a new executable is being hashed
while it is very unlikely for processes/connections to be missed (unless Every exe (not just conns) is enabled), picosnitch was designed such that it should still detect this and log an error giving you some indication of what happened
for most people in most cases, this should raise suspicion that a program may be misbehaving
a program should not be able to hide from picosnitch (either by omission or spoofing another program) without picosnitch reporting an error
while picosnitch aims to be as reliable as possible, no tool is perfect and you should know the limitations when deciding whether it is useful and how to use it effectively, whether it's for your threat model or simply measuring bandwidth
for example, picosnitch was designed to be more accurate than existing tools by hashing executables and tracking parents, but there are still ways malicious software could hide its traffic through trusted executables as described below, such as compromising shared libraries
this is not necessary for most people, and of little benefit without considering what else an adversary with these capabilities could do to your system in order to establish appropriate safeguards for your threat model, such as cross-checking with a standalone router/firewall to ensure all communication is accounted for, monitoring error logs, etc
detecting open sockets, monitoring traffic, and identifying the process should be fairly reliable with BPF; however, accurately identifying the application behind it can be difficult, especially if has malicious intent
the process name is trivial to change, the path can be set to anything with mount namespaces, including impersonating an already existing executable (or replacing it)
hashing the executable helps with this; however, it is an imperfect solution since only the process executable itself is hashed and there are still ways a program can hide
this leaves out shared libraries (e.g. LD_PRELOAD rootkits), extensions, or scripts which could become compromised
if a process is too short lived, picosnitch may not be able to open a file descriptor in time in order to hash it (should be very rare)
the device and inode of the opened file descriptor is checked against what was reported by the BPF program to detect if the executable was replaced; however, BTRFS uses non-unique inodes, negating this protection (this is negligible and only mentioned in an attempt for thoroughness)
if for any reason the executable fails to hash, the traffic will still be logged with whatever information was available and you will be notified of an error
too many processes or connections could cause the connection data to be lost if callbacks are not processed fast enough, this will be detected, logging the error and triggering a notification
instead of playing cat and mouse by trying to cover any edge cases malware may use to hide, the focus is on accurately handling the common case, with clear and reliable error reporting for anything else
in addition to bugs, please report any other caveats I may have missed!