Documentation
¶
Overview ¶
Package mounts validates host bind mounts and guest mount targets.
Host workspace sources use a deny-list (DenyBasenames / $HOME) unless --i-know. Guest targets use OpenShell-style reserved roots (ControlRoots) so users cannot overwrite /osg control state — not a general Linux system-path denylist.
Index ¶
Constants ¶
const WorkdirInContainer = "/workspace"
WorkdirInContainer is where the host workspace is mounted.
Variables ¶
var ( // ControlRoots are in-guest paths owned by osg (must not be user-mounted over). ControlRoots = []string{ "/osg", "/etc/osg", "/run/osg", "/run/netns", "/var/run/netns", } // OCIRuntimeMountRoots must not be used as workspace or user bind targets. OCIRuntimeMountRoots = []string{ "/proc", "/sys", "/dev", } )
OpenShell-aligned guest reserved roots (osg control plane + OCI runtime mounts). Intentionally not a general Linux system-path denylist for host sources — host workspace secrets use DenyBasenames / ResolveWorkspace instead.
var DenyBasenames = []string{
".ssh", ".aws", ".gnupg", ".kube", ".docker", ".config",
".cursor", ".codex", ".claude",
}
DenyBasenames are never auto-mounted as workspace (secrets / cloud CLIs). OpenShell relies more on --upload; osg still bind-mounts workspace, so this host-side check remains as hardening.
Functions ¶
func PathsOverlap ¶
PathsOverlap reports whether a and b are equal or one contains the other.
func ResolveWorkspace ¶
ResolveWorkspace returns an absolute path and checks the deny-list. iKnow skips deny-list (still requires the path to exist as a directory).
func ValidateContainerMountTarget ¶
ValidateContainerMountTarget rejects user mounts that overlap reserved guest paths.
func ValidateUploadDest ¶
ValidateUploadDest rejects uploads into reserved control paths. Destinations under /workspace are always allowed.
Types ¶
This section is empty.