aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/app/start.go
AgeCommit message (Collapse)Author
2025-02-19app: separate appSeal finalise methodOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: merge seal with sysOphestra
The existence of the appSealSys struct was an implementation detail obsolete since system.I was integrated in 084cd84f36a1d608541b4aa4e1e95334395d8953. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: embed appSeal in app structOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-19app: store values with string representationOphestra
Improves code readability without changing memory layout. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-18app: separate interface from implementationOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-02-17system: move out of internalOphestra
Signed-off-by: Ophestra <cat@gensokyo.uk>
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-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-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-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>
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-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-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-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-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-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-03system/dbus: buffer xdg-dbus-proxy messagesOphestra Umiker
Pointing xdg-dbus-proxy to stdout/stderr makes a huge mess. This change enables app to neatly print out prefixed xdg-dbus-proxy messages after output is resumed. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-11-02cmd: shim and init into separate binariesOphestra Umiker
This change also fixes a deadlock when shim fails to connect and complete the setup. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-28app/start: skip cleanup if shim is nilOphestra Umiker
Shim is created before any system operation happens. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-28shim: expose checkPid in constructorOphestra Umiker
This will be supported soon when launching via fsu. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-27shim: user switcher process management structOphestra Umiker
This change moves all user switcher and shim management to the shim package and withholds output while shim is alive. This also eliminated all exit scenarios where revert is skipped. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-25app/start: cleaner command not found messageOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-25shim: kill shim if setup becomes impossibleOphestra Umiker
This prevents a hang when setup faults but the shim keeps waiting on the socket. Setup is automatically aborted when the shim is killed. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-21shim: abort setup on failed start and process exitOphestra Umiker
Shim setup listens on a socket in the process share, if shim setup hasn't happened on exit revert will fail. This change makes sure shim setup is aborted on a doomed launch. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-21fmsg: produce all output through fmsgOphestra Umiker
The behaviour of print functions from package fmt is not thread safe. Functions provided by fmsg wrap around Logger methods. This makes prefix much cleaner and makes it easy to deal with future changes to logging. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-21app: move wayland mediation to shim packageOphestra Umiker
Values used in the Wayland mediation implementation is stored in various struct fields strewn across multiple app structs and checks are messy and confusing. This commit unifies them into a single struct and access it using much better looking methods. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-20migrate to git.ophivana.moe/security/fortifyOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-20app: move app ID to app structOphestra Umiker
App ID is inherent to App, and it makes no sense to generate it as part of the app sealing process. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-18state: store launch method instead of launcher pathOphestra Umiker
Launcher path is constant for each launch method on the same system. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16system: move enablements from state packageOphestra Umiker
This removes the unnecessary import of the state package. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16app: port app to use the system packageOphestra Umiker
This commit does away with almost all baggage left over from the Ego port. Error wrapping also got simplified. All API changes happens to be internal which means no changes to main except renaming of the BaseError type. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-15helper/bwrap: ordered filesystem argsOphestra Umiker
The argument builder was written based on the incorrect assumption that bwrap arguments are unordered. The argument builder is replaced in this commit to correct that mistake. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-14init: custom init process inside sandboxOphestra Umiker
Bubblewrap as init is a bit awkward and don't support a few setup actions fortify will need, such as starting/supervising nscd. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-12app: filesystem struct that maps to all bwrap bind optionsOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-11app: integrate bwrap into environment setupOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-11app: migrate to new shim implementationOphestra Umiker
Both machinectl and sudo launch methods launch shim as shim is now responsible for setting up the sandbox. Various app structures are adapted to accommodate bwrap configuration and mediated wayland access. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-10app: tag ACL operations for revertOphestra Umiker
ACL operations are now tagged with the enablement causing them. At the end of child process's life, enablements of all remaining launchers are resolved and inverted. This allows Wait to only revert operations targeting resources no longer required by other launchers. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-10app: remove bubblewrap launch methodOphestra Umiker
Launch methods serve the primary purpose of setting UID in the init namespace, which bubblewrap does not do. Furthermore, all applications will start within a bubblewrap sandbox once it has been implemented. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>