Expand rootkit monitoring and Claude docs
This commit is contained in:
parent
a7129e5666
commit
3e5f8fc3f7
16 changed files with 524 additions and 32 deletions
|
|
@ -82,6 +82,20 @@ class TestDataLayer(unittest.TestCase):
|
|||
self.assertEqual(plan["incident_id"], iid)
|
||||
self.assertEqual(plan["mode"], "dry-run")
|
||||
|
||||
def test_posture_report_shape(self):
|
||||
def runner(_cfg):
|
||||
yield Alert(Severity.HIGH, "ssh_root_login", "k",
|
||||
"root SSH login enabled", sid=100040,
|
||||
classtype="host-posture")
|
||||
yield Alert(Severity.MEDIUM, "sudo_nopasswd", "k2",
|
||||
"passwordless sudo", sid=100043,
|
||||
classtype="host-posture")
|
||||
|
||||
report = web.posture_report(self.cfg, runner=runner)
|
||||
self.assertEqual(report["count"], 2)
|
||||
self.assertEqual(report["counts"], {"HIGH": 1, "MEDIUM": 1})
|
||||
self.assertEqual(report["findings"][0]["signature"], "ssh_root_login")
|
||||
|
||||
|
||||
class TestNetworkHelpers(unittest.TestCase):
|
||||
def test_is_loopback(self):
|
||||
|
|
@ -153,6 +167,12 @@ class TestAuth(unittest.TestCase):
|
|||
resp = self._get("/api/alerts?token=secret-token")
|
||||
self.assertEqual(resp.status, 200)
|
||||
|
||||
def test_posture_endpoint(self):
|
||||
resp = self._get("/api/posture", token="secret-token")
|
||||
data = json.loads(resp.read())
|
||||
self.assertIn("findings", data)
|
||||
self.assertIn("count", data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue