-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlinux-process.puml
More file actions
71 lines (55 loc) · 1.77 KB
/
linux-process.puml
File metadata and controls
71 lines (55 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@startuml linux-process
!theme plain
skinparam backgroundColor #FEFEFE
skinparam defaultFontName Inter
skinparam shadowing false
skinparam roundcorner 8
skinparam ArrowColor #444444
skinparam RectangleBorderColor #888888
skinparam PackageBorderColor #666666
skinparam NoteBackgroundColor #FFFDE7
skinparam NoteBorderColor #FBC02D
title **Linux Process & Filesystem Isolation**\nnamespaces + mount overrides (no root required)
actor "User" as user
rectangle "**aigate run -- <cmd>**" as aigate #E3F2FD
rectangle "User Namespace\n(unshare --user --map-root-user)" as userns #FFF3E0 {
rectangle "Mount Namespace\n(unshare --mount)" as mntns #FFECB3 {
rectangle "**Mount Overrides**\n(deny_read enforcement)" as mounts #FFE082
rectangle "**/proc remount**\n(mount -t proc proc /proc)" as procmnt #FFE082
rectangle "**resolv.conf**\nbind-mount to 10.0.2.3\n(only with AllowNet)" as resolv #FFE082
}
rectangle "PID Namespace\n(unshare --pid --fork)" as pidns #E1BEE7 {
rectangle "**Sandboxed Process**\n<cmd> <args>" as proc #CE93D8
}
}
user --> aigate
aigate --> userns
note right of mounts
**deny_read paths:**
Directories -> tmpfs (ro, size=0)
Files -> bind /dev/null
Examples:
mount -t tmpfs tmpfs ~/.ssh/
mount --bind /dev/null .env
end note
note right of proc
Process sees itself as PID 1.
Cannot see or signal any host
processes. /proc remounted to
match the new PID namespace.
end note
note left of userns
Maps calling user to UID 0
inside the namespace. Gives
CAP_SYS_ADMIN for mount/net
operations without real root.
end note
note bottom of aigate
**deny_exec enforcement:**
Checked BEFORE entering the
sandbox. If the command (or
subcommand like "kubectl delete")
is in the deny list, aigate
refuses to run it.
end note
@enduml