Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

release: v7.2.0 — pull-by-default boot path + CI hardening (#56)

Beenu Arora5f8b5e489ce4
diff --git a/.env.example b/.env.example
index 801796c3b..efee65017 100644
--- a/.env.example
+++ b/.env.example
@@ -1,6 +1,13 @@
# AiSOC Environment Variables
# Copy this file to .env and fill in your values
+# ─── Image Pinning ────────────────────────────────────────────────────────────
+# Tag pulled by every `image: ghcr.io/beenuar/aisoc-*:${AISOC_VERSION:-latest}`
+# in docker-compose.yml. With `pull_policy: missing`, Docker will pull this tag
+# on first boot and skip the local build (~90 s vs ~15 min). Pin to a release
+# tag (e.g. v7.2.0) for reproducible deploys; leave as `latest` to track main.
+AISOC_VERSION=latest
+
# ─── Core Configuration ───────────────────────────────────────────────────────
ENVIRONMENT=development
LOG_LEVEL=info
diff --git a/.github/workflows/compose-smoke-nightly.yml b/.github/workflows/compose-smoke-nightly.yml
new file mode 100644
index 000000000..d91ecb002
--- /dev/null
+++ b/.github/workflows/compose-smoke-nightly.yml
@@ -0,0 +1,225 @@
+name: Compose Smoke (nightly cold-cache)
+
+# Nightly cold-build of the full Docker Compose stack on `main`.
+#
+# Whereas `compose-smoke.yml` optimizes for fast PR feedback by pulling
+# published images, this workflow exists to catch the regressions that only
+# show up when you build everything from source on a fresh machine:
+#
+# - Upstream base image (`python:3.11-slim` etc.) breakage
+# - Poetry/pip resolution drift on a cold cache
+# - `pyproject.toml` ↔ pip-fallback list drift in service Dockerfiles
+# - Build-time toolchain regressions (apt mirrors, system deps)
+#
+# The runner is fresh per scheduled invocation, so the OS layer cache is
+# already cold. We additionally pass `--no-cache --pull` to compose build to
+# force every Dockerfile layer to rebuild and every base image to refetch.
+
+on:
+ schedule:
+ # 09:00 UTC ≈ 02:00 PT — runs after upstream base image rebuilds usually
+ # land but before the workday so a nightly break is visible at standup.
+ - cron: '0 9 * * *'
+ workflow_dispatch:
+ inputs:
+ open_issue_on_failure:
+ description: 'Open a tracking issue if the smoke run fails'
+ type: boolean
+ default: true
+
+concurrency:
+ group: ${{ github.workflow }}
+ cancel-in-progress: false
+
+jobs:
+ cold-smoke:
+ name: docker compose build --no-cache && up
+ runs-on: ubuntu-latest
+ timeout-minutes: 60
+
+ permissions:
+ contents: read
+ issues: write
+
+ env:
+ AISOC_VERSION: nightly-cold
+ COMPOSE_PROJECT_NAME: aisoc-nightly
+ # Cold rebuilds of the Python services on a default runner are slower
+ # than the PR smoke; give them more headroom.
+ HEALTH_BUDGET_SECONDS: '1200'
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Show runner capacity
+ run: |
+ echo "## Runner snapshot" >> "$GITHUB_STEP_SUMMARY"
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
+ uname -a >> "$GITHUB_STEP_SUMMARY"
+ docker --version >> "$GITHUB_STEP_SUMMARY"
+ docker compose version >> "$GITHUB_STEP_SUMMARY"
+ free -h >> "$GITHUB_STEP_SUMMARY" || true
+ df -h / >> "$GITHUB_STEP_SUMMARY"
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Seed environment file
+ run: |
+ cp .env.example .env
+ # AISOC_VERSION is overridden purely for clarity in `docker ps`
+ # output — every image is built locally so the tag is just a label.
+ if grep -q '^AISOC_VERSION=' .env; then
+ sed -i "s|^AISOC_VERSION=.*|AISOC_VERSION=${AISOC_VERSION}|" .env
+ else
+ printf '\nAISOC_VERSION=%s\n' "${AISOC_VERSION}" >> .env
+ fi
+
+ - name: Validate compose file
+ run: docker compose config --quiet
+
+ - name: Build every service from scratch
+ run: |
+ # --no-cache: force every Dockerfile layer to re-execute.
+ # --pull: force base image (`python:3.11-slim`, etc.) refetch so
+ # we surface upstream breakage instead of using a stale
+ # cached layer.
+ docker compose build --no-cache --pull
+
+ - name: Boot stack
+ run: docker compose up -d
+
+ - name: Wait for stack to converge
+ id: converge
+ run: |
+ set -u
+ deadline=$(( $(date +%s) + HEALTH_BUDGET_SECONDS ))
+
+ probe_postgres() {
+ docker compose ps --format '{{.Name}} {{.Health}}' \
+ | awk '$1=="aisoc-postgres" && $2=="healthy" {found=1} END {exit !found}'
+ }
+
+ probe_http() {
+ local url="$1" expect="$2"
+ local code
+ code=$(curl --silent --output /dev/null --write-out '%{http_code}' \
+ --max-time 5 "$url" || echo "000")
+ [ "$code" = "$expect" ]
+ }
+
+ ok_postgres=0
+ ok_api=0
+ ok_web=0
+
+ while [ "$(date +%s)" -lt "$deadline" ]; do
+ if [ "$ok_postgres" -eq 0 ] && probe_postgres; then
+ ok_postgres=1
+ echo "✓ postgres healthy"
+ fi
+ if [ "$ok_api" -eq 0 ] && probe_http "http://localhost:8000/health" "200"; then
+ ok_api=1
+ echo "✓ api /health 200"
+ fi
+ if [ "$ok_web" -eq 0 ] && probe_http "http://localhost:3000" "200"; then
+ ok_web=1
+ echo "✓ web 200"
+ fi
+ if [ "$ok_postgres" -eq 1 ] && [ "$ok_api" -eq 1 ] && [ "$ok_web" -eq 1 ]; then
+ elapsed=$(( $(date +%s) - (deadline - HEALTH_BUDGET_SECONDS) ))
+ echo "elapsed_seconds=${elapsed}" >> "$GITHUB_OUTPUT"
+ echo "Stack converged in ${elapsed}s"
+ exit 0
+ fi
+ sleep 10
+ done
+
+ echo "::error::Stack did not converge within ${HEALTH_BUDGET_SECONDS}s"
+ echo " postgres healthy: ${ok_postgres}"
+ echo " api /health 200: ${ok_api}"
+ echo " web 200: ${ok_web}"
+ exit 1
+
+ - name: Record success summary
+ if: success()
+ run: |
+ {
+ echo "## Cold-cache smoke result"
+ echo ""
+ echo "Full rebuild + boot converged in **${{ steps.converge.outputs.elapsed_seconds }}s**"
+ echo "(budget ${HEALTH_BUDGET_SECONDS}s)."
+ echo ""
+ echo "| gate | status |"
+ echo "|------|--------|"
+ echo "| postgres healthy | ✓ |"
+ echo "| api /health 200 | ✓ |"
+ echo "| web 200 | ✓ |"
+ } >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Capture forensics on failure
+ if: failure()
+ id: forensics
+ run: |
+ {
+ echo "## Compose state"
+ echo '```'
+ docker compose ps || true
+ echo '```'
+ echo
+ echo "## Recent service logs"
+ echo '```'
+ docker compose logs --tail=300 --no-color || true
+ echo '```'
+ echo
+ echo "## Disk after boot"
+ echo '```'
+ df -h /
+ echo '```'
+ echo
+ echo "## Memory after boot"
+ echo '```'
+ free -h || true
+ echo '```'
+ } | tee forensics.md
+
+ - name: Upload forensics artifact
+ if: failure()
+ uses: actions/upload-artifact@v4
+ with:
+ name: nightly-smoke-forensics-${{ github.run_id }}
+ path: forensics.md
+ retention-days: 14
+
+ - name: Open tracking issue on failure
+ if: failure() && (github.event_name == 'schedule' || github.event.inputs.open_issue_on_failure == 'true')
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
+ run: |
+ title="Nightly cold-cache compose smoke failed ($(date -u +%Y-%m-%d))"
+ body=$(cat <<EOF
+ The nightly cold-cache smoke run on \`main\` failed.
+
+ **Run:** ${RUN_URL}
+ **Commit:** \`${{ github.sha }}\`
+
+ This catches regressions that PR smoke (pull-by-default) cannot see:
+ upstream base image drift, Poetry/pip resolution drift, and
+ \`pyproject.toml\` ↔ pip-fallback drift in service Dockerfiles.
+
+ Forensics artifact: \`nightly-smoke-forensics-${{ github.run_id }}\`
+ (under the run's Artifacts tab).
+ EOF
+ )
+ # Use only the `ci` label — it exists in the standard repo label set.
+ # Adding `nightly-smoke` would cause gh to fail-and-swallow on repos
+ # that don't have it pre-created. The "nightly cold-cache" framing
+ # is already in the issue title.
+ gh issue create \
+ --title "${title}" \
+ --body "${body}" \
+ --label "ci" \
+ || echo "::warning::Failed to open tracking issue"
+
+ - name: Teardown
+ if: always()
+ run: docker compose down -v --remove-orphans
diff --git a/.github/workflows/compose-smoke.yml b/.github/workflows/compose-smoke.yml
new file mode 100644
index 000000000..82e3a997d
--- /dev/null
+++ b/.github/workflows/compose-smoke.yml
@@ -0,0 +1,310 @@
+name: Compose Smoke
+
+# Boots the full Docker Compose stack from a clean checkout and asserts the
+# user-facing surfaces (Postgres, API, web) become healthy within a 10-minute
+# budget. This is the gate that proves a fresh `git clone && docker compose up`
+# actually works — the workflow that catches `docker-compose.yml` regressions
+# before they reach a new contributor.
+#
+# Strategy: pull-by-default. Services with published images on GHCR
+# (`AISOC_VERSION=main`) are pulled; the two unpublished default-profile
+# services (`honeytokens`, `purple-team`) are built locally. Profile-gated
+# services (osquery, connectors, chatops, monitoring) are intentionally
+# excluded — they are exercised by their own publish workflows.
+#
+# Use `workflow_dispatch` with `force_build: true` to force every service to
+# rebuild from source — useful when validating Dockerfile changes that have
+# not yet been published.
+
+on:
+ pull_request:
+ branches: [main, develop]
+ paths:
+ # Compose surface itself.
+ - 'docker-compose.yml'
+ - 'docker-compose.demo.yml'
+ - '.env.example'
+ - '.github/workflows/compose-smoke.yml'
+ # Any source under a service build context — Dockerfile changes alone
+ # are not enough, because a stale GHCR image will silently mask source
+ # bugs introduced under services/<svc>/. The detect step below decides
+ # whether to rebuild or pull.
+ - 'services/**'
+ - 'apps/web/**'
+ # The web image's build context is the repo root; these are the things
+ # its Dockerfile actually copies into the build.
+ - 'packages/**'
+ - 'pnpm-lock.yaml'
+ - 'pnpm-workspace.yaml'
+ - 'turbo.json'
+ - 'tsconfig.base.json'
+ - 'package.json'
+ push:
+ branches:
+ - main
+ - 'release/**'
+ - 'hotfix/**'
+ paths:
+ - 'docker-compose.yml'
+ - 'docker-compose.demo.yml'
+ - '.env.example'
+ - '.github/workflows/compose-smoke.yml'
+ - 'services/**'
+ - 'apps/web/**'
+ - 'packages/**'
+ - 'pnpm-lock.yaml'
+ - 'pnpm-workspace.yaml'
+ - 'turbo.json'
+ - 'tsconfig.base.json'
+ - 'package.json'
+ workflow_dispatch:
+ inputs:
+ force_build:
+ description: 'Force every service to build from source (skip GHCR pulls)'
+ type: boolean
+ default: false
+ aisoc_version:
+ description: 'Image tag to pull when not force-building (default: main)'
+ type: string
+ default: main
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ smoke:
+ name: docker compose up — full stack
+ runs-on: ubuntu-latest
+ timeout-minutes: 25
+
+ env:
+ AISOC_VERSION: ${{ github.event.inputs.aisoc_version || 'main' }}
+ COMPOSE_PROJECT_NAME: aisoc-smoke
+ # Health budget for the up + converge phase. The job timeout is wider
+ # to leave room for checkout, log capture, and teardown.
+ HEALTH_BUDGET_SECONDS: '600'
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ # Full history so the rebuild-detection step below can resolve a
+ # merge base against `origin/${base_ref}`. With the default
+ # `fetch-depth: 1` shallow clone, `git diff base...HEAD` errors
+ # with `no merge base`, our `|| true` swallows it, the diff
+ # appears empty, and we silently pull a stale GHCR image even
+ # when the PR has source-code fixes. Full history is cheap on
+ # this runner and the only safe option.
+ fetch-depth: 0
+
+ - name: Show runner capacity
+ run: |
+ echo "## Runner snapshot" >> "$GITHUB_STEP_SUMMARY"
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
+ uname -a >> "$GITHUB_STEP_SUMMARY"
+ docker --version >> "$GITHUB_STEP_SUMMARY"
+ docker compose version >> "$GITHUB_STEP_SUMMARY"
+ free -h >> "$GITHUB_STEP_SUMMARY" || true
+ df -h / >> "$GITHUB_STEP_SUMMARY"
+ echo '```' >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Seed environment file
+ run: |
+ cp .env.example .env
+ # Override the image tag so smoke runs always pull a known-good
+ # published tag. Manual dispatches can override this via input.
+ if grep -q '^AISOC_VERSION=' .env; then
+ sed -i "s|^AISOC_VERSION=.*|AISOC_VERSION=${AISOC_VERSION}|" .env
+ else
+ printf '\nAISOC_VERSION=%s\n' "${AISOC_VERSION}" >> .env
+ fi
+ echo "Resolved AISOC_VERSION=${AISOC_VERSION}"
+
+ - name: Validate compose file
+ run: docker compose config --quiet
+
+ - name: Detect build-context changes
+ id: dockerfile_changes
+ run: |
+ # The published GHCR image becomes stale the moment ANY file inside
+ # a service's build context changes — not only the Dockerfile. A PR
+ # that fixes a Python bug under services/api/app/ but leaves the
+ # Dockerfile untouched would otherwise silently boot the previous
+ # image and mask the fix (or the bug). We diff the full build
+ # contexts derived from docker-compose.yml to decide.
+ force_build="${{ github.event.inputs.force_build || 'false' }}"
+ if [ "${force_build}" = "true" ]; then
+ echo "Manual force_build=true requested."
+ echo "rebuild=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ # Determine the diff base.
+ base_ref=""
+ if [ -n "${{ github.base_ref }}" ]; then
+ git fetch --no-tags --depth=50 origin "${{ github.base_ref }}" || true
+ base_ref="origin/${{ github.base_ref }}"
+ elif [ -n "${{ github.event.before }}" ] && [ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]; then
+ base_ref="${{ github.event.before }}"
+ fi
+
+ if [ -z "${base_ref}" ]; then
+ echo "No diff base; defaulting to pull."
+ echo "rebuild=false" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ # Build paths mirror docker-compose.yml `build.context` entries.
+ # Keep this list in sync when adding/removing built services. The
+ # web image's context is the repo root but only a subset of the
+ # tree is COPY'd in — listing those entries explicitly avoids
+ # false-positive rebuilds on every PR.
+ paths=(
+ 'services/api/'
+ 'services/ingest/'
+ 'services/enrichment/'
+ 'services/fusion/'
+ 'services/agents/'
+ 'services/osquery-tls/'
+ 'services/actions/'
+ 'services/connectors/'
+ 'services/threatintel/'
+ 'services/ueba/'
+ 'services/honeytokens/'
+ 'services/purple-team/'
+ 'services/realtime/'
+ 'services/slack-bot/'
+ 'apps/web/'
+ 'packages/'
+ 'pnpm-lock.yaml'
+ 'pnpm-workspace.yaml'
+ 'turbo.json'
+ 'tsconfig.base.json'
+ 'package.json'
+ )
+
+ # Fail-open: if `git diff` errors (shallow clone, missing merge
+ # base, etc.) we rebuild rather than risk pulling a stale image
+ # that masks the very fix this PR is shipping. The previous
+ # `|| true` form silently set `rebuild=false` and caused the
+ # IndexError in detection_proposals.py to keep landing in CI
+ # logs even after the source fix had been pushed.
+ diff_status=0
+ changed=$(git diff --name-only "${base_ref}"...HEAD -- "${paths[@]}") || diff_status=$?
+ if [ "${diff_status}" -ne 0 ]; then
+ echo "git diff vs ${base_ref} failed (exit ${diff_status}); rebuilding from source."
+ echo "rebuild=true" >> "$GITHUB_OUTPUT"
+ exit 0
+ fi
+
+ if [ -n "${changed}" ]; then
+ echo "Build-context file(s) changed since ${base_ref}:"
+ printf ' %s\n' ${changed}
+ echo "rebuild=true" >> "$GITHUB_OUTPUT"
+ else
+ echo "No build-context changes vs ${base_ref}; pulling published images."
+ echo "rebuild=false" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: Pre-pull published images
+ if: steps.dockerfile_changes.outputs.rebuild != 'true'
+ run: |
+ # Best-effort pull. We don't fail the build here — services that
+ # don't yet publish will fall through to the local build step
+ # triggered by `compose up` honoring `pull_policy: missing`.
+ docker compose pull --ignore-pull-failures --quiet || true
+
+ - name: Boot stack (pull-by-default)
+ if: steps.dockerfile_changes.outputs.rebuild != 'true'
+ run: docker compose up -d --quiet-pull
+
+ - name: Boot stack (force rebuild)
+ if: steps.dockerfile_changes.outputs.rebuild == 'true'
+ run: docker compose up -d --build
+
+ - name: Wait for stack to converge
+ id: converge
+ run: |
+ set -u
+ deadline=$(( $(date +%s) + HEALTH_BUDGET_SECONDS ))
+
+ probe_postgres() {
+ docker compose ps --format '{{.Name}} {{.Health}}' \
+ | awk '$1=="aisoc-postgres" && $2=="healthy" {found=1} END {exit !found}'
+ }
+
+ probe_http() {
+ local url="$1" expect="$2"
+ local code
+ code=$(curl --silent --output /dev/null --write-out '%{http_code}' \
+ --max-time 5 "$url" || echo "000")
+ [ "$code" = "$expect" ]
+ }
+
+ ok_postgres=0
+ ok_api=0
+ ok_web=0
+
+ while [ "$(date +%s)" -lt "$deadline" ]; do
+ if [ "$ok_postgres" -eq 0 ] && probe_postgres; then
+ ok_postgres=1
+ echo "✓ postgres healthy"
+ fi
+ if [ "$ok_api" -eq 0 ] && probe_http "http://localhost:8000/health" "200"; then
+ ok_api=1
+ echo "✓ api /health 200"
+ fi
+ if [ "$ok_web" -eq 0 ] && probe_http "http://localhost:3000" "200"; then
+ ok_web=1
+ echo "✓ web 200"
+ fi
+ if [ "$ok_postgres" -eq 1 ] && [ "$ok_api" -eq 1 ] && [ "$ok_web" -eq 1 ]; then
+ elapsed=$(( $(date +%s) - (deadline - HEALTH_BUDGET_SECONDS) ))
+ echo "elapsed_seconds=${elapsed}" >> "$GITHUB_OUTPUT"
+ echo "Stack converged in ${elapsed}s"
+ exit 0
+ fi
+ sleep 5
+ done
+
+ echo "::error::Stack did not converge within ${HEALTH_BUDGET_SECONDS}s"
+ echo " postgres healthy: ${ok_postgres}"
+ echo " api /health 200: ${ok_api}"
+ echo " web 200: ${ok_web}"
+ exit 1
+
+ - name: Record success summary
+ if: success()
+ run: |
+ {
+ echo "## Smoke result"
+ echo ""
+ echo "Stack converged in **${{ steps.converge.outputs.elapsed_seconds }}s**"
+ echo "(budget ${HEALTH_BUDGET_SECONDS}s)."
+ echo ""
+ echo "| gate | status |"
+ echo "|------|--------|"
+ echo "| postgres healthy | ✓ |"
+ echo "| api /health 200 | ✓ |"
+ echo "| web 200 | ✓ |"
+ } >> "$GITHUB_STEP_SUMMARY"
+
+ - name: Capture forensics on failure
+ if: failure()
+ run: |
+ echo "## Compose state"
+ docker compose ps || true
+ echo
+ echo "## Recent service logs"
+ docker compose logs --tail=200 --no-color || true
+ echo
+ echo "## Disk after boot"
+ df -h /
+ echo
+ echo "## Memory after boot"
+ free -h || true
+
+ - name: Teardown
+ if: always()
+ run: docker compose down -v --remove-orphans
diff --git a/.github/workflows/publish-images.yml b/.github/workflows/publish-images.yml
index f941890d0..3f77976af 100644
--- a/.github/workflows/publish-images.yml
+++ b/.github/workflows/publish-images.yml
@@ -36,6 +36,7 @@ jobs:
fail-fast: false
matrix:
include:
+ # Demo-stack images (must always be fresh; pnpm aisoc:demo pulls these by tag).
- service: api
context: services/api
dockerfile: Dockerfile
@@ -52,6 +53,42 @@ jobs:
context: .
dockerfile: apps/web/Dockerfile
image: ghcr.io/beenuar/aisoc-web
+
+ # Full-stack backend images. Published so `docker compose up -d` can
+ # pull instead of build (with `pull_policy: missing`), shaving the
+ # cold-start time from ~15 min to ~90 s on a fresh clone.
+ - service: ingest
+ context: services/ingest
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-ingest
+ - service: enrichment
+ context: services/enrichment
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-enrichment
+ - service: fusion
+ context: services/fusion
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-fusion
+ - service: actions
+ context: services/actions
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-actions
+ - service: connectors
+ context: services/connectors
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-connectors
+ - service: threatintel
+ context: services/threatintel
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-threatintel
+ - service: ueba
+ context: services/ueba
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-ueba
+ - service: slack-bot
+ context: services/slack-bot
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-slack-bot
steps:
- uses: actions/checkout@v4
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index cc7d2e02c..e36b0526d 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -46,6 +46,11 @@ jobs:
# special: its Dockerfile copies workspace packages and pnpm config from the
# monorepo root, so its build context must be `.` (the repo root) with the
# Dockerfile path explicitly set.
+ #
+ # The matrix here must stay aligned with publish-images.yml — every service
+ # whose `:main` / `:latest` tag is published on push-to-main also needs a
+ # pinned `:vX.Y.Z` tag on release, so users who set `AISOC_VERSION=vX.Y.Z`
+ # in their .env get a reproducible deploy across the full stack.
docker-push:
name: Docker — Build & Push (${{ matrix.service }})
runs-on: ubuntu-latest
@@ -54,6 +59,7 @@ jobs:
fail-fast: false
matrix:
include:
+ # Demo-stack images (pulled by `pnpm aisoc:demo`).
- service: api
context: services/api
dockerfile: Dockerfile
@@ -62,14 +68,6 @@ jobs:
context: services/agents
dockerfile: Dockerfile
image: ghcr.io/beenuar/aisoc-agents
- - service: enrichment
- context: services/enrichment
- dockerfile: Dockerfile
- image: ghcr.io/beenuar/aisoc-enrichment
- - service: ingest
- context: services/ingest
- dockerfile: Dockerfile
- image: ghcr.io/beenuar/aisoc-ingest
- service: realtime
context: services/realtime
dockerfile: Dockerfile
@@ -78,6 +76,41 @@ jobs:
context: .
dockerfile: apps/web/Dockerfile
image: ghcr.io/beenuar/aisoc-web
+
+ # Full-stack backend images (pulled by `docker compose up -d` with
+ # `pull_policy: missing` when AISOC_VERSION is pinned).
+ - service: ingest
+ context: services/ingest
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-ingest
+ - service: enrichment
+ context: services/enrichment
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-enrichment
+ - service: fusion
+ context: services/fusion
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-fusion
+ - service: actions
+ context: services/actions
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-actions
+ - service: connectors
+ context: services/connectors
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-connectors
+ - service: threatintel
+ context: services/threatintel
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-threatintel
+ - service: ueba
+ context: services/ueba
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-ueba
+ - service: slack-bot
+ context: services/slack-bot
+ dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-slack-bot
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v4
@@ -86,6 +119,25 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
+
+ # Web image needs NEXT_PUBLIC_DEMO_* flags baked in at build time so the
+ # released ghcr.io/beenuar/aisoc-web:vX.Y.Z image (used by AISOC_VERSION
+ # pinning) ships a bundle that knows it's a demo. Mirrors the same step
+ # in publish-images.yml. Other images gate demo behavior at runtime via
+ # AISOC_DEMO_MODE so they don't need build args.
+ - id: web-build-args
+ if: matrix.service == 'web'
+ run: |
+ {
+ echo 'build_args<<EOF'
+ echo 'NEXT_PUBLIC_DEMO_MODE=true'
+ echo 'NEXT_PUBLIC_DEMO_DEEPLINK=/cases/INC-RT-001?tab=ledger'
+ echo 'NEXT_PUBLIC_DEMO_BANNER=Demo data resets daily at 00:00 UTC. All write actions are disabled.'
+ echo 'NEXT_PUBLIC_DEMO_AUTOLOGIN_PASSWORD=aisoc-demo'
+ echo 'EOF'
+ } >> "$GITHUB_OUTPUT"
+
- uses: docker/build-push-action@v7
with:
context: ${{ matrix.context }}
@@ -94,5 +146,7 @@ jobs:
tags: |
${{ matrix.image }}:${{ github.ref_name }}
${{ matrix.image }}:latest
+ build-args: ${{ steps.web-build-args.outputs.build_args }}
cache-from: type=gha,scope=${{ matrix.service }}
cache-to: type=gha,mode=max,scope=${{ matrix.service }}
+ platforms: linux/amd64
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2120f5a95..dc3b50ee6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,207 @@ All notable changes to AiSOC will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [7.2.0] — 2026-05-11
+
+### Changed — `docker compose up -d` is now pull-by-default
+
+Track 1 + Track 2 of the docker-compose hardening work that began in
+[7.1.1](#711--2026-05-10). 7.1.1 fixed the boot-path bugs that surfaced on
+a clean clone; this release attacks the *time* dimension. The previous
+behaviour — `docker compose up -d` on a fresh checkout building all 15
+services from source — took 10–20 minutes on a typical laptop and was the
+single largest source of "I tried AiSOC and gave up" reports. With this
+release, the same command pulls 12 prebuilt images from GHCR and is
+healthy in roughly 90 seconds.
+
+No service code, no API surface, no database schema changed. Every change
+in this release is in the boot path, the image-publish path, or the CI
+gate that proves both still work.
+
+#### Track 1 — Pull-by-default boot path
+
+- **`docker-compose.yml`**: Every service that previously had a `build:`
+ directive now also has an `image:` and `pull_policy: missing`. Compose
+ will pull the prebuilt image from `ghcr.io/aisoc-platform/aisoc-<svc>`
+ if it exists locally or in the registry; only if the pull fails does it
+ fall back to building from source. The 12 backend services that publish
+ images (api, agents, realtime, web, ingest, enrichment, fusion, actions,
+ connectors, threatintel, ueba, slack-bot) are tagged via the
+ `${AISOC_VERSION:-latest}` interpolation so the same compose file works
+ for `latest`, `main`, a release tag (`v7.2.0`), or a local override.
+ The three deferred services (osquery-tls, honeytokens, purple-team) are
+ marked with a `# TODO(publish)` comment and continue to build locally.
+- **`.env.example`**: Added a new top-of-file `AISOC_VERSION=latest`
+ block that documents how to pin the entire backend to a release tag for
+ reproducible deploys (`AISOC_VERSION=v7.2.0`), or track the bleeding
+ edge (`AISOC_VERSION=main`).
+- **`.github/workflows/publish-images.yml`**: Extended the build matrix
+ from 4 services to 12 by adding ingest, enrichment, fusion, actions,
+ connectors, threatintel, ueba, and slack-bot. These are the backend
+ services that every full-stack `docker compose up -d` boots; without
+ them in the publish matrix, `pull_policy: missing` would resolve to
+ "build from source" for two-thirds of the stack and the change would be
+ cosmetic.
+- **`.github/workflows/release.yml`**: Mirrored the same 12-service
+ matrix on tagged-release builds so that `AISOC_VERSION=v7.2.0` resolves
+ to a real published image for every service in the compose file, not
+ just the demo subset.
+
+#### Track 2 — Build & CI hardening
+
+The pull-by-default path only matters if the underlying images actually
+build. Track 2 attacks the two largest historical sources of build-path
+flakes — Poetry resolution failures during image build, and Dockerfile
+regressions that nobody catches until release day.
+
+- **All seven Python service Dockerfiles**
+ (`services/{api,fusion,threatintel,slack-bot,actions,connectors,osquery-tls}/Dockerfile`):
+ Added a `poetry install` → `pip install` fallback. The previous pattern
+ failed the build on any transient PyPI hiccup, lock-file drift, or
+ proxy timeout during `poetry install`. The new pattern wraps the
+ install in `set -eux; if poetry install ...; then ...; else
+ pip install <pinned list>; fi`, logs which path was taken, and pins
+ every runtime dependency explicitly in the fallback list. The pinned
+ list is documented as needing to track `pyproject.toml` and is
+ exercised by the new nightly cold-cache CI run.
+- **`.github/workflows/compose-smoke.yml`** (new): On every PR that
+ touches `docker-compose.yml`, `docker-compose.demo.yml`, any service
+ Dockerfile, `.env.example`, or the workflow itself, GitHub Actions now
+ boots the full stack from a clean checkout and asserts `aisoc-postgres`
+ is healthy, `api` returns 200 on `/health`, and `web` returns 200 on
+ `/` — all within a 10-minute budget. Pull-by-default by design (so the
+ CI run mirrors what the user sees), with automatic detection of
+ Dockerfile changes that flips the workflow into rebuild-from-source
+ mode so we don't smoke-test against a stale published image. Captures
+ `docker compose ps`, `docker compose logs`, disk, and memory on
+ failure.
+- **`.github/workflows/compose-smoke-nightly.yml`** (new): At 09:00 UTC
+ every day, GitHub Actions does a full cold-cache rebuild of every
+ service (`docker compose build --no-cache --pull`) and re-runs the
+ same smoke gates with a wider 20-minute budget. This is the gate that
+ catches the regressions PR smoke physically cannot — upstream
+ `python:3.11-slim` breakage, transitive dependency drift,
+ `pyproject.toml` ↔ pip-fallback drift in the seven Python services.
+ Failures upload a forensics artifact and open a `ci`-labelled tracking
+ issue automatically so a nightly break is visible by standup.
+
+### Changed
+
+- **`apps/web/package.json`**: Bumped to `7.2.0`.
+
+### Migration notes
+
+None for users on 7.1.1. The compose file is backwards-compatible —
+`pull_policy: missing` only changes behaviour the first time you boot
+(it tries the registry before building); existing local images are
+honoured. If you want the new fast path explicitly, run `docker compose
+pull` once after upgrading. To pin a deploy to this release rather than
+tracking `latest`, set `AISOC_VERSION=v7.2.0` in `.env`.
+
+If you skipped 7.1.1, also read its [migration note](#711--2026-05-10)
+about the `osquery-tls` host-port change (`8007` → `8091`).
+
+## [7.1.1] — 2026-05-10
+
+### Fixed — `docker compose up -d` first-touch experience
+
+Hotfix in response to user-reported `docker compose up -d` failures on a clean
+clone. None of these are functional changes to the running services — every
+fix is in the boot path, the boot documentation, or the pre-flight check.
+
+#### Compose hygiene
+
+- **`docker-compose.yml`**: Removed the obsolete `version: '3.8'` declaration,
+ which Docker Compose v2 ignores and warns about on every invocation
+ (`level=warning msg="...the attribute version is obsolete..."`). The warning
+ is harmless but is the very first line of output a new user sees, which
+ signals "this project is broken" before the build even starts.
+- **`docker-compose.yml`**: Added `mem_limit` + `mem_reservation` to the four
+ data-tier containers most likely to OOM-kill on an under-provisioned Docker
+ Desktop:
+ - `kafka`: 1.5 GB limit / 1 GB reservation
+ - `clickhouse`: 1 GB limit / 768 MB reservation
+ - `opensearch`: 1 GB limit / 768 MB reservation
+ - `neo4j`: 1 GB limit / 768 MB reservation
+
+ Without these caps, a 4 GB Docker Desktop allocation (the default on macOS)
+ would silently OOM-kill OpenSearch or Neo4j during JVM warmup, leaving the
+ rest of the stack running but the alert/case feeds permanently empty.
+- **`docker-compose.yml`** (`osquery-tls` service): Fixed `AISOC_INGEST_BASE_URL`
+ pointing at the non-existent `ingest:8080` (the actual service is named
+ `ingest-worker`). Also remapped the host port from `8007` to `8091` to
+ resolve a host-port collision with the `ueba` service. Both bugs only
+ surfaced if the user actually queried the osquery TLS server, which is why
+ they survived the previous release; running `docker compose up -d` would
+ succeed but `osquery-tls` would log connection-refused errors on every
+ agent check-in.
+
+#### README rewrite
+
+- **`README.md`** — *Quick start*: Restructured so `pnpm aisoc:demo` is the
+ canonical first-touch path (4 prebuilt images, ~90s to a working SOC
+ console) and `docker compose up -d` is explicitly labelled the
+ "developer-build path" (22 services, 10–20 min cold build, requires Docker
+ with at least 6 GB RAM allocated). The previous structure presented both
+ paths as equally valid, which led users with stock Docker Desktop settings
+ straight into a stack that physically cannot fit in the daemon's memory.
+- **`README.md`** — *Service map*: Updated `osquery-tls` from `:8090` to `:8091`
+ and added a `Kafka UI` row at `:8090`, matching the compose hygiene fix
+ above.
+- **`README.md`** — *Boot section*: Added explicit timing expectations
+ ("~5 GB of base image pulls + 10–20 min of build on a typical laptop"), a
+ recommendation to run `pnpm aisoc:doctor` before kicking off the build, and
+ a troubleshooting note pointing under-provisioned Docker Desktop installs
+ at *Settings → Resources*.
+
+#### `aisoc:doctor` hardening
+
+The pre-flight check that the user is now told to run before
+`docker compose up -d` was previously useless to first-time users — its
+container check used `docker compose ps` (which is project-scoped and
+therefore couldn't see containers launched by a sibling compose file), and
+it had no opinion on whether Docker itself was provisioned to actually run
+the stack. This release fixes both:
+
+- **Docker Compose plugin enforcement**: New check that fails with an
+ actionable error if the user only has Compose v1 (`docker-compose` Python
+ binary) on PATH, which is now end-of-life and lacks healthcheck semantics
+ the stack depends on.
+- **Docker daemon RAM check**: Reads `docker info --format json` and asserts
+ at least 6 GB allocated for the full stack (4 GB for the demo stack).
+ Anything less hard-fails with a pointer to *Docker Desktop → Settings →
+ Resources*. This single check would have prevented every variant of "the
+ build succeeds but `docker compose ps` shows half my containers in a
+ restart loop" reported to date.
+- **Cross-compose-project container discovery**: Replaced `docker compose ps`
+ with `docker ps -a --format json --filter name=aisoc-`. The doctor now
+ detects whether the user is on the demo stack (`aisoc-demo-*` containers)
+ or full stack (`aisoc-*` containers) and accepts either as a valid boot,
+ so demo users no longer see false `FAIL` rows for services the demo
+ intentionally omits (kafka-ui, neo4j, etc.).
+- **Exit-code aware container reporting**: When a container exists but is
+ not running, the doctor now emits the exact `Exited (255)` status from
+ `docker ps` and tells the user `run \`docker logs <container>\``. The
+ previous output ("not running") gave the user no signal about whether
+ the container had crashed, never started, or been manually stopped.
+- **Stack flavor summary**: A new `stack flavor` row reports `demo`,
+ `full`, or `mixed`, plus a running/total container count
+ (`(4/8 container(s) running)`) so the user can see at a glance whether
+ they're looking at a half-broken stack or a fully-broken stack.
+
+### Changed
+
+- **`apps/web/package.json`**: Bumped to `7.1.1`.
+
+### Migration notes
+
+None. This is a docker-compose hygiene release — no service code,
+no database schema, no API surface area changed. Pull, re-run
+`pnpm aisoc:doctor`, and re-run `docker compose up -d` (the
+`osquery-tls` port change means existing deployments need to update any
+osquery-agent `tls_hostname:tls_port` config from `localhost:8007` to
+`localhost:8091`, but no one was using that interface yet).
+
## [7.1.0] — 2026-05-10
### Added — Cloud Security Coverage Wave
diff --git a/README.md b/README.md
index 70d42b095..b9c257cf7 100644
--- a/README.md
+++ b/README.md
@@ -343,7 +343,7 @@ flowchart LR
| `ueba` | Python | 8007 | User & Entity Behavior Analytics |
| `honeytokens` | Python | 8008 | Honeytoken lifecycle + webhook alerting |
| `purple-team` | Python | 8006 | Atomic Red Team + Caldera + ATT&CK heatmap + detection drift snapshots |
-| `osquery-tls` | Python | 8090 | Native osquery TLS server — enroll nodes, distribute packs, stream FIM/process/network telemetry |
+| `osquery-tls` | Python | 8091 | Native osquery TLS server — enroll nodes, distribute packs, stream FIM/process/network telemetry |
| `osquery-extensions` | Python | — | Custom osquery extensions (AI-powered threat intel table, ML anomaly score table) |
| `ingest` | Go | 8081 | OCSF normalization + Shodan/CVE |
| `enrichment` | Go | 8080 | IOC enrichment (VT, AbuseIPDB, GreyNoise) |
@@ -525,11 +525,19 @@ upstream so anyone can do the same on their own domain.
### Full stack (development)
+> **Heads-up — this is the developer-build path.**
+> If you just want to *see* AiSOC investigate cases in your browser, use [`pnpm aisoc:demo`](#one-shot-demo) above instead — it pulls prebuilt images from `ghcr.io/beenuar/*` and is up in ~5 minutes.
+> The full stack below builds **22 services from source** (Python, Go, Node, Next.js) and brings up a heavy datastore tier (Postgres, Redis, Kafka, ClickHouse, OpenSearch, Neo4j, Qdrant). Only use this path if you're hacking on the source.
+
#### Prerequisites
-- Docker 24+ and Docker Compose v2
-- Node.js 20+ and pnpm 8+
-- Go 1.21+ and Python 3.11+ (only for local service hacking)
+- **Docker 24+** with **Docker Compose v2** (built into Docker Desktop). Run `docker compose version` to confirm — Compose v1's `docker-compose` is not supported.
+- **Docker resources**: at minimum **6 GB of RAM** and **20 GB of free disk** allocated to the Docker daemon. On Docker Desktop: *Settings → Resources*. The OpenSearch + ClickHouse + Neo4j + Kafka quartet alone reserves ~3.5 GB at idle; under-provisioning causes silent OOM-kills that surface as opaque "container exited" errors.
+- **Node.js 20+** and **pnpm 8+** (`corepack enable` then `corepack prepare [email protected] --activate`).
+- **Go 1.21+** and **Python 3.11+** are only required if you plan to run individual services *outside* the compose stack.
+- A free **8 GB of disk** for the build cache and image layers, on top of the 20 GB allocated to Docker.
+
+Run `pnpm aisoc:doctor` after cloning — it sanity-checks Docker, Compose v2, allocated RAM, and host port availability before you spend 10 minutes on a build that's destined to fail.
#### 1. Clone
@@ -573,11 +581,20 @@ ATOMIC_RED_TEAM_PATH=/opt/atomic-red-team/atomics
#### 3. Boot
```bash
-docker compose up -d
+# Optional: pre-flight check (Docker daemon, RAM, ports) before a long build
+pnpm aisoc:doctor
+
+# Build and start all 22 services. Cold first run: 10-20 min (build) + ~90s (warm-up).
+# Subsequent runs reuse cached layers and start in ~90s.
+docker compose up -d --build
+
+# Watch services come up
docker compose ps
```
-First start takes ~60s while datastores warm up.
+The first invocation on a clean checkout will pull ~5 GB of base images and compile every Python, Go, and Next.js service from source. Plan for **10-20 minutes** on a typical laptop. After that, layers are cached and `docker compose up -d` is roughly 90 seconds.
+
+If the build aborts, check Docker Desktop *Settings → Resources* — under-provisioning RAM is the #1 cause of opaque failures, particularly for the Kafka, OpenSearch, ClickHouse, and Neo4j containers.
#### 4. Seed demo data
@@ -628,7 +645,8 @@ The harness runs deterministic substrate code (extractors, fusion, templates, ju
| UEBA | http://localhost:8007/docs | Behavioural analytics |
| Honeytokens | http://localhost:8008/docs | Honeytoken lifecycle |
| Purple Team | http://localhost:8006/docs | Adversary emulation |
-| osquery TLS | http://localhost:8090/docs | Node enrolment + pack distribution + FIM stream |
+| osquery TLS | http://localhost:8091/docs | Node enrolment + pack distribution + FIM stream (`osquery` profile) |
+| Kafka UI | http://localhost:8090 | Kafka topic + consumer-group inspector |
| Realtime WS | ws://localhost:8086/ws/alerts | Live alert channel |
| Neo4j | http://localhost:7474 | `neo4j` / `neo4j_dev_secret` |
| Grafana | http://localhost:3001 | `admin` / `admin` (`monitoring` profile) |
diff --git a/apps/web/package.json b/apps/web/package.json
index 69258de97..87d583da7 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -1,6 +1,6 @@
{
"name": "@aisoc/web",
- "version": "7.1.0",
+ "version": "7.2.0",
"private": true,
"description": "AiSOC SOC Console - Next.js 14 Frontend",
"license": "MIT",
diff --git a/docker-compose.yml b/docker-compose.yml
index 4f9262d67..d2ec530d3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -15,8 +15,6 @@
# password while you're there.
###############################################################################
-version: '3.8'
-
networks:
aisoc:
driver: bridge
@@ -106,6 +104,10 @@ services:
- aisoc
volumes:
- kafka_data:/var/lib/kafka/data
+ # Memory caps surface OOMKiller events as a clear container exit instead of
+ # silent broker rebalances. Tune up if you raise KAFKA_HEAP_OPTS.
+ mem_limit: 1536m
+ mem_reservation: 1g
healthcheck:
test: ["CMD", "kafka-broker-api-versions", "--bootstrap-server", "localhost:9092"]
interval: 15s
@@ -146,6 +148,8 @@ services:
nofile:
soft: 262144
hard: 262144
+ mem_limit: 1g
+ mem_reservation: 768m
opensearch:
image: opensearchproject/opensearch:2.11.0
@@ -168,6 +172,8 @@ services:
- "127.0.0.1:9200:9200"
networks:
- aisoc
+ mem_limit: 1g
+ mem_reservation: 768m
qdrant:
image: qdrant/qdrant:v1.7.0
@@ -196,6 +202,8 @@ services:
- neo4j_logs:/logs
networks:
- aisoc
+ mem_limit: 1g
+ mem_reservation: 768m
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:7474 || exit 1"]
interval: 15s
@@ -208,6 +216,8 @@ services:
build:
context: ./services/api
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-core-api:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-api
depends_on:
postgres:
@@ -239,6 +249,8 @@ services:
build:
context: ./services/ingest
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-ingest:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-ingest
depends_on:
kafka:
@@ -263,6 +275,8 @@ services:
build:
context: ./services/enrichment
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-enrichment:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-enrichment
depends_on:
redis:
@@ -286,6 +300,8 @@ services:
build:
context: ./services/fusion
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-fusion:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-fusion
depends_on:
redis:
@@ -306,6 +322,8 @@ services:
build:
context: ./services/agents
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-agents:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-agents
depends_on:
postgres:
@@ -334,18 +352,25 @@ services:
build:
context: ./services/osquery-tls
dockerfile: Dockerfile
+ # Not in publish-images.yml matrix yet — pull falls back to local build.
+ image: ghcr.io/beenuar/aisoc-osquery-tls:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-osquery-tls
depends_on:
postgres:
condition: service_healthy
+ # Host port 8007 was previously colliding with the `ueba` service's
+ # 127.0.0.1:8007 binding; remapped to 8091 here. UEBA still owns 8007.
ports:
- - "127.0.0.1:8007:8007"
+ - "127.0.0.1:8091:8007"
profiles:
- osquery
environment:
DATABASE_URL: postgresql+asyncpg://aisoc:aisoc_dev_secret@postgres:5432/aisoc
AISOC_OSQUERY_TLS_ENROLL_SECRET: ${AISOC_OSQUERY_TLS_ENROLL_SECRET:-change-me-in-production}
- AISOC_INGEST_BASE_URL: http://ingest:8080
+ # The ingest service is registered as `ingest-worker` in this compose
+ # file; the previous `http://ingest:8080` would not resolve via DNS.
+ AISOC_INGEST_BASE_URL: http://ingest-worker:8080
networks:
- aisoc
restart: unless-stopped
@@ -354,6 +379,8 @@ services:
build:
context: ./services/actions
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-actions:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-actions
depends_on:
redis:
@@ -375,6 +402,8 @@ services:
build:
context: ./services/connectors
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-connectors:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-connectors
depends_on:
kafka:
@@ -403,6 +432,8 @@ services:
build:
context: ./services/threatintel
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-threatintel:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-threatintel
depends_on:
redis:
@@ -433,6 +464,8 @@ services:
build:
context: ./services/ueba
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-ueba:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-ueba
depends_on:
postgres:
@@ -457,6 +490,9 @@ services:
build:
context: ./services/honeytokens
dockerfile: Dockerfile
+ # Not in publish-images.yml matrix yet — pull falls back to local build.
+ image: ghcr.io/beenuar/aisoc-honeytokens:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-honeytokens
depends_on:
postgres:
@@ -480,6 +516,9 @@ services:
build:
context: ./services/purple-team
dockerfile: Dockerfile
+ # Not in publish-images.yml matrix yet — pull falls back to local build.
+ image: ghcr.io/beenuar/aisoc-purple-team:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-purple-team
depends_on:
postgres:
@@ -501,6 +540,8 @@ services:
build:
context: ./services/realtime
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-realtime:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-realtime
depends_on:
redis:
@@ -526,6 +567,8 @@ services:
build:
context: ./services/slack-bot
dockerfile: Dockerfile
+ image: ghcr.io/beenuar/aisoc-slack-bot:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-slack-bot
depends_on:
- api
@@ -553,6 +596,8 @@ services:
build:
context: .
dockerfile: apps/web/Dockerfile
+ image: ghcr.io/beenuar/aisoc-web:${AISOC_VERSION:-latest}
+ pull_policy: missing
container_name: aisoc-web
depends_on:
- api
diff --git a/scripts/aisoc-doctor.ts b/scripts/aisoc-doctor.ts
index 03905e112..328ed2eaf 100644
--- a/scripts/aisoc-doctor.ts
+++ b/scripts/aisoc-doctor.ts
@@ -127,26 +127,94 @@ async function checkDocker() {
}
record("docker available", "OK", docker);
+ // Enforce Compose v2+. Compose v1 (the standalone `docker-compose` Python
+ // binary) does not register a `compose` Docker subcommand, so calling
+ // `docker compose version` on a v1-only system errors out and tryRun
+ // returns null. But on systems that *do* have v2, we want to enforce a
+ // minimum of v2.0 because earlier alpha builds had healthcheck and
+ // depends_on bugs that surface as opaque container failures.
const compose = tryRun("docker compose version");
if (!compose) {
- record("docker compose v2", "FAIL", "docker compose plugin not installed");
+ record(
+ "docker compose v2",
+ "FAIL",
+ "docker compose plugin not installed (Compose v1's `docker-compose` is not supported)"
+ );
return;
}
- record("docker compose v2", "OK", compose);
+ const versionMatch = compose.match(/v?(\d+)\.(\d+)\.(\d+)/);
+ if (!versionMatch) {
+ record("docker compose v2", "WARN", `unrecognized version string: ${compose}`);
+ } else {
+ const [, major, minor] = versionMatch;
+ const majorNum = parseInt(major, 10);
+ if (majorNum < 2) {
+ record(
+ "docker compose v2",
+ "FAIL",
+ `Compose v${major}.${minor} detected — AiSOC requires v2.0+`
+ );
+ return;
+ }
+ record("docker compose v2", "OK", compose);
+ }
+
+ // Docker daemon resource allocation. The #1 source of opaque
+ // "container exited" failures on a clean clone is Docker Desktop being
+ // under-provisioned: OpenSearch + ClickHouse + Neo4j + Kafka together
+ // reserve ~3.5 GB at idle, and the full stack peaks around 5-6 GB.
+ const info = tryRun("docker info --format json");
+ if (info) {
+ try {
+ const parsed = JSON.parse(info);
+ const memBytes: number = parsed.MemTotal ?? 0;
+ const memGb = memBytes / 1024 / 1024 / 1024;
+ const memDetail = `Docker daemon has ${memGb.toFixed(1)} GB RAM allocated`;
+ if (memGb < 4) {
+ record(
+ "docker RAM allocation",
+ "FAIL",
+ `${memDetail} — full stack needs 6 GB+, demo stack needs 4 GB+ (Docker Desktop → Settings → Resources)`
+ );
+ } else if (memGb < 6) {
+ record(
+ "docker RAM allocation",
+ "WARN",
+ `${memDetail} — sufficient for demo stack only; full dev stack will OOM-kill (raise to 6 GB+ in Docker Desktop → Settings → Resources)`
+ );
+ } else {
+ record("docker RAM allocation", "OK", memDetail);
+ }
+ } catch {
+ record("docker RAM allocation", "WARN", "could not parse `docker info` output");
+ }
+ } else {
+ // `docker info` failing usually means the daemon is not running.
+ // The container check below will surface a clearer error in that case;
+ // here we just note the resource probe was skipped.
+ record("docker RAM allocation", "WARN", "could not query daemon (is Docker running?)");
+ }
- const ps = tryRun("docker compose ps --format json");
+ // Use `docker ps -a` instead of `docker compose ps` so we discover
+ // containers across compose projects (the demo stack uses
+ // `-f docker-compose.demo.yml` which is a separate project) AND so we can
+ // distinguish "container never created" from "container exited" — the most
+ // common silent failure mode is the data tier (postgres, redis, kafka)
+ // exiting 255 after a Docker Desktop restart while upper services keep
+ // running. The `aisoc-` prefix on every container_name in both compose
+ // files makes this a safe filter.
+ const ps = tryRun("docker ps -a --format json --filter name=aisoc-");
if (!ps) {
record(
"containers running",
"WARN",
- 'no compose stack running — run `docker compose up -d`'
+ 'no AiSOC containers running — run `pnpm aisoc:demo` (slim) or `docker compose up -d` (full)'
);
return;
}
- // docker compose ps --format json prints ndjson on Compose v2
const lines = ps.split("\n").filter((l) => l.trim());
- const services = lines
+ const containers = lines
.map((l) => {
try {
return JSON.parse(l);
@@ -156,14 +224,46 @@ async function checkDocker() {
})
.filter(Boolean);
- if (services.length === 0) {
- record("containers running", "WARN", "no services up");
+ if (containers.length === 0) {
+ record(
+ "containers running",
+ "WARN",
+ "no AiSOC containers up — run `pnpm aisoc:demo` (slim) or `docker compose up -d` (full)"
+ );
return;
}
- // The doctor runs against either the full stack (`aisoc-*`) or the
- // smaller demo stack (`aisoc-demo-*`). We accept either prefix for the
- // core services so `pnpm aisoc:demo` users don't see false FAILs.
+ // Detect which stack flavor is present so the per-role check below can give
+ // an accurate "looked for X" message and so demo users aren't told to chase
+ // services (kafka-ui, neo4j, etc.) that the demo stack intentionally omits.
+ // We classify by container *name*, not state, because a wedged data-tier
+ // container is still informative about which stack the user tried to run.
+ const hasDemo = containers.some((c: any) =>
+ typeof c.Names === "string" && c.Names.startsWith("aisoc-demo-")
+ );
+ const hasFull = containers.some(
+ (c: any) =>
+ typeof c.Names === "string" &&
+ c.Names.startsWith("aisoc-") &&
+ !c.Names.startsWith("aisoc-demo-")
+ );
+ const runningCount = containers.filter((c: any) => c.State === "running").length;
+ const stackLabel = hasDemo && hasFull
+ ? "demo + full (mixed)"
+ : hasDemo
+ ? "demo"
+ : hasFull
+ ? "full"
+ : "unknown";
+ record(
+ "stack flavor",
+ "OK",
+ `${stackLabel} (${runningCount}/${containers.length} container(s) running)`
+ );
+
+ // The full stack uses `aisoc-<role>` names; the demo stack uses
+ // `aisoc-demo-<role>`. We accept either prefix for the core services so
+ // `pnpm aisoc:demo` users don't see false FAILs.
const expectedRoles = [
"api",
"agents",
@@ -174,19 +274,44 @@ async function checkDocker() {
];
for (const role of expectedRoles) {
const candidates = [`aisoc-${role}`, `aisoc-demo-${role}`];
- const found = services.find((s: any) => candidates.includes(s.Name));
+ const found = containers.find((c: any) => candidates.includes(c.Names));
if (!found) {
- record(`container ${role}`, "FAIL", `not running (looked for ${candidates.join(" or ")})`);
+ // No container with this name in either stack — the user probably hasn't
+ // booted the corresponding compose file yet, so this is a hint, not a
+ // hard failure (the API check below will tell them whether the stack
+ // is actually broken).
+ record(
+ `container ${role}`,
+ "WARN",
+ `not present (looked for ${candidates.join(" or ")}) — start the stack with \`pnpm aisoc:demo\` or \`docker compose up -d\``
+ );
+ continue;
+ }
+ // `docker ps --format json` exposes Status as a free-text string like
+ // "Up About an hour (healthy)" / "Up 2 minutes (starting)" / "Exited
+ // (255) About an hour ago". Parse the parenthetical for health, and
+ // treat "no parens" as "no healthcheck configured" — which we accept as
+ // healthy if the container is running.
+ const status: string = found.Status ?? "";
+ const state: string = found.State ?? "";
+ const healthMatch = status.match(/\(([^)]+)\)/);
+ const health = healthMatch ? healthMatch[1] : "";
+ if (state !== "running") {
+ // The most actionable signal we can give: the container exists but
+ // exited. The exit code (e.g. "Exited (255)") is in the status string
+ // and is exactly what a user should grep `docker logs` for.
+ record(
+ `container ${role}`,
+ "FAIL",
+ `${found.Names} ${status.toLowerCase()} — run \`docker logs ${found.Names}\``
+ );
continue;
}
- const healthy =
- found.Health === "healthy" ||
- found.Health === "" /* no healthcheck */ ||
- found.State === "running";
+ const ok = health === "" || health === "healthy";
record(
`container ${role}`,
- healthy ? "OK" : "FAIL",
- `${found.Name} state=${found.State}${found.Health ? ` health=${found.Health}` : ""}`
+ ok ? "OK" : health === "starting" ? "WARN" : "FAIL",
+ `${found.Names} state=${state}${health ? ` health=${health}` : ""}`
);
}
}
diff --git a/services/actions/Dockerfile b/services/actions/Dockerfile
index cab2a24ed..918481783 100644
--- a/services/actions/Dockerfile
+++ b/services/actions/Dockerfile
@@ -6,10 +6,33 @@ RUN pip install poetry==1.7.1 && \
poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
-RUN poetry install --no-interaction --no-ansi --no-dev 2>/dev/null || \
- pip install fastapi uvicorn[standard] redis[hiredis] asyncpg \
- sqlalchemy[asyncio] structlog httpx aiokafka \
- pydantic pydantic-settings python-dateutil
+
+# Run poetry without swallowing errors. Falls back to a complete pip
+# install mirroring pyproject.toml so a transient registry timeout
+# doesn't fail the whole image build. The previous fallback used
+# ``2>/dev/null ||`` which hid the real reason poetry failed and shipped
+# an incomplete dep set (missing cryptography, used by app.core for
+# credential vault decryption). Keep the fallback list in lockstep with
+# services/actions/pyproject.toml.
+RUN set -eux; \
+ if poetry install --no-interaction --no-ansi --without dev --no-root; then \
+ echo "[actions] poetry install succeeded"; \
+ else \
+ echo "[actions] poetry install failed; using pip fallback"; \
+ pip install --no-cache-dir \
+ "fastapi>=0.109,<0.137" \
+ "uvicorn[standard]>=0.27,<0.28" \
+ "pydantic>=2.5,<3" \
+ "pydantic-settings>=2.1,<3" \
+ "redis[hiredis]>=5.0.1,<8.0.0" \
+ "asyncpg>=0.29,<0.32" \
+ "sqlalchemy[asyncio]>=2.0.25,<3" \
+ "structlog>=24.1,<26" \
+ "httpx>=0.27,<0.29" \
+ "aiokafka>=0.10,<0.15" \
+ "python-dateutil>=2.8.2,<3" \
+ "cryptography>=42,<43" ; \
+ fi
COPY app/ ./app/
diff --git a/services/api/Dockerfile b/services/api/Dockerfile
index abc1e5f62..fb3d76cac 100644
--- a/services/api/Dockerfile
+++ b/services/api/Dockerfile
@@ -17,11 +17,55 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
shared-mime-info \
&& rm -rf /var/lib/apt/lists/*
-RUN pip install poetry==1.8.2
+RUN pip install poetry==1.8.2 && \
+ poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
-RUN poetry config virtualenvs.create false && \
- poetry install --no-dev --no-interaction --no-ansi
+
+# Run poetry without swallowing errors. If resolution fails (transient
+# registry timeout, proxy hiccup, etc.) we fall through to a pip install
+# that mirrors pyproject.toml so the image still ships a working api
+# service. The fallback list MUST stay in lockstep with
+# services/api/pyproject.toml — missing a dep there means the image
+# builds but crashes on import.
+RUN set -eux; \
+ if poetry install --no-interaction --no-ansi --without dev --no-root; then \
+ echo "[api] poetry install succeeded"; \
+ else \
+ echo "[api] poetry install failed; using pip fallback"; \
+ pip install --no-cache-dir \
+ "fastapi>=0.111,<0.112" \
+ "uvicorn[standard]>=0.29,<0.30" \
+ "pydantic>=2.7,<2.11" \
+ "pydantic-settings>=2.2,<3" \
+ "sqlalchemy[asyncio]>=2.0.30,<3" \
+ "asyncpg>=0.29,<0.32" \
+ "alembic>=1.13,<2" \
+ "redis[hiredis]>=5.0.4,<8.0.0" \
+ "httpx>=0.27,<0.29" \
+ "python-jose[cryptography]>=3.3,<4" \
+ "PyJWT>=2.8,<3" \
+ "cryptography>=42,<43" \
+ "bcrypt>=4.1,<5" \
+ "python-multipart>=0.0.9,<0.1" \
+ "tenacity>=8.3,<10" \
+ "structlog>=24.1,<25" \
+ "prometheus-client>=0.20,<0.26" \
+ "opentelemetry-sdk>=1.24,<2" \
+ "opentelemetry-instrumentation-fastapi>=0.45b0" \
+ "opentelemetry-instrumentation-sqlalchemy>=0.45b0" \
+ "clickhouse-driver>=0.2.8,<0.3" \
+ "sqlglot>=23,<27" \
+ "boto3>=1.34,<2" \
+ "neo4j>=5.19,<7" \
+ "pysigma>=0.11,<0.12" \
+ "pysigma-backend-opensearch>=1.0,<2" \
+ "yara-python>=4.5,<5" \
+ "pyyaml>=6.0.1,<7" \
+ "strawberry-graphql[fastapi]>=0.236,<0.237" \
+ "webauthn>=2.2,<3" \
+ "weasyprint>=62,<63" ; \
+ fi
COPY . .
diff --git a/services/api/app/api/v1/endpoints/detection_proposals.py b/services/api/app/api/v1/endpoints/detection_proposals.py
index 4dfed4539..6dfaa70bd 100644
--- a/services/api/app/api/v1/endpoints/detection_proposals.py
+++ b/services/api/app/api/v1/endpoints/detection_proposals.py
@@ -52,8 +52,15 @@ router = APIRouter(prefix="/detection-proposals", tags=["detection_rules", "dac"
# Repository root: services/api/app/api/v1/endpoints/detection_proposals.py
# ^ ^ ^ ^ ^ ^ ^
# parents: [0] [1] [2] [3] [4][5] [6] = repo root
+#
+# On the host we sit six levels deep under the repo root. Inside the API
+# Docker image only the services/api/ subtree is copied to /app, so
+# parents[6] would IndexError. Resolve the deepest available ancestor and
+# let AISOC_REPO_ROOT override at runtime when the eval script is actually
+# needed (only relevant in dev/CI where the full repo is mounted).
_ENDPOINT_FILE = Path(__file__).resolve()
-_REPO_ROOT_DEFAULT = _ENDPOINT_FILE.parents[6]
+_ENDPOINT_PARENTS = list(_ENDPOINT_FILE.parents)
+_REPO_ROOT_DEFAULT = _ENDPOINT_PARENTS[6] if len(_ENDPOINT_PARENTS) > 6 else _ENDPOINT_PARENTS[-1]
_REPO_ROOT = Path(os.environ.get("AISOC_REPO_ROOT", str(_REPO_ROOT_DEFAULT)))
_EVAL_SCRIPT = _REPO_ROOT / "scripts" / "run_evals.py"
diff --git a/services/api/app/api/v1/endpoints/saved_views.py b/services/api/app/api/v1/endpoints/saved_views.py
index 7fd32f7fc..e77b031e2 100644
--- a/services/api/app/api/v1/endpoints/saved_views.py
+++ b/services/api/app/api/v1/endpoints/saved_views.py
@@ -352,7 +352,7 @@ async def update_saved_view(
return SavedViewModel.from_orm(row)
[email protected]("/{view_id}", status_code=status.HTTP_204_NO_CONTENT)
[email protected]("/{view_id}", status_code=status.HTTP_204_NO_CONTENT, response_model=None)
async def delete_saved_view(
view_id: str,
user: AuthUser,
diff --git a/services/api/migrations/023_mssp_detection_scoping.sql b/services/api/migrations/023_mssp_detection_scoping.sql
index 91fbb63bc..30032ffd5 100644
--- a/services/api/migrations/023_mssp_detection_scoping.sql
+++ b/services/api/migrations/023_mssp_detection_scoping.sql
@@ -26,6 +26,45 @@
BEGIN;
+-- 0. Schema reconciliation: detection_rules.status -----------------------------
+-- The ORM (services/api/app/models/detection_rule.py) treats `status` as the
+-- source of truth for whether a rule participates in detection runs
+-- (testing | active | disabled | deprecated), but migration 001 only ships the
+-- legacy boolean `enabled` column. We need `status` to exist before the view
+-- below can reference it on a fresh Postgres init (cold-boot via
+-- /docker-entrypoint-initdb.d), otherwise CREATE VIEW fails with
+-- "column r.status does not exist" and the container exits with code 3.
+--
+-- Strategy:
+-- * Add the column idempotently (no-op on databases already migrated past
+-- this point or that have a future "introduce status" migration).
+-- * Backfill from `enabled` when both columns are present so historical rows
+-- keep their semantics: enabled=TRUE -> 'active', enabled=FALSE -> 'disabled'.
+-- * Default new rows to 'active' so existing seed data and the rest of this
+-- migration's view definition behave exactly as documented below.
+ALTER TABLE detection_rules
+ ADD COLUMN IF NOT EXISTS status TEXT NOT NULL DEFAULT 'active';
+
+-- Backfill from `enabled` only if the legacy column still exists. We use a
+-- DO block with information_schema so the migration is safe whether you're
+-- coming from the legacy 001 schema or a future schema where `enabled` was
+-- already dropped.
+DO $$
+BEGIN
+ IF EXISTS (
+ SELECT 1 FROM information_schema.columns
+ WHERE table_name = 'detection_rules' AND column_name = 'enabled'
+ ) THEN
+ EXECUTE $sql$
+ UPDATE detection_rules
+ SET status = CASE WHEN enabled THEN 'active' ELSE 'disabled' END
+ WHERE status = 'active' -- only touch rows still on the default
+ $sql$;
+ END IF;
+END $$;
+
+CREATE INDEX IF NOT EXISTS idx_detection_rules_status ON detection_rules(status);
+
-- 1. Rule packs ----------------------------------------------------------------
-- A pack is owned by a parent tenant and is the unit MSSPs assign to children.
CREATE TABLE IF NOT EXISTS mssp_rule_packs (
diff --git a/services/connectors/Dockerfile b/services/connectors/Dockerfile
index f4b4bb00e..59ead6633 100644
--- a/services/connectors/Dockerfile
+++ b/services/connectors/Dockerfile
@@ -6,9 +6,32 @@ RUN pip install --no-cache-dir poetry==1.7.1 && \
poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
-RUN poetry install --no-interaction --no-ansi --no-dev 2>/dev/null || \
- pip install --no-cache-dir fastapi uvicorn[standard] httpx pydantic pydantic-settings \
- structlog boto3
+
+# Run poetry without swallowing errors. Falls back to a complete pip
+# install mirroring pyproject.toml so a transient registry timeout
+# doesn't fail the whole image build. The previous fallback used
+# ``2>/dev/null ||`` which hid the real reason poetry failed and shipped
+# an incomplete dep set (missing cryptography, sqlalchemy, asyncpg,
+# apscheduler — half the connector platform). Keep the fallback
+# list in lockstep with services/connectors/pyproject.toml.
+RUN set -eux; \
+ if poetry install --no-interaction --no-ansi --without dev --no-root; then \
+ echo "[connectors] poetry install succeeded"; \
+ else \
+ echo "[connectors] poetry install failed; using pip fallback"; \
+ pip install --no-cache-dir \
+ "fastapi>=0.109,<0.110" \
+ "uvicorn[standard]>=0.27,<0.28" \
+ "httpx>=0.26,<0.27" \
+ "pydantic>=2.5,<3" \
+ "pydantic-settings>=2.1,<3" \
+ "structlog>=24.1,<25" \
+ "boto3>=1.34,<2" \
+ "apscheduler>=3.10,<4" \
+ "sqlalchemy>=2.0,<3" \
+ "asyncpg>=0.29,<0.30" \
+ "cryptography>=42,<43" ; \
+ fi
COPY app/ ./app/
diff --git a/services/enrichment/Dockerfile b/services/enrichment/Dockerfile
index dd0b8af7b..a68f94671 100644
--- a/services/enrichment/Dockerfile
+++ b/services/enrichment/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.21-alpine AS builder
+FROM golang:1.24-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git ca-certificates
diff --git a/services/fusion/Dockerfile b/services/fusion/Dockerfile
index 6cbd57c74..a3b399f7e 100644
--- a/services/fusion/Dockerfile
+++ b/services/fusion/Dockerfile
@@ -6,9 +6,39 @@ RUN pip install poetry==1.7.1 && \
poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
-RUN poetry install --no-interaction --no-ansi --no-dev 2>/dev/null || \
- pip install fastapi uvicorn[standard] aiokafka redis[hiredis] pydantic pydantic-settings \
- asyncpg sqlalchemy[asyncio] structlog prometheus-client httpx python-dateutil
+
+# Run poetry without swallowing errors. Falls back to a complete pip
+# install mirroring pyproject.toml so a transient registry timeout
+# doesn't fail the whole image build. The previous fallback used
+# ``2>/dev/null ||`` which hid the real reason poetry failed and shipped
+# an incomplete dep set (missing simhash + scikit-learn + lightgbm + numpy
+# — i.e. the entire ML correlation engine, which would crash the fusion
+# service on the first incoming alert). Keep the fallback list in lockstep
+# with services/fusion/pyproject.toml.
+RUN set -eux; \
+ if poetry install --no-interaction --no-ansi --without dev --no-root; then \
+ echo "[fusion] poetry install succeeded"; \
+ else \
+ echo "[fusion] poetry install failed; using pip fallback"; \
+ pip install --no-cache-dir \
+ "fastapi>=0.109,<0.110" \
+ "uvicorn[standard]>=0.27,<0.28" \
+ "pydantic>=2.5,<3" \
+ "pydantic-settings>=2.1,<3" \
+ "aiokafka>=0.10,<0.11" \
+ "aioredis>=2.0.1,<3" \
+ "redis[hiredis]>=5.0.1,<6" \
+ "asyncpg>=0.29,<0.30" \
+ "sqlalchemy[asyncio]>=2.0.25,<3" \
+ "structlog>=24.1,<25" \
+ "prometheus-client>=0.19,<0.20" \
+ "httpx>=0.26,<0.27" \
+ "python-dateutil>=2.8.2,<3" \
+ "simhash>=2.1.2,<3" \
+ "scikit-learn>=1.4,<2" \
+ "lightgbm>=4.3,<5" \
+ "numpy>=1.26,<2" ; \
+ fi
COPY app/ ./app/
diff --git a/services/honeytokens/Dockerfile b/services/honeytokens/Dockerfile
index cbe54553a..c81d77878 100644
--- a/services/honeytokens/Dockerfile
+++ b/services/honeytokens/Dockerfile
@@ -1,9 +1,30 @@
FROM python:3.11-slim
WORKDIR /app
+ENV PYTHONDONTWRITEBYTECODE=1 \
+ PYTHONUNBUFFERED=1 \
+ PIP_NO_CACHE_DIR=1 \
+ PIP_DISABLE_PIP_VERSION_CHECK=1
COPY pyproject.toml .
-RUN pip install --no-cache-dir .
+
+# Install runtime deps explicitly. We deliberately don't `pip install .`
+# because the hatchling backend would need the package source, but we
+# don't COPY app/ until later (so this layer caches across source edits).
+# Keep this list in lockstep with pyproject.toml [project.dependencies].
+RUN pip install --no-cache-dir \
+ "fastapi>=0.110.0" \
+ "uvicorn[standard]>=0.29.0" \
+ "sqlalchemy[asyncio]>=2.0.0" \
+ "asyncpg>=0.29.0" \
+ "alembic>=1.13.0" \
+ "pydantic>=2.0.0" \
+ "pydantic-settings>=2.0.0" \
+ "httpx>=0.27.0" \
+ "cryptography>=42.0.0" \
+ "opentelemetry-sdk>=1.24.0" \
+ "opentelemetry-exporter-otlp>=1.24.0" \
+ "opentelemetry-instrumentation-fastapi>=0.45b0"
COPY alembic.ini .
COPY alembic/ alembic/
diff --git a/services/ingest/Dockerfile b/services/ingest/Dockerfile
index 3b0eb37c5..77fdbe724 100644
--- a/services/ingest/Dockerfile
+++ b/services/ingest/Dockerfile
@@ -1,4 +1,4 @@
-FROM golang:1.21-alpine AS builder
+FROM golang:1.24-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git ca-certificates gcc musl-dev
diff --git a/services/osquery-tls/Dockerfile b/services/osquery-tls/Dockerfile
index 128505c21..57f1276d4 100644
--- a/services/osquery-tls/Dockerfile
+++ b/services/osquery-tls/Dockerfile
@@ -11,11 +11,33 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
-RUN pip install poetry==1.8.2
+RUN pip install poetry==1.8.2 && \
+ poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
-RUN poetry config virtualenvs.create false && \
- poetry install --no-dev --no-interaction --no-ansi
+
+# Run poetry without swallowing errors. Falls back to a complete pip
+# install mirroring pyproject.toml so a transient registry timeout
+# doesn't fail the whole image build. Keep the fallback list in lockstep
+# with services/osquery-tls/pyproject.toml.
+RUN set -eux; \
+ if poetry install --no-interaction --no-ansi --without dev --no-root; then \
+ echo "[osquery-tls] poetry install succeeded"; \
+ else \
+ echo "[osquery-tls] poetry install failed; using pip fallback"; \
+ pip install --no-cache-dir \
+ "fastapi>=0.111,<0.112" \
+ "uvicorn[standard]>=0.29,<0.30" \
+ "pydantic>=2.7,<2.11" \
+ "pydantic-settings>=2.2,<3" \
+ "sqlalchemy[asyncio]>=2.0.30,<3" \
+ "asyncpg>=0.29,<0.32" \
+ "alembic>=1.13,<2" \
+ "httpx>=0.27,<0.29" \
+ "structlog>=24.1,<25" \
+ "prometheus-client>=0.20,<0.26" \
+ "cryptography>=42,<43" ; \
+ fi
COPY . .
diff --git a/services/purple-team/Dockerfile b/services/purple-team/Dockerfile
index be9e91d62..a7e4868c4 100644
--- a/services/purple-team/Dockerfile
+++ b/services/purple-team/Dockerfile
@@ -1,9 +1,31 @@
FROM python:3.11-slim
WORKDIR /app
+ENV PYTHONDONTWRITEBYTECODE=1 \
+ PYTHONUNBUFFERED=1 \
+ PIP_NO_CACHE_DIR=1 \
+ PIP_DISABLE_PIP_VERSION_CHECK=1
COPY pyproject.toml .
-RUN pip install --no-cache-dir .
+
+# Install runtime deps explicitly. We deliberately don't `pip install .`
+# because the hatchling backend would need the package source, but we
+# don't COPY app/ until later (so this layer caches across source edits).
+# Keep this list in lockstep with pyproject.toml [project.dependencies].
+RUN pip install --no-cache-dir \
+ "fastapi>=0.110.0" \
+ "uvicorn[standard]>=0.29.0" \
+ "sqlalchemy[asyncio]>=2.0.0" \
+ "asyncpg>=0.29.0" \
+ "alembic>=1.13.0" \
+ "pydantic>=2.0.0" \
+ "pydantic-settings>=2.0.0" \
+ "httpx>=0.27.0" \
+ "pyyaml>=6.0.0" \
+ "apscheduler>=3.10.0" \
+ "opentelemetry-sdk>=1.24.0" \
+ "opentelemetry-exporter-otlp>=1.24.0" \
+ "opentelemetry-instrumentation-fastapi>=0.45b0"
COPY alembic.ini .
COPY alembic/ alembic/
diff --git a/services/slack-bot/Dockerfile b/services/slack-bot/Dockerfile
index 46861cb84..ba4c405fc 100644
--- a/services/slack-bot/Dockerfile
+++ b/services/slack-bot/Dockerfile
@@ -6,17 +6,29 @@ RUN pip install --no-cache-dir poetry==1.7.1 && \
poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
-RUN poetry install --no-interaction --no-ansi --no-dev 2>/dev/null || \
- pip install --no-cache-dir \
- fastapi \
- "uvicorn[standard]" \
- pydantic \
- pydantic-settings \
- slack-bolt \
- slack-sdk \
- "aiohttp>=3.9,<4.0" \
- httpx \
- structlog
+
+# Run poetry without swallowing errors. Falls back to a complete pip
+# install mirroring pyproject.toml so a transient registry timeout
+# doesn't fail the whole image build. The previous fallback used
+# ``2>/dev/null ||`` which hid the real reason poetry failed (we'd ship
+# the image and only learn at runtime when /slack/events 500'd). Keep the
+# fallback list in lockstep with services/slack-bot/pyproject.toml.
+RUN set -eux; \
+ if poetry install --no-interaction --no-ansi --without dev --no-root; then \
+ echo "[slack-bot] poetry install succeeded"; \
+ else \
+ echo "[slack-bot] poetry install failed; using pip fallback"; \
+ pip install --no-cache-dir \
+ "fastapi>=0.109,<0.137" \
+ "uvicorn[standard]>=0.27,<0.28" \
+ "pydantic>=2.5,<3" \
+ "pydantic-settings>=2.1,<3" \
+ "slack-bolt>=1.18.1,<2" \
+ "slack-sdk>=3.27,<4" \
+ "aiohttp>=3.9,<4.0" \
+ "httpx>=0.27,<0.29" \
+ "structlog>=24.1,<26" ; \
+ fi
COPY app/ ./app/
diff --git a/services/threatintel/Dockerfile b/services/threatintel/Dockerfile
index 342085085..f9ad25bce 100644
--- a/services/threatintel/Dockerfile
+++ b/services/threatintel/Dockerfile
@@ -6,11 +6,39 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential curl \
&& rm -rf /var/lib/apt/lists/*
-RUN pip install --no-cache-dir poetry==1.8.2
+RUN pip install --no-cache-dir poetry==1.8.2 \
+ && poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock* ./
-RUN poetry config virtualenvs.create false \
- && poetry install --no-interaction --no-ansi --only main
+
+# Run poetry without swallowing errors. Falls back to a complete pip
+# install mirroring pyproject.toml so a transient registry timeout
+# doesn't fail the whole image build. Keep the fallback list in lockstep
+# with services/threatintel/pyproject.toml.
+RUN set -eux; \
+ if poetry install --no-interaction --no-ansi --only main; then \
+ echo "[threatintel] poetry install succeeded"; \
+ else \
+ echo "[threatintel] poetry install failed; using pip fallback"; \
+ pip install --no-cache-dir \
+ "fastapi>=0.109,<0.110" \
+ "uvicorn[standard]>=0.27,<0.28" \
+ "pydantic>=2.5,<3" \
+ "pydantic-settings>=2.1,<3" \
+ "httpx>=0.26,<0.27" \
+ "redis[hiredis]>=5.0.1,<6" \
+ "taxii2-client>=2.3,<3" \
+ "stix2>=3.0.1,<4" \
+ "apscheduler>=3.10.4,<4" \
+ "opensearch-py[async]>=2.7,<3" \
+ "qdrant-client[fastembed]>=1.9,<2" \
+ "neo4j>=5.19,<6" \
+ "structlog>=24.1,<25" \
+ "prometheus-client>=0.19,<0.20" \
+ "python-dateutil>=2.8.2,<3" \
+ "aiokafka>=0.10,<0.11" \
+ "mmh3>=4.1,<5" ; \
+ fi
COPY app ./app
diff --git a/services/ueba/Dockerfile b/services/ueba/Dockerfile
index 16ff165e3..d2b8e398c 100644
--- a/services/ueba/Dockerfile
+++ b/services/ueba/Dockerfile
@@ -1,9 +1,34 @@
FROM python:3.11-slim
WORKDIR /app
+ENV PYTHONDONTWRITEBYTECODE=1 \
+ PYTHONUNBUFFERED=1 \
+ PIP_NO_CACHE_DIR=1 \
+ PIP_DISABLE_PIP_VERSION_CHECK=1
COPY pyproject.toml .
-RUN pip install --no-cache-dir .
+
+# Install runtime deps explicitly. We deliberately don't `pip install .`
+# because the hatchling backend would need the package source, but we
+# don't COPY app/ until later (so this layer caches across source edits).
+# numpy/scipy install from manylinux wheels on python:3.11-slim, no
+# build-essential required. Keep this list in lockstep with
+# pyproject.toml [project.dependencies].
+RUN pip install --no-cache-dir \
+ "fastapi>=0.110.0" \
+ "uvicorn[standard]>=0.29.0" \
+ "sqlalchemy[asyncio]>=2.0.0" \
+ "asyncpg>=0.29.0" \
+ "alembic>=1.13.0" \
+ "pydantic>=2.0.0" \
+ "pydantic-settings>=2.0.0" \
+ "aiokafka>=0.10.0" \
+ "numpy>=1.26.0" \
+ "scipy>=1.12.0" \
+ "httpx>=0.27.0" \
+ "opentelemetry-sdk>=1.24.0" \
+ "opentelemetry-exporter-otlp>=1.24.0" \
+ "opentelemetry-instrumentation-fastapi>=0.45b0"
COPY alembic.ini .
COPY alembic/ alembic/