# michiko-hagakure/bash-scripts architecture

> Architecture diagram of the GitHub repository michiko-hagakure/bash-scripts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/michiko-hagakure/bash-scripts
- Repository: https://github.com/michiko-hagakure/bash-scripts

## Overview

This repository provides two platform-specific sandbox launchers: a Linux `unshare`/`chroot` environment and a Windows Docker container. Users run the corresponding script to enter an isolated shell or container; the documented protections cover filesystem, network, and process isolation, with cleanup on Linux and elevated-privilege enforcement on Windows. The README documents these relationships, but no source excerpts were available to verify implementation details.

Main entry points: [`launch_sandbox.sh`](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh) (Linux launcher), [`launch_sandbox.ps1`](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.ps1) (Windows launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_linux["Linux Sandbox"]
  node_linux_launcher["Linux launcher<br/>[launch_sandbox.sh]"]
  node_linux_namespaces["Namespace isolation<br/>[launch_sandbox.sh]"]
  node_linux_jail["Chroot filesystem<br/>[launch_sandbox.sh]"]
  node_linux_shell["Sandbox shell<br/>[launch_sandbox.sh]"]
  node_linux_cleanup["Process cleanup<br/>[launch_sandbox.sh]"]
end

subgraph group_windows["Windows Sandbox"]
  node_windows_launcher["Windows launcher<br/>[launch_sandbox.ps1]"]
  node_admin_check["Admin enforcement<br/>[launch_sandbox.ps1]"]
  node_docker_container["Docker container<br/>[launch_sandbox.ps1]"]
end

node_user(("User"))
node_unshare["unshare"]
node_chroot["chroot"]
node_docker["Docker"]

node_user -->|"runs"| node_linux_launcher
node_linux_launcher -->|"uses"| node_unshare
node_linux_launcher -->|"uses"| node_chroot
node_linux_launcher -->|"configures"| node_linux_namespaces
node_linux_launcher -->|"restricts"| node_linux_jail
node_linux_launcher -->|"starts"| node_linux_shell
node_linux_launcher -->|"cleans up"| node_linux_cleanup
node_user -->|"runs"| node_windows_launcher
node_windows_launcher -->|"checks privileges"| node_admin_check
node_windows_launcher -->|"uses"| node_docker
node_windows_launcher -->|"starts"| node_docker_container

click node_linux_launcher "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh"
click node_linux_namespaces "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh"
click node_linux_jail "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh"
click node_linux_shell "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh"
click node_linux_cleanup "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh"
click node_windows_launcher "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.ps1"
click node_admin_check "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.ps1"
click node_docker_container "https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.ps1"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_linux_launcher,node_linux_namespaces,node_linux_jail,node_linux_shell,node_linux_cleanup,node_user toneBlue
class node_windows_launcher,node_admin_check,node_docker_container toneAmber
class node_unshare,node_chroot,node_docker toneIndigo
```

## Components

### Linux Sandbox

- [Linux launcher](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh): `launch_sandbox.sh`
- [Namespace isolation](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh): `launch_sandbox.sh`
- [Chroot filesystem](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh): `launch_sandbox.sh`
- [Sandbox shell](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh): `launch_sandbox.sh`
- [Process cleanup](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.sh): `launch_sandbox.sh`

### Windows Sandbox

- [Windows launcher](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.ps1): `launch_sandbox.ps1`
- [Admin enforcement](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.ps1): `launch_sandbox.ps1`
- [Docker container](https://github.com/michiko-hagakure/bash-scripts/blob/original/launch_sandbox.ps1): `launch_sandbox.ps1`

### Other components

- **User**
- **unshare**
- **chroot**
- **Docker**

## Connections

- User → Linux launcher: runs
- Linux launcher → unshare: uses
- Linux launcher → chroot: uses
- Linux launcher → Namespace isolation: configures
- Linux launcher → Chroot filesystem: restricts
- Linux launcher → Sandbox shell: starts
- Linux launcher → Process cleanup: cleans up
- User → Windows launcher: runs
- Windows launcher → Admin enforcement: checks privileges
- Windows launcher → Docker: uses
- Windows launcher → Docker container: starts
