107 Commits

Author SHA1 Message Date
tomFlowee 49747829ea More remote introspection
just calling with -l will now list all known profiles.
Additionally we list the executable that is used for a profile.
2024-02-19 20:21:36 +01:00
tomFlowee 5e689f34de Introduce app-aliases
This moves the primary key for a 'jail' to no longer be the executable
path, but instead a name.
In many cases that string will be based on the executable path, for
instance it will take the filename if the exe lives in /bin or /usr/bin
so in that respect nothing will change.

What this does allow is that you can have two different profiles that
both map to the same executabe. Allowing for instance having two
completely isolated instances running of telegram or of firefox.
2024-02-19 19:52:24 +01:00
tomFlowee ce7046efa2 Rename from 'securityManager' to 'IsolationRunner'.
The defaults are not 'secure', as they would be annoying to the max.
This is an isolation runner, removing a lot of attack vectors, for sure
but the name would give the wrong impression with defaults like we have
now.
2024-02-19 12:54:52 +01:00
tomFlowee b9a5f9babe Add support for 'media' permission 2024-02-19 12:30:57 +01:00
tomFlowee 735abb7c1f Make a start with /run
this improves rbind to create the target dirs, if needed.
We also detect if the source is a socket and instead create a file to
mount on top of.
2024-02-19 12:22:45 +01:00
tomFlowee f805e8f2ce Have app-specific rules
This introduces the command execute-apprules which behaves like
an 'include' as it recurses into the app specific file.

If there is no app specific one, it will load the default.rules

Notable too is that in an app specific rules file the usage of
execute-apprules will always go to default.rules, to avoid
copy / paste of rules.
2024-02-19 10:47:36 +01:00
tomFlowee 279e6b5078 Add ability to point to the ruleset 2024-02-19 09:44:46 +01:00
tomFlowee 02a723827c Make sure that only one is running at a time 2024-02-19 09:23:40 +01:00
tomFlowee c88cf37d8e Add the homedir and git permissions 2024-02-18 23:50:34 +01:00
tomFlowee e9b61601a2 Avoid chown on install when we're not root.
This avoids the problem that install fails if the file hasn't changed
and its installed version was changed to be owned by root externally to
cmake.

Additionally, call the helper app 'secure'.
I like 'secure firefox' to read.
2024-02-18 23:49:55 +01:00
tomFlowee b589022cbd Add showing of details in the cli app 2024-02-18 23:42:08 +01:00
tomFlowee f4032e8abe Update client to properly use the dbus 2024-02-18 22:13:16 +01:00
tomFlowee 05730c1d60 Switch to depending on Qt6 2024-02-18 22:12:53 +01:00
tomFlowee 495c4b5adb Add more DBus methods. 2024-02-18 20:58:27 +01:00
tomFlowee aac648cfc6 Add if statements backend code 2024-02-18 00:22:50 +01:00
tomFlowee a4774dfc89 cleanup unused constructs 2024-02-17 23:04:42 +01:00
tomFlowee 11eee03993 Close channels.
If needed these might be nice to read and put into some database or log
file or something.
Might be. Maybe. It's not like I read the one from x EVER.
2024-02-17 22:09:38 +01:00
tomFlowee f24b005018 Find harder 2024-02-17 22:09:38 +01:00
tomFlowee 2489e77a09 Fix copy command to be much more useful.
It can create directories now to copy into.
2024-02-17 21:53:28 +01:00
tomFlowee 846aa8f4a9 Add 'shared' and env vars
This moves the final mounts to the rules file and creates the default
setup where the app has the users homedir available under a 'shared'
subdir.

This also introduces environment variables support, filtering out all
easy targets and additionally setting the config / data dirs to not be
hidden dirs.
2024-02-17 18:11:48 +01:00
tomFlowee de6162b149 Do the backend work for env-vars cleanup 2024-02-17 01:03:43 +01:00
tomFlowee aa21075f2d Remove dead code. 2024-02-17 00:33:42 +01:00
tomFlowee 1892740678 Wrap exec in bash, which makes this work.
Not entirely sure why, but starting bash and making it start
our app seems to make practically app apps work just fine.
2024-02-16 18:51:46 +01:00
tomFlowee 089c74ad01 Add copy and fix lots of issues 2024-02-16 16:54:09 +01:00
tomFlowee 0b182e47ad Fix iterator to work with the 'try'
needed to invert meaning of 'next()'...
2024-02-16 09:00:15 +01:00
tomFlowee e1ac8745a6 Move policy rules to a rules file. 2024-02-15 23:39:04 +01:00
tomFlowee 72fcec81da comment Message 2024-02-15 21:41:26 +01:00
tomFlowee 796a6fe2fc Write some high level overview API docs 2024-02-15 21:33:28 +01:00
tomFlowee d58ddc62c3 Better basedir 2024-02-15 21:33:14 +01:00
tomFlowee afee9f2dac Fixes and proof-reading results 2022-08-16 16:36:29 +02:00
tomFlowee 44c29d2883 Add readme 2022-08-16 16:26:21 +02:00
tomFlowee 6b9759685e More complete /tmp solution. 2021-08-18 16:26:50 +02:00
tomFlowee fe4bc7c1d3 Remount /tmp 2021-08-18 12:30:11 +02:00
tomFlowee 78eba8ee88 Detect passing of desktop files. 2021-08-18 12:22:16 +02:00
tomFlowee 9edfe28713 Fix assert 2021-08-18 12:22:00 +02:00
tomFlowee fb25419e52 Close stdin/out/err
No point in keeping them tied to the server.
At this point I also don't see the benefit of writing them to disk or
something.
2021-08-15 22:05:28 +02:00
tomFlowee 2efaeea4ca Introduce mounts settings
In ~/.local/share/secure-run/1/db we store our data.
In a file `system` we now read (ini format) a [Drives] list
of which mounts are 'dangerous' in a system.
The result will be that for processes those mountmounts
will be unmounted before they start.

Drives]
1\mount=/mnt/usbpen
size=1

This also adds to an app specific (same dir) ini file the ability to list
those mounts that this specific app is allowed to see, and thus should
not be unmounted.
This uses the [AllowedDrives] list naming.

[AllowedDrives]
1\mount=/mnt/usbpen
size=1
2021-08-15 21:35:52 +02:00
tomFlowee f86b975714 Make error message clearer. 2021-08-15 21:30:32 +02:00
tomFlowee fcb358f33b Add xorg support 2021-08-15 20:50:06 +02:00
tomFlowee 7671492b31 Fix mount flags.
rbind mounting inherits all flags from the source.
2021-08-14 23:29:02 +02:00
tomFlowee 80320fc2b1 Add 'unmount' feature.
The security manager controller process can ask the runner to unmount
drives which will thus become invisible to the running process.
2021-08-14 23:03:01 +02:00
tomFlowee 0f2b1bada9 Remove fsType option.
bind-mount doesn't need that.
2021-08-14 22:53:51 +02:00
tomFlowee dea125149f Move rebind code.
This moves the homedir rebinding discovery out of the code that runs as
root and make that one do just the simplest logic possible.
2021-08-14 22:42:26 +02:00
tomFlowee 24873bbf60 Rework the message and its iterator.
This allows us to add more options and data fields.
2021-08-14 22:40:26 +02:00
tomFlowee e81cf7973f Fixlets and docs
Added plenty of small docs.
Changed the message to be pre-fixed with a message-size in order to allow
us to get interrupted on read() and know
if we need to read more.

Also fixes the bug that the server shuts down after one process as
reported by some.
2021-08-14 17:15:02 +02:00
tomFlowee f3870aec3f Redirect to namespaces
Instead of using a new user to run something secure, we now use
namespaces in order to isolate an application.
2021-05-25 14:24:44 +02:00
tomFlowee 13615be3a0 fixlets 2021-05-21 20:13:39 +02:00
tomFlowee e0a359534f Support starting apps with arguments. 2021-05-21 15:28:57 +02:00
tomFlowee 5551ac720e Add simple command to run over dbus. 2021-05-21 13:22:26 +02:00
tomFlowee d6132fa3e2 Convert to CMake 2021-05-21 11:53:51 +02:00