aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app
AgeCommit message (Collapse)Author
2025-02-17system/wayland: sync file at caller specified addressOphestra
Storing this in sys is incredibly ugly: sys should be stateless and Ops must keep track of their state. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-17system/tmpfiles: implement private tmpfilesOphestra
These are only available within the mount namespace and should significantly reduce attack surface. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-16app/shim/manager: return error on bad fsu pathOphestra
This results in a graceful failure that does not leave garbage behind. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-16fmsg: implement suspend in writerOphestra
This removes the requirement to call fmsg.Exit on every exit path, and enables direct use of the "log" package. However, fmsg.BeforeExit is still encouraged when possible to catch exit on suspended output. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-16internal: move shim and init into appOphestra
This structure makes more sense, as both processes are part of an app's lifecycle. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-15app: improve WAYLAND_DISPLAY correctnessOphestra
This now has identical behaviour as wayland C library. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-15app: remove wayland socket hard linkOphestra
This Op was not doing anything useful. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-15app: port passwd and group files to copyOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-15priv/shim: move /sbin/init setup to appOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-14app: check username length against LOGIN_NAME_MAXOphestra
This limit is arbitrary, but it's good to enforce it anyway. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-13helper: use generic extra files interfaceOphestra
This replaces the pipes object and integrates context into helper process lifecycle. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-08helper/proc: move package out of internalOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-07system/dbus: dump method prints msgbufOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-22app/share: clean BaseError messageOphestra
This removes trailing '\n' in the PulseAudio warning. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-22helper/bwrap: integrate seccomp into helper interfaceOphestra
This makes API usage much cleaner, and encapsulates all bwrap arguments in argsWt. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-21state: store config in separate gob streamOphestra
This enables early serialisation of config. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-20fst: include syscall filter configurationOphestra
This value is passed through to shim. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-19helper/bwrap: move sync to helper stateOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-19proc/priv/shim: remove unnecessary stateOphestra
These values are only used during process creation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-17proc/priv/shim: merge shim into main programOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-15app: expose single run methodOphestra
App is no longer just a simple [exec.Cmd] wrapper, so exposing these steps separately no longer makes sense and actually hinders proper error handling, cleanup and cancellation. This change removes the five-second wait when the shim dies before receiving the payload, and provides caller the ability to gracefully stop execution of the confined process. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-01-15fst: hide sockets exposed via FilesystemOphestra
This is mostly useful for permissive defaults. Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-31update reverse-DNS style identifiersOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-28cmd/fshim: ensure data directoryOphestra
Ensuring home directory in shim causes the directory to be owned by the target user. Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-28app: ensure extra pathsOphestra
The primary use case for extra perms is app-specific state directories, which may or may not exist (first run of any app). Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-28app: extra acl entries from configurationOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-28app: merge share methodsOphestra
This significantly increases readability and makes order of ops more obvious. Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-22app: mount /dev/kvm in permissive defaultsOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-21app: rename /fortify to /.fortifyOphestra
Also removed the inner share tmpfs mount. Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-21app: do not fail on missing cookieOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2024-12-20migrate to git.gensokyo.uk/security/fortifyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-19state: expose aids and use instance id as keyOphestra Umiker
Fortify state store instances was specific to aids due to outdated design decisions carried over from the ego rewrite. That no longer makes sense in the current application, so the interface now enables a single store object to manage all transient state. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-18cmd/fshim: switch to setup pipeOphestra Umiker
The socket-based approach is no longer necessary as fsu allows extra files and sudo compatibility is no longer relevant. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-18fst: rename from fipcOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-18fipc: export config structOphestra Umiker
Also store full config as part of state. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-12-06app: integrate security-context-v1Ophestra Umiker
Should be able to get rid of XDG_RUNTIME_DIR share after this. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-21app: add nixos-based config test caseOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-19app: validate usernameOphestra Umiker
This value is used for passwd generation. Bad input can cause very confusing issues. This is not a security issue, however validation will improve user experience. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-18cmd/fshim/ipc: install signal handler on shim startOphestra Umiker
Getting killed at this point will result in inconsistent state. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-18app: alternative inner home pathOphestra Umiker
Support binding home to an alternative path in the mount namespace. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-17app/start: check for cleanup and abort conditionOphestra Umiker
Dirty fix. Will rewrite after fsu integration complete. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-17app: append # for ChangeHosts message with numerical uidOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-16app: integrate fsuOphestra Umiker
This removes the dependency on external user switchers like sudo/machinectl and decouples fortify user ids from the passwd database. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-09app/config: rename map_real_uid from use_real_uidOphestra Umiker
This option only changes mapped uid in the user namespace. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-06app: support full /dev accessOphestra Umiker
Also moved /dev/fortify to /fortify since it is impossible to create new directories in /dev from the init namespace and bind mounting its contents has undesirable side effects. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-04linux: provide access to stdoutOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-04app: separate auto etc from permissive defaultsOphestra Umiker
Populating /etc with symlinks is quite useful even outside the permissive defaults usage pattern. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-04app/config: UseRealUID as true in templateOphestra Umiker
The template is based on a Chromium setup, which this workaround was created for. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-04app: support mapping target uid as privileged uid in sandboxOphestra Umiker
Chromium's D-Bus client implementation refuses to work when its getuid call returns a different value than what the D-Bus server is running as. The reason behind this is not fully understood, but this workaround is implemented to support chromium and electron apps. This is not used by default since it has many side effects that break many other programs, like SSH on NixOS. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-04app: format mapped uid instead of real uidOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>