Main logic and UI should be separated into a daemon and a dbus based UI process. #20
Comments
voltagex
commented
May 3, 2017
|
Isn't this pretty much what Polkit is for? |
hobarrera
commented
May 3, 2017
•
|
@voltagex Polkit is also for running GUI apps as root, this is what being advocated against here. Privilege separation is probably the cleanest approach. |
|
I'll repost this here, just to have more feedback :) Future Plan
Questions
|
hobarrera
commented
May 3, 2017
|
In response to your questions:
|
|
@hobarrera Mmmm, about 1, from the bottom of my deep ignorance about UI and IPC on GNU/Linux, I was thinking about something like:
|
hobarrera
commented
May 3, 2017
How will the app store this? Or more importantly: what prevent malicious apps from reading what is stored? A second, interesting, approach, is that the UI has a dedicated user, and installed as |
Very good point, secure IPC is a bitch :P
Dunno, it might cause troubles for packaging and cross distribution compatibility :S |
hobarrera
commented
May 3, 2017
|
Definitely (on both items). Packaging would need to be delicately documented in case that's actually a viable route. |
|
guys I just created a private Telegram channel for devs, where can I send you guys the invitation link? |
hobarrera
commented
May 3, 2017
|
Is this channel open to anyone? If so, you can include a link in the README as well. :) |
|
No, it's not. For now, I'd rather just have a devs-only private channel, we're not ready to have a public chan with thousands of ppl asking for support :P |
|
I would highly suggest going with dbus for IPC. It comes with a fully fledged SASL implementation for authentication, it's present on all distros and in wide use. |
eliasp
commented
May 3, 2017
|
DBus will also make it far easier to integrate it into various DEs (e.g. SNI-based systray), communicate with NetworkManager and/or systemd-networkd, have other people/tools interact with opensnitchd, etc. |
hobarrera
commented
May 3, 2017
|
Definitely no intention of reinventing the wheel, it's just a matter of choosing the right wheel and how to use it. I was unaware that dbus provided the authentication we need. How does it avoid other [malicious] processes from messaging a certain interface? |
evilsocket
changed the title from
please don't run X applications as root to Main logic and UI should be separated into a daemon and a dbus based UI process.
May 3, 2017
samis
commented
May 3, 2017
|
While it doesn't give you a solution to the authentication problem if you were of thinking of using an RPC-style interface, you may find Cap'n Proto to be useful. There's apparently a python implementation at https://jparyani.github.io/pycapnp/ and general documentation at https://capnproto.org/index.html |
|
@samis I'm not concerned about the protocol, that can be websockets, protobufs over tcp, whatever ... I'm concerned about security, let me explain: Scenario:
|
|
Bonus:
:D |
IDEA:Maybe the UI could be signed somehow, with random keys generated during first boot, daemon keeps private key as root (thus protected from users) and verifies whoever connects to the unix socket ... i honestly don't know if this would work ... |
nmindz
commented
May 3, 2017
•
|
@evilsocket From your first bullet on the scenario description... Wouldn't using Polkit and leaving the socket readable only to members of a specific group work and be enough to block alien processes or malware to read it without elevating privileges first? |
|
@nmindz No, because if I'm user |
|
Think to simple yet effective phishing scenarios like: someone sends you a |
hobarrera
commented
May 3, 2017
|
For now, the only solution is to have a dedicated user for the UI, and make the UI |
taoeffect
commented
May 4, 2017
|
Comment:
We're in 2017 now. There's little excuse to start new projects in C++ instead of Rust, especially if they're security critical. |
|
Mmmm like, I don't know Rust and have no willing to learn it in the short term future? |
taoeffect
commented
May 4, 2017
|
It's your project, you can do whatever you want with it of course, but in case it's at all helpful here are some possibly useful/interesting links: |
evilsocket
added the
enhancement
label
May 4, 2017
eliasp
commented
May 4, 2017
That's one of the points of polkit where system-provided policies define what gets executed, whether it requires interactive confirmation/authorization/password input etc. |
hobarrera
commented
May 4, 2017
|
Just read the wikipedia page for polkit, and that made it a bit clearer for me. So, the flow would be:
Right? |
hobarrera
commented
May 4, 2017
|
Do you have an example of a desktop application that uses polkit? Nothing in my system that requires it seems to prompt for any permissions under any scenario.
I also wonder a bit how polkit shows the dialog for prompting the password. Does the lib depend on gtk or something? Are developers responsible for that prompt? |
eliasp
commented
May 5, 2017
The desktop environment is responsible for providing a corresponding agent. |
|
Why are we still talking about polkit? Once IPC and authentication are implemented (correctly), the UI env. will not matter as OpenSnitch will be able to have different clients/UIs in different technologies. Let's stop this here, no need for polemics at this stage of developement. |
hobarrera
commented
May 5, 2017
•
|
@eliasp Also, not a fan of having to run a second daemon for the opensnitch UI to work (my desktop doesn't have any such agent). @evilsocket I just wanted to really confirm that we didn't have a better alternative to what we picked. :) |
n1nj4sec
commented
May 15, 2017
|
something like that ? https://github.com/subgraph/fw-daemon |
tidux commentedMay 1, 2017
Running an X application as root destroys any shred of security the Linux desktop might otherwise have. A root-privileged daemon and an unprivileged user interface talking across a Unix socket or some other form of IPC would be far more reasonable for a security application.