The rules and connection database isn't protected from other accounts on the Mac the way the Insights store is
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 57/100
Research direction
Read Sources/Shared/RuleStore.swift:100-107 alongside Sources/Helper/InsightsStore.swift:400-450 to trace how the main store is created and how the Insights store enforces permissions. Check the installed database and its sidecar file modes on macOS, then update the store handling so existing installs are tightened on helper start and startup fails if root-only access cannot be ensured. Done when the folder, database, and sidecars are root-readable only.
Written by the indexing model from the issue text.
Description
The Insights store locks itself down: its folder is created with mode 700 and its files with 600, and it refuses to open anything else (Sources/Helper/InsightsStore.swift:127, :164, :405-450).
The main database gets none of that. RuleStore.init creates the folder with try? FileManager.default.createDirectory(atPath: dir, withIntermediateDirectories: true) and opens the file with a plain sqlite3_open(path, &db) (Sources/Shared/RuleStore.swift:100-107). No mode is set and none is checked, so the folder and the file get whatever the helper's default umask gives them. For a launchd daemon that is normally readable by everyone.
That database holds every rule, the profiles, the blocklists and the recorded connections (app, destination, time).
Steps
- Install FreeSnitch and let it record connections.
- Log in as another, non-admin account on the same Mac.
- Check whether that account can read
/Library/Application Support/FreeSnitch/freesnitch.sqliteand its-walfile.
Where
Sources/Shared/RuleStore.swift:100-107Sources/Helper/InsightsStore.swift:400-450(how the Insights store does it)
Done when: the main database, its sidecar files and its folder are readable by root only, existing installs are tightened on the next helper start, and the helper refuses to use the store if it can't make that true.
I found this reading the code and haven't reproduced it on a signed build yet: the actual file modes on an installed Mac still need checking.
- Dominant language
- Swift
- Stars
- 49
- Forks
- 5
- Avg merge
- 16h 48m
- Merged PRs (30d)
- 82
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from isaaclins/freesnitch
-
area:cli documentation good first issue priority:low
Difficulty 1/5 Under an hour Newbie friendliness 94/100
isaaclins/freesnitch#430 ·
Maintainers usually reply within 1 day
-
area:gui bug priority:low status:queued
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
isaaclins/freesnitch#428 ·
Maintainers usually reply within 1 day
-
area:shared bug priority:high status:queued type:correctness
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
isaaclins/freesnitch#284 ·
Maintainers usually reply within 1 day
-
area:helper bug priority:medium status:queued type:diagnostics
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
isaaclins/freesnitch#282 ·
Maintainers usually reply within 1 day
-
area:gui bug priority:low status:queued type:correctness
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
isaaclins/freesnitch#281 ·
Maintainers usually reply within 1 day
All issues in isaaclins/freesnitch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Enzoo404/gravitybox#21 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
haacked/switchboard#420 ·
Maintainers usually reply within 1 day
-
area: sidebar enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ZigaoWang/zigzag#351 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
manaflow-ai/cmux#46584 ·
Maintainers usually reply within 1 day