-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathappliance.schema.json
More file actions
592 lines (592 loc) · 18.2 KB
/
appliance.schema.json
File metadata and controls
592 lines (592 loc) · 18.2 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://secai-hub.github.io/SecAI_OS/schemas/appliance.schema.json",
"title": "SecAI OS Appliance Configuration",
"description": "JSON Schema for the SecAI OS appliance configuration file (appliance.yaml). Controls runtime behavior, service bindings, hardware settings, and security features.",
"type": "object",
"required": ["version", "appliance", "paths", "inference", "services"],
"additionalProperties": false,
"properties": {
"version": {
"type": "integer",
"description": "Schema version number.",
"minimum": 1
},
"appliance": {
"type": "object",
"description": "Top-level appliance identity.",
"required": ["name", "mode"],
"additionalProperties": false,
"properties": {
"name": {
"type": "string",
"description": "Human-readable appliance name.",
"default": "Secure AI Appliance"
},
"mode": {
"type": "string",
"enum": ["local-only", "online-augmented"],
"description": "Appliance networking mode. 'local-only' blocks all egress; 'online-augmented' enables airlock and search."
}
}
},
"paths": {
"type": "object",
"description": "Filesystem paths for data storage.",
"additionalProperties": false,
"properties": {
"vault": {
"type": "string",
"description": "Root path for the LUKS-encrypted vault.",
"default": "/var/lib/secure-ai/vault"
},
"registry": {
"type": "string",
"description": "Directory for promoted model files.",
"default": "/var/lib/secure-ai/registry"
},
"quarantine": {
"type": "string",
"description": "Directory for incoming models awaiting scanning.",
"default": "/var/lib/secure-ai/quarantine"
},
"airlock_audit": {
"type": "string",
"description": "Directory for airlock audit logs.",
"default": "/var/lib/secure-ai/airlock-audit"
},
"tmpdir": {
"type": "string",
"description": "Temporary directory on tmpfs (memory-backed).",
"default": "/run/secure-ai/tmp"
},
"outputs": {
"type": "string",
"description": "Directory for generated outputs (images, text).",
"default": "/var/lib/secure-ai/vault/outputs"
}
}
},
"gpu": {
"type": "object",
"description": "GPU configuration. Auto-detected at first boot.",
"additionalProperties": false,
"properties": {
"backend": {
"type": "string",
"enum": ["auto", "cuda", "rocm", "xpu", "vulkan", "mps", "cpu"],
"default": "auto",
"description": "GPU backend. 'auto' runs detect-gpu.sh at first boot."
}
}
},
"vm": {
"type": "object",
"description": "Virtual machine settings. Auto-detected at first boot.",
"additionalProperties": false,
"properties": {
"gpu_passthrough": {
"type": "boolean",
"default": false,
"description": "Enable GPU acceleration in VMs. Disabled by default because GPU memory is visible to the host hypervisor."
}
}
},
"inference": {
"type": "object",
"description": "LLM inference engine settings (llama-server).",
"additionalProperties": false,
"properties": {
"engine": {
"type": "string",
"default": "llama-cpp",
"description": "Inference engine identifier."
},
"bind": {
"type": "string",
"default": "127.0.0.1:8465",
"description": "Address and port for the inference server."
},
"gpu_layers": {
"type": "integer",
"default": -1,
"description": "Number of model layers to offload to GPU. -1 means all layers."
},
"context_size": {
"type": "integer",
"minimum": 512,
"default": 8192,
"description": "Maximum context window size in tokens."
},
"default_model": {
"type": "string",
"default": "",
"description": "Default model name to load. Set after first model is promoted."
}
}
},
"diffusion": {
"type": "object",
"description": "Diffusion model (image/video generation) settings.",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8455",
"description": "Address and port for the diffusion service."
},
"max_resolution": {
"type": "integer",
"minimum": 256,
"default": 2048,
"description": "Maximum image resolution (width or height)."
},
"max_steps": {
"type": "integer",
"minimum": 1,
"default": 100,
"description": "Maximum diffusion steps per generation."
},
"max_frames": {
"type": "integer",
"minimum": 1,
"default": 120,
"description": "Maximum video frames per generation."
}
}
},
"services": {
"type": "object",
"description": "Service bind addresses.",
"additionalProperties": false,
"properties": {
"registry": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8470"
}
}
},
"tool_firewall": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8475"
}
}
},
"ui": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8480"
}
}
},
"airlock": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8490"
}
}
},
"diffusion": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8455"
}
}
},
"search_mediator": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8485"
}
}
},
"searxng": {
"type": "object",
"additionalProperties": false,
"properties": {
"bind": {
"type": "string",
"default": "127.0.0.1:8888"
}
}
},
"tor": {
"type": "object",
"additionalProperties": false,
"properties": {
"socks": {
"type": "string",
"default": "127.0.0.1:9050"
}
}
}
}
},
"traffic_analysis_protection": {
"type": "object",
"description": "Countermeasures against network traffic analysis.",
"additionalProperties": false,
"properties": {
"query_delay_min": {
"type": "number",
"minimum": 0.0,
"default": 0.5,
"description": "Minimum random delay before each search (seconds)."
},
"query_delay_max": {
"type": "number",
"minimum": 0.0,
"default": 3.0,
"description": "Maximum random delay before each search (seconds)."
},
"query_pad_buckets": {
"type": "array",
"items": {
"type": "integer",
"minimum": 1
},
"default": [256, 512, 1024],
"description": "Fixed-size query padding buckets (bytes)."
},
"tor_max_circuit_dirtiness": {
"type": "integer",
"minimum": 1,
"default": 30,
"description": "Tor MaxCircuitDirtiness in seconds for faster circuit rotation."
},
"tor_connection_padding": {
"type": "boolean",
"default": true,
"description": "Enable Tor ConnectionPadding to add dummy cells."
},
"dns_leak_check_interval": {
"type": "integer",
"minimum": 1,
"default": 60,
"description": "DNS leak check interval in minutes."
}
}
},
"session": {
"type": "object",
"description": "Session mode configuration.",
"additionalProperties": false,
"properties": {
"mode": {
"type": "string",
"enum": ["normal", "sensitive", "offline-only"],
"default": "normal",
"description": "'sensitive' enables aggressive worker recycling. 'offline-only' hard-blocks all network."
}
}
},
"monitoring": {
"type": "object",
"description": "Periodic monitoring intervals.",
"additionalProperties": false,
"properties": {
"integrity_interval": {
"type": "integer",
"enum": [5, 15, 30, 60],
"default": 15,
"description": "Model integrity check interval in minutes."
},
"audit_interval": {
"type": "integer",
"minimum": 1,
"default": 30,
"description": "Audit log chain verification interval in minutes."
}
}
},
"vault": {
"type": "object",
"description": "LUKS-encrypted vault auto-lock settings.",
"additionalProperties": false,
"properties": {
"auto_lock_timeout": {
"type": "integer",
"minimum": 0,
"default": 30,
"description": "Auto-lock after this many minutes of inactivity. 0 disables (not recommended)."
},
"check_interval": {
"type": "integer",
"minimum": 1,
"default": 30,
"description": "How often the watchdog checks for inactivity (seconds)."
}
}
},
"auth": {
"type": "object",
"description": "Local authentication settings.",
"additionalProperties": false,
"properties": {
"session_timeout": {
"type": "integer",
"minimum": 0,
"default": 30,
"description": "Session timeout in minutes. 0 disables (not recommended)."
},
"max_failed_attempts": {
"type": "integer",
"minimum": 1,
"default": 5,
"description": "Failed login attempts before lockout."
},
"lockout_duration": {
"type": "integer",
"minimum": 1,
"default": 60,
"description": "Initial lockout duration in seconds."
},
"escalated_lockout": {
"type": "integer",
"minimum": 1,
"default": 900,
"description": "Escalated lockout after 15 failed attempts (seconds)."
}
}
},
"secure_boot": {
"type": "object",
"description": "UEFI Secure Boot and TPM2 measured boot settings.",
"additionalProperties": false,
"properties": {
"tpm2_pcr_binding": {
"type": "string",
"default": "sha256:0,2,4,7",
"description": "TPM2 PCR binding for vault key sealing. Format: hash_alg:pcr_list."
},
"passphrase_fallback": {
"type": "boolean",
"default": true,
"description": "Allow passphrase fallback when PCR values do not match."
},
"auto_reseal_on_update": {
"type": "boolean",
"default": false,
"description": "Automatically reseal TPM2 after rpm-ostree upgrades."
}
}
},
"sandbox": {
"type": "object",
"description": "Process isolation settings (seccomp-bpf, Landlock).",
"additionalProperties": false,
"properties": {
"seccomp_enabled": {
"type": "boolean",
"default": true,
"description": "Enable seccomp-bpf syscall filtering."
},
"landlock_enabled": {
"type": "boolean",
"default": true,
"description": "Enable Landlock filesystem access control."
},
"core_dumps_disabled": {
"type": "boolean",
"default": true,
"description": "Prevent core dumps across all services."
}
}
},
"memory_protection": {
"type": "object",
"description": "Memory protection hardening to prevent secrets leaking to disk.",
"additionalProperties": false,
"properties": {
"swap_disabled": {
"type": "boolean",
"default": true,
"description": "Set vm.swappiness=0 to avoid swapping."
},
"zswap_disabled": {
"type": "boolean",
"default": true,
"description": "Disable zswap (compressed swap in RAM)."
},
"core_dumps_disabled": {
"type": "boolean",
"default": true,
"description": "Discard all core dumps via core_pattern."
},
"mlock_sensitive_data": {
"type": "boolean",
"default": true,
"description": "Lock sensitive buffers in RAM via SecureBuffer class."
},
"tee_detection": {
"type": "boolean",
"default": true,
"description": "Detect AMD SEV / Intel TDX / TME at first boot."
}
}
},
"clipboard": {
"type": "object",
"description": "Clipboard isolation to prevent data leakage in VMs.",
"additionalProperties": false,
"properties": {
"isolate_vm_clipboard": {
"type": "boolean",
"default": true,
"description": "Detect and disable VM clipboard agents (spice-vdagent, vmware-user, etc.)."
},
"auto_clear_enabled": {
"type": "boolean",
"default": true,
"description": "Auto-clear clipboard on a timer."
},
"auto_clear_interval": {
"type": "integer",
"minimum": 1,
"default": 60,
"description": "Clipboard auto-clear interval in seconds."
},
"private_users_non_ui": {
"type": "boolean",
"default": true,
"description": "Run non-UI services with PrivateUsers=yes to prevent clipboard access."
}
}
},
"canary": {
"type": "object",
"description": "Canary / tripwire system for tamper detection.",
"additionalProperties": false,
"properties": {
"check_interval": {
"type": "integer",
"minimum": 1,
"default": 5,
"description": "Periodic check interval in minutes."
},
"inotify_enabled": {
"type": "boolean",
"default": true,
"description": "Enable inotify watcher for real-time detection."
},
"locations": {
"type": "array",
"items": { "type": "string" },
"description": "Filesystem paths for canary files.",
"default": [
"/var/lib/secure-ai/vault/.canary",
"/var/lib/secure-ai/registry/.canary",
"/var/lib/secure-ai/keys/.canary",
"/etc/secure-ai/.canary"
]
}
}
},
"emergency": {
"type": "object",
"description": "Emergency wipe / panic system.",
"additionalProperties": false,
"properties": {
"countdown_seconds": {
"type": "integer",
"minimum": 0,
"default": 5,
"description": "Countdown before executing panic (can be skipped with --no-countdown)."
},
"require_passphrase_level2": {
"type": "boolean",
"default": true,
"description": "Require passphrase confirmation for Level 2+ panic."
},
"audit_log": {
"type": "string",
"default": "/var/lib/secure-ai/logs/panic-audit.jsonl",
"description": "Path to the panic audit log."
}
}
},
"updates": {
"type": "object",
"description": "Update verification and auto-rollback settings.",
"additionalProperties": false,
"properties": {
"cosign_verify": {
"type": "boolean",
"default": true,
"description": "Verify cosign signatures before applying updates."
},
"auto_check_interval": {
"type": "integer",
"minimum": 1,
"default": 6,
"description": "Automatic update check interval in hours."
},
"max_rollback_attempts": {
"type": "integer",
"minimum": 1,
"default": 2,
"description": "Maximum rollback attempts before halting for manual intervention."
},
"health_check_timeout": {
"type": "integer",
"minimum": 1,
"default": 300,
"description": "Health check timeout in seconds after applying an update."
},
"staged_updates": {
"type": "boolean",
"default": true,
"description": "Require explicit user confirmation before applying staged updates."
}
}
},
"logging": {
"type": "object",
"description": "Global logging settings.",
"additionalProperties": false,
"properties": {
"level": {
"type": "string",
"enum": ["debug", "info", "warning", "error"],
"default": "info",
"description": "Log verbosity level."
},
"store_raw_prompts": {
"type": "boolean",
"default": false,
"description": "Store raw user prompts in logs."
},
"store_raw_responses": {
"type": "boolean",
"default": false,
"description": "Store raw LLM responses in logs."
},
"audit_tool_calls": {
"type": "boolean",
"default": true,
"description": "Write structured audit log entries for tool calls."
}
}
}
}
}