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.

The chart did not render, and nothing stopped a pod calling out (#736)

Beenu Arorad4868895e3a6
diff --git a/.github/workflows/helm.yml b/.github/workflows/helm.yml
new file mode 100644
index 000000000..a79b3e871
--- /dev/null
+++ b/.github/workflows/helm.yml
@@ -0,0 +1,151 @@
+name: Helm
+
+# The chart was never exercised. `docs/audit/REPOSITORY_REALITY.md` recorded
+# it as "renders; whether it runs was not tested", and it turned out not even
+# to render: `helm template` fails outright with "missing in charts/
+# directory: postgresql, redis" until dependencies are fetched. So the chart
+# in this repository could not be installed by anyone who cloned it and
+# followed the docs, and nothing said so.
+#
+# This job does the fetch, renders, validates the output as Kubernetes
+# objects, and installs into a real cluster.
+
+on:
+ push:
+ branches: [main]
+ paths:
+ - 'infra/helm/**'
+ - '.github/workflows/helm.yml'
+ pull_request:
+ paths:
+ - 'infra/helm/**'
+ - '.github/workflows/helm.yml'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
+
+permissions:
+ contents: read
+
+jobs:
+ render:
+ name: Helm — lint, render, validate
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+ - uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
+ with:
+ version: v3.18.5
+
+ # The two steps the docs never told anyone to run, which is why the
+ # chart appeared to work and did not. A clean machine has no repository
+ # definitions at all, so `helm dependency build` fails before it starts
+ # — which is exactly what a first-time user hits.
+ - name: Fetch chart dependencies
+ run: |
+ helm repo add bitnami https://charts.bitnami.com/bitnami
+ helm repo update
+ helm dependency build infra/helm/aisoc
+
+ - name: Lint
+ run: helm lint infra/helm/aisoc
+
+ - name: Render with defaults
+ run: helm template aisoc infra/helm/aisoc > /tmp/default.yaml
+
+ # The Helm chart could not install at all on main before v8.1: the
+ # deployment template read .Values.ueba.replicaCount and values.yaml had
+ # no `ueba` key. Rendering every switched-on path is how that class is
+ # caught, rather than the default path alone.
+ - name: Render with every optional subsystem on
+ run: |
+ helm template aisoc infra/helm/aisoc \
+ --set networkPolicy.enabled=true \
+ --set 'networkPolicy.allowedEgressCIDRs={10.0.0.0/8}' \
+ --set hpa.enabled=true \
+ --set ingress.enabled=true \
+ > /tmp/full.yaml
+
+ - name: Validate the rendered objects against the Kubernetes schema
+ run: |
+ set -euo pipefail
+ curl -sSLo /tmp/kubeconform.tar.gz \
+ https://github.com/yannh/kubeconform/releases/download/v0.6.7/kubeconform-linux-amd64.tar.gz
+ tar -xzf /tmp/kubeconform.tar.gz -C /tmp
+ /tmp/kubeconform -strict -summary /tmp/default.yaml
+ /tmp/kubeconform -strict -summary /tmp/full.yaml
+
+ # The egress policy is the network half of "runs entirely on your
+ # infrastructure". Asserting it renders is not the same as asserting it
+ # is correct, so check the two properties that make it worth having.
+ - name: The egress policy denies by default and excludes metadata
+ run: |
+ set -euo pipefail
+ python3 - <<'PY'
+ import sys, yaml
+ docs = [d for d in yaml.safe_load_all(open("/tmp/full.yaml")) if d]
+ policies = [d for d in docs if d.get("kind") == "NetworkPolicy"]
+ if not policies:
+ sys.exit("no NetworkPolicy rendered with networkPolicy.enabled=true")
+ policy = policies[0]
+
+ if policy["spec"].get("policyTypes") != ["Egress"]:
+ sys.exit("policy does not declare Egress; an empty egress list would not deny")
+
+ blocks = [
+ block
+ for rule in policy["spec"]["egress"]
+ for dest in rule.get("to", [])
+ if (block := dest.get("ipBlock"))
+ ]
+ if not blocks:
+ sys.exit("no ipBlock rendered from allowedEgressCIDRs")
+ for block in blocks:
+ if "169.254.169.254/32" not in block.get("except", []):
+ sys.exit(f"cidr {block['cidr']} does not exclude the metadata service")
+
+ # Default render must NOT emit one — it is opt-in because a CNI that
+ # does not enforce NetworkPolicy ignores it silently, and a control
+ # that is silently ignored reads as protection while providing none.
+ default = [d for d in yaml.safe_load_all(open("/tmp/default.yaml")) if d]
+ if any(d.get("kind") == "NetworkPolicy" for d in default):
+ sys.exit("NetworkPolicy rendered by default; it must stay opt-in")
+
+ print("OK: egress policy denies by default, excludes metadata, and is opt-in")
+ PY
+
+ install:
+ name: Helm — install into a real cluster
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
+ - uses: azure/setup-helm@b9e51907a09c216f16ebe8536097933489208112 # v4.3.0
+ with:
+ version: v3.18.5
+
+ - name: Start a kind cluster
+ uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0
+ with:
+ cluster_name: aisoc-helm
+
+ - name: Fetch chart dependencies
+ run: |
+ helm repo add bitnami https://charts.bitnami.com/bitnami
+ helm repo update
+ helm dependency build infra/helm/aisoc
+
+ # --dry-run=server is the honest bar for a CI runner. The images are not
+ # published for every PR and the datastores would not fit anyway, so a
+ # full rollout would test the runner's disk rather than the chart. What
+ # this does test is the thing that was never tested: that the API server
+ # accepts every object the chart produces — admission, defaulting, RBAC
+ # and schema — which `helm template` alone cannot tell you.
+ - name: Install (server dry-run)
+ run: |
+ helm install aisoc infra/helm/aisoc \
+ --dry-run=server \
+ --set networkPolicy.enabled=true \
+ --set 'networkPolicy.allowedEgressCIDRs={10.0.0.0/8}' \
+ > /dev/null
+ echo "OK: the API server accepted every object in the chart."
diff --git a/apps/docs/docs/deployment/kubernetes.md b/apps/docs/docs/deployment/kubernetes.md
index bb13ac615..3877816cd 100644
--- a/apps/docs/docs/deployment/kubernetes.md
+++ b/apps/docs/docs/deployment/kubernetes.md
@@ -12,6 +12,14 @@ The supported way to run AiSOC on Kubernetes is the Helm chart shipped at [`infr
git clone https://github.com/beenuar/AiSOC.git
cd AiSOC
+# The chart depends on the Bitnami postgresql and redis charts. A clean
+# machine has no repository definitions, so `helm dependency update` fails
+# with "no repository definition for https://charts.bitnami.com/bitnami"
+# before it starts. This line was missing, which meant the documented
+# Kubernetes path failed at its first command.
+helm repo add bitnami https://charts.bitnami.com/bitnami
+helm repo update
+
helm dependency update infra/helm/aisoc
helm install aisoc infra/helm/aisoc \
diff --git a/docs/audit/CLAIM_TO_GATE_MATRIX.md b/docs/audit/CLAIM_TO_GATE_MATRIX.md
index 6afb0e317..0cd547b8e 100644
--- a/docs/audit/CLAIM_TO_GATE_MATRIX.md
+++ b/docs/audit/CLAIM_TO_GATE_MATRIX.md
@@ -16,7 +16,7 @@ Statuses: `GATED` (a CI job fails when the claim stops being true) · `PARTIAL`
| Investigation Ledger stores every step | README L61, L169 | `ci.yml :: api tests` (`audit_hash`, audit immutability) | PARTIAL (write path gated; UI replay only in hermetic e2e) | Phase 3.2 |
| Public eval harness gates every PR | README L62, L77 | `ci.yml :: p1-eval` | GATED (but suites are self-consistency; see reality report) | Phase 4 |
| Alert-reduction is a real measurement | README / benchmark page | `ci.yml :: python-test` (fusion) runs `test_alert_reduction_real.py`, which groups a 1 000-alert stream with `RawAlert.correlation_key()` — the method `Correlator` actually calls — and bounds the ratio on both sides, because a floor alone is satisfied by a key that collapses everything into one incident | GATED | the legacy suite's 75.3% stays published for continuity and is labelled as not describing this product; the measurement is still a synthetic workload, as the benchmark page states |
-| Runs entirely on your infrastructure / no data exfiltration | README L63 | `ci.yml :: python-test` (agents) runs `test_privacy_redactor.py` (zero raw PII survives) | PARTIAL (redaction gated; the CLI now has no default telemetry endpoint and `telemetry.test.ts` pins that an enabled-but-unconfigured run makes zero network calls; platform-wide air-gapped egress-blocked CI + Helm NetworkPolicy still outstanding) | Phase 2 |
+| Runs entirely on your infrastructure / no data exfiltration | README L63 | `ci.yml :: python-test` (agents) runs `test_privacy_redactor.py` (zero raw PII survives) | PARTIAL (redaction gated; the CLI now has no default telemetry endpoint and `telemetry.test.ts` pins that an enabled-but-unconfigured run makes zero network calls; **v9.0 adds the Helm egress default-deny** — `infra/helm/aisoc/templates/networkpolicy.yaml`, gated by `helm.yml` which asserts it denies by default, excludes `169.254.169.254/32` from every allowed CIDR, and stays opt-in because a CNI that does not enforce NetworkPolicy ignores it silently; platform-wide air-gapped egress-blocked CI still outstanding) | Phase 2 |
| Detection-as-Code rejects candidates that regress MITRE accuracy | README L170 | `ci.yml :: python-test` (`test_detection_eval.py` — candidate `rule_body` run through the real engine vs its own positive/negative fixtures; approval requires it) + `p1-eval` w2-dac baseline | GATED | - |
| 800+ native detection rules | README L78, L170 | `validate-detections.yml` (strict fixture replay) | GATED | - |
| 6000+ imported detection rules | README L78 | `validate-detections.yml` (parse/provenance + `detection_truth_table.py --check`); README cites the executable figure (939) not the on-disk figure for coverage | GATED | - |
diff --git a/infra/helm/.gitignore b/infra/helm/.gitignore
new file mode 100644
index 000000000..f357b5957
--- /dev/null
+++ b/infra/helm/.gitignore
@@ -0,0 +1 @@
+aisoc/charts/
diff --git a/infra/helm/aisoc/Chart.lock b/infra/helm/aisoc/Chart.lock
new file mode 100644
index 000000000..f880490b5
--- /dev/null
+++ b/infra/helm/aisoc/Chart.lock
@@ -0,0 +1,9 @@
+dependencies:
+- name: postgresql
+ repository: https://charts.bitnami.com/bitnami
+ version: 13.4.4
+- name: redis
+ repository: https://charts.bitnami.com/bitnami
+ version: 18.19.4
+digest: sha256:2907a6719690caad0ae3e3a051df2b6be0b19fc57851d6b215d9ac17cee95059
+generated: "2026-09-23T14:47:49.879013-07:00"
diff --git a/infra/helm/aisoc/templates/networkpolicy.yaml b/infra/helm/aisoc/templates/networkpolicy.yaml
new file mode 100644
index 000000000..ada2815d2
--- /dev/null
+++ b/infra/helm/aisoc/templates/networkpolicy.yaml
@@ -0,0 +1,71 @@
+{{- if .Values.networkPolicy.enabled }}
+{{- /*
+ Egress default-deny.
+
+ README says AiSOC "runs entirely on your infrastructure — no data
+ exfiltration". The redaction half of that was gated (`test_privacy_redactor`
+ proves no raw PII survives), and the network half was not: nothing stopped a
+ pod opening a socket to anywhere. A claim about where data goes is a claim
+ about egress, and redaction is what happens to data that is *about* to go
+ somewhere.
+
+ This policy is opt-in (`networkPolicy.enabled`) rather than on by default,
+ because a cluster with no CNI that enforces NetworkPolicy silently ignores
+ it — and a control that is silently ignored is worse than one an operator
+ consciously turned on. The values file says so at the switch.
+
+ What is allowed out, and nothing else:
+ - DNS, or nothing resolves
+ - other AiSOC pods, by release label
+ - the CIDRs an operator declares in `networkPolicy.allowedEgressCIDRs`,
+ which is where a vendor API or an LLM endpoint goes
+
+ Cloud metadata is excluded from every allowed CIDR below, because
+ 169.254.169.254 sits inside the link-local range an operator would
+ otherwise wave through without thinking about it.
+*/}}
+apiVersion: networking.k8s.io/v1
+kind: NetworkPolicy
+metadata:
+ name: {{ include "aisoc.fullname" . }}-egress
+ labels:
+ {{- include "aisoc.labels" . | nindent 4 }}
+spec:
+ podSelector:
+ matchLabels:
+ {{- include "aisoc.selectorLabels" . | nindent 6 }}
+ policyTypes:
+ - Egress
+ egress:
+ # DNS. Without this nothing resolves, including in-cluster service names.
+ - to:
+ - namespaceSelector: {}
+ podSelector:
+ matchLabels:
+ k8s-app: kube-dns
+ ports:
+ - protocol: UDP
+ port: 53
+ - protocol: TCP
+ port: 53
+
+ # Other pods in this release: the datastores and the sibling services.
+ - to:
+ - podSelector:
+ matchLabels:
+ app.kubernetes.io/instance: {{ .Release.Name }}
+
+ {{- with .Values.networkPolicy.allowedEgressCIDRs }}
+ # Operator-declared destinations: vendor APIs, an LLM endpoint, a SIEM.
+ - to:
+ {{- range . }}
+ - ipBlock:
+ cidr: {{ . | quote }}
+ except:
+ # The metadata service is never a legitimate destination for
+ # this workload, and it sits inside ranges an operator would
+ # otherwise allow wholesale.
+ - 169.254.169.254/32
+ {{- end }}
+ {{- end }}
+{{- end }}
diff --git a/infra/helm/aisoc/values.yaml b/infra/helm/aisoc/values.yaml
index 56750e7af..b49ec40d8 100644
--- a/infra/helm/aisoc/values.yaml
+++ b/infra/helm/aisoc/values.yaml
@@ -435,8 +435,20 @@ coreApi:
enabled: false # Replaced by services.api above
# ─── Network Policies ─────────────────────────────────────────────────────────
+#
+# Egress default-deny. This is the network half of "runs entirely on your
+# infrastructure": the redaction half is gated by test_privacy_redactor, and
+# until v9.0 nothing stopped a pod opening a socket to anywhere.
+#
+# Off by default on purpose. A cluster whose CNI does not enforce
+# NetworkPolicy ignores this object silently, and a control that is silently
+# ignored is worse than one an operator consciously switched on — it reads as
+# protection while providing none. Check your CNI, then set this.
networkPolicy:
enabled: false
+ # Destinations reachable outside the release: vendor APIs, an LLM endpoint,
+ # a SIEM. 169.254.169.254 is excluded from each of these automatically.
+ allowedEgressCIDRs: []
# ─── Pod Security ─────────────────────────────────────────────────────────────
podSecurityPolicy: