Skip to content

Commit 6246bdd

Browse files
committed
Harden services and validate Linux deployment
1 parent 89f1ce6 commit 6246bdd

40 files changed

Lines changed: 1261 additions & 384 deletions

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.sh text eol=lf
2+
*.service text eol=lf
3+
*.timer text eol=lf
4+
*.socket text eol=lf
5+
*.target text eol=lf
6+
*.path text eol=lf
7+
*.mount text eol=lf
8+
files/system/usr/lib/systemd/system/* text eol=lf
9+
files/system/usr/libexec/secure-ai/* text eol=lf
10+
files/system/etc/greenboot/check/required.d/* text eol=lf

files/system/etc/secure-ai/policy/policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ search:
9797
block_high_pii_queries: true
9898
# Injection detection on inbound results
9999
detect_injection: true
100-
# Audit every search (query hash + sanitized query + result count)
100+
# Audit every search (query hash + length + redaction count + result count)
101101
audit: true
102102
# Search engines enabled in SearXNG (privacy-respecting only)
103103
allowed_engines:

files/system/usr/lib/systemd/system/secure-ai-clipboard-clear.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Unit]
22
Description=Secure AI Clipboard Auto-Clear
3-
Documentation=Clears clipboard to prevent sensitive data persistence
3+
# Clears clipboard to reduce sensitive data persistence on the desktop host
44

55
[Service]
66
Type=oneshot

files/system/usr/lib/systemd/system/secure-ai-clipboard-clear.timer

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Unit]
22
Description=Periodic Clipboard Clear (every 60 seconds)
3-
Documentation=Prevents sensitive data from persisting on clipboard
3+
# Prevents sensitive data from persisting on the clipboard between uses
44

55
[Timer]
66
OnBootSec=2min

files/system/usr/lib/systemd/system/secure-ai-gpu-integrity-watch.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ RestrictRealtime=yes
4848
CapabilityBoundingSet=CAP_SYS_RAWIO
4949
AmbientCapabilities=
5050

51+
# Network restriction — probes are limited to localhost services
52+
IPAddressDeny=any
53+
IPAddressAllow=localhost
54+
5155
# Namespace restrictions
5256
RestrictNamespaces=yes
5357
RestrictAddressFamilies=AF_UNIX AF_INET

files/system/usr/lib/systemd/system/secure-ai-incident-recorder.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ RestrictAddressFamilies=AF_UNIX AF_INET
5252
PrivateUsers=yes
5353
PrivateNetwork=no
5454

55+
# Network restriction — recorder only serves and calls local control-plane APIs
56+
IPAddressDeny=any
57+
IPAddressAllow=localhost
58+
5559
# Syscall filtering
5660
SystemCallFilter=@system-service
5761
SystemCallFilter=~@privileged @resources @mount @clock @debug @swap @reboot @raw-io @module @cpu-emulation @obsolete

files/system/usr/lib/systemd/system/secure-ai-integrity-monitor.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ PrivateUsers=yes
5656
# PrivateNetwork=no — needs localhost HTTP for API and to read service binaries
5757
PrivateNetwork=no
5858

59+
# Network restriction — monitor only exposes and reaches localhost APIs
60+
IPAddressDeny=any
61+
IPAddressAllow=localhost
62+
5963
# Syscall filtering
6064
SystemCallFilter=@system-service
6165
SystemCallFilter=~@privileged @resources @mount @clock @debug @swap @reboot @raw-io @module @cpu-emulation @obsolete

files/system/usr/lib/systemd/system/secure-ai-quarantine-watcher.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ RestrictRealtime=yes
4848
CapabilityBoundingSet=
4949
AmbientCapabilities=
5050

51+
# Network restriction — watcher only calls local registry and smoke-test endpoints
52+
IPAddressDeny=any
53+
IPAddressAllow=localhost
54+
5155
# Namespace restrictions
5256
RestrictNamespaces=yes
5357
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6

files/system/usr/lib/systemd/system/secure-ai-runtime-attestor.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ PrivateUsers=yes
5959
# and needs to exec tpm2_pcrread and rpm-ostree (external commands)
6060
PrivateNetwork=no
6161

62+
# Network restriction — attestor may only reach localhost peers
63+
IPAddressDeny=any
64+
IPAddressAllow=localhost
65+
6266
# Syscall filtering
6367
SystemCallFilter=@system-service
6468
SystemCallFilter=~@privileged @resources @mount @clock @debug @swap @reboot @raw-io @module @cpu-emulation @obsolete

files/system/usr/lib/systemd/system/secure-ai-search-mediator.service

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ RestrictRealtime=yes
4545
CapabilityBoundingSet=
4646
AmbientCapabilities=
4747

48+
# Network restriction — mediator only talks to local SearXNG
49+
IPAddressDeny=any
50+
IPAddressAllow=localhost
51+
4852
# Namespace restrictions
4953
RestrictNamespaces=yes
5054
RestrictAddressFamilies=AF_INET AF_UNIX

0 commit comments

Comments
 (0)