|
|
@@ -4,6 +4,16 @@ services:
|
|
|
build: { context: ./api }
|
|
|
command: migrate
|
|
|
env_file: .env
|
|
|
+ # SEC_REVIEW F20: rootfs read-only — /app source cannot be overwritten
|
|
|
+ # by an RCE. Writable paths are restricted to the irdb-data volume
|
|
|
+ # plus a few small tmpfs mounts (PHP `/tmp`, Caddy/FrankenPHP XDG
|
|
|
+ # state). These tmpfs mounts inherit uid=1000 so the unprivileged
|
|
|
+ # `app` user can write to them.
|
|
|
+ read_only: true
|
|
|
+ tmpfs:
|
|
|
+ - /tmp:uid=1000,gid=1000,mode=1777
|
|
|
+ - /home/app/.config:uid=1000,gid=1000,mode=0700
|
|
|
+ - /home/app/.local/share:uid=1000,gid=1000,mode=0700
|
|
|
volumes:
|
|
|
- irdb-data:/data
|
|
|
restart: "no"
|
|
|
@@ -12,6 +22,12 @@ services:
|
|
|
image: irdb-api:latest
|
|
|
command: api
|
|
|
env_file: .env
|
|
|
+ # SEC_REVIEW F20: see migrate above.
|
|
|
+ read_only: true
|
|
|
+ tmpfs:
|
|
|
+ - /tmp:uid=1000,gid=1000,mode=1777
|
|
|
+ - /home/app/.config:uid=1000,gid=1000,mode=0700
|
|
|
+ - /home/app/.local/share:uid=1000,gid=1000,mode=0700
|
|
|
ports:
|
|
|
- "8081:8081"
|
|
|
volumes:
|
|
|
@@ -30,6 +46,14 @@ services:
|
|
|
image: irdb-ui:latest
|
|
|
build: { context: ./ui }
|
|
|
env_file: .env
|
|
|
+ # SEC_REVIEW F20: rootfs read-only. The ui has no /data volume —
|
|
|
+ # all writes (PHP sessions in /tmp, Caddy/FrankenPHP XDG state) go
|
|
|
+ # to ephemeral tmpfs mounts owned by uid=1000.
|
|
|
+ read_only: true
|
|
|
+ tmpfs:
|
|
|
+ - /tmp:uid=1000,gid=1000,mode=1777
|
|
|
+ - /home/app/.config:uid=1000,gid=1000,mode=0700
|
|
|
+ - /home/app/.local/share:uid=1000,gid=1000,mode=0700
|
|
|
ports:
|
|
|
- "8080:8080"
|
|
|
depends_on:
|