107 Commits

Author SHA1 Message Date
tomFlowee c0f579ff6d add VPN feature
This allows a jail to have a VPN config associated and as a result we start
a new net namespace, completely isolating the jails networking.
We then start an openVPN client to route between the main network and the
jails' network.

The main limitation here is that we don't setup DNS, which basically means
that the VPN will route DNS calls to the other side, but since we don't
remount resolv.conf this depends on the vpn provider actually mapping the
nameserver we use. For people that use a nameserver like 192.168.100.1,
this most of the time works just fine.

Improvement is possible.
2026-04-11 15:06:44 +02:00
tomFlowee dae688f6d6 Allow various KDE apps to start in a jail.
This makes it possible to run apps that require dbus as a way to
avoid duplicates.
2026-04-11 15:05:19 +02:00
tomFlowee 8702fbe0cf Allow remount also in a dir where I have group rights
We now no longer deny 'writing' in a directory where the user
would be able to write due to her user-group matching what the
filesystem has.
2026-04-11 14:50:53 +02:00
tomFlowee a4f8b645e4 Fix jail Id usage above ID 255
Also document for linters (and LLMS) why we explicitly don't use endian
conversion.
2026-04-11 14:47:24 +02:00
tomFlowee 995cf23294 Minor fixes 2026-04-11 14:45:40 +02:00
tomFlowee 065c0682cd Minor fixes 2026-04-11 14:44:27 +02:00
tomFlowee 041a6f486f Fix potential hijack of the pipe.
The pipe is between me and myself, so checking was minimal, but lets
not assume and add some checks to avoid overflow attacks.
2026-03-27 10:39:15 +01:00
tomFlowee 002cdf4c08 Seems that hyprland always uses 1 2025-11-18 21:37:30 +01:00
tomFlowee 749e6c9323 use nullptr in c++ 2025-11-04 12:57:36 +01:00
tomFlowee b8bf5c7523 Fix various warnings. 2025-11-04 12:57:36 +01:00
tomFlowee 2f53888e90 make compile 2025-08-19 22:17:36 +02:00
tomFlowee b5212b5b52 Just go for the newest 2025-02-01 12:11:37 +01:00
tomFlowee 188e40df69 Remove not needed safety 'feature'.
This code now no longer makes tmpfs based mounts NOEXEC.

This was an optimization that didn't really add anything anyway
since those tmpfs would all be default be local to the jail anyway,
making any executable being placed there invisible to the rest
of the system. So what were we protecting?
2025-02-01 12:08:47 +01:00
tomFlowee 29694853bf Run cleanup thread to clean zombies
For apps that use shell we every now and then saw zombies appear as a
child of the jailer process. Presumably the shall re-parented those to
process 1, which is our jailer inside the jail.

This adds a forever loop to simply call wait() repeatedly which clears
the state (makes clear we don't care about their state, really) and thus
removes the zobie processes.
2024-09-06 19:21:11 +02:00
tomFlowee 29cc3e56ff remove unused include 2024-09-06 19:18:56 +02:00
tomFlowee c8fcc71bd2 Another change after wayland 2024-05-23 22:27:51 +02:00
tomFlowee 9c1d33ff6e Add wayland support 2024-05-23 20:09:41 +02:00
tomFlowee d046c171f6 New feature; add encrypt-at-rest
When a jail is encryted at rest using 'encfs' we detect that and ask for
a password upon starting the jail.

This sounded like a neat little idea which ended up taking nearly 4 days
to do...
EncFS needs to be running as root, as it is a FUSE system and it will
actually stop root from reading/writing files if it is running as a
user. It also is very picky about not running in a namespace, it manages
to hang indefinitely otherwise where a shutdown can't complete because
the process doesn't want to die :-)

So, it runs as root, takes the password via a pipe and we have a
watchdog proces to kill it when the jail is shut down.
2024-05-20 22:21:03 +02:00
tomFlowee 4c1505b8fa Move chdir() to the main.cpp 2024-05-20 22:12:45 +02:00
tomFlowee 49130ecaf1 Add docker support 2024-05-02 23:19:55 +02:00
tomFlowee 8888793de9 Fix list size calculation 2024-04-24 18:50:40 +02:00
tomFlowee 27ed04fcb3 Allow running apps IN without full path
If it turns out it lives in /usr/bin/
2024-04-24 18:50:40 +02:00
tomFlowee 7564862be6 Add --in, running in other apps jail 2024-04-24 18:50:40 +02:00
tomFlowee a36d69cbe7 Add 'run in' feature.
Allow running a random executable inside of an existing jail.
2024-04-21 23:55:14 +02:00
tomFlowee 1cf0e006a5 Make ssh agent file copying a 'try' 2024-03-09 11:08:52 +01:00
tomFlowee 0b2136cca1 Limit view.
Telegram is only buildable by the company, not by distro's AFAIK.
So trust is lowered and this limits exposure to just your download
directory.
2024-03-07 11:21:30 +01:00
tomFlowee ba4ba341ad Show path to exe in listing
Calling `iso -lv` shows a listing of all profiles, this will now include
the path to the executable in profiles where it isn't instantly obvious.
2024-03-06 12:24:14 +01:00
tomFlowee 0030116453 Move path-resolve out of config phase
We resolve a symlink to an exe now only at the time we start the
application, avoiding the target being the one ending up in the config
file instead of the symlink.
The same now happens with the insertion of '/shared/' in the path
should the (resolved) exe path be in the users' homedir.
2024-03-06 12:22:46 +01:00
tomFlowee 771bf8d4f7 Fix exe-paths in my homedir. 2024-03-06 11:48:16 +01:00
tomFlowee 72cbe9ffd5 Add an INSTALL file 2024-03-05 22:45:06 +01:00
tomFlowee 792727e6b0 Proof read the readme 2024-03-05 22:30:24 +01:00
tomFlowee cb7a293835 Also hide /var/log 2024-02-26 11:27:12 +01:00
tomFlowee cfebf56ea2 Give auto-deleted jobs a unique name
Avoid actually starting an existing profile by adding a random number to
our profile name.
2024-02-26 11:11:25 +01:00
tomFlowee 82a0f22d58 Add audio permission and copy kde session server
The audio permission allows hiding of pulse audio and pipewire sockets.

The kde session (ksmserver) socket and state files allowing some more
apps to run properly.
2024-02-26 10:49:40 +01:00
tomFlowee 151b874a8e Add 'autodelete' and 'secure' arguments
When starting a new application for the first time you can
start them with these two feature.

Autodelete:
  this waits until the iso-pipe file is removed by the jailer,
  which it does when all processes stopped,
  and then proceeds to remove all files for the jail.

Secure:
  Puts all known rights in the 'denied' list, making the jail
  quite secure. Not a VM or a docker, but close.
2024-02-25 23:29:33 +01:00
tomFlowee 53e434769d Improve details reporting
Include proper start time and 'is running' information in the iso cli
app.
2024-02-25 20:52:04 +01:00
tomFlowee f7c9347c4c Process data sent from runner to listener
The pipe was always there, but we didn't really use it so far.
This now uses the pipe to send back the PID of the 'jailer' which we
store in a 'state' file.
2024-02-25 19:22:08 +01:00
tomFlowee b6192288f4 Have more expressive profile listing 2024-02-25 16:21:41 +01:00
tomFlowee b826503d86 Add init-script feature
When the profile has an init-script, we execute that with bash _before_
the actual executable is started.

This allows things like preparing the jail for a fresh run every time.

Notice that adding a second app in the same running jail skips the init
script.
2024-02-24 11:40:42 +01:00
tomFlowee 69b8a5d9a1 Add symlink for usability 2024-02-22 16:26:53 +01:00
tomFlowee 326ad48351 Add way to auto-start the runner
Just copy the desktop file to ~/.config/autostart/
2024-02-21 16:07:23 +01:00
tomFlowee eaedd64568 Re-view the process hierarchy
After introducing a new process that dispatches new processes _inside_
the jail, there is no point leaving the root owned 'runner' in memory.
So we move its functionality to the new mini-dispatcher (since renamed
to jailer) and remove it from the tree.
2024-02-21 14:25:15 +01:00
tomFlowee 4becd867af Allow sharing jails
When a request comes for a profile that already has someone running,
we now send a message to that jail and make them run the second
application in there directly.

The basis here is that it is impossible to recreate the 'jail' exactly
with things like tmpfs. So requests like "start a new firefox window in
the same process" need to actually run in the jail we created before.
So due to that I leave a process that I call 'mini-dispatch' which
itself lives inside of the jail, so it can trivially exec a new process
there.
2024-02-21 11:21:37 +01:00
tomFlowee e75359bcbe Rename the 'middle' process to dispatcher 2024-02-20 22:15:20 +01:00
tomFlowee 1df8778a60 Close pipes
The child runner isn't supposed to use the pipes its parent
owned, so simply close them and avoid everyone inheriting them.
2024-02-20 21:57:25 +01:00
tomFlowee 7260988bcf Rename listApps to listProfiles
Also more docs
2024-02-20 21:57:05 +01:00
tomFlowee b344481946 Rewrite the readme 2024-02-20 20:26:33 +01:00
tomFlowee 825dfb73bd Add dbus-proxy support
We re-route the dbus socket to a different location and then start
the dbus proxy in order to provide a filtered view of the world for our
jailed application.

DBus is a fantastic and a horrible system at the same time. It provides
only basic concepts and features which others can build on top of. Which
is great as many have done that building on top of it.
Unfortunately many apps have completely missed the idea of security and
hierarchy so its a mess now and you can't really open up most to apps...

Favourite stupid design, the org.freedesktop.Notifications has under
there the 'klipper' app. With an endpoint to destroy all its historical
data. Making 'just open the notifications, what could go wrong' end with
pain.
2024-02-20 19:14:25 +01:00
tomFlowee 5f261e65ad rename default datadir.
We now expect to be installed into /etc/security/iso-rules/
Well, the ruleset anyway.
2024-02-20 11:39:16 +01:00
tomFlowee 317c491a15 fix argument passing to the final exe 2024-02-19 22:45:32 +01:00