Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions deploy/docker/tests/test_security_container_posture.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ def test_no_host_dev_shm_bind(self, compose):
def test_pids_limit(self, compose):
assert "pids_limit" in compose

def test_read_only_runtime_tmpfs_are_appuser_owned(self, compose):
assert "/var/lib/redis:uid=999,gid=999,mode=0700" in compose
assert "/var/lib/crawl4ai/outputs:uid=999,gid=999,mode=0700" in compose
assert "/home/appuser/.crawl4ai:uid=999,gid=999,mode=0700" in compose
assert "/home/appuser/.gunicorn:uid=999,gid=999,mode=0700" in compose

def test_playwright_cache_is_not_shadowed(self, compose):
assert "/home/appuser/.cache\n" not in compose
assert "/home/appuser/.cache/url_seeder:uid=999,gid=999,mode=0700" in compose


class TestEntrypoint:
def test_entrypoint_exists_and_resolves_bind(self):
Expand Down
9 changes: 6 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ x-base-config: &base-config
read_only: true
tmpfs:
- /tmp
- /var/lib/redis
- /var/lib/crawl4ai/outputs:mode=0700
- /home/appuser/.cache
- /var/lib/redis:uid=999,gid=999,mode=0700
- /var/lib/crawl4ai/outputs:uid=999,gid=999,mode=0700
- /home/appuser/.crawl4ai:uid=999,gid=999,mode=0700
# Keep the baked Playwright browser under ~/.cache/ms-playwright visible.
- /home/appuser/.cache/url_seeder:uid=999,gid=999,mode=0700
- /home/appuser/.gunicorn:uid=999,gid=999,mode=0700
deploy:
resources:
limits:
Expand Down
Loading