aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2024-10-23internal: wrap calls to os standard library functionsOphestra Umiker
This change helps tests stub out and simulate OS behaviour during the sealing process. This also removes dependency on XDG_RUNTIME_DIR as the internal.System implementation provided to App provides a compat directory inside the tmpdir-based share when XDG_RUNTIME_DIR is unavailable. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-23system: sys comparison methodOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-23system: return sys in queueing methodsOphestra Umiker
This enables building an instance in a single statement. 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-20release: 0.0.7Ophestra Umiker
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-20update README documentOphestra Umiker
We have a highly configurable sandbox now, just not really the Android sandbox. 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-18workflows: call apt-get without sudoOphestra Umiker
Workflow scripts run as root in act-runner containers, so calling sudo is redundant and pointless. 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-18release: 0.0.6Ophestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-18app/share: fix order to ensure SharePath before any of its subdirectoriesOphestra Umiker
shareTmpdirChild happened to request an ephemeral dir within SharePath and was called before shareRuntime which ensures that path. This commit moves SharePath initialisation to shareSystem and moves shareTmpdirChild into ShareSystem. Further cleanup and tests are desperately needed for the app package but for now this fix will have to do. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17release: 0.0.5Ophestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17init: start timeout only if reaped PID is the initial processOphestra Umiker
Fix a very obvious bug introduced in 5401882ed0. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17nix: remove fortify package from default devShellOphestra Umiker
This change makes it possible to start a devShell when tests aren't passing. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17system: tests for all Op implementations except DBusOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17system/mkdir: type label in String methodOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17ldd: run ldd with read-only filesystem and unshared netOphestra Umiker
This is only called on trusted programs, however extra hardening is never a bad idea. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17system: handle invalid enablement in String methodOphestra Umiker
Invalid enablement is only caused by bad API usage, however panicking on the spot leaves behind messy state that has to be manually cleaned up. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17init: post initial process death exit timeoutOphestra Umiker
Wait for 5 seconds before printing a message and exiting after picking up the initial process's wait status. This also kills any lingering processes.This behaviour is helpful for applications launched without a terminal attached. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17workflows: test workflow to run tests every commitOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-17workflows: add lines between stepsOphestra Umiker
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-16system: isolate app/system into generic implementationOphestra Umiker
This improves maintainability and extensibility of system operations, makes writing tests for them possible, and operations now apply and revert in order, instead of being bunched up into their own categories. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16fmsg/errors: isolate app/error into a separate packageOphestra Umiker
These functions are not in any way specific to the app package. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-16dbus: various accessors for dbus.Proxy internal fieldsOphestra Umiker
These values are useful during sandbox setup and exporting them makes more sense than storing them twice. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-15release: 0.0.4Ophestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-15helper/bwrap: add fortify permissive default test caseOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-15helper/bwrap: sort SetEnv argumentsOphestra Umiker
This guarantees consistency of resulting args. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-15app: filter /tmp from permissive defaultOphestra Umiker
Tmpdir is bind mounted over further along in execution so there is no point sharing it here. 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-14helper/bwrap: format mode in octalOphestra Umiker
Bubblewrap expects an octal representation of mode. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-14fortify: move PR_SET_DUMPABLE to the beginning of mainOphestra Umiker
This call does need flag values. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-14release: 0.0.3Ophestra Umiker
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-13fortify: refuse to run as rootOphestra Umiker
There is no good reason to run fortify as root and desktop environments typically do not like that either. This check prevents confusion for new users who might mistakenly run it as root or set the setuid bit. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13shim: update payload commentOphestra Umiker
Generating permissive default no longer happens in shim. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13shim: re-exec self on startupOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13shim: get rid of insane launch conditionOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13app: generate and replace passwd and group filesOphestra Umiker
This ensures libc functions get correct user information. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13app/config: map bwrap tmpfs in app configOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13helper/bwrap: allow pushing generic arguments to the end of argument streamOphestra Umiker
Bwrap argument order determines the order their corresponding actions are performed. This allows generic arguments like tmpfs to the end of the stream to override bind mounts. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13app/config: always use nobody UID within sandboxOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13fortify: set SUID_DUMP_DISABLE after flag parseOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13app/seal: skip /mnt in permissive defaultOphestra Umiker
This directory usually contains temporarily mounted stuff and shouldn't get into the sandbox. Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-13update README documentOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
2024-10-12nix: pass $SHELL for shell interpreterOphestra Umiker
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>