Add host correlation and assurance coverage

This commit is contained in:
Luna 2026-07-10 03:07:00 -07:00
parent 8194d13734
commit b40ac4252c
No known key found for this signature in database
36 changed files with 944 additions and 23 deletions

View file

@ -9,7 +9,7 @@ from io import StringIO
from pathlib import Path
from unittest.mock import patch
from enodia_sentinel import incident, reconcile, respond, schemas, snapshot, web
from enodia_sentinel import assurance, incident, reconcile, respond, schemas, snapshot, web
from enodia_sentinel.alert import Alert, Severity
from enodia_sentinel.cli import main
from enodia_sentinel.config import Config
@ -134,6 +134,7 @@ class TestSchemaContracts(unittest.TestCase):
"lineage": list,
"snapshots": list,
"alert_count": int,
"correlations": list,
})
view = web.get_incident(self.cfg, iid)
@ -215,9 +216,26 @@ class TestSchemaContracts(unittest.TestCase):
"watchdog": dict,
"anchors": dict,
"sentinel_footprint": dict,
"hash_chain": dict,
"read_only": bool,
})
def test_hash_chain_v1_contract(self):
artifact = self.tmp / "artifact.json"
artifact.write_text("{}")
record = assurance.append_artifact(self.cfg, "test-artifact", artifact)
self.assertEqual(record["schema"], schemas.HASH_CHAIN_V1)
_assert_types(self, record, {
"schema": str,
"time": float,
"kind": str,
"path": str,
"size": int,
"sha256": str,
"prev_hash": str,
"chain_hash": str,
})
def test_response_plan_and_audit_contracts(self):
iid = self._record_incident_with_snapshot()
bundle = respond.load_bundle(self.cfg, iid)