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.

Bound the twelve packages the wave-1 test job installed with no version at all (#866)

Beenu Arora5a682764f9dd
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 14690ccec..a949a318e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -925,9 +925,39 @@ jobs:
# `sqlalchemy` installed it by accident and this list passed for
# months without declaring what it depended on. SQLAlchemy 2.1.0
# dropped that clause, the unbounded install re-resolved onto it, and
- # the import died at collection. Bounding the range is the second half:
- # unbounded, any upstream release lands here before anyone reads it.
- run: pip install --quiet pydantic pydantic-settings pytest pytest-asyncio structlog redis aioredis "fastapi>=0.117,<0.142" httpx aiokafka asyncpg clickhouse-driver pyyaml "cryptography>=46,<51" "sqlalchemy[asyncio]>=2,<3"
+ # the import died at collection.
+ #
+ # Bounding the rest is that second half, done. Twelve packages here
+ # named no version at all, which is the same defect the `sqlalchemy`
+ # outage was: an unbounded install resolves whatever upstream shipped
+ # this morning, and the first anyone hears of it is a red `main` on a
+ # pull request that changed nothing. Every bound below is the range the
+ # three services under test declare, so this job installs what they
+ # ship rather than what PyPI happens to be serving:
+ #
+ # pydantic / pydantic-settings / structlog / aioredis / aiokafka /
+ # asyncpg / clickhouse-driver — services/fusion, which is the
+ # tightest of the three.
+ # pytest / pytest-asyncio — services/fusion's dev group; the
+ # other two leave them unbounded.
+ # pyyaml — services/purple-team, and
+ # services/api agrees.
+ # redis — services/fusion, *with* the
+ # `[hiredis]` extra it declares. The
+ # bare name here was the sqlalchemy
+ # shape again: an install path
+ # dropping an extra the manifest asks
+ # for installs a smaller set than
+ # ships.
+ # httpx — see below. The three did not agree.
+ run: >-
+ pip install --quiet
+ "pydantic>=2.5,<3" "pydantic-settings>=2.1,<3"
+ "pytest>=9.0.3,<10" "pytest-asyncio>=1.0,<2"
+ "structlog>=24.1,<25" "redis[hiredis]>=5.0.1,<6" "aioredis>=2.0.1,<3"
+ "fastapi>=0.117,<0.142" "httpx>=0.27,<0.29" "aiokafka>=0.10,<0.11"
+ "asyncpg>=0.29,<0.30" "clickhouse-driver>=0.2.6,<0.3" "pyyaml>=6,<7"
+ "cryptography>=46,<51" "sqlalchemy[asyncio]>=2,<3"
- name: Install pytest-cov (Phase 2.2 coverage gate)
run: pip install --quiet 'pytest-cov>=4,<7'
# Phase 2.2 — every wave-1 service now has a measured coverage
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 895026ae0..b4d35ed2f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -102,6 +102,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
failed, which only happens for a malformed URL — the one error in that
loop no retry can clear. It now says so and stops.
+### Fixed
+
+- **The wave-1 service-test job installed twelve packages with no version
+ bound, which is the outage that already happened, still loaded.** A CI job
+ pip-installing a hand-curated list named a bare, unbounded `sqlalchemy` and
+ passed for months only because a platform marker happened to pull
+ `greenlet`; when 2.1.0 deleted that clause, every import of
+ `sqlalchemy.ext.asyncio` began failing at collection. That one was bounded.
+ The other twelve in the same list were not, and the job's own comment said
+ so — *"Bounding the range is the second half: unbounded, any upstream
+ release lands here before anyone reads it."* `pydantic`,
+ `pydantic-settings`, `pytest`, `pytest-asyncio`, `structlog`, `redis`,
+ `aioredis`, `httpx`, `aiokafka`, `asyncpg`, `clickhouse-driver` and `pyyaml`
+ now carry the range the three services under test declare, so the job
+ installs what they ship rather than whatever PyPI is serving this morning.
+
+ Two things fell out of doing it, both pre-existing and both invisible while
+ the install was unbounded. `redis` was installed bare while
+ `services/fusion` declares `redis[hiredis]` — the same dropped-extra shape
+ as the `sqlalchemy` break, an install path quietly installing a smaller set
+ than ships. And the three manifests **could not be satisfied at once**:
+ `services/fusion` declared `httpx = "^0.26.0"` while `honeytokens` and
+ `purple-team` declare `>=0.27.0`. The unbounded install resolved 0.28.1, so
+ fusion was being tested on a version its own manifest forbade and shipping
+ 0.26.0 — tested and shipped were different software, which is the exact
+ thing `check_dependency_pins.py` exists to prevent. fusion moves to
+ `>=0.27,<0.29`, matching api / actions / mesh / osquery-tls / slack-bot /
+ teams-bot, and its lock re-resolves to 0.28.1 so the three now agree and the
+ job tests what fusion ships. All three suites pass on the bounded set
+ (fusion 308, honeytokens 66, purple-team 100, every coverage floor met).
+
+ Still unbounded and reported rather than silently fixed: `services/connectors`
+ and `services/threatintel` also declare `httpx = "^0.26.0"`, and neither is
+ in this job.
+
### Changed
- **`mypy` moved to 2.3.1 across all ten declarations, and the baseline it
diff --git a/services/fusion/poetry.lock b/services/fusion/poetry.lock
index a39b04aa5..2aca57b69 100644
--- a/services/fusion/poetry.lock
+++ b/services/fusion/poetry.lock
@@ -929,14 +929,14 @@ files = [
[[package]]
name = "httpx"
-version = "0.26.0"
+version = "0.28.1"
description = "The next generation HTTP client."
optional = false
python-versions = ">=3.8"
groups = ["main"]
files = [
- {file = "httpx-0.26.0-py3-none-any.whl", hash = "sha256:8915f5a3627c4d47b73e8202457cb28f1266982d1159bd5779d86a80c0eab1cd"},
- {file = "httpx-0.26.0.tar.gz", hash = "sha256:451b55c30d5185ea6b23c2c793abf9bb237d2a7dfb901ced6ff69ad37ec1dfaf"},
+ {file = "httpx-0.28.1-py3-none-any.whl", hash = "sha256:d909fcccc110f8c7faf814ca82a9a4d816bc5a6dbfea25d6591d6985b8ba59ad"},
+ {file = "httpx-0.28.1.tar.gz", hash = "sha256:75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc"},
]
[package.dependencies]
@@ -944,13 +944,13 @@ anyio = "*"
certifi = "*"
httpcore = "==1.*"
idna = "*"
-sniffio = "*"
[package.extras]
brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""]
cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"]
http2 = ["h2 (>=3,<5)"]
socks = ["socksio (==1.*)"]
+zstd = ["zstandard (>=0.18.0)"]
[[package]]
name = "idna"
@@ -2076,18 +2076,6 @@ files = [
{file = "six-1.17.0.tar.gz", hash = "sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81"},
]
-[[package]]
-name = "sniffio"
-version = "1.3.1"
-description = "Sniff out which async library your code is running under"
-optional = false
-python-versions = ">=3.7"
-groups = ["main"]
-files = [
- {file = "sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2"},
- {file = "sniffio-1.3.1.tar.gz", hash = "sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc"},
-]
-
[[package]]
name = "sqlalchemy"
version = "2.0.54"
@@ -2591,4 +2579,4 @@ files = [
[metadata]
lock-version = "2.1"
python-versions = "^3.11"
-content-hash = "aa83a6ec8a10a5b9c20ddf3dfc796194aa213eb004d3b5a2d46b53747cc6a52f"
+content-hash = "f1429e2a7ea8ffa949e1fb47576e14e6f30bdd2f52fd6a05ebc0335361856cd2"
diff --git a/services/fusion/pyproject.toml b/services/fusion/pyproject.toml
index 8427e75e2..78e716bec 100644
--- a/services/fusion/pyproject.toml
+++ b/services/fusion/pyproject.toml
@@ -25,7 +25,14 @@ asyncpg = "^0.29.0"
sqlalchemy = {extras = ["asyncio"], version = "^2.0.25"}
structlog = "^24.1.0"
prometheus-client = "^0.19.0"
-httpx = "^0.26.0"
+# `>=0.27,<0.29`, matching api / actions / mesh / osquery-tls / slack-bot /
+# teams-bot, because the CI job that runs this service's tests also runs
+# honeytokens' and purple-team's and both of those declare `>=0.27.0`. While
+# this line read `^0.26.0` the three could not be satisfied at once, and the
+# job papered over it by installing httpx with no bound at all: fusion was
+# tested on 0.28.1, a version its own manifest forbade, and shipped 0.26.0.
+# Bounding the job made that unavoidable rather than creating it.
+httpx = ">=0.27,<0.29"
python-dateutil = "^2.8.2"
simhash = "^2.1.2"
scikit-learn = "^1.4.0"