diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5341f13..91ae89d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -28,6 +28,8 @@ jobs: node-version: 22 cache: npm cache-dependency-path: frontend/package-lock.json + - name: Validate standalone Compose + run: docker compose config --quiet - name: Validate backend shell: bash run: | diff --git a/Dockerfile b/Dockerfile index d742610..783b8bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,7 +26,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 ENV EVENTLENS_FRONTEND_DIR=/app/frontend-dist ENV TMPDIR=/tmp -RUN apk add --no-cache 'libuuid=2.42.3-r1' \ +RUN apk upgrade --no-cache \ + && apk add --no-cache 'libuuid=2.42.3-r1' \ && addgroup -S -g 10001 eventlens \ && adduser -S -D -H -u 10001 -G eventlens -s /sbin/nologin eventlens diff --git a/PUBLIC_SOURCE_EXPORT.md b/PUBLIC_SOURCE_EXPORT.md index dc61391..2a81f1e 100644 --- a/PUBLIC_SOURCE_EXPORT.md +++ b/PUBLIC_SOURCE_EXPORT.md @@ -1,3 +1,3 @@ # Public source export -This source snapshot was generated from the private canonical repository at revision `8f9b57a425e88c7efda5bba3212d1c8aae5b4d02`. It contains no private Git history or operational evidence. Changes are published from the canonical repository. +This source snapshot was generated from the private canonical repository at revision `6a2ca12f81a2dcf816c61a86bd8811fcc95e8d8d`. It contains no private Git history or operational evidence. Changes are published from the canonical repository. diff --git a/PUBLIC_SOURCE_MANIFEST.json b/PUBLIC_SOURCE_MANIFEST.json index 8e2f708..49eba0c 100644 --- a/PUBLIC_SOURCE_MANIFEST.json +++ b/PUBLIC_SOURCE_MANIFEST.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "sourceRevision": "8f9b57a425e88c7efda5bba3212d1c8aae5b4d02", + "sourceRevision": "6a2ca12f81a2dcf816c61a86bd8811fcc95e8d8d", "files": [ { "path": ".dockerignore", @@ -9,8 +9,8 @@ }, { "path": ".gitea/workflows/ci.yml", - "sha256": "d2da54058d2caf5095dffc4782376ed3734ab1b58ff6497ca2eb9ea021fb932b", - "bytes": 1322 + "sha256": "82d644d6877d6a4625ff3712ebf6363731a64d83aad7e8261b9217bf70180421", + "bytes": 1407 }, { "path": ".gitignore", @@ -19,8 +19,8 @@ }, { "path": "Dockerfile", - "sha256": "17bc8f55bbd2351ba1936ec81019a048e05c20c27507a1066a726439c117771f", - "bytes": 1853 + "sha256": "fce2f2d6519eb9e7849ee533bb9fdb997ead59c98c3e05fc742b67e8568d761e", + "bytes": 1885 }, { "path": "Makefile", @@ -29,8 +29,8 @@ }, { "path": "README.md", - "sha256": "5e8961597355247bf20df8424f60a694d0b94c3281407f3b91d0b034c42c2731", - "bytes": 10087 + "sha256": "6d070f74b9572b423ebb5f37bc2d5fc3681a82ac17a05ac2c19f8b79c2d5e867", + "bytes": 10252 }, { "path": "SECURITY.md", @@ -39,7 +39,7 @@ }, { "path": "VERSION", - "sha256": "51c18dc8694861beb47a67894e61044864214435389f6d3a274704d9566ff96c", + "sha256": "1575e1af4a95f12f70b4ee6a6adce8160953d93ea17dc2611b90883ccc3ad3b8", "bytes": 6 }, { @@ -49,8 +49,8 @@ }, { "path": "backend/app/correlate.py", - "sha256": "0a0e5050e66629716c0d236c98e1e0c805bef0a2817fa334f885df613083dd70", - "bytes": 12470 + "sha256": "a31fa11894426e9e7dc7ca2ce42fd0533920094bc9aacc9e4d746f887001ac4a", + "bytes": 25294 }, { "path": "backend/app/demo.py", @@ -59,23 +59,23 @@ }, { "path": "backend/app/main.py", - "sha256": "4858dc69de23fba45ca61f18495d5bfb5d02c441f80fac33aebd5b86b53c0ebe", - "bytes": 11411 + "sha256": "d02086c0940a1c6e2e63ea8dd987ac36a5ad73218475df4521684ed91e90b48f", + "bytes": 13631 }, { "path": "backend/app/models.py", - "sha256": "8ae8512d721e8258611eefe6e9badee9aefa0e18bacfcdd6150b491a010f9b3a", - "bytes": 2912 + "sha256": "a36482a8c4ff0bd8af5de85fd3cd270521c9669d3a4985cd640c009241c3386e", + "bytes": 4048 }, { "path": "backend/app/normalize.py", - "sha256": "022a8c77e2de072700f8bd63a56de394ed4a71760b664d72532d2ff68353cf52", - "bytes": 10479 + "sha256": "9ee4ac09dd254f94051f27bf9b3764f0bf74fcff9fe38c9e44703c8c93dadd7b", + "bytes": 13442 }, { "path": "backend/app/parser.py", - "sha256": "ee30330c92cae8d9fd7106e798a98d4371a8766894df823dd742f30c63d2ca22", - "bytes": 8355 + "sha256": "9a923331a7f22902e7e027e5f8511a7ffbc64e7b90bf703729d834b67b246cf9", + "bytes": 8570 }, { "path": "backend/app/version.py", @@ -84,7 +84,7 @@ }, { "path": "backend/pyproject.toml", - "sha256": "00cf1e47d79a0c1b2d5fd7ea2179231c8e3db4670828d750d3f67a16fe0b7097", + "sha256": "4636893f7b2ba72a6a2d604ed8983f86bcb6692dbe793bb549f028e8f2812822", "bytes": 493 }, { @@ -97,6 +97,11 @@ "sha256": "3c86e9de65b41dc907cdd646d0dd35ed6196a60291698286c2750c92d3c04eba", "bytes": 6610 }, + { + "path": "backend/tests/test_audit_improvements.py", + "sha256": "d39b5d45c1af218af00c5e0c41bb5bef476e3e647f795a5518eef90d094ed520", + "bytes": 12570 + }, { "path": "backend/tests/test_correlation.py", "sha256": "c13a6046ca7a104dec01156aeddba7dd273dfdc3c31b2fe727c10075815a07d3", @@ -117,6 +122,11 @@ "sha256": "4043c1091ba7897249f0764a27a749a0344eec443d43087bdfcdb2cd937a28b7", "bytes": 997 }, + { + "path": "backend/tests/test_performance.py", + "sha256": "00fda8ff70b192cde735306ce380aef33f0b8651b3f4735d3c20e272b3ea53aa", + "bytes": 4675 + }, { "path": "backend/tests/test_post_v1_hardening.py", "sha256": "6a8a1774c9c16ce42397f4ae700ede9f77ae75dd6a50fcc77deef41ef862ba85", @@ -129,48 +139,53 @@ }, { "path": "backend/uv.lock", - "sha256": "b5fbd41e4fba64e79799e1412a5f91c426c8e5e7fcd0b0df8c1768757180cda9", - "bytes": 235409 + "sha256": "8c7d9d14daa3c9e029a91238ad48da7968745868c8fe1056038e9bec3a028a83", + "bytes": 236374 }, { "path": "docker-compose.yml", - "sha256": "7650ac8db82abc276df314c0cb4bdec5b5bb83be17190e3f16a72400efb01f84", - "bytes": 666 + "sha256": "af10bbae7a8b754e71970deec44c127645def2b8202de84101f713e8bbd728e6", + "bytes": 695 }, { "path": "docs/ARCHITECTURE.md", - "sha256": "730281d8ffed30ce5ff8e2c75f5e17e6e6a2f969f90707516c985f598ca9d847", - "bytes": 3902 + "sha256": "c5bb5cc22753a5f518539812a2cacd673ba1b954c323b721bae3b595db5eae45", + "bytes": 4011 }, { "path": "docs/CORRELATION.md", - "sha256": "7358216d20bf780994b36ddaad4790c71ebc561959dbfcfe6eec2c41a87f2b3b", - "bytes": 3797 + "sha256": "ebc1d95e832b1e493c8d3de919a0387a6cad074a0eebe16ee2c9466f6ce3d05a", + "bytes": 6992 }, { "path": "docs/PRIVACY.md", - "sha256": "22b2887bf0e3bf99654d9350188daec617ea38255f89c03cd1e70ea77580d876", - "bytes": 3127 + "sha256": "e973006e6c05f5e9f53130e7f5bf76c5a9362614a54c1c1db3d4bb6ace354159", + "bytes": 4310 }, { "path": "docs/assets/eventlens-demo-overview.png", - "sha256": "c24060588edb7004eac6cbd3b2164d84911d868bbc15d7c1deb7eec4faf558a5", - "bytes": 285470 + "sha256": "d9e0e3f8783d94667ff66a27302f10b56b3c6f84703d5285fc5dafb80af61b43", + "bytes": 674596 }, { "path": "docs/assets/eventlens-redaction-export.png", - "sha256": "5bed3e7ee9b3e1f96465a9f127a9ac18e358c02f23271478eb5734f05fdd6af0", - "bytes": 265967 + "sha256": "adaab7eac081563c599067c9aed0352e19821ebb695b271e40c5b77ad5a0b570", + "bytes": 298180 + }, + { + "path": "frontend/.prettierrc.json", + "sha256": "4752a235d1f2814dca17798159419f73def1f49b8075a1fbea26556dc439736f", + "bytes": 47 }, { "path": "frontend/e2e/accessibility.spec.ts", - "sha256": "5998b134062bd595cfb3ea65c24fb6ead3d1c5a7936f7a7d264e37257baf29c0", - "bytes": 2214 + "sha256": "45ce5aee90ad64d50824f015bee2650d8cd1d134481fa37aa12c72879dd4c8f5", + "bytes": 2240 }, { "path": "frontend/e2e/api-contract.spec.ts", - "sha256": "c4c98acdd0d22b887da0609310bf9b7cb4b10b1588ee3cb81ebfba4198683241", - "bytes": 3291 + "sha256": "f70bc171eddc65606a5be5ef566925b62733f57a560d7244614551db04a9fb9b", + "bytes": 3381 }, { "path": "frontend/e2e/branding.spec.ts", @@ -179,17 +194,17 @@ }, { "path": "frontend/e2e/eventlens.spec.ts", - "sha256": "1537f595e5ae5ef612c2697fe801bcb66c7f5705aba38370a48ba592a8be0827", - "bytes": 2702 + "sha256": "4725a6dc0a8002d3c75765ec1aa0aae16aea38c91efe142469ffbc1b5fd2cb57", + "bytes": 2720 }, { "path": "frontend/e2e/partial-and-error.spec.ts", - "sha256": "23ecb9ef44a8dee31aabaaaeb311390a31196c261ad1ec65608f2e25d205b6c3", - "bytes": 2412 + "sha256": "f850752ccd5dd7da37e3541fe325974bffa9c0143c3511b89c45f591c993ef70", + "bytes": 2662 }, { "path": "frontend/e2e/portfolio-assets.spec.ts", - "sha256": "beb4c7dd354bf8244517ef32120986d8a4fe33f61f1317669c7cc86c49837341", + "sha256": "78dacc4b0b64bf9210964e39341add1fe934834b38a908a78a45afe34b04770b", "bytes": 1870 }, { @@ -199,13 +214,13 @@ }, { "path": "frontend/e2e/responsive.spec.ts", - "sha256": "9cf6947caefd9a8ca89cb341751784ae0d714e967bb77da2fd6ccea8562e8bab", - "bytes": 1180 + "sha256": "147c1fb566f68f584fca549c3900319df385c2d4ee4d008161e6818f43aaa403", + "bytes": 1325 }, { "path": "frontend/e2e/settings-storage-failure.spec.ts", - "sha256": "fb0269aa65e27c5668c54b171d1c0e73358ba0e82cdc36fa919b9481b5595a17", - "bytes": 1548 + "sha256": "a93e0d5a01e49da8a8e66d6306249de87b82ece05c94999a43b5a4519d7ef1f1", + "bytes": 1557 }, { "path": "frontend/e2e/settings.spec.ts", @@ -214,13 +229,13 @@ }, { "path": "frontend/e2e/virtualization.spec.ts", - "sha256": "d14a4914988e0d971c26ec66c87b7cb0d9b11de543892ca920ebb28973aba731", - "bytes": 1411 + "sha256": "71c351820aa9be7836b49dbde1833738feaf6d9ef63ff6ecf71ea66ca88be452", + "bytes": 1496 }, { "path": "frontend/e2e/workspace.spec.ts", - "sha256": "ce6153b084d3c6ae6ba280a6b1663b95bb5d14eb71c6aa3ca7246a05514c968b", - "bytes": 4529 + "sha256": "27ef8cb4d3662dcc4b615cada47219c17a3b9434423c52c96928a300a1fecf71", + "bytes": 4530 }, { "path": "frontend/eslint.config.mjs", @@ -234,13 +249,13 @@ }, { "path": "frontend/package-lock.json", - "sha256": "2df5851a6e2a0da42cc046fca58b4c483bf8cf5cac2513761726992a46d2db07", - "bytes": 193055 + "sha256": "7d22d62cce13dd76b1a30bcda0f94d2404a5514659e72efffe04d5bc89fd197f", + "bytes": 193540 }, { "path": "frontend/package.json", - "sha256": "83d5fb76468d3fb8825f419817bb3ee452fafb3b618d675439988fcbdb43f259", - "bytes": 774 + "sha256": "6dd90d6931474d7166e2772ec672f0c7195b73a8e0baf1c33467f8144561e1f0", + "bytes": 869 }, { "path": "frontend/playwright.config.ts", @@ -279,128 +294,148 @@ }, { "path": "frontend/src/app/App.tsx", - "sha256": "5a605de7d22d01a0e82c77690ce3fa831da8a46d6861cc1a82a78a4b6eb18af6", - "bytes": 16490 + "sha256": "37469c64b40d92b7532935b400ddde65a03ba171e62a1a60e3d0d13a6e7086ef", + "bytes": 21348 }, { "path": "frontend/src/app/format.ts", - "sha256": "3b006879ff2eeaafabbbccde0dd06c8695a5275788e1063c0adb46143ed73fbc", - "bytes": 2712 + "sha256": "8adbe1f33fd5cee549ffac987488b31a3e02a9656491a2c49250bf1314269a50", + "bytes": 2969 + }, + { + "path": "frontend/src/app/indexes.ts", + "sha256": "0f0ab79633b61d36001fcb420b123a4dab4e3cb33dd8ece1f581740ee5c74de3", + "bytes": 1603 }, { "path": "frontend/src/app/model.ts", - "sha256": "659dab5db49da5a3ff6f8f6ec2a7358cbbb9d6085814e2c8b29243c19917c491", - "bytes": 2773 + "sha256": "1daacacccbc22f1de8dd48286f503bcab419603ea0ffed12c0519d458fc4a7e2", + "bytes": 3062 }, { "path": "frontend/src/app/validation.test.ts", - "sha256": "e85977b980e40f46ffd33ed46bb48ab1decc42c73374c31c6cd03b37a4367608", - "bytes": 2988 + "sha256": "0bf959ee90744155c40d23fa3116b75d716d0a1aa68adc52f8e6acbed47c2d59", + "bytes": 3104 }, { "path": "frontend/src/app/validation.ts", - "sha256": "1cc56bcdcc9f9f9bc582934493d0b58dc641b9d31846e6d8a22f96c1a39a7147", - "bytes": 4465 + "sha256": "8f999e1795b682c16c2d94a0059ed32b400b0d4eefd3c96338744ff49f8d1c08", + "bytes": 6744 + }, + { + "path": "frontend/src/audit.test.ts", + "sha256": "14295619f79061a3842926ea649fa1ccac3ddc317368a0b4abe7674f0277354b", + "bytes": 7853 }, { "path": "frontend/src/components/icons.tsx", - "sha256": "aa4be3ad6ec59703c90a9ea58d57964002305279dad695b018842e73c5b49560", - "bytes": 3714 + "sha256": "9cc8e3c433cfa5881b5a733b5d708ef2746168bf04fbc92d33464ae60726c3c7", + "bytes": 4408 }, { "path": "frontend/src/components/shell.tsx", - "sha256": "2dab2e7f00179f4aca798c694f51b5587333065cf540e5bec36ec3f009482197", - "bytes": 4577 + "sha256": "ef7bebcb45b0047cf4c67d03435157ca46b3477d21ea7261cfdb95a5199d0a1b", + "bytes": 5502 }, { "path": "frontend/src/components/states.tsx", - "sha256": "f1c124f3f1d71ad0fd050796feb2e6117768eff80033a512e3b9abc6239ce98c", - "bytes": 4818 + "sha256": "01d53d435cf3bf253cb3c6670a4c3a2de0560dba66de8480813426626cb0923c", + "bytes": 5900 }, { "path": "frontend/src/components/timeline.tsx", - "sha256": "1c4f00f8094b5fb961ee5ba0a3accc39ae2a072c42258202198ca8c3abb68881", - "bytes": 14451 + "sha256": "48de3459a4070928aa7da87bfdfbee6d0164b7f50dbff1b4f3d2697e13978004", + "bytes": 21013 }, { "path": "frontend/src/export.test.ts", - "sha256": "4b29b8804b89fa4a24a5a72eae189421d9825413a8f2fe9aff5cef4279afc1ac", - "bytes": 3084 + "sha256": "73d3068054f7432639f701704a152b428b985b91d8ec2d62a5430605bb146f80", + "bytes": 3521 }, { "path": "frontend/src/export.ts", - "sha256": "c9684adc77e1f7f03b65456704da4d98228ed48bcb4a9b45ba3963ad2a1da774", - "bytes": 4723 + "sha256": "defdaaaf09ad6f37fb63a56ed911ed34fe76d91de2ee4af8610e615a25186b5d", + "bytes": 6417 }, { "path": "frontend/src/filter.performance.test.ts", - "sha256": "5dce8af288421b31623113d5b99ed3833d6e534c959c4f125274bb53c9b2f63b", - "bytes": 1065 + "sha256": "391978b421774e3ce1fbdbf3c545c23253a78317b7e9a251684cf432b65a1ee4", + "bytes": 1100 }, { "path": "frontend/src/filter.test.ts", - "sha256": "9b11358017ca756d40f8dfa26501deb13ac29dc311c94a78b1cfcb80c50f6587", - "bytes": 2306 + "sha256": "bf006614726d067def85a3f7dd8da556ebede372f60ed8adaf1789de24e58f42", + "bytes": 2458 }, { "path": "frontend/src/filter.ts", - "sha256": "5079417fd973938cec7d8be4c53f696c32e9b5af856440463c89b6131ece96eb", - "bytes": 2388 + "sha256": "fa4a78e6424388b31331521a08d5581a068f0c7fb2ebfb5ab7ec662400787f37", + "bytes": 2637 }, { "path": "frontend/src/main.tsx", - "sha256": "17bf4515b6bbb2bb45a23a5aad2c0009997431679b766877c97383f38fd3a6b8", - "bytes": 332 + "sha256": "7294c1382bfe63876033c002d4f8a2c0e851279f240dd7a71a490027f9e1603d", + "bytes": 345 }, { "path": "frontend/src/redact.test.ts", - "sha256": "845433d1d3816c41724da85e3c292afae2b9b8c6803fa5686db2b9db42d1c682", - "bytes": 4462 + "sha256": "bdc4a6772b695e7a9f4b0cd0f52a518dcb2a016e6b082c833dcd21595c52d6b7", + "bytes": 4869 }, { "path": "frontend/src/redact.ts", - "sha256": "c0feba977c333d53066e8f13282a4e43c74ecfcad9bbd9a086eab9251e1132c1", - "bytes": 7753 + "sha256": "5411f57dce98be37e4341eef730f0d417a7e636ec5be0f207358ac15963724e2", + "bytes": 10588 + }, + { + "path": "frontend/src/redactClient.ts", + "sha256": "85f37b44b652caf418a60b987f3423191b08818dd20aa063b85b3a0ada6fb55c", + "bytes": 1567 }, { "path": "frontend/src/styles.css", - "sha256": "45595619d70e62e28d11c5696b1173fe3d78db6ec81e273312c24ddc792cbc3e", - "bytes": 42831 + "sha256": "10e2268a4c5074ea65bf6dd4801e60285533f724d4808e0dc5db4b78434dfc6b", + "bytes": 47616 }, { "path": "frontend/src/types.ts", - "sha256": "80eb8a81628f287134af1c10716c0c27a322ec9cf6f6fb6b1ca77634f62a1230", - "bytes": 1162 + "sha256": "7c29818a1ebf6e3987c38b00fcf69b2763b4a2205e9ee5f22b4b78a05cb32b25", + "bytes": 1659 }, { "path": "frontend/src/vite-env.d.ts", "sha256": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5", "bytes": 38 }, + { + "path": "frontend/src/workers/redact.worker.ts", + "sha256": "ff45144c7d73fbff63d9d6e43f6f7593444ae89966fbce411b9a896f27b33555", + "bytes": 196 + }, { "path": "frontend/src/workspaces/AnalysisView.tsx", - "sha256": "8ce9c0e1448222ca158fca4a57783570a1c04d462f42f0b23ab82e64baca15af", - "bytes": 2801 + "sha256": "3946e3a8367b22ecc9bf29cc3f161e71b6209623d769d59f9efcb03075cc89a3", + "bytes": 7283 }, { "path": "frontend/src/workspaces/HuntingView.tsx", - "sha256": "a50dc627a50a46ef574825beb274c0a76c6e44ff012488f16a58ba772ed20bdc", - "bytes": 6336 + "sha256": "1b2711c8028df5fc30632b7b567446ecc7cde153667a6785ab3a17a9b136c54d", + "bytes": 10229 }, { "path": "frontend/src/workspaces/ReportsView.tsx", - "sha256": "c9003a3f8989c92da519f64db1c351044e5f8b5df5c973216ae23e69b22b4a47", - "bytes": 5403 + "sha256": "c5f2c0d8ce86a68ac8df91b30b51674ad5bcf8c6dc782f2368e80cc8a84683fa", + "bytes": 11083 }, { "path": "frontend/src/workspaces/SettingsView.tsx", - "sha256": "3bea2be936f3dcf1fbed7b789953f421b27a13e66dfc43ef9966ba2c6e3f6e69", - "bytes": 7847 + "sha256": "2445bd5d2cf96814b82986b240cb9193ac0540254818c9e4931e7474008c1843", + "bytes": 8919 }, { "path": "frontend/src/workspaces/TimelineView.tsx", - "sha256": "7a051c83fcac216484db4b14edcddd8fb00c1c14372a62ba5462904f8de8b027", - "bytes": 2592 + "sha256": "fb402d530732f1e93a1cc374f943cb0e019c46a1a8a26c5b312a836529289051", + "bytes": 3181 }, { "path": "frontend/tsconfig.json", @@ -409,8 +444,8 @@ }, { "path": "frontend/vite.config.ts", - "sha256": "64afcd7677c678de227f1a86b53d7a4bcf113c9e2cac87612ef5e87c4fa3d8f0", - "bytes": 395 + "sha256": "5467dcf3835ee7a8ca0fae6473ba8f9dd7d2f0b20ac034b122820a38a1f6b238", + "bytes": 430 }, { "path": "frontend/vitest.config.ts", @@ -419,8 +454,8 @@ }, { "path": "samples/demo-events.json", - "sha256": "3b0bd933f0e067c7f2aa1dc620fc92248d7c422ee0a1edf144fc0a53ebc9ed34", - "bytes": 1680 + "sha256": "221ebc497b3880f374f437b0c23e8818eb4d9bc1668f6c51ad545f442b3f76f7", + "bytes": 6782 } ] } diff --git a/README.md b/README.md index 69ab05c..9787657 100644 --- a/README.md +++ b/README.md @@ -18,17 +18,19 @@ It preserves source evidence, makes every grouping explainable, and keeps the an EventLens is deliberately not a SIEM, a full Windows Event Viewer replacement, a cloud platform or an AI product. It has no database, authentication, telemetry, background worker, cloud account or LLM requirement. It focuses on one compact job: reconstructing a bounded incident story from Windows event records. -## v1.0.6 capabilities +## v1.1.0 capabilities - Parses real EVTX in memory with the Rust-backed `evtx` engine. - Enforces a 50 MiB file cap plus a receive-level request cap, 100,000-event cap, cooperative 8-second parse budget and bounded normalized output. - Reports `complete`, `partial` or `failed` parser status with stable issue codes, retained/skipped metrics and export metadata. - Normalizes System, EventData and UserData into a stable evidence contract; unreliable timestamps remain explicit and are never converted to epoch evidence. -- Correlates provider/channel-scoped startup, shutdown, service, DNS, authentication and crash patterns using stable rule IDs, incident IDs and evidence event IDs. +- Correlates provider/channel-scoped startup, shutdown, service failure and installation, DNS, failed sign-in, password-spray, lockout, account-change, log-clearing and crash patterns using stable rule IDs, incident IDs and evidence event IDs. - Keeps unmatched warning/error evidence visible and compresses repeated signatures without deleting source events. +- Summarizes sustained activity in campaigns that link adjacent incident windows for the same rule and key. +- Shows the uploaded file’s SHA-256 and size in Reports and exports. - Supports drag/drop, search, category/level/provider filters, informational-noise suppression, incident focus and ±1/5/15/60-minute evidence windows. - Shows the rule, reason, time window and exact evidence IDs behind each incident. -- Exports semantically equivalent JSON and Markdown in the browser. Redaction is enabled by default and previews host, identity, e-mail, IP, path and source-name replacement counts before export. +- Exports semantically equivalent JSON and Markdown in the browser. Redaction runs in a Web Worker, uses consistent pseudonyms, and previews replacement counts and unmasked field names before export. - Uses `no-store` responses, security headers, bounded parse concurrency, sanitized source names and no intentional upload persistence. - Virtualizes large timelines so a 100,000-event analysis does not create 100,000 DOM rows. - Includes a deterministic demo fixture plus a pinned-hash public real-EVTX qualification fixture in CI and Playwright. @@ -56,7 +58,7 @@ Redaction is a privacy aid, not a formal DLP engine. Review an export before sha ## Portfolio walkthrough 1. Open the deployed instance or start EventLens locally. -2. Select **Load demo** for a deterministic six-event walkthrough. +2. Select **Load demo** for a deterministic walkthrough that includes a sign-in campaign and account and service changes. 3. Review the source/completeness summary in **Analysis** and select an incident. 4. Investigate the linked evidence in **Timeline** with search, facets, focus and time windows. 5. Use **Hunting** for combined event-ID, provider, category, level, host and incident-membership searches. @@ -130,7 +132,7 @@ The private canonical repository maintains its own validation and deployment wor ## Deployment and access -Compose publishes port 1252 on all host interfaces. For local use, change the mapping to `127.0.0.1:1252:8000`. There is no built-in authentication; use network isolation and an authenticated HTTPS reverse proxy before allowing other users to upload sensitive evidence. Configure the build revision via `GITEA_COMMIT_SHA` when reproducible deployment identity is needed. +Compose binds port 1252 to loopback by default. Configure network isolation and an authenticated HTTPS reverse proxy before exposing it to other users. Set `EVENTLENS_REVISION` at build time when reproducible deployment identity is needed. The screenshots show the deterministic bundled demo, not a real incident or an uploaded customer log. @@ -148,4 +150,4 @@ No project-wide license file is included in this repository. Publishing the sour ## Public source distribution -The private canonical repository remains the development source. Reviewed snapshots are synchronized automatically to `EventLens-Public` after changes reach its default branch. The public export contains application source, dependency locks, generic deployment examples and selected demo visuals; private Git history, infrastructure workflows and operational records are excluded. `PUBLIC_SOURCE_MANIFEST.json` identifies the exact source revision and file hashes. +The private canonical repository remains the development source. Reviewed snapshots are published to `EventLens-Public` from the canonical default branch. The public export contains application source, dependency locks, generic deployment examples and selected demo visuals; private Git history, infrastructure workflows and operational records are excluded. `PUBLIC_SOURCE_MANIFEST.json` identifies the exact source revision and file hashes. diff --git a/VERSION b/VERSION index af0b7dd..9084fa2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.6 +1.1.0 diff --git a/backend/app/correlate.py b/backend/app/correlate.py index 2e92f19..1373e59 100644 --- a/backend/app/correlate.py +++ b/backend/app/correlate.py @@ -3,13 +3,14 @@ from collections.abc import Callable from dataclasses import dataclass from datetime import UTC, datetime, timedelta -from .models import Category, IncidentCluster, NormalizedEvent +from .models import Campaign, Category, IncidentCluster, NormalizedEvent, Severity from .normalize import ( is_application_error, is_dns_client, is_event_log, is_kernel_general, is_kernel_power, + is_log_cleared, is_security_audit, is_service_control_manager, is_windows_error_reporting, @@ -17,18 +18,28 @@ from .normalize import ( TitleBuilder = Callable[[list[NormalizedEvent]], str] ReasonBuilder = Callable[[list[NormalizedEvent]], str] +GroupFilter = Callable[[list[NormalizedEvent]], bool] +Group = tuple[str | None, list[NormalizedEvent]] + +MAX_TITLE_CHARS = 256 +FALLBACK_RULE_ID = "windows.generic.attention" +FALLBACK_WINDOW_SECONDS = 300 +SPRAY_MIN_DISTINCT_ACCOUNTS = 3 +SEVERITY_RANK: dict[str, int] = {"info": 0, "warning": 1, "error": 2, "critical": 3} +LEVEL_SEVERITY: dict[str, Severity] = {"critical": "critical", "error": "error", "warning": "warning"} @dataclass(frozen=True) class Rule: id: str category: Category - severity: str + severity: Severity window_seconds: int predicate: Callable[[NormalizedEvent], bool] key: Callable[[NormalizedEvent], str | None] title_for: TitleBuilder reason_for: ReasonBuilder + accept: GroupFilter | None = None def _field(event: NormalizedEvent, *names: str) -> str: @@ -66,16 +77,36 @@ def _service(event: NormalizedEvent) -> str | None: return _dimension(_field(event, "service", "EventData.param1", "UserData.param1")) +def _new_service(event: NormalizedEvent) -> str | None: + return _dimension(_field(event, "EventData.ServiceName", "service")) + + def _account(event: NormalizedEvent) -> str | None: return _dimension(_field(event, "EventData.TargetUserName", "TargetUserName")) +def _source_ip(event: NormalizedEvent) -> str | None: + return _dimension(_field(event, "EventData.IpAddress", "IpAddress")) + + def _group_key(*dimensions: str | None) -> str | None: if any(value is None for value in dimensions): return None return "|".join(value.casefold() for value in dimensions if value is not None) +def _bounded_title(value: str, fallback: str) -> str: + text = " ".join(value.split()) or fallback + return text if len(text) <= MAX_TITLE_CHARS else f"{text[: MAX_TITLE_CHARS - 1]}…" + + +def _distinct_accounts(evidence: list[NormalizedEvent]) -> int: + return len({account.casefold() for event in evidence if (account := _account(event))}) + + +# --- predicates ------------------------------------------------------------- + + def _crash(event: NormalizedEvent) -> bool: return is_application_error(event.provider, event.channel, event.event_id) or is_windows_error_reporting( event.provider, event.channel, event.event_id @@ -86,6 +117,10 @@ def _service_failure(event: NormalizedEvent) -> bool: return is_service_control_manager(event.provider, event.channel) and event.event_id in {7023, 7024, 7031, 7034} +def _service_installed(event: NormalizedEvent) -> bool: + return is_service_control_manager(event.provider, event.channel) and event.event_id == 7045 + + def _dns_timeout(event: NormalizedEvent) -> bool: return is_dns_client(event.provider, event.channel) and event.event_id == 1014 @@ -94,6 +129,18 @@ def _failed_logon(event: NormalizedEvent) -> bool: return is_security_audit(event.provider, event.channel) and event.event_id == 4625 +def _account_lockout(event: NormalizedEvent) -> bool: + return is_security_audit(event.provider, event.channel) and event.event_id == 4740 + + +def _account_change(event: NormalizedEvent) -> bool: + return is_security_audit(event.provider, event.channel) and event.event_id in {4720, 4728, 4732, 4756} + + +def _log_cleared(event: NormalizedEvent) -> bool: + return is_log_cleared(event.provider, event.channel, event.event_id) + + def _normal_startup(event: NormalizedEvent) -> bool: return (is_kernel_general(event.provider, event.channel) and event.event_id == 12) or ( is_event_log(event.provider, event.channel) and event.event_id == 6005 @@ -112,6 +159,9 @@ def _unexpected_shutdown(event: NormalizedEvent) -> bool: ) +# --- titles and reasons ----------------------------------------------------- + + def _crash_title(evidence: list[NormalizedEvent]) -> str: ids = {event.event_id for event in evidence} if {1000, 1001}.issubset(ids): @@ -139,6 +189,20 @@ def _service_reason(evidence: list[NormalizedEvent]) -> str: return "Service Control Manager reported an abnormal service termination for the same known service and host." +def _service_installed_key(event: NormalizedEvent) -> str | None: + return _group_key(_host(event), _new_service(event)) + + +def _service_installed_title(evidence: list[NormalizedEvent]) -> str: + return "New service installed" if len(evidence) == 1 else "New service installation activity" + + +def _service_installed_reason(evidence: list[NormalizedEvent]) -> str: + if _service_installed_key(evidence[0]) is None: + return "Service Control Manager recorded a service installation (7045); no service/host grouping was applied because a grouping dimension was unavailable." + return "Service Control Manager recorded installation of the same known service on the same host (7045); installation alone is not evidence of malice." + + def _dns_title(evidence: list[NormalizedEvent]) -> str: return "DNS timeout activity" if len(evidence) > 1 else "DNS timeout recorded" @@ -163,6 +227,53 @@ def _auth_reason(evidence: list[NormalizedEvent]) -> str: return "Security Auditing reported failed sign-ins for the same known account and host; this is evidence of activity, not proof of cause." +def _spray_title(evidence: list[NormalizedEvent]) -> str: + return "Failed sign-ins across multiple accounts from one source" + + +def _spray_reason(evidence: list[NormalizedEvent]) -> str: + return ( + f"Security Auditing reported failed sign-ins (4625) for {_distinct_accounts(evidence)} distinct accounts " + "from the same known source address on the same host; this pattern is consistent with, but does not prove, password spraying." + ) + + +def _lockout_title(evidence: list[NormalizedEvent]) -> str: + return "Account lockout" if len(evidence) == 1 else "Repeated account lockouts" + + +def _lockout_reason(evidence: list[NormalizedEvent]) -> str: + if _group_key(_host(evidence[0]), _account(evidence[0])) is None: + return "Security Auditing recorded an account lockout (4740); no account/host grouping was applied because a grouping dimension was unavailable." + return "Security Auditing recorded lockouts (4740) for the same known account on the same host." + + +def _account_change_title(evidence: list[NormalizedEvent]) -> str: + ids = {event.event_id for event in evidence} + if 4720 in ids and ids & {4728, 4732, 4756}: + return "Account created and added to a security group" + if 4720 in ids: + return "User account created" + return "Security group membership changed" + + +def _account_change_reason(evidence: list[NormalizedEvent]) -> str: + if _host(evidence[0]) is None: + return "Security Auditing recorded an account or security-group change; no host grouping was applied because the computer identity was unavailable." + return "Security Auditing recorded account creation or security-group membership changes (4720/4728/4732/4756) on the same known host in one bounded window." + + +def _log_cleared_title(evidence: list[NormalizedEvent]) -> str: + return "Event log cleared" if len(evidence) == 1 else "Event logs cleared" + + +def _log_cleared_reason(evidence: list[NormalizedEvent]) -> str: + return ( + "EventLog recorded that an event log was cleared (Security 1102 / System 104); records from before this point " + "may be missing. The record identifies the clearing account only as far as its own fields state." + ) + + def _startup_title(evidence: list[NormalizedEvent]) -> str: return "Normal startup sequence" if len(evidence) > 1 else "Normal startup evidence" @@ -188,6 +299,16 @@ def _unexpected_reason(evidence: list[NormalizedEvent]) -> str: RULES = ( + Rule( + "windows.audit.log-cleared", + "security", + "critical", + 300, + _log_cleared, + lambda event: _group_key(_host(event)), + _log_cleared_title, + _log_cleared_reason, + ), Rule( "windows.crash.application-report", "crash", @@ -208,6 +329,16 @@ RULES = ( _service_title, _service_reason, ), + Rule( + "windows.service.installed", + "service", + "warning", + 300, + _service_installed, + _service_installed_key, + _service_installed_title, + _service_installed_reason, + ), Rule( "windows.network.dns-timeout", "network", @@ -228,6 +359,37 @@ RULES = ( _auth_title, _auth_reason, ), + Rule( + "windows.auth.password-spray", + "authentication", + "warning", + 300, + _failed_logon, + lambda event: _group_key(_host(event), _source_ip(event)), + _spray_title, + _spray_reason, + accept=lambda evidence: _distinct_accounts(evidence) >= SPRAY_MIN_DISTINCT_ACCOUNTS, + ), + Rule( + "windows.auth.account-lockout", + "authentication", + "warning", + 300, + _account_lockout, + lambda event: _group_key(_host(event), _account(event)), + _lockout_title, + _lockout_reason, + ), + Rule( + "windows.account.change", + "security", + "warning", + 300, + _account_change, + lambda event: _group_key(_host(event)), + _account_change_title, + _account_change_reason, + ), Rule( "windows.system.startup", "system", @@ -261,6 +423,9 @@ RULES = ( ) +# --- grouping --------------------------------------------------------------- + + def _event_sort_key(event: NormalizedEvent) -> tuple[bool, datetime, str]: reliable_timestamp = event.timestamp is not None and event.timestamp_valid return ( @@ -270,19 +435,56 @@ def _event_sort_key(event: NormalizedEvent) -> tuple[bool, datetime, str]: ) -def _groups_for_rule(events: list[NormalizedEvent], rule: Rule) -> list[list[NormalizedEvent]]: - buckets: dict[str, list[NormalizedEvent]] = {} - isolated_number = 0 +Signature = tuple[str, str, int | None] + + +def _signature(event: NormalizedEvent) -> Signature: + return (event.provider, event.channel, event.event_id) + + +def _matching(events: list[NormalizedEvent], predicate: Callable[[NormalizedEvent], bool]) -> list[NormalizedEvent]: + """Filter events by a rule predicate, evaluating it once per distinct signature. + + Every rule predicate depends only on provider, channel and event ID, so a + 100,000-event log with a few hundred signatures needs a few hundred + predicate calls per rule instead of 100,000. + """ + verdicts: dict[Signature, bool] = {} + matched: list[NormalizedEvent] = [] for event in events: - if not rule.predicate(event) or event.timestamp is None or not event.timestamp_valid: + signature = _signature(event) + verdict = verdicts.get(signature) + if verdict is None: + verdict = verdicts[signature] = predicate(event) + if verdict: + matched.append(event) + return matched + + +def _windowed_groups( + events: list[NormalizedEvent], + predicate: Callable[[NormalizedEvent], bool], + key_for: Callable[[NormalizedEvent], str | None], + window_seconds: int, +) -> list[Group]: + """Bucket timed events by key and split each bucket into bounded windows. + + A window is anchored on its first event, so a group can never chain beyond + ``window_seconds``. Events whose key is unknown become isolated groups + (key ``None``) so that missing dimensions never merge unrelated evidence. + """ + buckets: dict[str, list[NormalizedEvent]] = {} + isolated: list[NormalizedEvent] = [] + for event in events: + if not predicate(event) or event.timestamp is None or not event.timestamp_valid: continue - key = rule.key(event) + key = key_for(event) if key is None: - isolated_number += 1 - key = f"__isolated__{isolated_number}:{event.id}" - buckets.setdefault(key, []).append(event) - groups: list[list[NormalizedEvent]] = [] - window = timedelta(seconds=rule.window_seconds) + isolated.append(event) + else: + buckets.setdefault(key, []).append(event) + groups: list[Group] = [] + window = timedelta(seconds=window_seconds) for key in sorted(buckets): ordered = sorted(buckets[key], key=_event_sort_key) current: list[NormalizedEvent] = [] @@ -290,73 +492,202 @@ def _groups_for_rule(events: list[NormalizedEvent], rule: Rule) -> list[list[Nor if not current or event.timestamp - current[0].timestamp <= window: current.append(event) else: - groups.append(current) + groups.append((key, current)) current = [event] if current: - groups.append(current) + groups.append((key, current)) + groups.extend((None, [event]) for event in sorted(isolated, key=_event_sort_key)) return groups +def _always(_event: NormalizedEvent) -> bool: + return True + + +def _groups_for_rule(events: list[NormalizedEvent], rule: Rule) -> list[Group]: + groups = _windowed_groups(_matching(events, rule.predicate), _always, rule.key, rule.window_seconds) + if rule.accept is None: + return groups + return [group for group in groups if rule.accept(group[1])] + + def _incident_id(rule_id: str, evidence: list[NormalizedEvent]) -> str: seed = f"{rule_id}|{'|'.join(event.id for event in evidence)}".encode() return f"incident-{hashlib.sha256(seed).hexdigest()[:16]}" -def _build(rule: Rule, evidence: list[NormalizedEvent]) -> IncidentCluster: - signatures = {(event.provider, event.event_id, event.summary) for event in evidence} - reasons = [rule.reason_for(evidence)] - if len(evidence) > 1: +def _signatures(evidence: list[NormalizedEvent]) -> set[tuple[str, int | None, str]]: + return {(event.provider, event.event_id, event.summary) for event in evidence} + + +def _compression_reasons(evidence: list[NormalizedEvent]) -> list[str]: + reasons: list[str] = [] + timed = all(event.timestamp is not None and event.timestamp_valid for event in evidence) + if len(evidence) > 1 and timed: seconds = int((evidence[-1].timestamp - evidence[0].timestamp).total_seconds()) reasons.append(f"{len(evidence)} evidence events occurred within {seconds} second(s).") + signatures = _signatures(evidence) if len(signatures) < len(evidence): reasons.append(f"Repeated signals compress from {len(evidence)} records to {len(signatures)} distinct signature(s).") - return IncidentCluster( + return reasons + + +def _build(rule: Rule, evidence: list[NormalizedEvent]) -> IncidentCluster: + return IncidentCluster.model_construct( id=_incident_id(rule.id, evidence), rule_id=rule.id, start=evidence[0].timestamp, end=evidence[-1].timestamp, - title=rule.title_for(evidence), + title=_bounded_title(rule.title_for(evidence), "Correlated evidence"), category=rule.category, severity=rule.severity, - reasons=reasons, + reasons=[rule.reason_for(evidence), *_compression_reasons(evidence)], evidence_event_ids=[event.id for event in evidence], original_count=len(evidence), - compressed_count=max(1, len(signatures)), + compressed_count=max(1, len(_signatures(evidence))), ) +def _attention(event: NormalizedEvent) -> bool: + return event.level.casefold() in LEVEL_SEVERITY + + +def _fallback_key(event: NormalizedEvent) -> str | None: + provider = _dimension(event.provider) + if provider is None or provider.casefold() == "unknown provider" or event.event_id is None: + return None + return _group_key(_host(event), provider, str(event.event_id)) + + +def _max_severity(levels: list[Severity]) -> Severity: + return max(levels, key=lambda level: SEVERITY_RANK[level]) + + +def _build_fallback(evidence: list[NormalizedEvent]) -> IncidentCluster: + first = evidence[0] + timed = first.timestamp is not None and first.timestamp_valid + if len(evidence) == 1: + reason = "An error or warning was not matched by a more specific correlation rule." + else: + reason = ( + "Errors or warnings with the same provider, event ID and known host were not matched by a more specific " + "rule and were compressed into one bounded window; repetition is not a causal claim." + ) + return IncidentCluster.model_construct( + id=_incident_id(FALLBACK_RULE_ID, evidence), + rule_id=FALLBACK_RULE_ID, + start=first.timestamp if timed else None, + end=evidence[-1].timestamp if timed else None, + title=_bounded_title(first.summary, "Unclassified attention event"), + category=first.category, + severity=_max_severity([LEVEL_SEVERITY.get(event.level.casefold(), "warning") for event in evidence]), + reasons=[reason, *_compression_reasons(evidence)], + evidence_event_ids=[event.id for event in evidence], + original_count=len(evidence), + compressed_count=max(1, len(_signatures(evidence))), + ) + + +# --- campaigns -------------------------------------------------------------- + + +def _campaigns_for( + rule_id: str, window_seconds: int, keyed: list[tuple[str | None, IncidentCluster]] +) -> list[Campaign]: + """Link adjacent windows of one rule and one known key into a summary campaign. + + ``keyed`` is ordered by key and then by time, as produced by + :func:`_windowed_groups`. Incidents keep their bounded windows; a campaign + only records that the same rule recurred for the same known dimensions. + """ + campaigns: list[Campaign] = [] + window = timedelta(seconds=window_seconds) + run: list[IncidentCluster] = [] + run_key: str | None = None + + def flush() -> None: + if len(run) < 2: + return + first, last = run[0], run[-1] + incident_ids = [incident.id for incident in run] + seed = f"{rule_id}|{'|'.join(incident_ids)}".encode() + campaign = Campaign.model_construct( + id=f"campaign-{hashlib.sha256(seed).hexdigest()[:16]}", + rule_id=rule_id, + title=_bounded_title(f"Recurring: {first.title}", "Recurring activity"), + category=first.category, + severity=_max_severity([incident.severity for incident in run]), + start=first.start, + end=last.end, + incident_ids=incident_ids, + event_count=sum(incident.original_count for incident in run), + reasons=[ + ( + f"The same rule fired for the same known grouping dimensions in {len(run)} adjacent windows " + f"(gaps of at most {window_seconds} second(s))." + ), + "Each incident stays bounded by its rule span; the campaign only summarizes recurrence and makes no causal claim.", + ], + ) + for incident in run: + incident.campaign_id = campaign.id + campaigns.append(campaign) + + for key, incident in keyed: + previous = run[-1] if run else None + contiguous = ( + key is not None + and key == run_key + and previous is not None + and previous.end is not None + and incident.start is not None + and incident.start - previous.end <= window + ) + if not contiguous: + flush() + run = [] + run_key = key + if key is not None and incident.start is not None: + run.append(incident) + flush() + return campaigns + + +def _incident_sort_key(incident: IncidentCluster) -> tuple[bool, datetime, str, str]: + return ( + incident.start is None, + incident.start or datetime.max.replace(tzinfo=UTC), + incident.rule_id, + incident.id, + ) + + +def correlate_with_campaigns(events: list[NormalizedEvent]) -> tuple[list[IncidentCluster], list[Campaign]]: + ordered = sorted(events, key=_event_sort_key) + incidents: list[IncidentCluster] = [] + campaigns: list[Campaign] = [] + consumed: set[str] = set() + for rule in RULES: + keyed = [(key, _build(rule, group)) for key, group in _groups_for_rule(ordered, rule)] + for _, incident in keyed: + consumed.update(incident.evidence_event_ids) + incidents.extend(incident for _, incident in keyed) + campaigns.extend(_campaigns_for(rule.id, rule.window_seconds, keyed)) + + remaining = [event for event in ordered if event.id not in consumed and _attention(event)] + keyed_fallback = [ + (key, _build_fallback(group)) + for key, group in _windowed_groups(remaining, _always, _fallback_key, FALLBACK_WINDOW_SECONDS) + ] + incidents.extend(incident for _, incident in keyed_fallback) + campaigns.extend(_campaigns_for(FALLBACK_RULE_ID, FALLBACK_WINDOW_SECONDS, keyed_fallback)) + # Untimed attention events stay visible as evidence but never join a temporal group. + incidents.extend( + _build_fallback([event]) for event in remaining if event.timestamp is None or not event.timestamp_valid + ) + campaigns.sort(key=lambda campaign: (campaign.start, campaign.rule_id, campaign.id)) + return sorted(incidents, key=_incident_sort_key), campaigns + + def correlate(events: list[NormalizedEvent]) -> list[IncidentCluster]: - ordered = sorted(events, key=_event_sort_key) - incidents: list[IncidentCluster] = [] - consumed: set[str] = set() - for rule in RULES: - for group in _groups_for_rule(ordered, rule): - incidents.append(_build(rule, group)) - consumed.update(event.id for event in group) - fallback_rule_id = "windows.generic.attention" - for event in ordered: - if event.id not in consumed and event.level.casefold() in {"critical", "error", "warning"}: - incidents.append( - IncidentCluster( - id=_incident_id(fallback_rule_id, [event]), - rule_id=fallback_rule_id, - start=event.timestamp if event.timestamp_valid else None, - end=event.timestamp if event.timestamp_valid else None, - title=event.summary or "Unclassified attention event", - category=event.category, - severity="warning", - reasons=["An error or warning was not matched by a more specific correlation rule."], - evidence_event_ids=[event.id], - original_count=1, - compressed_count=1, - ) - ) - return sorted( - incidents, - key=lambda incident: ( - incident.start is None, - incident.start or datetime.max.replace(tzinfo=UTC), - incident.rule_id, - incident.id, - ), - ) + return correlate_with_campaigns(events)[0] diff --git a/backend/app/main.py b/backend/app/main.py index 8050edb..7bcef83 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -1,22 +1,30 @@ import asyncio +import gzip +import hashlib import json import logging import os import re +from collections import Counter +from collections.abc import AsyncIterator +from contextlib import asynccontextmanager from pathlib import Path from typing import Any -from fastapi import FastAPI, File, HTTPException, UploadFile +from fastapi import FastAPI, HTTPException, Request, Response from fastapi.middleware.cors import CORSMiddleware from fastapi.staticfiles import StaticFiles +from starlette.datastructures import UploadFile as StarletteUploadFile +from starlette.formparsers import MultiPartException from starlette.requests import ClientDisconnect -from .correlate import correlate +from .correlate import correlate_with_campaigns from .demo import load_demo -from .models import AnalysisResponse, ParseIssue, ParseStats +from .models import AnalysisResponse, ParseIssue, ParseStats, ParseStatus, SourceInfo from .parser import ( MAX_UPLOAD_BYTES, EvtxParseError, + ParseResult, UnexpectedParserError, parse_evtx_bytes, ) @@ -43,10 +51,11 @@ app.add_middleware( MAX_MULTIPART_OVERHEAD_BYTES = 1024 * 1024 MAX_REQUEST_BYTES = MAX_UPLOAD_BYTES + MAX_MULTIPART_OVERHEAD_BYTES +MAX_REPORTED_ISSUES = 200 +GZIP_LEVEL = 1 CONTENT_SECURITY_POLICY = ( "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; " - "img-src 'self' data:; connect-src 'self' http://localhost:8000 http://127.0.0.1:8000 " - "http://localhost:5173 http://127.0.0.1:5173 http://127.0.0.1:4173; " + "img-src 'self' data:; connect-src 'self'; " "font-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'" ) SECURITY_HEADERS = { @@ -176,49 +185,67 @@ def health(): @app.get("/api/demo", response_model=AnalysisResponse) def demo(): events = load_demo() - return AnalysisResponse(source="bundled-demo", events=events, incidents=correlate(events)) + incidents, campaigns = correlate_with_campaigns(events) + return AnalysisResponse(source="bundled-demo", events=events, incidents=incidents, campaigns=campaigns) -async def _parse_with_admission(data: bytes): +def _capacity_error(message: str) -> HTTPException: + return HTTPException( + 503, + detail={"code": "parse_capacity_exceeded", "message": message}, + headers={"Retry-After": "1"}, + ) + + +@asynccontextmanager +async def _admission() -> AsyncIterator[None]: + """Reserve an analysis slot before the multipart body is spooled. + + Starlette spools uploads to TMPDIR while parsing the form. Admitting first + bounds the number of concurrently spooled uploads to concurrency + queue, + so a burst of large uploads gets a fast 503 instead of exhausting tmpfs. + """ global _parse_inflight async with _parse_admission_lock: if _parse_inflight >= PARSE_CONCURRENCY + PARSE_QUEUE_LIMIT: - raise HTTPException( - 503, - detail={ - "code": "parse_capacity_exceeded", - "message": "EventLens is already analyzing its maximum concurrent uploads; retry shortly.", - }, - headers={"Retry-After": "1"}, - ) + raise _capacity_error("EventLens is already analyzing its maximum concurrent uploads; retry shortly.") _parse_inflight += 1 - acquired = False try: - try: - await asyncio.wait_for(_parse_slots.acquire(), timeout=PARSE_QUEUE_TIMEOUT_SECONDS) - acquired = True - except TimeoutError as exc: - raise HTTPException( - 503, - detail={ - "code": "parse_capacity_exceeded", - "message": "EventLens is busy analyzing another upload; retry shortly.", - }, - headers={"Retry-After": "1"}, - ) from exc + yield finally: - if not acquired: - async with _parse_admission_lock: - _parse_inflight -= 1 - try: - return await asyncio.to_thread(parse_evtx_bytes, data) - finally: - if acquired: - _parse_slots.release() async with _parse_admission_lock: _parse_inflight -= 1 +@asynccontextmanager +async def _parse_slot() -> AsyncIterator[None]: + try: + await asyncio.wait_for(_parse_slots.acquire(), timeout=PARSE_QUEUE_TIMEOUT_SECONDS) + except TimeoutError as exc: + raise _capacity_error("EventLens is busy analyzing another upload; retry shortly.") from exc + try: + yield + finally: + _parse_slots.release() + + +def _stats(parsed: ParseResult, status: ParseStatus | None = None) -> ParseStats: + counts = Counter(issue.code for issue in parsed.issues) + return ParseStats( + status=status or parsed.status, + parsed_events=len(parsed.events) if status != "failed" else 0, + records_seen=parsed.records_seen, + skipped_records=parsed.skipped_records, + issue_count=len(parsed.issues), + truncated=parsed.truncated, + truncation_reason=parsed.truncation_reason, + duration_ms=parsed.duration_ms, + issues=parsed.issues[:MAX_REPORTED_ISSUES], + issues_truncated=len(parsed.issues) > MAX_REPORTED_ISSUES, + issue_counts=dict(sorted(counts.items())), + ) + + def _failed_parse_stats() -> ParseStats: return ParseStats( status="failed", @@ -230,77 +257,112 @@ def _failed_parse_stats() -> ParseStats: truncation_reason=None, duration_ms=0, issues=[ParseIssue(code="parser_rejected_input", message="The EVTX parser rejected the input.")], + issue_counts={"parser_rejected_input": 1}, ) -@app.post("/api/analyze", response_model=AnalysisResponse) -async def analyze(file: UploadFile = File(...)): # noqa: B008 +def _analyze_bytes(source: str, data: bytes | bytearray, compress: bool = False) -> bytes: + """Parse, correlate, serialize and optionally gzip off the event loop.""" + source_info = SourceInfo(sha256=hashlib.sha256(data).hexdigest(), size_bytes=len(data)) try: - source = _safe_source_name(file.filename) - if not source.lower().endswith(".evtx"): - raise HTTPException(400, "Upload an .evtx file") - data = bytearray() - while True: - chunk = await file.read(min(1024 * 1024, MAX_UPLOAD_BYTES + 1 - len(data))) - if not chunk: - break - data.extend(chunk) - if len(data) > MAX_UPLOAD_BYTES: - raise HTTPException(413, "EVTX file exceeds the 50 MiB MVP limit") - try: - parsed = await _parse_with_admission(bytes(data)) - except EvtxParseError as exc: - raise HTTPException( - 422, - detail={ - "code": "parser_rejected_input", - "message": str(exc), - "parse": _failed_parse_stats().model_dump(mode="json"), - }, - ) from exc - except UnexpectedParserError as exc: - logger.error("Unexpected EVTX parser failure reached API exception_type=%s", type(exc).__name__) - raise HTTPException( - 500, - detail={"code": "parser_internal_error", "message": "EVTX analysis failed unexpectedly; retry the request."}, - ) from exc - if not parsed.events: - raise HTTPException( - 422, - detail={ - "code": "no_readable_events", - "message": "No readable Windows events were found in this file.", - "parse": ParseStats( - status="failed", - parsed_events=0, - records_seen=parsed.records_seen, - skipped_records=parsed.skipped_records, - issue_count=len(parsed.issues), - truncated=parsed.truncated, - truncation_reason=parsed.truncation_reason, - duration_ms=parsed.duration_ms, - issues=parsed.issues, - ).model_dump(mode="json"), - }, - ) - return AnalysisResponse( - source=source, - events=parsed.events, - incidents=correlate(parsed.events), - parse=ParseStats( - status=parsed.status, - parsed_events=len(parsed.events), - records_seen=parsed.records_seen, - skipped_records=parsed.skipped_records, - issue_count=len(parsed.issues), - truncated=parsed.truncated, - truncation_reason=parsed.truncation_reason, - duration_ms=parsed.duration_ms, - issues=parsed.issues, - ), + parsed = parse_evtx_bytes(data) + except EvtxParseError as exc: + raise HTTPException( + 422, + detail={ + "code": "parser_rejected_input", + "message": str(exc), + "parse": _failed_parse_stats().model_dump(mode="json"), + }, + ) from exc + if not parsed.events: + raise HTTPException( + 422, + detail={ + "code": "no_readable_events", + "message": "No readable Windows events were found in this file.", + "parse": _stats(parsed, "failed").model_dump(mode="json"), + }, ) - finally: - await file.close() + incidents, campaigns = correlate_with_campaigns(parsed.events) + response = AnalysisResponse( + source=source, + events=parsed.events, + incidents=incidents, + campaigns=campaigns, + parse=_stats(parsed), + source_info=source_info, + ) + payload = response.model_dump_json().encode("utf-8") + # Event JSON is highly repetitive: level 1 shrinks a 100k-event response + # ~20x for about a second of worker-thread CPU, never on the event loop. + return gzip.compress(payload, compresslevel=GZIP_LEVEL, mtime=0) if compress else payload + + +async def _read_bounded(upload: StarletteUploadFile) -> bytearray: + data = bytearray() + while True: + chunk = await upload.read(min(1024 * 1024, MAX_UPLOAD_BYTES + 1 - len(data))) + if not chunk: + return data + data.extend(chunk) + if len(data) > MAX_UPLOAD_BYTES: + raise HTTPException(413, "EVTX file exceeds the 50 MiB MVP limit") + + +ANALYZE_OPENAPI = { + "requestBody": { + "required": True, + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "required": ["file"], + "properties": {"file": {"type": "string", "format": "binary"}}, + } + } + }, + } +} + + +@app.post("/api/analyze", response_model=AnalysisResponse, openapi_extra=ANALYZE_OPENAPI) +async def analyze(request: Request): + compress = "gzip" in request.headers.get("accept-encoding", "").lower() + async with _admission(): + try: + form = await request.form(max_files=1, max_fields=4) + except MultiPartException as exc: + raise HTTPException(400, "Upload one .evtx file as multipart form data") from exc + try: + upload = form.get("file") + if not isinstance(upload, StarletteUploadFile): + raise HTTPException(422, "Upload one .evtx file in the 'file' form field") + source = _safe_source_name(upload.filename) + if not source.lower().endswith(".evtx"): + raise HTTPException(400, "Upload an .evtx file") + data = await _read_bounded(upload) + async with _parse_slot(): + try: + payload = await asyncio.to_thread(_analyze_bytes, source, data, compress) + except UnexpectedParserError as exc: + logger.error( + "Unexpected EVTX parser failure reached API exception_type=%s", type(exc).__name__ + ) + raise HTTPException( + 500, + detail={ + "code": "parser_internal_error", + "message": "EVTX analysis failed unexpectedly; retry the request.", + }, + ) from exc + del data + finally: + await form.close() + headers = {"Vary": "Accept-Encoding"} + if compress: + headers["Content-Encoding"] = "gzip" + return Response(content=payload, media_type="application/json", headers=headers) def _safe_source_name(filename: str | None) -> str: diff --git a/backend/app/models.py b/backend/app/models.py index a23669b..d587475 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -3,7 +3,11 @@ from typing import Literal from pydantic import BaseModel, Field, field_validator, model_validator -Category = Literal["system", "service", "network", "authentication", "application", "crash", "other"] +Category = Literal[ + "system", "service", "network", "authentication", "security", "application", "crash", "other" +] +Severity = Literal["critical", "error", "warning", "info"] +AuditOutcome = Literal["success", "failure"] ParseStatus = Literal["complete", "partial", "failed"] TimestampSource = Literal["event", "record", "missing", "invalid"] @@ -20,6 +24,7 @@ class NormalizedEvent(BaseModel): computer: str = Field(default="", max_length=256) category: Category = "other" summary: str = Field(default="", max_length=512) + outcome: AuditOutcome | None = None fields: dict[str, str] = Field(default_factory=dict, max_length=200) @field_validator("timestamp") @@ -49,11 +54,31 @@ class IncidentCluster(BaseModel): end: datetime | None = None title: str = Field(max_length=256) category: Category - severity: str = Field(max_length=32) + severity: Severity reasons: list[str] = Field(max_length=8) evidence_event_ids: list[str] original_count: int = Field(ge=1) compressed_count: int = Field(ge=1) + campaign_id: str | None = Field(default=None, max_length=128) + + +class Campaign(BaseModel): + """Consecutive incidents of one rule and grouping key, linked for summary only. + + Incident windows stay bounded by their rule span; a campaign only states + that the same rule fired for the same known dimensions in adjacent windows. + """ + + id: str = Field(max_length=128) + rule_id: str = Field(max_length=128) + title: str = Field(max_length=256) + category: Category + severity: Severity + start: datetime + end: datetime + incident_ids: list[str] = Field(min_length=2) + event_count: int = Field(ge=2) + reasons: list[str] = Field(max_length=8) class ParseIssue(BaseModel): @@ -74,10 +99,19 @@ class ParseStats(BaseModel): truncation_reason: str | None = Field(default=None, max_length=64) duration_ms: int = Field(ge=0) issues: list[ParseIssue] = Field(default_factory=list) + issues_truncated: bool = False + issue_counts: dict[str, int] = Field(default_factory=dict) + + +class SourceInfo(BaseModel): + sha256: str = Field(pattern=r"^[0-9a-f]{64}$") + size_bytes: int = Field(ge=0) class AnalysisResponse(BaseModel): source: str events: list[NormalizedEvent] incidents: list[IncidentCluster] + campaigns: list[Campaign] = Field(default_factory=list) parse: ParseStats | None = None + source_info: SourceInfo | None = None diff --git a/backend/app/normalize.py b/backend/app/normalize.py index e81e08d..1c884b7 100644 --- a/backend/app/normalize.py +++ b/backend/app/normalize.py @@ -3,9 +3,12 @@ import json from datetime import UTC, datetime from typing import Any -from .models import Category, NormalizedEvent, TimestampSource +from .models import AuditOutcome, Category, NormalizedEvent, TimestampSource -AUTH_EVENT_IDS = {4624, 4625, 4634, 4647, 4648, 4672, 4768, 4769, 4771, 4776} +AUTH_EVENT_IDS = {4624, 4625, 4634, 4647, 4648, 4672, 4740, 4768, 4769, 4771, 4776} +ACCOUNT_CHANGE_EVENT_IDS = {4720, 4728, 4732, 4756} +AUDIT_FAILURE_KEYWORD = 0x0010_0000_0000_0000 +AUDIT_SUCCESS_KEYWORD = 0x0020_0000_0000_0000 LEVELS = {0: "information", 1: "critical", 2: "error", 3: "warning", 4: "information", 5: "verbose"} MAX_EVENT_ID = 4_294_967_295 MAX_RECORD_ID = 9_223_372_036_854_775_807 @@ -86,6 +89,21 @@ def _provider(system: dict[str, Any]) -> str: return _bounded_text(value, MAX_PROVIDER_CHARS, "Unknown provider") +def _outcome(system: dict[str, Any]) -> AuditOutcome | None: + raw = _scalar(system.get("Keywords")) + if raw is None or isinstance(raw, bool): + return None + try: + value = int(raw, 0) if isinstance(raw, str) else int(raw) + except (TypeError, ValueError, OverflowError): + return None + if value & AUDIT_FAILURE_KEYWORD: + return "failure" + if value & AUDIT_SUCCESS_KEYWORD: + return "success" + return None + + def _store_field(output: dict[str, str], key: str, value: str, limit: int) -> None: bounded_key = _bounded_text(key or "value", MAX_FIELD_KEY_CHARS) if bounded_key not in output: @@ -127,47 +145,78 @@ def _flatten( if len(output) >= limit: return return + _store_field(output, prefix or "value", _render_scalar(value)[:MAX_FIELD_VALUE_CHARS], limit) + + +def _render_scalar(value: Any) -> str: + """Render a scalar exactly like ``json.dumps`` would, with fast paths for common types.""" + if isinstance(value, str): + return value + if value is None: + return "null" + if value is True: + return "true" + if value is False: + return "false" + if type(value) is int: + return str(value) try: - rendered = json.dumps(value, ensure_ascii=False) if not isinstance(value, str) else value + return json.dumps(value, ensure_ascii=False) except (TypeError, ValueError): - rendered = "[unrenderable value]" - _store_field(output, prefix or "value", rendered[:MAX_FIELD_VALUE_CHARS], limit) + return "[unrenderable value]" + + +def _fold(value: str) -> str: + return value.strip().casefold() + + +EVENTLOG_PROVIDERS = frozenset({"eventlog", "microsoft-windows-eventlog"}) def _channel_matches(channel: str, *accepted: str) -> bool: - return channel.strip().casefold() in {value.casefold() for value in accepted} + folded = _fold(channel) + return any(folded == value.casefold() for value in accepted) def is_security_audit(provider: str, channel: str) -> bool: - return provider.strip().casefold() == "microsoft-windows-security-auditing" and _channel_matches(channel, "Security") + return _fold(provider) == "microsoft-windows-security-auditing" and _fold(channel) == "security" def is_service_control_manager(provider: str, channel: str) -> bool: - return provider.strip().casefold() == "service control manager" and _channel_matches(channel, "System") + return _fold(provider) == "service control manager" and _fold(channel) == "system" def is_dns_client(provider: str, channel: str) -> bool: - return provider.strip().casefold() == "microsoft-windows-dns-client" and _channel_matches(channel, "System") + return _fold(provider) == "microsoft-windows-dns-client" and _fold(channel) == "system" def is_application_error(provider: str, channel: str, event_id: int | None) -> bool: - return provider.casefold().strip() == "application error" and event_id == 1000 and _channel_matches(channel, "Application") + return event_id == 1000 and _fold(provider) == "application error" and _fold(channel) == "application" def is_windows_error_reporting(provider: str, channel: str, event_id: int | None) -> bool: - return provider.casefold().strip() == "windows error reporting" and event_id == 1001 and _channel_matches(channel, "Application") + return event_id == 1001 and _fold(provider) == "windows error reporting" and _fold(channel) == "application" def is_event_log(provider: str, channel: str) -> bool: - return provider.casefold().strip() in {"eventlog", "microsoft-windows-eventlog"} and _channel_matches(channel, "System") + return _fold(provider) in EVENTLOG_PROVIDERS and _fold(channel) == "system" + + +def is_log_cleared(provider: str, channel: str, event_id: int | None) -> bool: + """Security 1102 (audit log cleared) or System 104 (an event log was cleared).""" + if event_id not in {1102, 104} or _fold(provider) not in EVENTLOG_PROVIDERS: + return False + return (event_id == 1102 and _channel_matches(channel, "Security")) or ( + event_id == 104 and _channel_matches(channel, "System") + ) def is_kernel_general(provider: str, channel: str) -> bool: - return provider.strip().casefold() == "microsoft-windows-kernel-general" and _channel_matches(channel, "System") + return _fold(provider) == "microsoft-windows-kernel-general" and _fold(channel) == "system" def is_kernel_power(provider: str, channel: str) -> bool: - return provider.strip().casefold() == "microsoft-windows-kernel-power" and _channel_matches(channel, "System") + return _fold(provider) == "microsoft-windows-kernel-power" and _fold(channel) == "system" def classify(provider: str, event_id: int | None, channel: str) -> Category: @@ -181,6 +230,10 @@ def classify(provider: str, event_id: int | None, channel: str) -> Category: return "network" if is_security_audit(provider, channel) and event_id in AUTH_EVENT_IDS: return "authentication" + if is_log_cleared(provider, channel, event_id) or ( + is_security_audit(provider, channel) and event_id in ACCOUNT_CHANGE_EVENT_IDS + ): + return "security" if is_application_error(provider, channel, event_id) or is_windows_error_reporting(provider, channel, event_id): return "crash" if ( @@ -195,6 +248,23 @@ def classify(provider: str, event_id: int | None, channel: str) -> Category: def summarize(provider: str, event_id: int | None, category: Category, fields: dict[str, str]) -> str: + if category == "service" and event_id == 7045: + service = fields.get("EventData.ServiceName") or fields.get("service") + return f"Service installed: {service}" if service else "Service installed" + if category == "security" and event_id == 1102: + return "Security audit log cleared" + if category == "security" and event_id == 104: + cleared = fields.get("UserData.LogFileCleared.Channel") + return f"Event log cleared: {cleared}" if cleared else "Event log cleared" + if category == "security" and event_id == 4720: + account = fields.get("EventData.TargetUserName") + return f"User account created: {account}" if account else "User account created" + if category == "security" and event_id in {4728, 4732, 4756}: + group = fields.get("EventData.TargetUserName") + return f"Member added to security group {group}" if group else "Member added to a security group" + if category == "authentication" and event_id == 4740: + account = fields.get("EventData.TargetUserName") + return f"Account locked out: {account}" if account else "Account locked out" if category == "service" and event_id in {7023, 7024, 7031, 7034}: service = fields.get("EventData.param1") or fields.get("UserData.param1") or fields.get("service") return f"{service} terminated unexpectedly" if service else "Service failure recorded" @@ -245,11 +315,14 @@ def normalize_record( stable_id = f"event-{hashlib.sha256(seed).hexdigest()[:16]}" timestamp, timestamp_source = _timestamp(system, record_timestamp) summary = summarize(provider, event_id, category, fields)[:MAX_SUMMARY_CHARS] - return NormalizedEvent( + # Every value above is already bounded and typed exactly as NormalizedEvent + # requires (see tests/test_performance.py, which re-validates the output), + # so skip per-event pydantic validation on this hot path. + return NormalizedEvent.model_construct( id=stable_id, timestamp=timestamp, timestamp_source=timestamp_source, - timestamp_valid=timestamp is not None, + timestamp_valid=timestamp is not None and timestamp_source in {"event", "record"}, provider=provider, event_id=event_id, level=level[:32], @@ -257,5 +330,6 @@ def normalize_record( computer=computer, category=category, summary=summary, + outcome=_outcome(system), fields=fields, ) diff --git a/backend/app/parser.py b/backend/app/parser.py index d62c8a2..2bf2501 100644 --- a/backend/app/parser.py +++ b/backend/app/parser.py @@ -52,7 +52,7 @@ def _fingerprint(stage: str, exc: BaseException) -> str: def parse_evtx_bytes( - data: bytes, + data: bytes | bytearray, max_events: int = MAX_EVENTS, max_seconds: float = MAX_PARSE_SECONDS, ) -> ParseResult: @@ -113,9 +113,11 @@ def parse_evtx_bytes( raw_data = record["data"] if not isinstance(raw_data, str): raise TypeError("record data was not textual") - if ( - len(raw_data) > MAX_RECORD_JSON_BYTES - or len(raw_data.encode("utf-8")) > MAX_RECORD_JSON_BYTES + # A str of n characters encodes to at most 4n UTF-8 bytes, so the + # costly encode is only needed for records near the limit. + if len(raw_data) > MAX_RECORD_JSON_BYTES or ( + len(raw_data) * 4 > MAX_RECORD_JSON_BYTES + and len(raw_data.encode("utf-8")) > MAX_RECORD_JSON_BYTES ): add_issue( "record_json_limit_exceeded", diff --git a/backend/pyproject.toml b/backend/pyproject.toml index ef512b8..6568064 100644 --- a/backend/pyproject.toml +++ b/backend/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "eventlens-api" -version = "1.0.6" +version = "1.1.0" description = "Local EVTX incident reconstruction API for EventLens" requires-python = ">=3.12" dependencies = [ diff --git a/backend/tests/test_audit_improvements.py b/backend/tests/test_audit_improvements.py new file mode 100644 index 0000000..d7f41e7 --- /dev/null +++ b/backend/tests/test_audit_improvements.py @@ -0,0 +1,298 @@ +"""Regression tests for the November 2026 audit: bounded titles, severities, +fallback burst compression, campaigns, new scoped rules, audit outcome, +source integrity metadata, bounded issue lists and off-loop analysis.""" + +import asyncio +import hashlib +import threading +import time +from datetime import UTC, datetime, timedelta + +import httpx + +from app import main +from app.correlate import MAX_TITLE_CHARS, correlate, correlate_with_campaigns +from app.models import NormalizedEvent, ParseIssue +from app.normalize import normalize_record +from app.parser import ParseResult + +START = datetime(2026, 11, 20, 8, 0, tzinfo=UTC) + + +def event( + identifier: str, + seconds: int, + *, + provider: str = "Microsoft-Windows-Security-Auditing", + event_id: int = 4625, + channel: str = "Security", + computer: str = "LAB-PC", + level: str = "information", + summary: str = "Synthetic event", + fields: dict[str, str] | None = None, +) -> NormalizedEvent: + return NormalizedEvent( + id=identifier, + timestamp=START + timedelta(seconds=seconds), + provider=provider, + event_id=event_id, + level=level, + channel=channel, + computer=computer, + summary=summary, + fields=fields or {}, + ) + + +def request(method: str, url: str, **kwargs) -> httpx.Response: + async def send() -> httpx.Response: + transport = httpx.ASGITransport(app=main.app) + async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client: + return await client.request(method, url, **kwargs) + + return asyncio.run(send()) + + +# --- correlation ------------------------------------------------------------ + + +def test_unmatched_event_with_long_summary_gets_a_bounded_title(): + long = event("1", 0, provider="P" * 250, event_id=4_294_967_295, level="warning", summary="P" * 300 + " event") + incident = correlate([long])[0] + assert len(incident.title) <= MAX_TITLE_CHARS + assert incident.title.endswith("…") + + +def test_fallback_severity_preserves_critical_and_error_levels(): + critical = event("1", 0, provider="Disk", event_id=11, channel="System", level="critical") + error = event("2", 0, provider="Ntfs", event_id=55, channel="System", level="error") + severities = {incident.evidence_event_ids[0]: incident.severity for incident in correlate([critical, error])} + assert severities == {"1": "critical", "2": "error"} + + +def test_identical_unmatched_warnings_are_burst_compressed(): + events = [ + event(str(index), index % 60, provider="Disk", event_id=153, channel="System", level="warning", summary="Disk event 153") + for index in range(5_000) + ] + incidents = correlate(events) + assert len(incidents) == 1 + assert incidents[0].rule_id == "windows.generic.attention" + assert incidents[0].original_count == 5_000 + assert incidents[0].compressed_count == 1 + assert any("compress" in reason for reason in incidents[0].reasons) + + +def test_fallback_never_merges_unknown_hosts_or_different_event_ids(): + events = [ + event("1", 0, provider="Disk", event_id=153, channel="System", computer="", level="warning"), + event("2", 1, provider="Disk", event_id=153, channel="System", computer="", level="warning"), + event("3", 2, provider="Disk", event_id=154, channel="System", level="warning"), + event("4", 3, provider="Disk", event_id=153, channel="System", level="warning"), + ] + assert sorted(len(incident.evidence_event_ids) for incident in correlate(events)) == [1, 1, 1, 1] + + +def test_sustained_activity_is_summarized_as_a_campaign_without_widening_incidents(): + events = [ + event(str(index), index * 60, fields={"EventData.TargetUserName": "alice"}) for index in range(30) + ] + incidents, campaigns = correlate_with_campaigns(events) + failed = [incident for incident in incidents if incident.rule_id == "windows.auth.failed-logon"] + assert len(failed) > 1 + assert all( + (incident.end - incident.start).total_seconds() <= 120 for incident in failed if incident.start and incident.end + ) + assert len(campaigns) == 1 + campaign = campaigns[0] + assert campaign.incident_ids == [incident.id for incident in failed] + assert campaign.event_count == 30 + assert {incident.campaign_id for incident in failed} == {campaign.id} + + +def test_separated_activity_does_not_form_a_campaign(): + events = [ + event("1", 0, fields={"EventData.TargetUserName": "alice"}), + event("2", 3_600, fields={"EventData.TargetUserName": "alice"}), + ] + incidents, campaigns = correlate_with_campaigns(events) + assert campaigns == [] + assert all(incident.campaign_id is None for incident in incidents) + + +def test_log_clear_is_a_critical_security_incident(): + cleared = normalize_record( + { + "Event": { + "System": { + "Provider": {"#attributes": {"Name": "Microsoft-Windows-Eventlog"}}, + "EventID": 1102, + "Channel": "Security", + "Computer": "LAB-PC", + "TimeCreated": {"#attributes": {"SystemTime": "2026-11-20T08:00:00Z"}}, + }, + "UserData": {"LogFileCleared": {"SubjectUserName": "admin"}}, + } + } + ) + assert cleared.category == "security" + assert cleared.summary == "Security audit log cleared" + incident = correlate([cleared])[0] + assert incident.rule_id == "windows.audit.log-cleared" + assert incident.severity == "critical" + + +def test_system_log_clear_is_detected_and_scoped_to_its_channel(): + system_clear = event("1", 0, provider="Microsoft-Windows-Eventlog", event_id=104, channel="System") + wrong_channel = event("2", 0, provider="Microsoft-Windows-Eventlog", event_id=104, channel="Application") + rules = {incident.evidence_event_ids[0]: incident.rule_id for incident in correlate([system_clear, wrong_channel])} + assert rules.get("1") == "windows.audit.log-cleared" + assert rules.get("2") != "windows.audit.log-cleared" + + +def test_service_installation_lockout_and_account_change_rules(): + events = [ + event("1", 0, provider="Service Control Manager", event_id=7045, channel="System", fields={"EventData.ServiceName": "Updater"}), + event("2", 10, event_id=4740, fields={"EventData.TargetUserName": "alice"}), + event("3", 20, event_id=4720, fields={"EventData.TargetUserName": "backup"}), + event("4", 25, event_id=4732, fields={"EventData.TargetUserName": "Administrators"}), + ] + by_rule = {incident.rule_id: incident for incident in correlate(events)} + assert by_rule["windows.service.installed"].evidence_event_ids == ["1"] + assert by_rule["windows.auth.account-lockout"].evidence_event_ids == ["2"] + change = by_rule["windows.account.change"] + assert change.evidence_event_ids == ["3", "4"] + assert change.title == "Account created and added to a security group" + + +def test_password_spray_requires_distinct_accounts_from_one_known_source(): + spray = [ + event(str(index), index, fields={"EventData.TargetUserName": f"user{index}", "EventData.IpAddress": "192.0.2.9"}) + for index in range(3) + ] + two_accounts = [ + event(f"b{index}", index, fields={"EventData.TargetUserName": f"user{index % 2}", "EventData.IpAddress": "192.0.2.8"}) + for index in range(4) + ] + unknown_source = [ + event(f"c{index}", index, fields={"EventData.TargetUserName": f"user{index}", "EventData.IpAddress": "-"}) + for index in range(5) + ] + sprays = [ + incident for incident in correlate(spray + two_accounts + unknown_source) if incident.rule_id == "windows.auth.password-spray" + ] + assert len(sprays) == 1 + assert sprays[0].evidence_event_ids == ["0", "1", "2"] + assert "3 distinct accounts" in sprays[0].reasons[0] + + +def test_audit_failure_keyword_becomes_outcome(): + record = { + "Event": { + "System": { + "Provider": {"#attributes": {"Name": "Microsoft-Windows-Security-Auditing"}}, + "EventID": 4625, + "Level": 0, + "Keywords": "0x8010000000000000", + "Channel": "Security", + } + } + } + assert normalize_record(record).outcome == "failure" + record["Event"]["System"]["Keywords"] = "0x8020000000000000" + assert normalize_record(record).outcome == "success" + record["Event"]["System"]["Keywords"] = "not-hex" + assert normalize_record(record).outcome is None + + +def test_correlation_of_large_inputs_stays_within_budget(): + events = [ + event(str(index), index, fields={"EventData.TargetUserName": f"u{index % 50}", "EventData.IpAddress": "192.0.2.1"}) + for index in range(50_000) + ] + started = time.perf_counter() + incidents, campaigns = correlate_with_campaigns(events) + assert time.perf_counter() - started < 20 + assert len(campaigns) >= 50 + assert incidents + + +# --- API -------------------------------------------------------------------- + + +def _parse_with_issues(issue_count: int): + def fake(_data) -> ParseResult: + events = [event("1", 0, provider="Test", event_id=1000, channel="Application", level="error")] + issues = [ParseIssue(code="invalid_timestamp", message="synthetic", record_id=index) for index in range(issue_count)] + return ParseResult(events=events, issues=issues, truncated=False, duration_ms=1) + + return fake + + +def test_analysis_reports_source_sha256_and_size(monkeypatch): + monkeypatch.setattr(main, "parse_evtx_bytes", _parse_with_issues(0)) + payload = b"synthetic-evtx-bytes" + response = request("POST", "/api/analyze", files={"file": ("sample.evtx", payload, "application/octet-stream")}) + assert response.status_code == 200 + assert response.json()["source_info"] == {"sha256": hashlib.sha256(payload).hexdigest(), "size_bytes": len(payload)} + + +def test_demo_has_no_source_integrity_claim_and_returns_campaign_list(): + body = request("GET", "/api/demo").json() + assert body["source_info"] is None + assert isinstance(body["campaigns"], list) + + +def test_parse_issue_list_is_bounded_with_counts(monkeypatch): + monkeypatch.setattr(main, "parse_evtx_bytes", _parse_with_issues(main.MAX_REPORTED_ISSUES + 50)) + response = request("POST", "/api/analyze", files={"file": ("sample.evtx", b"x", "application/octet-stream")}) + parse = response.json()["parse"] + assert parse["issue_count"] == main.MAX_REPORTED_ISSUES + 50 + assert len(parse["issues"]) == main.MAX_REPORTED_ISSUES + assert parse["issues_truncated"] is True + assert parse["issue_counts"] == {"invalid_timestamp": main.MAX_REPORTED_ISSUES + 50} + + +def test_parsing_and_correlation_run_off_the_event_loop(monkeypatch): + threads: list[int] = [] + original = main.correlate_with_campaigns + + def recording(events): + threads.append(threading.get_ident()) + return original(events) + + monkeypatch.setattr(main, "parse_evtx_bytes", _parse_with_issues(0)) + monkeypatch.setattr(main, "correlate_with_campaigns", recording) + loop_thread: list[int] = [] + + async def send() -> httpx.Response: + loop_thread.append(threading.get_ident()) + transport = httpx.ASGITransport(app=main.app) + async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client: + return await client.post("/api/analyze", files={"file": ("a.evtx", b"x", "application/octet-stream")}) + + assert asyncio.run(send()).status_code == 200 + assert threads and threads[0] != loop_thread[0] + + +def test_full_admission_rejects_before_reading_the_upload(monkeypatch): + def must_not_parse(_data): + raise AssertionError("parser must not run when admission is full") + + monkeypatch.setattr(main, "parse_evtx_bytes", must_not_parse) + monkeypatch.setattr(main, "_parse_inflight", main.PARSE_CONCURRENCY + main.PARSE_QUEUE_LIMIT) + response = request("POST", "/api/analyze", files={"file": ("a.evtx", b"x", "application/octet-stream")}) + assert response.status_code == 503 + assert response.json()["detail"]["code"] == "parse_capacity_exceeded" + assert response.headers["retry-after"] == "1" + + +def test_missing_file_field_is_a_client_error(): + response = request("POST", "/api/analyze", data={"other": "value"}) + assert response.status_code == 422 + + +def test_production_csp_only_allows_same_origin_connections(): + csp = request("GET", "/health").headers["content-security-policy"] + assert "connect-src 'self';" in csp + assert "localhost" not in csp diff --git a/backend/tests/test_performance.py b/backend/tests/test_performance.py new file mode 100644 index 0000000..b0c9b1b --- /dev/null +++ b/backend/tests/test_performance.py @@ -0,0 +1,99 @@ +"""Guards for the performance shortcuts: they must never change results or +bypass the normalized-event contract.""" + +import asyncio +import gzip +from datetime import UTC, datetime + +import httpx +import pytest + +from app import correlate as correlate_module +from app import main +from app.models import NormalizedEvent +from app.normalize import _render_scalar, normalize_record +from app.parser import ParseResult + +RECORDS = [ + {"Event": {"System": {"Provider": {"#attributes": {"Name": "Service Control Manager"}}, "EventID": {"#text": 7031, "#attributes": {"Qualifiers": 49152}}, "Level": 2, "Channel": "System", "Computer": "LAB-PC", "EventRecordID": 9, "TimeCreated": {"#attributes": {"SystemTime": "2026-11-20T08:00:00.123456Z"}}}, "EventData": {"param1": "Sync", "param2": 1, "flag": True, "none": None, "ratio": 1.5, "huge": 10**30}}}, + {"Event": {"System": {"Provider": "P" * 400, "EventID": "not-a-number", "Level": "weird", "Channel": "C" * 400, "Computer": "H" * 400}, "UserData": {"Nested": {"List": [{"a": "x" * 5000}, [1, [2, [3]]]]}}}}, + {"Event": {"System": {"Provider": {"Name": "Legacy"}, "EventID": 1, "TimeCreated": {"#attributes": {"SystemTime": "garbage"}}}}}, + {"Event": {"System": {"EventID": 4294967296, "Keywords": "0x8010000000000000"}, "EventData": {f"k{index}": index for index in range(400)}}}, + {"System": {"Provider": {"#attributes": {"Name": "Microsoft-Windows-Eventlog"}}, "EventID": 1102, "Channel": "Security"}}, +] + + +@pytest.mark.parametrize("payload", RECORDS) +def test_constructed_events_satisfy_the_validated_contract(payload): + event = normalize_record(payload, record_timestamp="2026-11-20T08:00:00Z", record_ordinal=3) + revalidated = NormalizedEvent.model_validate(event.model_dump()) + assert revalidated == event + + +@pytest.mark.parametrize("value", [None, True, False, 0, -7, 10**30, 1.5, float("inf"), [1, "a"], {"a": 1}]) +def test_fast_scalar_rendering_matches_json_dumps(value): + import json + + assert _render_scalar(value) == json.dumps(value, ensure_ascii=False) + + +def test_strings_are_kept_verbatim(): + assert _render_scalar('a "quoted" value') == 'a "quoted" value' + + +def test_rule_predicates_run_once_per_signature(monkeypatch): + calls = 0 + original = correlate_module._failed_logon + + def counting(event): + nonlocal calls + calls += 1 + return original(event) + + rules = tuple( + correlate_module.Rule(**{**rule.__dict__, "predicate": counting}) if rule.predicate is original else rule + for rule in correlate_module.RULES + ) + monkeypatch.setattr(correlate_module, "RULES", rules) + events = [ + NormalizedEvent(id=str(index), timestamp=datetime(2026, 11, 20, tzinfo=UTC), provider="Microsoft-Windows-Security-Auditing", channel="Security", computer="LAB-PC", event_id=4625, fields={"EventData.TargetUserName": "alice"}) + for index in range(1_000) + ] + correlate_module.correlate(events) + # two rules use the predicate (failed-logon and password-spray), one signature each + assert calls == 2 + + +def _request(headers: dict[str, str]) -> httpx.Response: + async def send() -> httpx.Response: + transport = httpx.ASGITransport(app=main.app) + async with httpx.AsyncClient(transport=transport, base_url="http://testserver") as client: + return await client.post("/api/analyze", headers=headers, files={"file": ("a.evtx", b"x", "application/octet-stream")}) + + return asyncio.run(send()) + + +def _fake_parse(_data) -> ParseResult: + event = NormalizedEvent(id="1", timestamp=datetime(2026, 11, 20, tzinfo=UTC), provider="Test", event_id=1, level="error", channel="Application", computer="LAB-PC", summary="x") + return ParseResult(events=[event], issues=[], truncated=False, duration_ms=1) + + +def test_analysis_response_is_gzipped_when_accepted(monkeypatch): + monkeypatch.setattr(main, "parse_evtx_bytes", _fake_parse) + response = _request({"Accept-Encoding": "gzip"}) + assert response.status_code == 200 + assert response.headers["content-encoding"] == "gzip" + assert response.headers["vary"] == "Accept-Encoding" + assert response.json()["events"][0]["id"] == "1" + + +def test_analysis_response_is_plain_without_gzip_support(monkeypatch): + monkeypatch.setattr(main, "parse_evtx_bytes", _fake_parse) + response = _request({"Accept-Encoding": "identity"}) + assert "content-encoding" not in response.headers + assert response.json()["events"][0]["id"] == "1" + + +def test_gzip_output_is_deterministic(): + payload = b'{"events": []}' * 100 + assert gzip.compress(payload, compresslevel=main.GZIP_LEVEL, mtime=0) == gzip.compress(payload, compresslevel=main.GZIP_LEVEL, mtime=0) diff --git a/backend/uv.lock b/backend/uv.lock index 05c9fc6..c9ccfdb 100644 --- a/backend/uv.lock +++ b/backend/uv.lock @@ -62,11 +62,11 @@ filecache = [ [[package]] name = "certifi" -version = "2026.7.22" +version = "2026.10.23" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } +sdist = { url = "https://files.pythonhosted.org/packages/fd/11/b524cbd9bbdaca58608e4cf4053fd463417549e1959fa8d3aa18319f9555/certifi-2026.10.23.tar.gz", hash = "sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd", size = 136225, upload-time = "2026-10-23T11:36:16.478Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, + { url = "https://files.pythonhosted.org/packages/32/d1/a3652fe2c19134d0d15922177821d863cbd7e842d53a21bbe7e8e3a1b5ac/certifi-2026.10.23-py3-none-any.whl", hash = "sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1", size = 135082, upload-time = "2026-10-23T11:36:14.763Z" }, ] [[package]] @@ -245,7 +245,7 @@ wheels = [ [[package]] name = "eventlens-api" -version = "1.0.6" +version = "1.1.0" source = { virtual = "." } dependencies = [ { name = "evtx" }, @@ -309,11 +309,11 @@ wheels = [ [[package]] name = "filelock" -version = "3.32.6" +version = "4.2.12" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/38/46/126b1831dca12060d4a8296bf9c4fe5c93c4f22197fa239cb0cc82042bba/filelock-3.32.6.tar.gz", hash = "sha256:a3f55a18af3652a94d8f47d6055df434f254ca1d02ef2524850c6d249ca2512c", size = 225172, upload-time = "2026-09-08T22:57:11.528Z" } +sdist = { url = "https://files.pythonhosted.org/packages/52/aa/8ccff8da9a27e089727fcffd3c5b61708383217e47eb1e1b8af37b1dd166/filelock-4.2.12.tar.gz", hash = "sha256:7e7da24d3ac39268b0f156e56870001de44886318f092f9d851e692f7114d6dd", size = 680837, upload-time = "2026-11-18T01:20:03.951Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/cc/06/4f138f618dbea66803291274f228f01daf29f306fe8b96bc30dab765df75/filelock-3.32.6-py3-none-any.whl", hash = "sha256:3f16ecd0117feae0dfc147e8c62eb5daeccd8bd800378c3ddf416de9b4feb6b1", size = 100189, upload-time = "2026-09-08T22:57:10.182Z" }, + { url = "https://files.pythonhosted.org/packages/8a/c9/eb6b6528c7edb958d4c24ac47a8b94113d9de36e4cfc6eecd599b1a4f349/filelock-4.2.12-py3-none-any.whl", hash = "sha256:21decfec02f116ed4c954433cdb31f28c3b346b784543177b6d7059da2702ee9", size = 222442, upload-time = "2026-11-18T01:20:02.439Z" }, ] [[package]] @@ -442,76 +442,79 @@ wheels = [ [[package]] name = "msgpack" -version = "1.2.2" +version = "1.2.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/6d/44/ea2100ec54d30c46ee9dba10a3bfb79b655e96c6df237238a3234c75869b/msgpack-1.2.2.tar.gz", hash = "sha256:9eb0b0e602064527a045ea28c4f174ed69383587e29cebe28947e3b84106eb2a", size = 187025, upload-time = "2026-08-27T10:03:47.793Z" } +sdist = { url = "https://files.pythonhosted.org/packages/cc/52/1ec7ead2c7528bf3d1db73e886fa4df10f9e6f0eb7854a448b7090cfcef7/msgpack-1.2.4.tar.gz", hash = "sha256:475c44e12f2a5de766a8448783f149c9b33f3f49b88953c6cd739a77d93c732c", size = 197764, upload-time = "2026-10-26T17:55:48.593Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/31/78/90c15bebb1a72667349ca62d4507e9d9369e7f8f76b95f490b823d3622e5/msgpack-1.2.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a4348705be86e029d04e741cf9ed0dfe03e942d7d3b92e838fa80d3aa2c3ebc", size = 84275, upload-time = "2026-08-27T10:02:07.106Z" }, - { url = "https://files.pythonhosted.org/packages/88/88/c2b6d8e81571da87aa232c0e34a3f3a0e618e6235892065ec82d1d81fc7a/msgpack-1.2.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0a652ceeededf71d3fa40c303a02a149d42338d310162367b91c539d4bd6e0a3", size = 83970, upload-time = "2026-08-27T10:02:08.488Z" }, - { url = "https://files.pythonhosted.org/packages/da/c0/d3ede9f5d16acb4c05a9281859f1e99ef9f877a928eb78454c37f70db001/msgpack-1.2.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90986cc9aab9d7d1d8f38bcbf65d3f7ac83bdd90c35765db7d691b4829698cba", size = 409401, upload-time = "2026-08-27T10:02:09.877Z" }, - { url = "https://files.pythonhosted.org/packages/41/f0/29f591bea185616cf417645ac03bd3ad9b317483ad8572160e325f7fe777/msgpack-1.2.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:77c2e018417dc1d66f235e383877ee885b60ade9d29e494dd581e08af2cb1923", size = 420619, upload-time = "2026-08-27T10:02:11.526Z" }, - { url = "https://files.pythonhosted.org/packages/4e/8e/c70c8c9180c5ddf4440eb8658ebead98e22e7686fbf84f6b165031430750/msgpack-1.2.2-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0e91332144f69bc3018c91232fac26da580ef748fb8eaddd7914d4458001cc4f", size = 379747, upload-time = "2026-08-27T10:02:13.345Z" }, - { url = "https://files.pythonhosted.org/packages/50/9a/f10ce11fa62700c9ab87a22e65b9ca272f7f673ddd31aeb2de6ae272ad35/msgpack-1.2.2-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:3e915d390d7068b257ca8b62f3fc59fad135c8631d1017ab03b0b924b07c5367", size = 398944, upload-time = "2026-08-27T10:02:15.006Z" }, - { url = "https://files.pythonhosted.org/packages/82/fe/d7be978456ff8552e69a8e270d882e7530e01513c096b293d83df03753ea/msgpack-1.2.2-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:c522420d78db2431887d45b518e304d86e27b9ad0b30f24e3806a6ad5d8bdbfc", size = 373979, upload-time = "2026-08-27T10:02:16.618Z" }, - { url = "https://files.pythonhosted.org/packages/be/af/91b0d8d3fb3063e259daee3ea8515cea6282f68f4b0e5f0b6fea25762c6e/msgpack-1.2.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:4b554d8164ebb526892194f71dcd96ef1fefe0c250087498785d3ffc04a80be3", size = 417781, upload-time = "2026-08-27T10:02:18.293Z" }, - { url = "https://files.pythonhosted.org/packages/8e/3c/ce8e9efe1fd9e95c78b3705e4300ba7feba3dc6c00fb76259895db155518/msgpack-1.2.2-cp312-cp312-win32.whl", hash = "sha256:0e3315de5a4b2920ccef48d96b4448025e064a10d0f5a250f6584477d839c8d4", size = 65267, upload-time = "2026-08-27T10:02:19.869Z" }, - { url = "https://files.pythonhosted.org/packages/85/98/a33b8b4af14e3476bb0da1b8c36ef7a0f28dcf95db1c5e68ff88cb89d591/msgpack-1.2.2-cp312-cp312-win_amd64.whl", hash = "sha256:b68614fba0570349833b7dd999ff0aed4e5cc8d9eb6e3a7d4527be33c65e33d3", size = 72275, upload-time = "2026-08-27T10:02:21.141Z" }, - { url = "https://files.pythonhosted.org/packages/df/5e/2f323a33a6aba5bd4b2d8b430e4fab21d92cd91c093b49ee287bc166ee54/msgpack-1.2.2-cp312-cp312-win_arm64.whl", hash = "sha256:59d5b93efa45fd09f620d0c9ba81cde339a2c9937af3eea42ee9653094ce6640", size = 65488, upload-time = "2026-08-27T10:02:22.575Z" }, - { url = "https://files.pythonhosted.org/packages/1f/eb/42f31c5a48811787ff59a9869721f70a49654d65ab6c455f4463c39b044e/msgpack-1.2.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8b2a281b556f120a43e591ea39915741b7ad54d4727b9c4350a0a11692252533", size = 83911, upload-time = "2026-08-27T10:02:24.06Z" }, - { url = "https://files.pythonhosted.org/packages/33/54/10c6c16ddba8a5112e3680176b838e3694e4aad7284f9daa6d6d70d98817/msgpack-1.2.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:1e8cdd1f3e7cc52c751092a9bf740e81e6919ab109cd376ae2d965dad0bbae34", size = 83734, upload-time = "2026-08-27T10:02:25.613Z" }, - { url = "https://files.pythonhosted.org/packages/d7/75/35823e4419df8792191b2a17ae3fe71b41d02c162b2c491c94d1a87f0caa/msgpack-1.2.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1814f92306ae7862908e9ece7cfd90e0dc87ded3e89b6ae7ffdd1175d6376fdc", size = 405635, upload-time = "2026-08-27T10:02:27.012Z" }, - { url = "https://files.pythonhosted.org/packages/6e/d3/6592e4064619b04f2dd0054c5fa13e37e3d55eb26044483d871fadb2f46b/msgpack-1.2.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d24b38a825bcca41bb956de50eb98451ef291304a8607fad99e619043d3e79b9", size = 417332, upload-time = "2026-08-27T10:02:28.776Z" }, - { url = "https://files.pythonhosted.org/packages/e3/a1/b21c6818a545e9a4a976ac954a5c250eecde9a02e0ec82f415473dab1324/msgpack-1.2.2-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:34e83e345194a2a51d8bd447dea9de2104f91e75b247f4735f14f04529f0746b", size = 374378, upload-time = "2026-08-27T10:02:30.678Z" }, - { url = "https://files.pythonhosted.org/packages/03/8b/7ada15c7b64151d6dbb562d1b091520efb2c37acf2403b1d4ae13797b27d/msgpack-1.2.2-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:682804bf31e43d46e51a9a33bd575b51e839d715ce6bd5612c055f7b28ad637b", size = 395809, upload-time = "2026-08-27T10:02:32.322Z" }, - { url = "https://files.pythonhosted.org/packages/bb/f7/96283e50f7020df4dfeacc55612b7a210c8cdf0dda48bc262f1f9b3e4c49/msgpack-1.2.2-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:9b659d77f8726fa5e7038967dda6b68d53cf34472c094cfa5b845454713b90d5", size = 373495, upload-time = "2026-08-27T10:02:33.832Z" }, - { url = "https://files.pythonhosted.org/packages/cc/fe/1548dede9d9ca482f2d424a2e110a9705d4e02627a16b8bc8d10ce0208a2/msgpack-1.2.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:4d9a562aec0a92fe536da2e533d313b3d2a6b929157b1dec7ff623446dc0a8ab", size = 414360, upload-time = "2026-08-27T10:02:35.396Z" }, - { url = "https://files.pythonhosted.org/packages/77/9d/4419b8f86c219174b1fb8bbd7faaf84a548935f7b1916d028401b9433417/msgpack-1.2.2-cp313-cp313-win32.whl", hash = "sha256:a4161eee7799863aee237c35c90427861f7b994416dd81ae829f560b0a81bdcd", size = 65196, upload-time = "2026-08-27T10:02:37.007Z" }, - { url = "https://files.pythonhosted.org/packages/3c/f8/593f5caf0dacab41cde1564c5f0419e61af55ec9628006205e8fd5eb5e03/msgpack-1.2.2-cp313-cp313-win_amd64.whl", hash = "sha256:b07c03f0da7e5279170df7745ddc732d526c8a198208936ec1a95c11ed2b2d5f", size = 72203, upload-time = "2026-08-27T10:02:38.28Z" }, - { url = "https://files.pythonhosted.org/packages/bc/9e/c6ef92046b4a2bbb9d3aa0cb581cbf4a4051afccf6e5fb301a1bd3086f39/msgpack-1.2.2-cp313-cp313-win_arm64.whl", hash = "sha256:d13d07efbf655f9ae7a2352b630c52727b359005b21ba08a507585c9ac8c0896", size = 65435, upload-time = "2026-08-27T10:02:39.534Z" }, - { url = "https://files.pythonhosted.org/packages/5e/50/3e92c403346652cabd08cb8faceef847bae917ea3b3c81b64a5b6d09ed41/msgpack-1.2.2-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:e497ee34e8a3342bbde51b27c22d8db05a651df3361dd3daef5b3ab0d66f3e04", size = 84315, upload-time = "2026-08-27T10:02:41.181Z" }, - { url = "https://files.pythonhosted.org/packages/b6/dc/8efe6dd96a12ab043930cb4cffb40b6e7f061491d6ec7a3d2b75ef1fda42/msgpack-1.2.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:0dd9173c5ebaf5ecc5ca86e7ae1db92934e1d57b856f3dd90698941431f4fd77", size = 84634, upload-time = "2026-08-27T10:02:42.621Z" }, - { url = "https://files.pythonhosted.org/packages/1b/89/996573095bf7b038c04dd65ddbc4f1a4d381b0f7a44ff9186f3c7b8325c2/msgpack-1.2.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8dc4487097571f7311188c3eca2a3e86cd1f1db4c37c7a017bcc3fd38486cbfe", size = 404194, upload-time = "2026-08-27T10:02:44.096Z" }, - { url = "https://files.pythonhosted.org/packages/b6/4e/46f5a5d949dbd054dab60cb15aac7ac6ae6774c134532893414689bf2f53/msgpack-1.2.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:73b0e05c32c3cfc3cd84994908e57430c0ebc6813abf905d3f18ff115d54df3f", size = 412343, upload-time = "2026-08-27T10:02:45.747Z" }, - { url = "https://files.pythonhosted.org/packages/da/e8/739a94197358a313307e6e9e7d8d22ef66add39222de911a44161aa96920/msgpack-1.2.2-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:aa1120c653b76d8eafa50423b5eba06b5c9737f8692c74fa3afe03e84b8978ea", size = 372620, upload-time = "2026-08-27T10:02:47.578Z" }, - { url = "https://files.pythonhosted.org/packages/03/d4/09b92e1fcdccea9466bfae45455367ac52362ae445d96a602e51b7a8df73/msgpack-1.2.2-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ccfd880988f8438d1c91c77d7edc58e70f4d2012e999167bc154c64c6f06ea6b", size = 394603, upload-time = "2026-08-27T10:02:49.172Z" }, - { url = "https://files.pythonhosted.org/packages/47/db/d11bd6f258a60703dcdc7a3772818ad0c2f602ee4c2acfb24088c6c3ebc3/msgpack-1.2.2-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:6195257a107bf25872ef84aab7295078271eea3ac6413f0506b631f6c9586ed5", size = 372666, upload-time = "2026-08-27T10:02:50.886Z" }, - { url = "https://files.pythonhosted.org/packages/71/cf/fbbbac0c6e5fbb9d51abc23e3b5fe8620f5c01e0588797cf664a623bb9e1/msgpack-1.2.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:b8dd6c71d20c28d2d0eb0c51e7cccf3584afde3b1364f6629596186c9025bd54", size = 410889, upload-time = "2026-08-27T10:02:52.51Z" }, - { url = "https://files.pythonhosted.org/packages/94/60/8366558da954095e04e7fbc351f9387d87a682feaee9a235ceda966f794b/msgpack-1.2.2-cp314-cp314-win32.whl", hash = "sha256:d242f3c4ccf55b056e6cf901720dccde58f1df117898f2bbf3bcd6e38ec7c248", size = 66774, upload-time = "2026-08-27T10:02:53.984Z" }, - { url = "https://files.pythonhosted.org/packages/4b/3d/1ce873c8057c65e4fbb076ffe1c99c9ae39d90a00a2540d7b06c652a292f/msgpack-1.2.2-cp314-cp314-win_amd64.whl", hash = "sha256:1510f24612d4b983dff6935d9273e02c320cfd525727fbcb58836a75f589fdbc", size = 73424, upload-time = "2026-08-27T10:02:55.277Z" }, - { url = "https://files.pythonhosted.org/packages/d5/55/e36f2a33e38657f33850d74e0bf256838a0d45802c298cc501a32bffcc08/msgpack-1.2.2-cp314-cp314-win_arm64.whl", hash = "sha256:7826f16edc763e768404f55605ef85dfcf5857e729c1ed29e0d7c180be4fe6d8", size = 67657, upload-time = "2026-08-27T10:02:56.493Z" }, - { url = "https://files.pythonhosted.org/packages/64/58/7e764b957bae80ae281a9cb28761068c8bae8d5c6ac0873e43cc69d176c7/msgpack-1.2.2-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:f466049b8e1ec0854287bbe9a074316826fe0e08dcf707245f98b1ae49e92650", size = 86594, upload-time = "2026-08-27T10:02:57.796Z" }, - { url = "https://files.pythonhosted.org/packages/ae/f0/250f5985b6ee533e60d357571a808aaae03c54118294dc3db7158e27feb1/msgpack-1.2.2-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1f6b6f8deb07d49090e1808c6ef9cb7d23ca17bef3aa6ed3e5e03df16606e60c", size = 87374, upload-time = "2026-08-27T10:02:59.256Z" }, - { url = "https://files.pythonhosted.org/packages/bd/2c/126ec8f187877c5f688631c543d1d3a3d75b2e66b83fb9de3ed7c13a39b6/msgpack-1.2.2-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b542ffc0a5c531eedc40419f291f1bd659aa8d4223408a5b51c88a2796083fd3", size = 428157, upload-time = "2026-08-27T10:03:00.9Z" }, - { url = "https://files.pythonhosted.org/packages/95/21/d2d81d50aaedb14147d01f22094185794db3ad8a8791b60afacba0627c89/msgpack-1.2.2-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7d095df2627e5dd59ac7b0c5ad627a671c76e6020171e03cbe4621a61f0562c3", size = 426669, upload-time = "2026-08-27T10:03:02.457Z" }, - { url = "https://files.pythonhosted.org/packages/c6/fc/f7d484ee5b572719608e7ffad569bea22ff11309a96ca2fae85eec94226b/msgpack-1.2.2-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ffdd2f4950daf7815490f23087963e3420175b9609520b7ff5df64d351159c22", size = 380625, upload-time = "2026-08-27T10:03:04.244Z" }, - { url = "https://files.pythonhosted.org/packages/0a/c4/b924cbd5516676f4e612329f18602a833bd055ffbe27f808eeba0f01bfea/msgpack-1.2.2-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:652d1bf13d01bac8fd569def0fe76745e55bcda01e30aa6332d5947ea3788839", size = 411328, upload-time = "2026-08-27T10:03:05.869Z" }, - { url = "https://files.pythonhosted.org/packages/27/9d/0c1d9683a951a80f270c3b7dac1022c18b9307617344dd44d904135d5e12/msgpack-1.2.2-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:9bf452ff4d4981f25a18e9476e002bcc9263e7928024aa4d7148e25f7be3f929", size = 377892, upload-time = "2026-08-27T10:03:07.37Z" }, - { url = "https://files.pythonhosted.org/packages/06/bb/bf22338cdd22e0b40c8f28468cea5f3d9c320244c095d8303364bc012c41/msgpack-1.2.2-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:55faa6f8395e23b848c535ad5dcb96b3462f37f5e7f4ac500d500434f7345da7", size = 419426, upload-time = "2026-08-27T10:03:09Z" }, - { url = "https://files.pythonhosted.org/packages/7d/42/6d02c19a01abd8d7ce817c321d2ee6af1a8e24d584dca619d1b6576a83bf/msgpack-1.2.2-cp314-cp314t-win32.whl", hash = "sha256:419a45c67a5c04213172a14b1864657e014665b77d7081b107a51707923dd39e", size = 71810, upload-time = "2026-08-27T10:03:10.498Z" }, - { url = "https://files.pythonhosted.org/packages/af/df/fda3a204415dab0a8c0db5461ef7205416ea52bd8581c5cafd361be07f3b/msgpack-1.2.2-cp314-cp314t-win_amd64.whl", hash = "sha256:935b1cfad9b908b0fa845010f4271df4c2f04e1cd26e3f18acd61a45f93c9e36", size = 78919, upload-time = "2026-08-27T10:03:12.016Z" }, - { url = "https://files.pythonhosted.org/packages/63/d4/4b4b0ef25a86deca91feaf7252ca885ba4f2ada40461379120122a04fe96/msgpack-1.2.2-cp314-cp314t-win_arm64.whl", hash = "sha256:11e8c421e117d1c36728b423d0402555cccbf0c6f53e288f0e75b6b12100d70f", size = 71925, upload-time = "2026-08-27T10:03:13.332Z" }, - { url = "https://files.pythonhosted.org/packages/3b/92/4b44bc8f3243ef8cf9cb5368c17a299d45b9df858f6dfdd98a0482dbbb37/msgpack-1.2.2-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:e1b99ad34613d5f8477fa5cf99bc4eaeaf27965588007c102370cd9a78fe9de5", size = 84293, upload-time = "2026-08-27T10:03:14.718Z" }, - { url = "https://files.pythonhosted.org/packages/80/05/c992bb65744665a41b5bf531fc0e1619bae0901f57738228ded90023c151/msgpack-1.2.2-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:0fbc1bed8a535389b41882cfae66376e248cd1680eaa94fd83193c73e1d24986", size = 84490, upload-time = "2026-08-27T10:03:16.12Z" }, - { url = "https://files.pythonhosted.org/packages/d7/bf/7f53b9e6709a4df7f9b9b81dc65f9dfaa32caf65bee94986ec2cb8fa07f1/msgpack-1.2.2-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:06d95f61de7afe4f4ff908a6feebfcb070d0582ac87c9cf3cedf8551cf634516", size = 405332, upload-time = "2026-08-27T10:03:17.692Z" }, - { url = "https://files.pythonhosted.org/packages/d2/5a/305c4dca14b50d0b51fb88ef04ec125b8f0be3e2ce730dcc62dbaa651cc5/msgpack-1.2.2-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b5c696ae7cd7166b3657261adb855b461ff31f07823fdbae9de8bf80adfccc21", size = 416798, upload-time = "2026-08-27T10:03:19.389Z" }, - { url = "https://files.pythonhosted.org/packages/7a/df/a645102b4cdfd9a94201cac4e900e9c1429fc16d86aa311c06eef82528c9/msgpack-1.2.2-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0708afbf6a9587f0bfe479a9825c141d14d91e2f6a5c8103cf28bc96f4edb5d9", size = 377312, upload-time = "2026-08-27T10:03:20.928Z" }, - { url = "https://files.pythonhosted.org/packages/f4/26/c56d8d086d3fb1077bb48092b158b5ea2eee08b279e10c191275f13bc980/msgpack-1.2.2-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:226a62ffe99fe54c5c61d910ec64c3449b7766c3280bd286bf6c94838dde239a", size = 395182, upload-time = "2026-08-27T10:03:22.571Z" }, - { url = "https://files.pythonhosted.org/packages/4d/b5/3d46ba367a565e536d8d2a61eebcee71b1dc803da3ce74a22313b573d6fa/msgpack-1.2.2-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:9fd7f32e2f0fb334e7ecc5adb5cf0458785bd3a9d9d86f950e1715f101cebce5", size = 377945, upload-time = "2026-08-27T10:03:24.151Z" }, - { url = "https://files.pythonhosted.org/packages/a5/2c/d5d2df273ed5306357da25b69400fd8d7a53c4d87d8976604b677484d61c/msgpack-1.2.2-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:9db1ba1c1e6a84245a9dd866265b56b8a1e9461549cc72ed296d8cbfbd32961b", size = 413341, upload-time = "2026-08-27T10:03:25.85Z" }, - { url = "https://files.pythonhosted.org/packages/1b/fb/32613bced3cad47b40b1b73dd04d687121349d83f748efc2575929121903/msgpack-1.2.2-cp315-cp315-win32.whl", hash = "sha256:e2eb7ea0ac3911a7aac9d8aaa36d40f216d99455b3274cd3fac38181bcd910cf", size = 66730, upload-time = "2026-08-27T10:03:27.294Z" }, - { url = "https://files.pythonhosted.org/packages/74/56/d86171f7251015e9312e5a7f9fdd4cf89752fc2114b88fed453d2a040c66/msgpack-1.2.2-cp315-cp315-win_amd64.whl", hash = "sha256:9352e6cdb510a7b1a5d3ccaccec730e82e50cf3484a3af7bdaab19e23b9589ff", size = 73477, upload-time = "2026-08-27T10:03:28.615Z" }, - { url = "https://files.pythonhosted.org/packages/13/1a/56b90f6defef61700b86baca3637c15f62ac0f9b21ab0f16613ab9d1f101/msgpack-1.2.2-cp315-cp315-win_arm64.whl", hash = "sha256:29cc2d5291711a52956a79a51f41c732329df39ad727c886bd8f0b5b9237a808", size = 67660, upload-time = "2026-08-27T10:03:29.895Z" }, - { url = "https://files.pythonhosted.org/packages/cd/20/12751ca0d8ec874701b54c392c2b19f51af8dd1de40a92a10e356f0aaf58/msgpack-1.2.2-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:d886baa46b2532135e7320067e6a44edb09ba5883a6096b0f9c044533984b8a8", size = 86462, upload-time = "2026-08-27T10:03:31.348Z" }, - { url = "https://files.pythonhosted.org/packages/91/4c/cf6d12a3d709fe5f9771dd917c35e6ebcd55597a5b792287382fde056c95/msgpack-1.2.2-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:53679573c75cce5f82359e0bd4e6a97809a6b9a9b7a48fd1ba592f4a82cddc84", size = 87412, upload-time = "2026-08-27T10:03:32.74Z" }, - { url = "https://files.pythonhosted.org/packages/ca/0d/0aac5752d1708dcb458f8754db34a4999514db3df2d2b798b9381293f638/msgpack-1.2.2-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d3c247d457ae9079974c7ce3c665396754a6d2baff7eaa51332212a8a5a3f13b", size = 422057, upload-time = "2026-08-27T10:03:34.124Z" }, - { url = "https://files.pythonhosted.org/packages/81/30/70f281a3685b04aaf235a5237da11b978a02a865a5a479186205177ad676/msgpack-1.2.2-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:352ed831042549cca8be23780e1fe7c9177e65ff02bf183509c4b4d33f671782", size = 422696, upload-time = "2026-08-27T10:03:35.862Z" }, - { url = "https://files.pythonhosted.org/packages/8a/6d/f76e8425efb0aa38988cd778ae290bfa120491d80d26872d88bb52fedb3f/msgpack-1.2.2-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f80361592c13d7226b4379c8941529b63fe1a9d0e05d2de8f3306b70e522b53f", size = 376495, upload-time = "2026-08-27T10:03:37.339Z" }, - { url = "https://files.pythonhosted.org/packages/95/77/0809aa9b52b2868f7d01862dc14073708f0440421a65197b48453480034c/msgpack-1.2.2-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:68df2947921d449f6dcfeafd86cb2cdde13327a8b447534bbe4ee5aaf32a5695", size = 404683, upload-time = "2026-08-27T10:03:38.87Z" }, - { url = "https://files.pythonhosted.org/packages/02/d2/4e5ac915ba120172d210ef00165c5e6276c8a65db3a4a5cf36e946b83e23/msgpack-1.2.2-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:51dd39d23cfdea0400ed3ff2d29d1e83bd951d3aea79dc89be5b701a09edfe23", size = 375087, upload-time = "2026-08-27T10:03:40.486Z" }, - { url = "https://files.pythonhosted.org/packages/cb/e3/8051d53e5495c87c6cf27eb42fb680361017037f87f322bdaf525f71e4a2/msgpack-1.2.2-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:b13b59e66f107cca1ba708dd5307179870ca1b15b19fcee7ccf722e5308d9212", size = 414421, upload-time = "2026-08-27T10:03:42.308Z" }, - { url = "https://files.pythonhosted.org/packages/ba/4e/13783aa7c17414d7186c72c49bc718366f75e49f0ea58d4f81cb63ac3187/msgpack-1.2.2-cp315-cp315t-win32.whl", hash = "sha256:8c6321a414f8b4a8dc43976b2fa8349156434ca9adedd9a187b796f7e1d3d3fc", size = 71790, upload-time = "2026-08-27T10:03:43.715Z" }, - { url = "https://files.pythonhosted.org/packages/5e/9d/1d02994c7ae2603c98100984428ff0f67443572133bc18eca6058f732c1b/msgpack-1.2.2-cp315-cp315t-win_amd64.whl", hash = "sha256:6f53285f20d592ed309ee19e509cc4c77a3bda1db02ad67e8a0949bb227a5a6d", size = 78766, upload-time = "2026-08-27T10:03:45.036Z" }, - { url = "https://files.pythonhosted.org/packages/60/54/89ed16e6f966a050dc78b0e94a545025211b07ce9f4bdfe07dff70c03fc2/msgpack-1.2.2-cp315-cp315t-win_arm64.whl", hash = "sha256:a378e12ccc06d76efde115caf4073b7e5ff3cc18291d1341f9e65fb882e3f754", size = 71819, upload-time = "2026-08-27T10:03:46.375Z" }, + { url = "https://files.pythonhosted.org/packages/27/fd/45f6cd13cefbb659a8e0128ea64d51b349571163fec3c9c20f99792dc42a/msgpack-1.2.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:90cba4996b18ec1201fcaabd01ec48ff4b9755416bcd52105ded2f89fe145c49", size = 91903, upload-time = "2026-10-26T17:54:03.097Z" }, + { url = "https://files.pythonhosted.org/packages/7f/89/169c2a0b1ffeafe68a4f13d8d96b6ed1cd8d40d8262b3a6690851da7eda1/msgpack-1.2.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:112933726919f4239646cca9572e2c2fa5626358c670da8440aac09403100a48", size = 90573, upload-time = "2026-10-26T17:54:04.383Z" }, + { url = "https://files.pythonhosted.org/packages/cf/8e/272a384f2a001cfced1baab0a8abdd912d6281432670f4609d1aab718d7b/msgpack-1.2.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9ca1e78106675f2aed07dc37b842ce19be70010ab22c5c5c04688f0840d48539", size = 461057, upload-time = "2026-10-26T17:54:05.821Z" }, + { url = "https://files.pythonhosted.org/packages/1e/d9/f59bd841fc2fd2b74dc50ce85860a6a25f58e588dd48946aeaf2862cf990/msgpack-1.2.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c4d5bbdbea8f5669b3a734d6c226772804fb120848f99cbe63a0ddee63b049c9", size = 475652, upload-time = "2026-10-26T17:54:07.414Z" }, + { url = "https://files.pythonhosted.org/packages/00/03/afd000e1b1e28fd535dc8c7bc21ebb88923bc1964a2429fe660fb313ace3/msgpack-1.2.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0d9ff7f3aaffd84010f1c501b05406a497584f5cab2f732eb9d89bf960e12f6f", size = 427082, upload-time = "2026-10-26T17:54:09.1Z" }, + { url = "https://files.pythonhosted.org/packages/f7/7a/e2890b272883c496faad777324ddb70e9cc4a6c63731962a4a39a6a40f44/msgpack-1.2.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:aa10dc04c03408f31948ac1896a942141fd8d7a954b3612edac79f19663e4076", size = 451956, upload-time = "2026-10-26T17:54:10.476Z" }, + { url = "https://files.pythonhosted.org/packages/c2/46/0c1b240b8a580af3e72139c33b018025440a1a42c2579e82e39b1195ee36/msgpack-1.2.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:472a25463678f2795143a7cb42e88a1b59cc2375e9881917e69a9323bde42114", size = 423833, upload-time = "2026-10-26T17:54:12.195Z" }, + { url = "https://files.pythonhosted.org/packages/80/8e/851415b1a9264e6abf64d8a9617d856769d59e247fb9470106f133aedbae/msgpack-1.2.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:cbb8a677da3e845713925e9a203b8a120b1e9da9989836890ba4a4a187902701", size = 470951, upload-time = "2026-10-26T17:54:13.764Z" }, + { url = "https://files.pythonhosted.org/packages/c9/74/d75bf61aab9cb88b84f7d3a8eca8dd92e19a742b77ded300a1177e88d031/msgpack-1.2.4-cp312-cp312-win32.whl", hash = "sha256:2b0b7dff5beddc10f16ecea6b28c6b98014d1135d7015bd83adff5037f35848d", size = 68786, upload-time = "2026-10-26T17:54:15.049Z" }, + { url = "https://files.pythonhosted.org/packages/81/c5/dd0e78eb04f9a0773a810d25ef2cd8f16bb941487567d0c63f814881133c/msgpack-1.2.4-cp312-cp312-win_amd64.whl", hash = "sha256:6e38b123681df22373d545520f54bbeddc4706d9235a1161061f12bd6648497d", size = 77272, upload-time = "2026-10-26T17:54:16.491Z" }, + { url = "https://files.pythonhosted.org/packages/65/e7/b38f63ae82777c0077daa56c4b09af39d29dcb8927ab2ff59268094069c5/msgpack-1.2.4-cp312-cp312-win_arm64.whl", hash = "sha256:6795c588b210b2f13d62c8fcc23bf779b509b839ec5c197a7ab4f5191459e126", size = 71884, upload-time = "2026-10-26T17:54:17.995Z" }, + { url = "https://files.pythonhosted.org/packages/2d/26/16eaad5fe6e199334fa5bd66070778665717c86e9a273525dc706ddb06a7/msgpack-1.2.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:fb811ac3d463a75013b234d2aae56b9f0bdb0105caf4dd2ee65305b6a8a6078d", size = 92057, upload-time = "2026-10-26T17:54:19.616Z" }, + { url = "https://files.pythonhosted.org/packages/9c/b8/9660be6d120820bc05106f291e824c73d35f4ab77d927788ae67ea80889c/msgpack-1.2.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:36258fd0909e1bf26e94604439108846432abe4ffa9a23c9dc2f6f1c60f94b60", size = 90542, upload-time = "2026-10-26T17:54:20.965Z" }, + { url = "https://files.pythonhosted.org/packages/6c/10/cd55a69fec29df26884b178dc4b1803442ec82abf929604aac619881917a/msgpack-1.2.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e9c5ba0f053a7e98f013f083c9d1b2dffb26cad8c897c533d8286e44ed24c669", size = 455798, upload-time = "2026-10-26T17:54:22.434Z" }, + { url = "https://files.pythonhosted.org/packages/c9/94/562e0733593a780c70b0b18994f30c205149f7f9f4efbe3e9b00b88612c5/msgpack-1.2.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:7fabd415c41e62006c6641fcdf5b3e866f581c4e11c58328c0d0f69584b9577d", size = 469262, upload-time = "2026-10-26T17:54:24.043Z" }, + { url = "https://files.pythonhosted.org/packages/bb/92/76d1a5c597e04e1d360b05573d150bdb4502f5a014e6e9cf089c9537c156/msgpack-1.2.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7433d340de45003db3ed909a642c9469b598d175530f7a707cbaba64287d27ce", size = 420789, upload-time = "2026-10-26T17:54:25.587Z" }, + { url = "https://files.pythonhosted.org/packages/8a/c6/b72b8d8022718380db459ced8ffbabc7570ad2d22c7f2fa659c872cb6734/msgpack-1.2.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ccd6e4af5347eb9828147320449bcd30e3321f6397d4583ff16047485dd8be3d", size = 447068, upload-time = "2026-10-26T17:54:27.721Z" }, + { url = "https://files.pythonhosted.org/packages/cb/dc/f378ef1def4aa135e70325c09e22457f3203ae2a390a192e892267906f33/msgpack-1.2.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:23d1459a1d0b4c9f6629df072d592eb74424b3ed3656b69af507bc9023cc027f", size = 418896, upload-time = "2026-10-26T17:54:29.325Z" }, + { url = "https://files.pythonhosted.org/packages/62/93/a7e507378f43e91415cb6fda47e0ded0c9de1618a1f4ac4f2887912a92dd/msgpack-1.2.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9e73761fe9fc55a4e9d2df8e8f59b0979231af4dbf80b8bf90cd64c74173d779", size = 465764, upload-time = "2026-10-26T17:54:30.719Z" }, + { url = "https://files.pythonhosted.org/packages/60/76/7f39f49cbcdaa4aafe64b4941b2640772dbdc1cac3a9332f4c9ba6994da9/msgpack-1.2.4-cp313-cp313-pyemscripten_2025_0_wasm32.whl", hash = "sha256:d088d1f552e129859db830692268747aba0a1ee3e6e0fe6344dbb3aab1df9f6c", size = 53615, upload-time = "2026-10-26T17:54:32.213Z" }, + { url = "https://files.pythonhosted.org/packages/67/9b/85b93350dbd7b52b358882f7f17a88a03664a7a59a359406e6315c162634/msgpack-1.2.4-cp313-cp313-win32.whl", hash = "sha256:892d4f17d7962bfd2c2928b0a47542bf2948f074a7c04721b73d4138b70481e4", size = 68724, upload-time = "2026-10-26T17:54:33.484Z" }, + { url = "https://files.pythonhosted.org/packages/02/4a/a7e2778ce09a943c17b6f91c7acb2f9488357657c01f2cccb278297621c4/msgpack-1.2.4-cp313-cp313-win_amd64.whl", hash = "sha256:318d4e634d2b320be10decd9968ad1ae0be1d80cba23b5528c37b429eeb0e3e0", size = 77039, upload-time = "2026-10-26T17:54:35.016Z" }, + { url = "https://files.pythonhosted.org/packages/64/16/9ff7495a9853e9d7de74965fdadce15017e7213ce564bb5dafc5403c9108/msgpack-1.2.4-cp313-cp313-win_arm64.whl", hash = "sha256:bec3e34749b90cfcf116149aad11295c720ff4a74a7d0a35abdb968a396c1524", size = 71873, upload-time = "2026-10-26T17:54:36.19Z" }, + { url = "https://files.pythonhosted.org/packages/86/34/747f9ea2b428088201c73fcb3a885cebcbedcd71def0f1f3c36896294b27/msgpack-1.2.4-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:895e9369185df4a874768849405c30cba7990caceb3fcb1692ebe62bb050f55e", size = 92449, upload-time = "2026-10-26T17:54:37.503Z" }, + { url = "https://files.pythonhosted.org/packages/83/7e/52d208cb1561f869762c17be0e2c004e4d34f2842d239a450492d6246d62/msgpack-1.2.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c97f5f17407e1761f23f1944be33cbf1d5ce67017db32544dcd5e16e0b1b4a3b", size = 91202, upload-time = "2026-10-26T17:54:38.797Z" }, + { url = "https://files.pythonhosted.org/packages/2e/58/5516cabb60da83506024015c669622a0277979aef51eb611308cebaf4cc9/msgpack-1.2.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2444a4e04f924630d059ae6eae8f91fdfcd28ed9fd17b21bacf4e74550a091f7", size = 455185, upload-time = "2026-10-26T17:54:40.213Z" }, + { url = "https://files.pythonhosted.org/packages/39/8f/bf975b5d2111e4954a0f8567fc6b60bab22c8766dd4fa509af1334c91a4f/msgpack-1.2.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:5d65b791ce4283e02b6267742ad540899155e1b32887b9cbdda47f38f5a076b5", size = 465078, upload-time = "2026-10-26T17:54:41.971Z" }, + { url = "https://files.pythonhosted.org/packages/32/2f/c74baeafc53d1c1fadfbeb774444d0e6354778d12b40b827e437a7a35856/msgpack-1.2.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:5e4c67dbac05dce90a3fa1d845137617383c415e6b319062baac9734540706ae", size = 420144, upload-time = "2026-10-26T17:54:44.994Z" }, + { url = "https://files.pythonhosted.org/packages/b0/f2/bdf2ce9e284821397dc5549101824c7607ee6ba6e0635390d168a77ac49c/msgpack-1.2.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:781e856db4f2cb398e4992e2a74305295d3ebf694eec26fa0f4bc766eb9fa0a0", size = 446479, upload-time = "2026-10-26T17:54:46.484Z" }, + { url = "https://files.pythonhosted.org/packages/76/8d/b4572d24bb75d98bcbbd031a934a3a1d03494ea88a100cd51ab16c4c7d57/msgpack-1.2.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:cfc1cc237792f9a5664002b66acb961027d4184528ec9d10e0e42330f7972383", size = 418780, upload-time = "2026-10-26T17:54:48.04Z" }, + { url = "https://files.pythonhosted.org/packages/55/8e/4493bef4422730cfd3420b84094652fabd27ef8aadc8b443a8995b524d08/msgpack-1.2.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:f60de6ae13d4d2a12a483f15c5e47cb6fa2731aa32d92fb31178e2017d6574a8", size = 462009, upload-time = "2026-10-26T17:54:49.433Z" }, + { url = "https://files.pythonhosted.org/packages/41/29/efdc3d1d09e4e0e45955b0aad559b4c1f5d908767c9fb1021990c52182a5/msgpack-1.2.4-cp314-cp314-pyemscripten_2026_0_wasm32.whl", hash = "sha256:06a0657a4110d563255006b7cb7147432f67827144e429c2cdb1c967548d1817", size = 53714, upload-time = "2026-10-26T17:54:50.753Z" }, + { url = "https://files.pythonhosted.org/packages/df/0b/08794c65e0a752acf20aa44e193e61dfb552b48fe6c27ba6023c146f9e77/msgpack-1.2.4-cp314-cp314-win32.whl", hash = "sha256:727a65b35db9f5ef516fc0229c4b05cab983092b1ae274a8a769b2d517fb0499", size = 70726, upload-time = "2026-10-26T17:54:52.397Z" }, + { url = "https://files.pythonhosted.org/packages/b5/da/e2cc63ec61e7ac05595b391cba01c10cb4657f4e517da1512e4a75d2d12e/msgpack-1.2.4-cp314-cp314-win_amd64.whl", hash = "sha256:80f5d4fda1ba373d95933f98e6c1d18247feffac839fda3930bdd85e6561bb5f", size = 78346, upload-time = "2026-10-26T17:54:54.662Z" }, + { url = "https://files.pythonhosted.org/packages/93/e4/1b0eb49887009dc2c530171d659cf2aa37202b5f79c0b784e63777554b37/msgpack-1.2.4-cp314-cp314-win_arm64.whl", hash = "sha256:e5f67f0286f2ba2c6dbb4998404ed880112ca204ceda729cf239879cd89d3acf", size = 74152, upload-time = "2026-10-26T17:54:55.915Z" }, + { url = "https://files.pythonhosted.org/packages/d0/4a/6defc8fd0270c4ba675e6625f4f76ce936fd0c48733395fd7ba912cd423e/msgpack-1.2.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:45506bfb902cde24a0d33fb0581f58497ddb2682686dd1f6aa07e7b769df7ca4", size = 94083, upload-time = "2026-10-26T17:54:57.108Z" }, + { url = "https://files.pythonhosted.org/packages/c8/e8/59f7e076739048864710a4de3403ae1c1b43ed5077b796cd9e8cbce9b3f6/msgpack-1.2.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:dc9dc681958e69f46b9f37def3e7fd6cc5dcfaa5943fb00bfe9c223a1a1052f6", size = 95037, upload-time = "2026-10-26T17:54:58.489Z" }, + { url = "https://files.pythonhosted.org/packages/2c/dd/dbae250b23b831cd0571eb664089f80de3249a39e98c6ef55f9a0efe928d/msgpack-1.2.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0bef691e2a95119cc6bf3ded29325dbd89c4b6f8ff233070431948ed70902421", size = 472722, upload-time = "2026-10-26T17:54:59.924Z" }, + { url = "https://files.pythonhosted.org/packages/a9/e2/383ece1c1b27c1ed322055fce8ab8972bc6d529ede881592065ce0c461bf/msgpack-1.2.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:55e6106d2d085af42b2de72efeb38ed255241a24b32295ca889707c1d679c442", size = 468726, upload-time = "2026-10-26T17:55:01.492Z" }, + { url = "https://files.pythonhosted.org/packages/37/2f/5410a8815ae74a824ac87543c612e40cb6674851b70a6ad858bb32813203/msgpack-1.2.4-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:996dfc4774c240c8e6adf1166ae102141cfbed33c8856fde821bd6c0bd35ee41", size = 420488, upload-time = "2026-10-26T17:55:02.848Z" }, + { url = "https://files.pythonhosted.org/packages/39/8e/16fdf02b4f91dff9c1480433c1bf80756c2fedc0b74fc6a231f02dfed007/msgpack-1.2.4-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:efa1357fb0c7201e833de28638be371ee127476f7ccff9e7a94211b0afc33ddf", size = 455541, upload-time = "2026-10-26T17:55:04.564Z" }, + { url = "https://files.pythonhosted.org/packages/c4/76/2454ef54d780a167667552d02e7bc977a3d419943bcbdf6a96a4da6786ad/msgpack-1.2.4-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:b9270b63409e70c8c6deb5faedc81fc27c6bd0196b38084a8773f68286abf034", size = 419514, upload-time = "2026-10-26T17:55:06.257Z" }, + { url = "https://files.pythonhosted.org/packages/ac/8b/2af9bf378def33c24875f250421b0d0b1b06f72a1c2c3f964749fc4cdee1/msgpack-1.2.4-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:2b597bb01aff61d65e305c2cf2589c93c86609929d42d575bfc359f3c54ea8e1", size = 461910, upload-time = "2026-10-26T17:55:08.05Z" }, + { url = "https://files.pythonhosted.org/packages/0e/46/a133ac6c4cef4d3939383c00cc19baa16ee85fd70af0c5990e7a9ca8767f/msgpack-1.2.4-cp314-cp314t-win32.whl", hash = "sha256:ad5bc540cbc34db236f8535721a9a872d12a9d88d1322470f1fc7c5e9dadfdb2", size = 76441, upload-time = "2026-10-26T17:55:09.711Z" }, + { url = "https://files.pythonhosted.org/packages/d4/f5/8d22ec454c188f1795107a3fd9f68ada485076ebf394a4aaaa5fbb6093e7/msgpack-1.2.4-cp314-cp314t-win_amd64.whl", hash = "sha256:287e52c2ebaa94f8eca045628374859f51584e77bc07086e6835a9bb2204c774", size = 84321, upload-time = "2026-10-26T17:55:10.947Z" }, + { url = "https://files.pythonhosted.org/packages/41/52/1390514aee47d14ca3fe6ea0cf236fddc55021867ace30daf8761deba36f/msgpack-1.2.4-cp314-cp314t-win_arm64.whl", hash = "sha256:f3f19fe5decd348b35b003ae5f32d3fa90877413a0183da676f748a3a7ab9270", size = 78589, upload-time = "2026-10-26T17:55:12.425Z" }, + { url = "https://files.pythonhosted.org/packages/d0/d8/0465d475c1a7063af1a1fb4f8c69e0dd661c4dd172055c9757a343a07d5d/msgpack-1.2.4-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:765584b93ed6f0b561f0c56e9735f24945c0682f857c9b3ee3b4caad9c32f66a", size = 92449, upload-time = "2026-10-26T17:55:13.665Z" }, + { url = "https://files.pythonhosted.org/packages/b2/d0/5220a8a53579dda39f3526394ba5b7eafc28736085f2626deda7fcd22cd1/msgpack-1.2.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:0221748c30ace75fde0dec8c470abe65fb5374cd4f37adb9db6aca7a3c362c0a", size = 91209, upload-time = "2026-10-26T17:55:14.913Z" }, + { url = "https://files.pythonhosted.org/packages/b2/98/f151742eba413503074a10d8f636bf03dd4f3f7cba29689767a35d19bd1c/msgpack-1.2.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c5917972ce1bf5f85f761031e00dab6fe0ad9f880cb3d2d43ed74b330c850400", size = 455713, upload-time = "2026-10-26T17:55:16.406Z" }, + { url = "https://files.pythonhosted.org/packages/b0/54/890510a2c9841aff63258e085d15d4e140c7eef559d4da81ef2d2d867436/msgpack-1.2.4-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e7ae8cf6012372cecb43016132d1b87ccc2ebb8ae5ab5078687399e82423386a", size = 466177, upload-time = "2026-10-26T17:55:18.351Z" }, + { url = "https://files.pythonhosted.org/packages/3d/41/a6f20d7c2c380fb072b95ffc5b865a1d62eaf49d77fbee44466c45a1a8de/msgpack-1.2.4-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e78c66cf97ac5675037f705ca433ad98ac9177f9523e7fdbb34e486ae29044c8", size = 424398, upload-time = "2026-10-26T17:55:19.979Z" }, + { url = "https://files.pythonhosted.org/packages/89/86/fa9559961f2b0d498e6cefa226298ddee2b896cb223449c211702bc34071/msgpack-1.2.4-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:59887281c3c163a7afff7dffaaad2f78cd2b513b7e1a7843f1ee8e7cd6a94231", size = 445686, upload-time = "2026-10-26T17:55:21.775Z" }, + { url = "https://files.pythonhosted.org/packages/39/23/5a9d94036cdd77d4310bbb7cfaf3ccd1f087c4a5d5a4befec4361c5fc0dc/msgpack-1.2.4-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:9f46e70c8d22e96856967ab9d80c51dcf5bc63133e4da2d66fab64c0d4119b82", size = 422096, upload-time = "2026-10-26T17:55:24Z" }, + { url = "https://files.pythonhosted.org/packages/6e/4b/86a5384112509a94ff6e20028aba6845138743effb7c6617e959ad1256ab/msgpack-1.2.4-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:0a1fd6c31952155b7cd01061288c70303e6554ae855244dfb38a897fd94f8749", size = 463407, upload-time = "2026-10-26T17:55:26.146Z" }, + { url = "https://files.pythonhosted.org/packages/f4/cf/14db289e0ad531e22ce0f03284865f81d14fbc80bf3f79d3b1714bcf76cf/msgpack-1.2.4-cp315-cp315-pyemscripten_2026_5_wasm32.whl", hash = "sha256:b1f08ec826417e3c8dc3edadb50f38debba033af6cb849229f0eac72f80f2342", size = 53743, upload-time = "2026-10-26T17:55:27.497Z" }, + { url = "https://files.pythonhosted.org/packages/46/72/a76fc90b51503c0bdacbc7fc823aa6fa62d40596ac47f9ea8492d6f95a34/msgpack-1.2.4-cp315-cp315-win32.whl", hash = "sha256:e8ba23c838739fe929e868095171e71f2f38d6ce0fcf5840b576fb82648e58e6", size = 70780, upload-time = "2026-10-26T17:55:28.705Z" }, + { url = "https://files.pythonhosted.org/packages/58/a7/fa9d4a1b5dfead83ea6e03b4007041a5da988c25eb941d42612e0211d3c0/msgpack-1.2.4-cp315-cp315-win_amd64.whl", hash = "sha256:67310606cf2528a6dc3ece1298dcd5cc6c57add148b16d22c5111138aa84820c", size = 78288, upload-time = "2026-10-26T17:55:29.928Z" }, + { url = "https://files.pythonhosted.org/packages/b5/f3/8163d7938a8fe003952fe2719ddb31da71998559bbe290c55ffe622b886b/msgpack-1.2.4-cp315-cp315-win_arm64.whl", hash = "sha256:ce76e7a7c11459157887a8dadf07c107ff74eca98cf914f0de6ee7ab4b47104d", size = 74235, upload-time = "2026-10-26T17:55:31.112Z" }, + { url = "https://files.pythonhosted.org/packages/b4/fa/37c3219b250d81bee788c0dd78ae2fc673db2da1c21ae51f7982d85698f7/msgpack-1.2.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:fb9ddbf23b8c6e89752af399fcf4daed60055e239cda44c6acfaa76d19331e8c", size = 93793, upload-time = "2026-10-26T17:55:32.304Z" }, + { url = "https://files.pythonhosted.org/packages/83/9f/b8afcd20d32cf4be1fa3c327e997656d6d446e667452b0fcc66b91710e82/msgpack-1.2.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:e283cf563166c21762131b88e3870ee2ec57757b08a8736929757b5a67541061", size = 94746, upload-time = "2026-10-26T17:55:33.624Z" }, + { url = "https://files.pythonhosted.org/packages/e6/4f/03348d381fcbbc2685356833408cc7e9d2af0fe0775926935a2889650f64/msgpack-1.2.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:40e91bf8325f492e8eb3c3aa6de06b20593c225336bb52b585c913d7c1da025b", size = 468480, upload-time = "2026-10-26T17:55:34.991Z" }, + { url = "https://files.pythonhosted.org/packages/16/46/e54af8d9a51fb562e068e69a0d75a51e9c2fedec49f911f888515f5477ab/msgpack-1.2.4-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:cfa86432bf329d6b976f5a00ad4c9064fd51736e4967a52526750236345cc2da", size = 470064, upload-time = "2026-10-26T17:55:36.615Z" }, + { url = "https://files.pythonhosted.org/packages/74/f5/8f9a6b3af1d803e832b11017c8dad44d761fefdb91dba04ee58cb51838da/msgpack-1.2.4-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:42e0a7dc26df739149478585d4264338b4d330f24b3e3b57d5aa89e48866e8ab", size = 421267, upload-time = "2026-10-26T17:55:38.076Z" }, + { url = "https://files.pythonhosted.org/packages/4b/8f/7302b0d18eadbbfef9be1dbbdc49905f7f3b847200c3e47068d093976be4/msgpack-1.2.4-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:8e680367090a58c966052d61418cc943111863538fd82471d61fca5271d911e1", size = 451244, upload-time = "2026-10-26T17:55:39.639Z" }, + { url = "https://files.pythonhosted.org/packages/36/c6/05717fb56b510b5e974446f2cb8e9b26fa4347fafc0c5927745b176939b3/msgpack-1.2.4-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:a6c9926f8871b261622fe6b599db72c69be5bca8fdc0976886f9a531a301dee9", size = 420273, upload-time = "2026-10-26T17:55:41.488Z" }, + { url = "https://files.pythonhosted.org/packages/05/d9/a19077d664c37319097e16ba8de14e6b3a2edcc8ee78a2069c0808e38960/msgpack-1.2.4-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:c50bac325dbf1a9c80e10da6dbd1100d7082f6b12e153084501e18e86cd3a037", size = 460421, upload-time = "2026-10-26T17:55:43.223Z" }, + { url = "https://files.pythonhosted.org/packages/a2/bd/0e2033a7435f8d2311be37363fedc88bdfa9fd95c364ee8ac3216eb63e36/msgpack-1.2.4-cp315-cp315t-win32.whl", hash = "sha256:34051de19ae532ba47fcab5b0abd08c25c7a64ff763ad819f18764d45f3c2c81", size = 76256, upload-time = "2026-10-26T17:55:44.588Z" }, + { url = "https://files.pythonhosted.org/packages/b3/3f/aa7265f25dafb6af7567a1a7d0a95c5566803db2226c5e084dc5850cfd96/msgpack-1.2.4-cp315-cp315t-win_amd64.whl", hash = "sha256:6ad2f0808099d4281208ff2c756efa958a55a7c8eb21fe1c7052b95c584f02f1", size = 83939, upload-time = "2026-10-26T17:55:45.773Z" }, + { url = "https://files.pythonhosted.org/packages/bf/f2/c53904c4bc3da828fb75678bf489ece808a277affa73f8a7a91dfb7c5851/msgpack-1.2.4-cp315-cp315t-win_arm64.whl", hash = "sha256:e38d854f1c60e94f46d998765201126338bde3fe1b029be0d849094bcbef72c2", size = 77995, upload-time = "2026-10-26T17:55:47.016Z" }, ] [[package]] diff --git a/docker-compose.yml b/docker-compose.yml index 0a3a53a..6e2b174 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,11 +6,11 @@ services: context: . dockerfile: Dockerfile args: - EVENTLENS_REVISION: ${GITEA_COMMIT_SHA:-local} - container_name: eventlens + EVENTLENS_REVISION: ${EVENTLENS_REVISION:-local} + user: "10001:10001" restart: unless-stopped ports: - - "1252:8000" + - "127.0.0.1:1252:8000" labels: net.unraid.docker.webui: "http://localhost:1252" net.unraid.docker.icon: "http://localhost:1252/eventlens-icon-512.png" @@ -20,8 +20,9 @@ services: - ALL read_only: true tmpfs: - - /tmp:rw,noexec,nosuid,size=64m + - /tmp:rw,noexec,nosuid,size=128m mem_limit: 1g + memswap_limit: 1g cpus: 2.0 logging: driver: json-file diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 35bc17f..c343db9 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -16,7 +16,7 @@ normalized events (bounded strings/fields, explicit timestamp validity/source, s deterministic correlation rules -> incidents + reasons + evidence IDs | v -React workspace shell (Analysis/Timeline/Hunting/Reports/Settings) -> virtualized timeline/filter/inspector -> cloned redacted JSON/Markdown export +React workspace shell (Analysis/Timeline/Hunting/Reports/Settings) -> virtualized timeline/filter/inspector -> worker-redacted JSON/Markdown export ``` ## Boundaries @@ -24,7 +24,7 @@ React workspace shell (Analysis/Timeline/Hunting/Reports/Settings) -> virtualize - `backend/app/main.py` owns HTTP, CORS, receive-level request limits, bounded parse admission, privacy headers, upload reading and response contracts. - `backend/app/parser.py` owns the untrusted EVTX boundary and never emits raw XML to presentation code. - `backend/app/normalize.py` maps parser-native JSON into `NormalizedEvent` values, with bounded fields, UTC timestamps and explicit `event`/`record`/`missing`/`invalid` timestamp metadata. -- `backend/app/correlate.py` consumes normalized events only. It never parses raw EVTX, requires provider/channel context for provider-scoped IDs, avoids unknown grouping keys and attaches stable rule/incident/evidence identifiers. +- `backend/app/correlate.py` consumes normalized events only. It never parses raw EVTX, requires provider/channel context for provider-scoped IDs, avoids unknown grouping keys and attaches stable rule/incident/evidence identifiers. Campaigns summarize adjacent incident windows for the same rule and grouping key. - `backend/app/models.py` defines the API contract. - `frontend/src/filter.ts`, `redact.ts` and `export.ts` are pure browser-side workflow functions. - `frontend/src/main.tsx` is only the React bootstrap. `frontend/src/app/App.tsx` owns explicit workspace state (active hash workspace, selection, filters, settings and loading/error state); reusable shell/state components live in `frontend/src/components/`, and Analysis, Timeline, Hunting, Reports and Settings live in `frontend/src/workspaces/` over the same in-memory `Analysis` object. The browser UI does not implement parser or correlation rules. @@ -35,6 +35,6 @@ Uploads are bounded while ASGI body messages are received, then read in bounded API and health responses are non-cacheable and carry defensive browser headers. The production container runs as an unprivileged user with a read-only root filesystem, dropped capabilities and a bounded temporary filesystem. The browser keeps only the current normalized analysis in memory; large timelines are virtualized and search documents are cached per event. -The deployment broker passes the validated main commit as `GITEA_COMMIT_SHA` into the Compose build. Docker embeds that exact SHA as `EVENTLENS_REVISION`; `/health` exposes it with the product version without running Git in the container. An unlabelled local build reports `local`. +Docker accepts the source SHA as `EVENTLENS_REVISION` and records it in the OCI revision label. The managed deployment also supplies the exact revision through its environment. `/health` exposes the revision and product version without running Git in the container. An unlabelled local build reports `local`. The browser stores only one validated local-preferences record in `localStorage` (`eventlens.preferences.v1`); it never stores events, analysis results or EVTX-derived values. Settings writes that record automatically, exposes an accessible save confirmation and can reset it to validated defaults. A configured default workspace is used only when no URL hash is present, so a hash/deep link always wins. Workspace navigation uses a lightweight URL hash so browser back/forward works without a routing dependency. The static browser-brand package (SVG/ICO/PNG/manifest) is bundled locally, has no service worker and does not add a cache or network dependency. The bundled JSON demo exercises the same normalized, correlation and presentation contracts while deliberately skipping only raw EVTX parsing. The real parser is qualified in CI against a public, hash-verified seven-record EVTX fixture without committing that fixture or its event data to the repository. diff --git a/docs/CORRELATION.md b/docs/CORRELATION.md index e433b0f..125fa84 100644 --- a/docs/CORRELATION.md +++ b/docs/CORRELATION.md @@ -13,17 +13,41 @@ Every incident carries a stable `rule_id`, bounded total time window, explicit p ## Rules and boundaries +- `windows.audit.log-cleared` — EventLog 1102 (Security audit log cleared) from the Security channel or EventLog 104 (an event log was cleared) from the System channel, in a bounded 300-second window per known host. Severity `critical`: records from before the clear may be missing. The reason states only what the record says about who cleared it. - `windows.crash.application-report` — Application Error 1000 and/or Windows Error Reporting 1001 from the exact Application provider/channel within 120 seconds, grouped by known host/process. The word “sequence” is reserved for evidence containing both records. - `windows.service.failure` — abnormal Service Control Manager 7023/7024/7031/7034 events from the System channel within 120 seconds, grouped by known host/service. +- `windows.service.installed` — Service Control Manager 7045 from the System channel in a bounded 300-second window per known host/service name. Installation alone is not evidence of malice. - `windows.network.dns-timeout` — DNS Client 1014 events from the System channel in a bounded 120-second window per known host. - `windows.auth.failed-logon` — Security Auditing 4625 events from the Security channel in a bounded 120-second window per known host/account. One event is recorded evidence; two are repeated failures; three or more are called a burst. +- `windows.auth.password-spray` — Security Auditing 4625 in a bounded 300-second window per known host and source address (`IpAddress`), kept only when the window contains at least three distinct target accounts. The reason says the pattern is consistent with, not proof of, password spraying. These events also remain evidence for `windows.auth.failed-logon`. +- `windows.auth.account-lockout` — Security Auditing 4740 in a bounded 300-second window per known host/account. +- `windows.account.change` — Security Auditing 4720 (user created) and 4728/4732/4756 (member added to a security group) in a bounded 300-second window per known host. - `windows.system.startup` — Kernel-General 12 or EventLog 6005 startup signals in a bounded 300-second window per known host. - `windows.system.shutdown.normal` — Kernel-General 13 or EventLog 6006 normal-shutdown evidence in a bounded 300-second window per known host. - `windows.system.shutdown.unexpected` — Kernel-Power 41 or EventLog 6008 unexpected-shutdown/restart evidence in a bounded 300-second window per known host. The reason describes evidence, not a cause. -- `windows.generic.attention` — preserves unmatched warning/error evidence rather than hiding it. +- `windows.generic.attention` — preserves unmatched warning/error evidence rather than hiding it. Unmatched events with the same known host, provider and event ID are burst-compressed into one bounded 300-second window; the incident keeps the highest level (`critical`, `error` or `warning`) of its evidence. Events with an unknown host, provider or event ID, or without a reliable timestamp, stay single-event incidents. A rule requires its provider and channel context; a coincidental Event ID from another provider is not classified as that rule. Missing/placeholder host, process, service or account values create an event-isolated group and the reason says that grouping was unavailable; they never become a shared `unknown-*` key. Events without a reliable timestamp remain evidence but do not enter temporal groups. A group is split when adding the next event would make the total span from the first event exceed the rule window. Equality at the boundary is included; one millisecond beyond it is split. This prevents a long chain of near-adjacent records from creating an unbounded incident. Repeated identical provider/event/summary signatures remain in the evidence timeline but are compressed in the incident summary; source records and evidence IDs are never removed. Events may support more than one specifically matching rule when their predicates independently match; no rule is treated as proof of root cause. + +## Campaigns + +Bounded windows keep incidents honest but fragment sustained activity: a brute force that runs for hours becomes thousands of 120-second incidents. A **campaign** is a summary layer on top of incidents, never a wider incident: + +- it links consecutive incidents of the same rule and the same known grouping key when the gap between one incident's last event and the next incident's first event is at most the rule window; +- it needs at least two incidents; isolated (unknown-key) and untimed incidents never join one; +- it carries a deterministic `campaign-…` ID derived from the rule and the ordered incident IDs, the time span, the incident IDs, the total evidence count, the highest severity and a reason that makes no causal claim; +- each member incident references it through `campaign_id`. Incident windows, evidence IDs and incident IDs are unchanged. + +The Analysis workspace shows campaigns first and pages the remaining incidents by severity, so a large log stays readable. + +## Audit outcome + +Security events are logged at level 0 (“LogAlways”); success or failure lives in the `Keywords` bitmask. EventLens normalizes the audit-failure (`0x0010000000000000`) and audit-success (`0x0020000000000000`) bits into `outcome: "failure" | "success"`. The informational-noise filter treats audit failures as attention events, so failed sign-ins are not hidden by default. + +## Source integrity + +For uploaded files the API returns `source_info` with the SHA-256 and byte size of the exact uploaded bytes, computed in memory before parsing. Reports and exports include it so an analysis can be tied to the original file. The bundled demo has no `source_info`. diff --git a/docs/PRIVACY.md b/docs/PRIVACY.md index 3926bb8..a0b388c 100644 --- a/docs/PRIVACY.md +++ b/docs/PRIVACY.md @@ -19,6 +19,7 @@ Redaction is enabled by default and operates on a cloned analysis object. It mas - computer/host values; - username/account/e-mail identity fields, including domain-qualified accounts, SIDs and machine accounts; +- domain-name fields (`SubjectDomainName`, `TargetDomainName`), DNS query names and fully qualified host names with three or more labels in free text (two-label names such as `app.exe` are left alone); - e-mail addresses in free text; - IPv4 and IPv6 addresses in free text or IP-address fields; - Windows and UNC paths (including spaces/parentheses) and path-like fields; @@ -26,12 +27,14 @@ Redaction is enabled by default and operates on a cloned analysis object. It mas - known structured identities propagated into summaries, incident titles and reasons; - the source filename in the exported report. -The UI previews replacement counts by type before export. The original in-memory analysis is never modified by the redaction function. The source name is replaced with `[REDACTED_SOURCE].evtx` when redaction is enabled. JSON and Markdown carry the same redacted normalized analysis and parse-completeness metadata. +Replacements are consistent pseudonyms: the same value always becomes the same numbered token (`[REDACTED_HOST_1]`, `[REDACTED_IDENTITY_3]`), so an exported report still shows which events share a host or account without revealing it. The UI previews replacement counts by type before export and lists the field names whose values were exported without masking, so a reviewer can check them explicitly. + +Redaction runs in a Web Worker when Reports or an export needs it, never on load, so large analyses do not block the page. If the worker cannot run, the same function runs in the page; if redaction fails, export stays disabled rather than falling back to raw data. The original in-memory analysis is never modified by the redaction function. The source name is replaced with `[REDACTED_SOURCE].evtx` when redaction is enabled. JSON and Markdown carry the same redacted normalized analysis, campaigns and parse-completeness metadata. The source SHA-256 is kept in redacted exports: it identifies the file, not a person, and lets the recipient verify which evidence was analyzed. Redaction can be disabled when a raw forensic export is explicitly required, but that is an explicit user choice and the warning remains visible. ## Limits -The API enforces a 50 MiB file limit, a bounded request body independent of `Content-Length`, parser event/time budgets, bounded normalized strings/fields/output and bounded parse concurrency. These controls reduce accidental resource exhaustion; they are not a guarantee against every parser implementation vulnerability. +The API admits an upload (up to the parse concurrency plus a small queue) before the multipart body is spooled to the in-memory `/tmp` tmpfs, so a burst of large uploads gets a fast `503` instead of exhausting it. The API enforces a 50 MiB file limit, a bounded request body independent of `Content-Length`, parser event/time budgets, bounded normalized strings/fields/output and bounded parse concurrency. These controls reduce accidental resource exhaustion; they are not a guarantee against every parser implementation vulnerability. Redaction is a best-effort privacy layer, not a formal DLP engine. Application-specific free-form values may contain sensitive data that cannot be inferred safely. Review exports before sharing them outside the intended context. diff --git a/docs/assets/eventlens-demo-overview.png b/docs/assets/eventlens-demo-overview.png index d15767b..2ef9703 100644 Binary files a/docs/assets/eventlens-demo-overview.png and b/docs/assets/eventlens-demo-overview.png differ diff --git a/docs/assets/eventlens-redaction-export.png b/docs/assets/eventlens-redaction-export.png index 9917eb2..6ce446a 100644 Binary files a/docs/assets/eventlens-redaction-export.png and b/docs/assets/eventlens-redaction-export.png differ diff --git a/frontend/.prettierrc.json b/frontend/.prettierrc.json new file mode 100644 index 0000000..eb0c1ab --- /dev/null +++ b/frontend/.prettierrc.json @@ -0,0 +1,4 @@ +{ + "printWidth": 120, + "endOfLine": "auto" +} diff --git a/frontend/e2e/accessibility.spec.ts b/frontend/e2e/accessibility.spec.ts index bfd3153..8dd26a1 100644 --- a/frontend/e2e/accessibility.spec.ts +++ b/frontend/e2e/accessibility.spec.ts @@ -7,12 +7,18 @@ test("workspace navigation and primary controls expose accessible state", async } await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); await page.getByRole("button", { name: "Timeline", exact: false }).click(); - await expect(page.getByRole("button", { name: "Timeline", exact: false }).first()).toHaveAttribute("aria-current", "page"); + await expect(page.getByRole("button", { name: "Timeline", exact: false }).first()).toHaveAttribute( + "aria-current", + "page", + ); await expect(page.getByRole("textbox", { name: "Search normalized evidence" })).toBeVisible(); await expect(page.getByLabel("Filter by category")).toBeVisible(); await expect(page.getByLabel("Filter by level")).toBeVisible(); await expect(page.getByLabel("Filter by provider")).toBeVisible(); - await expect(page.getByRole("button", { name: "Previous evidence" })).toHaveAttribute("aria-label", "Previous evidence"); + await expect(page.getByRole("button", { name: "Previous evidence" })).toHaveAttribute( + "aria-label", + "Previous evidence", + ); await expect(page.getByRole("listitem").first()).toHaveAttribute("aria-setsize", /[0-9]+/); await page.getByRole("textbox", { name: "Search normalized evidence" }).focus(); await page.keyboard.press("Tab"); diff --git a/frontend/e2e/api-contract.spec.ts b/frontend/e2e/api-contract.spec.ts index 7eb4c80..fc279da 100644 --- a/frontend/e2e/api-contract.spec.ts +++ b/frontend/e2e/api-contract.spec.ts @@ -7,11 +7,13 @@ test("malformed successful analysis keeps the previous investigation", async ({ await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); await expect(page.getByRole("region", { name: "Current investigation context" })).toContainText("bundled-demo"); - await page.route("**/api/analyze", (route) => route.fulfill({ - status: 200, - contentType: "application/json", - body: JSON.stringify({ source: "bad.evtx", events: [], incidents: [{ id: "broken" }] }), - })); + await page.route("**/api/analyze", (route) => + route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify({ source: "bad.evtx", events: [], incidents: [{ id: "broken" }] }), + }), + ); await page.locator('input[type="file"]').setInputFiles(validUpload); await expect(page.getByRole("alert")).toContainText("Analysis returned an invalid response."); @@ -21,11 +23,15 @@ test("malformed successful analysis keeps the previous investigation", async ({ }); test("structured parser errors have safe, useful wording", async ({ page }) => { - await page.route("**/api/analyze", (route) => route.fulfill({ - status: 422, - contentType: "application/json", - body: JSON.stringify({ detail: { code: "no_readable_events", message: "No readable Windows events were found in this file." } }), - })); + await page.route("**/api/analyze", (route) => + route.fulfill({ + status: 422, + contentType: "application/json", + body: JSON.stringify({ + detail: { code: "no_readable_events", message: "No readable Windows events were found in this file." }, + }), + }), + ); await page.goto("/#analysis"); await page.locator('input[type="file"]').setInputFiles(validUpload); @@ -40,13 +46,21 @@ test("rejecting an invalid file cancels an older pending analysis", async ({ pag let routeStarted!: () => void; let releaseRoute!: () => void; - const started = new Promise((resolve) => { routeStarted = resolve; }); - const released = new Promise((resolve) => { releaseRoute = resolve; }); + const started = new Promise((resolve) => { + routeStarted = resolve; + }); + const released = new Promise((resolve) => { + releaseRoute = resolve; + }); await page.route("**/api/analyze", async (route) => { routeStarted(); await released; try { - await route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify({ source: "late.evtx", events: [], incidents: [] }) }); + await route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify({ source: "late.evtx", events: [], incidents: [] }), + }); } catch { // The route can already be cancelled by the browser request abort. } diff --git a/frontend/e2e/eventlens.spec.ts b/frontend/e2e/eventlens.spec.ts index 25d9524..a87597e 100644 --- a/frontend/e2e/eventlens.spec.ts +++ b/frontend/e2e/eventlens.spec.ts @@ -4,7 +4,9 @@ test("demo investigation workflow crosses Analysis, Timeline and Reports", async await page.goto("/#analysis"); await expect(page.getByRole("heading", { name: "No event log loaded", exact: true })).toBeVisible(); await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); - await expect(page.getByRole("region", { name: "Current investigation context" }).getByText("bundled-demo", { exact: true })).toBeVisible(); + await expect( + page.getByRole("region", { name: "Current investigation context" }).getByText("bundled-demo", { exact: true }), + ).toBeVisible(); await expect(page.getByRole("heading", { name: "Incident windows", exact: true })).toBeVisible(); await expect(page.getByText("Analysis status", { exact: true })).toBeVisible(); await expect(page.getByText("Deterministic demo fixture", { exact: true })).toBeVisible(); @@ -14,7 +16,9 @@ test("demo investigation workflow crosses Analysis, Timeline and Reports", async await page.getByText("Service failure recorded", { exact: true }).click(); await expect(page).toHaveURL(/#timeline$/); await expect(page.getByRole("heading", { name: "Event timeline", exact: true })).toBeVisible(); - await expect(page.getByRole("heading", { name: "Example Sync Service terminated unexpectedly", exact: true })).toBeVisible(); + await expect( + page.getByRole("heading", { name: "Example Sync Service terminated unexpectedly", exact: true }), + ).toBeVisible(); await expect(page.getByText("Focus active", { exact: true })).toBeVisible(); const search = page.getByRole("textbox", { name: "Search normalized evidence" }); diff --git a/frontend/e2e/partial-and-error.spec.ts b/frontend/e2e/partial-and-error.spec.ts index 6231dc9..4d6a325 100644 --- a/frontend/e2e/partial-and-error.spec.ts +++ b/frontend/e2e/partial-and-error.spec.ts @@ -2,16 +2,62 @@ import { expect, test } from "@playwright/test"; const partialAnalysis = { source: "partial.evtx", - events: [{ id: "1", timestamp: "2026-09-09T10:00:00Z", timestamp_source: "event", timestamp_valid: true, provider: "Synthetic", event_id: 1000, level: "error", channel: "Application", computer: "TEST-PC", category: "crash", summary: "Synthetic crash", fields: {} }], - incidents: [{ id: "incident-1", rule_id: "windows.generic.attention", start: "2026-09-09T10:00:00Z", end: "2026-09-09T10:00:00Z", title: "Synthetic crash", category: "crash", severity: "warning", reasons: ["Parser retained only a partial result."], evidence_event_ids: ["1"], original_count: 1, compressed_count: 1 }], - parse: { parser: "evtx-rs", status: "partial", parsed_events: 1, records_seen: 4, skipped_records: 2, issue_count: 1, truncated: true, truncation_reason: "event_limit_reached", duration_ms: 8, issues: [{ code: "event_limit_reached", record_id: 4, message: "later records were not analyzed", skipped_record: true }] }, + events: [ + { + id: "1", + timestamp: "2026-09-09T10:00:00Z", + timestamp_source: "event", + timestamp_valid: true, + provider: "Synthetic", + event_id: 1000, + level: "error", + channel: "Application", + computer: "TEST-PC", + category: "crash", + summary: "Synthetic crash", + fields: {}, + }, + ], + incidents: [ + { + id: "incident-1", + rule_id: "windows.generic.attention", + start: "2026-09-09T10:00:00Z", + end: "2026-09-09T10:00:00Z", + title: "Synthetic crash", + category: "crash", + severity: "warning", + reasons: ["Parser retained only a partial result."], + evidence_event_ids: ["1"], + original_count: 1, + compressed_count: 1, + }, + ], + parse: { + parser: "evtx-rs", + status: "partial", + parsed_events: 1, + records_seen: 4, + skipped_records: 2, + issue_count: 1, + truncated: true, + truncation_reason: "event_limit_reached", + duration_ms: 8, + issues: [ + { code: "event_limit_reached", record_id: 4, message: "later records were not analyzed", skipped_record: true }, + ], + }, }; test("partial result is unmistakable and invalid extension is rejected", async ({ page }) => { - await page.route("**/api/analyze", (route) => route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(partialAnalysis) })); + await page.route("**/api/analyze", (route) => + route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(partialAnalysis) }), + ); await page.goto("/#analysis"); await expect(page.getByRole("heading", { name: "Analysis", exact: true })).toBeVisible(); - await page.locator('input[type="file"]').setInputFiles({ name: "partial.evtx", mimeType: "application/octet-stream", buffer: Buffer.from("synthetic") }); + await page + .locator('input[type="file"]') + .setInputFiles({ name: "partial.evtx", mimeType: "application/octet-stream", buffer: Buffer.from("synthetic") }); await expect(page.getByRole("alert")).toContainText("Partial analysis"); await expect(page.getByRole("alert")).toContainText("incident reconstruction may be incomplete"); await expect(page.getByText("event_limit_reached", { exact: true })).toBeVisible(); @@ -20,6 +66,8 @@ test("partial result is unmistakable and invalid extension is rejected", async ( await page.getByRole("button", { name: "Timeline", exact: false }).click(); await expect(page.getByRole("alert")).toContainText("incident reconstruction may be incomplete"); - await page.locator('input[type="file"]').setInputFiles({ name: "not-an-evtx.txt", mimeType: "text/plain", buffer: Buffer.from("nope") }); + await page + .locator('input[type="file"]') + .setInputFiles({ name: "not-an-evtx.txt", mimeType: "text/plain", buffer: Buffer.from("nope") }); await expect(page.getByRole("alert").filter({ hasText: "Choose a Windows .evtx file." })).toBeVisible(); }); diff --git a/frontend/e2e/portfolio-assets.spec.ts b/frontend/e2e/portfolio-assets.spec.ts index ab85f8e..918c6c0 100644 --- a/frontend/e2e/portfolio-assets.spec.ts +++ b/frontend/e2e/portfolio-assets.spec.ts @@ -1,6 +1,6 @@ import { expect, test } from "@playwright/test"; -test("capture deterministic v1.0.6 portfolio views", async ({ page }) => { +test("capture deterministic v1.1.0 portfolio views", async ({ page }) => { await page.goto("/#analysis"); await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); await expect(page.getByRole("heading", { name: "Incident windows", exact: true })).toBeVisible(); diff --git a/frontend/e2e/responsive.spec.ts b/frontend/e2e/responsive.spec.ts index ced98da..77dd214 100644 --- a/frontend/e2e/responsive.spec.ts +++ b/frontend/e2e/responsive.spec.ts @@ -1,9 +1,19 @@ import { expect, test } from "@playwright/test"; test("core workspace actions remain usable across supported viewport widths", async ({ page }) => { + // 7 viewports x 5 workspaces; the default 30 s is too tight on shared CI runners. + test.setTimeout(90_000); await page.goto("/#analysis"); await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); - for (const viewport of [{ width: 360, height: 800 }, { width: 390, height: 844 }, { width: 768, height: 900 }, { width: 1024, height: 768 }, { width: 1366, height: 768 }, { width: 1440, height: 900 }, { width: 1920, height: 1080 }]) { + for (const viewport of [ + { width: 360, height: 800 }, + { width: 390, height: 844 }, + { width: 768, height: 900 }, + { width: 1024, height: 768 }, + { width: 1366, height: 768 }, + { width: 1440, height: 900 }, + { width: 1920, height: 1080 }, + ]) { await page.setViewportSize(viewport); await expect(page.getByRole("button", { name: "Open .evtx", exact: true }).first()).toBeVisible(); for (const workspace of ["Analysis", "Timeline", "Hunting", "Reports", "Settings"]) { diff --git a/frontend/e2e/settings-storage-failure.spec.ts b/frontend/e2e/settings-storage-failure.spec.ts index 87e7caa..c3895ef 100644 --- a/frontend/e2e/settings-storage-failure.spec.ts +++ b/frontend/e2e/settings-storage-failure.spec.ts @@ -19,7 +19,9 @@ test("settings keeps session state and reports a persistence failure", async ({ await expect(compact).toBeChecked(); await expect(page.locator(".settings-save-feedback")).toHaveText("Preferences changed for this session only"); await expect(page.getByText("Saved automatically in this browser", { exact: true })).toBeHidden(); - await expect(page.getByText("Preferences are available for this session only because browser storage is unavailable.")).toBeVisible(); + await expect( + page.getByText("Preferences are available for this session only because browser storage is unavailable."), + ).toBeVisible(); await expect(page.getByText("Not saved to browser storage")).toBeVisible(); await expect(page.getByText("Interface preferences for this session")).toBeVisible(); diff --git a/frontend/e2e/virtualization.spec.ts b/frontend/e2e/virtualization.spec.ts index 4a9ade9..257da1a 100644 --- a/frontend/e2e/virtualization.spec.ts +++ b/frontend/e2e/virtualization.spec.ts @@ -3,14 +3,29 @@ import { expect, test } from "@playwright/test"; function largeAnalysis(count: number) { return { source: "synthetic-large.evtx", - events: Array.from({ length: count }, (_, index) => ({ id: String(index), timestamp: "2026-09-09T10:00:00Z", timestamp_source: "event", timestamp_valid: true, provider: "Synthetic Provider", event_id: index, level: "warning", channel: "Application", computer: "TEST-PC", category: "other", summary: `Synthetic event ${index}`, fields: { message: `Synthetic event ${index}` } })), + events: Array.from({ length: count }, (_, index) => ({ + id: String(index), + timestamp: "2026-09-09T10:00:00Z", + timestamp_source: "event", + timestamp_valid: true, + provider: "Synthetic Provider", + event_id: index, + level: "warning", + channel: "Application", + computer: "TEST-PC", + category: "other", + summary: `Synthetic event ${index}`, + fields: { message: `Synthetic event ${index}` }, + })), incidents: [], }; } test("large timelines virtualize DOM rows and keep search usable", async ({ page }) => { const analysis = largeAnalysis(10_000); - await page.route("**/api/demo", (route) => route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(analysis) })); + await page.route("**/api/demo", (route) => + route.fulfill({ status: 200, contentType: "application/json", body: JSON.stringify(analysis) }), + ); await page.goto("/#analysis"); await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); await expect(page.getByText("10,000", { exact: false }).first()).toBeVisible(); diff --git a/frontend/e2e/workspace.spec.ts b/frontend/e2e/workspace.spec.ts index 4b71da1..4169dcd 100644 --- a/frontend/e2e/workspace.spec.ts +++ b/frontend/e2e/workspace.spec.ts @@ -48,7 +48,7 @@ test("Hunting combines facets and opens a result in the inspector", async ({ pag await page.getByRole("button", { name: "Hunting", exact: false }).click(); await page.getByRole("textbox", { name: "Search hunting evidence" }).fill("DNS name resolution"); - await expect(page.getByRole("status")).toHaveText("1 of 6 matching events"); + await expect(page.getByRole("status")).toHaveText("1 of 19 matching events"); await expect(page.getByRole("button", { name: /DNS name resolution timed out/ })).toBeVisible(); await page.getByRole("button", { name: /DNS name resolution timed out/ }).click(); await expect(page.getByRole("heading", { name: "Inspector", exact: true })).toBeVisible(); diff --git a/frontend/package-lock.json b/frontend/package-lock.json index c2d3f6c..eddc884 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -1,12 +1,12 @@ { "name": "eventlens-web", - "version": "1.0.6", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "eventlens-web", - "version": "1.0.6", + "version": "1.1.0", "dependencies": { "react": "^19.0.0", "react-dom": "^19.0.0" @@ -21,6 +21,7 @@ "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.1.1", "globals": "^17.12.0", + "prettier": "3.6.2", "typescript": "^5.8.0", "typescript-eslint": "^8.70.1", "vite": "^6.0.0", @@ -932,6 +933,13 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz", + "integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.13", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", @@ -1460,17 +1468,17 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.70.1.tgz", - "integrity": "sha512-nDNrUQ/4ruSNYbu749TRY7cfrzPtoLHEXSNBI8aaNY32LlZCajixqRf3FqcKC4p5Cam4VOHYx/t+i5+nKXvrqA==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.73.0.tgz", + "integrity": "sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.12.2", - "@typescript-eslint/scope-manager": "8.70.1", - "@typescript-eslint/type-utils": "8.70.1", - "@typescript-eslint/utils": "8.70.1", - "@typescript-eslint/visitor-keys": "8.70.1", + "@typescript-eslint/scope-manager": "8.73.0", + "@typescript-eslint/type-utils": "8.73.0", + "@typescript-eslint/utils": "8.73.0", + "@typescript-eslint/visitor-keys": "8.73.0", "ignore": "^7.0.5", "natural-compare": "^1.4.0", "ts-api-utils": "^2.5.0" @@ -1483,15 +1491,15 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.70.1", + "@typescript-eslint/parser": "^8.73.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "typescript": ">=4.8.4 <6.1.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { - "version": "7.0.10", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.10.tgz", - "integrity": "sha512-HpbUakT7xp5miBUywCHf36ZEuAJNklBJDDsGpUIjMzOSmM8ELSfA9Sa/QDPeNeqeoN31u+UTCkL4klCOVvRm4Q==", + "version": "7.0.16", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.16.tgz", + "integrity": "sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A==", "dev": true, "license": "MIT", "engines": { @@ -1499,16 +1507,16 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.70.1.tgz", - "integrity": "sha512-nO974WLllwhSFWQXnMLj6nDGa8f0khKEz1JzpPJ1u7Vm/4X1X6ZHajpoknU4bb41vJyMB0HHVyS2GqdhWfIXZw==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.73.0.tgz", + "integrity": "sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.70.1", - "@typescript-eslint/types": "8.70.1", - "@typescript-eslint/typescript-estree": "8.70.1", - "@typescript-eslint/visitor-keys": "8.70.1", + "@typescript-eslint/scope-manager": "8.73.0", + "@typescript-eslint/types": "8.73.0", + "@typescript-eslint/typescript-estree": "8.73.0", + "@typescript-eslint/visitor-keys": "8.73.0", "debug": "^4.4.3" }, "engines": { @@ -1524,14 +1532,14 @@ } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz", - "integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.73.0.tgz", + "integrity": "sha512-/pEf8Rc4Mjk+qJnY0uO1+Gadeal8uv50xpuic+srG2vIVatA0XxvWMUeMtFvs6OCHqftiQ7/+qH4aehG5stzIA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.70.1", - "@typescript-eslint/types": "^8.70.1", + "@typescript-eslint/tsconfig-utils": "^8.73.0", + "@typescript-eslint/types": "^8.73.0", "debug": "^4.4.3" }, "engines": { @@ -1546,14 +1554,14 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.70.1.tgz", - "integrity": "sha512-Pa0EeSeAusQc1WbjQMac+YfenewYTBu0KjgYvkUKwhXaHUKbFog23Dm/rp0DX/6tyYOQ3Xl1a+3EcFNZynGHCw==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.73.0.tgz", + "integrity": "sha512-/TjD738Iq2rzj5z0ixVOi+TsvgjAzZPLPaH1yWdDBytR/HTR5gMpyYWZeCe5WTQZLwk3ho8AV7U3muoQCRtXBQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.70.1", - "@typescript-eslint/visitor-keys": "8.70.1" + "@typescript-eslint/types": "8.73.0", + "@typescript-eslint/visitor-keys": "8.73.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1564,9 +1572,9 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz", - "integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.73.0.tgz", + "integrity": "sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og==", "dev": true, "license": "MIT", "engines": { @@ -1581,15 +1589,15 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.70.1.tgz", - "integrity": "sha512-7zKTnyvaVWqzLZHPFQtX1hVHqgkMC+WebPWakNCSyrQVbIP1AM0L0TlBZtACldIRb6PptI8Odk+jyZ5kP3B1VA==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.73.0.tgz", + "integrity": "sha512-MOC9i4xy1F7KcDde7Ip8jf1SrRiALb2Km4UWxGNjUE2YlhjIEo1ayE27GHIwIQyfWuHTmEonQT14uyurlyC6aA==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.70.1", - "@typescript-eslint/typescript-estree": "8.70.1", - "@typescript-eslint/utils": "8.70.1", + "@typescript-eslint/types": "8.73.0", + "@typescript-eslint/typescript-estree": "8.73.0", + "@typescript-eslint/utils": "8.73.0", "debug": "^4.4.3", "ts-api-utils": "^2.5.0" }, @@ -1606,9 +1614,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.70.1.tgz", - "integrity": "sha512-Dm1ypdhhrGCTyyehxElhgJ6kgk8MVCv5qXdoOVqPr1uqk42jX8KjrZqhROvdShczA8qrDoYiOWn1ykWlx2k81Q==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.73.0.tgz", + "integrity": "sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw==", "dev": true, "license": "MIT", "engines": { @@ -1620,18 +1628,18 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz", - "integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.73.0.tgz", + "integrity": "sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.70.1", - "@typescript-eslint/tsconfig-utils": "8.70.1", - "@typescript-eslint/types": "8.70.1", - "@typescript-eslint/visitor-keys": "8.70.1", + "@typescript-eslint/project-service": "8.73.0", + "@typescript-eslint/tsconfig-utils": "8.73.0", + "@typescript-eslint/types": "8.73.0", + "@typescript-eslint/visitor-keys": "8.73.0", "debug": "^4.4.3", - "minimatch": "^10.2.2", + "minimatch": "^11.0.1", "semver": "^7.7.3", "tinyglobby": "^0.2.15", "ts-api-utils": "^2.5.0" @@ -1644,7 +1652,13 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { + "@typescript/native": "npm:typescript@>=7.1.0-dev.20261009.1 || >=7.1.0-beta <7.1.0-dev", "typescript": ">=4.8.4 <6.1.0" + }, + "peerDependenciesMeta": { + "@typescript/native": { + "optional": true + } } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { @@ -1658,9 +1672,9 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1671,25 +1685,26 @@ } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { - "version": "10.2.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", - "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "version": "11.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz", + "integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { - "brace-expansion": "^5.0.8" + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" }, "engines": { - "node": "18 || 20 || >=22" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "dev": true, "license": "ISC", "bin": { @@ -1700,16 +1715,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.70.1.tgz", - "integrity": "sha512-Esgul8MsnKnRLdYU2Eb2cRV9bS5HJYtKj1ByJnOzzG2M58DGdSUQ1jUuILxipqcpB2h9WLrbD5GijIWUjX/Tqw==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.73.0.tgz", + "integrity": "sha512-j2SVJJvVkXdUL0WcEzo4vEH1mO1vIi8KlVukcYA2MgMZvYN2LlZR4PmsW+GTSxSW24j6Q/EP7+MOifLtg5hmsA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.9.1", - "@typescript-eslint/scope-manager": "8.70.1", - "@typescript-eslint/types": "8.70.1", - "@typescript-eslint/typescript-estree": "8.70.1" + "@typescript-eslint/scope-manager": "8.73.0", + "@typescript-eslint/types": "8.73.0", + "@typescript-eslint/typescript-estree": "8.73.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1724,13 +1739,13 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.70.1.tgz", - "integrity": "sha512-Vwj9lUIW5Xq3wQ9w6gv3R86g1hMK8f2zNOdGTAgeXUMMXFK78G9ruCjjqutHMNJc0+CH7LYRnHeUB9IT8wFmcw==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.73.0.tgz", + "integrity": "sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.70.1", + "@typescript-eslint/types": "8.73.0", "eslint-visitor-keys": "^5.0.0" }, "engines": { @@ -1755,22 +1770,22 @@ } }, "node_modules/@vitest/mocker": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.0.tgz", - "integrity": "sha512-66PGTMIiVJP3t4a5yxU9qPtf7MdTBs8jmToMvy+HVflB3Yy13WJZTtPePdvU+wjRV02SKK5doLbSA6o9pwOmiA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.1.tgz", + "integrity": "sha512-b2OgTB4+3ImWIVafXKazJXwLKwQxUNnix6b3xUvUTMh7RyXlrtzoxfZr8aEz9zkHOMAS4K5lu3TvFWoiVeVTQg==", "dev": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.31", - "@vitest/spy": "5.0.0", + "@vitest/spy": "5.1.1", "estree-walker": "^3.0.3", - "magic-string": "^1.2.3" + "magic-string": "^1.4.5" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "msw": "^2.4.9", + "msw": "^2.4.9 || ^3.0.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "peerDependenciesMeta": { @@ -1783,9 +1798,9 @@ } }, "node_modules/@vitest/spy": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.0.tgz", - "integrity": "sha512-uy+luWBAPw9XfthoHi5AkfHUnuPYEESjl0p/r+meoBnU8bxg5GDQ3Ey8MjcJ6sqahkL4PFyrvfMJJBw7LbU06g==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.1.tgz", + "integrity": "sha512-6K8C6alQG1/Yc8/ZI22iJS7JEsxPdVzqtqDq+/xM4Z0mGVykemMVjLhqMy/q6/IHYG3kKD8hKSwRen/ZdyI9vQ==", "dev": true, "license": "MIT", "funding": { @@ -2213,9 +2228,9 @@ "license": "CC-BY-4.0" }, "node_modules/chai": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", + "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==", "dev": true, "license": "MIT", "engines": { @@ -4063,9 +4078,9 @@ } }, "node_modules/magic-string": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.3.1.tgz", - "integrity": "sha512-rm91zr2Ou+XueDTohjQQjdQEcYM6zVi8KVUCG8Ec3vHwUEKrhSdCNyfuIywkA6hcCAteIn0ZOtAHA6eGpiX+Pg==", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", "dev": true, "license": "MIT", "dependencies": { @@ -4266,9 +4281,9 @@ } }, "node_modules/obug": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", - "integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", + "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", "dev": true, "funding": [ "https://github.com/sponsors/sxzz", @@ -4486,6 +4501,22 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/prop-types": { "version": "15.8.1", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", @@ -4879,34 +4910,20 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/siginfo": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true, - "license": "ISC" - }, "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz", + "integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==", "dev": true, "license": "BSD-3-Clause", "engines": { - "node": ">=0.10.0" + "node": ">=6.0.0" } }, - "node_modules/stackback": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true, - "license": "MIT" - }, "node_modules/std-env": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", - "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", + "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==", "dev": true, "license": "MIT" }, @@ -5078,9 +5095,9 @@ } }, "node_modules/tinybench": { - "version": "6.1.4", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.1.4.tgz", - "integrity": "sha512-9APumHG7r4yOk4X4WlkmE71aZcv1gvin1czO3OQ1U9iJcFA5Ja/ygyb0vPOVHTthFozUYs8CLoLUlM8grb2lTQ==", + "version": "6.2.4", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.4.tgz", + "integrity": "sha512-SQ52jEncXxbMCzJuY2A/jGIbbAu6NYsBWW7grz2pNE+EnzQdoGaoBfpk4qC/opE7qiUcGmGgaGIz5EoHdS1O9w==", "dev": true, "license": "MIT", "engines": { @@ -5088,9 +5105,9 @@ } }, "node_modules/tinyexec": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz", - "integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz", + "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==", "dev": true, "license": "MIT", "engines": { @@ -5232,16 +5249,16 @@ } }, "node_modules/typescript-eslint": { - "version": "8.70.1", - "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.70.1.tgz", - "integrity": "sha512-AcWG7KDjZ2THNXsgwttMaGmzVi0VFRlFYfqFHYQRbDpF3owuYbuiL8c7UUrd2k8s3PoSfIQrWfrGXfcElrWLYA==", + "version": "8.73.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.73.0.tgz", + "integrity": "sha512-+EnKy9rkYPun4l+kG2bDuYWQ6y1tGVgdR/tY1U9AC6h21CjEwOoc7gsjwe0FXB8uWFzk4QiCFbuRWgX758PiAg==", "dev": true, "license": "MIT", "dependencies": { - "@typescript-eslint/eslint-plugin": "8.70.1", - "@typescript-eslint/parser": "8.70.1", - "@typescript-eslint/typescript-estree": "8.70.1", - "@typescript-eslint/utils": "8.70.1" + "@typescript-eslint/eslint-plugin": "8.73.0", + "@typescript-eslint/parser": "8.73.0", + "@typescript-eslint/typescript-estree": "8.73.0", + "@typescript-eslint/utils": "8.73.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -5316,9 +5333,9 @@ } }, "node_modules/vite": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", - "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", + "version": "6.4.6", + "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.6.tgz", + "integrity": "sha512-RtsraAwEG68idOA6iUOoIpOlcSKROnf815aIq9qHTSrDNpLoBrBa12suyfcEd8qn0xwOVQI1Yhm1GbmTjF600A==", "dev": true, "license": "MIT", "dependencies": { @@ -5391,25 +5408,25 @@ } }, "node_modules/vitest": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.0.tgz", - "integrity": "sha512-gpsMNoRhMjMktVxPtstOH4/PJuPyovVaMDr4oDilXaGH1EcqM2OE96SoHT2VIQ6fTGtTjqmHDrEu2X9RQiXf8Q==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.1.tgz", + "integrity": "sha512-trVmzUFOSraCZcI3uZIMD5FqBh4atFkC/XuJP/IU7qtyQay0FCs3Ia+0QiQ2JJwGyWG/xrcBoJNel2+O7kEZ0g==", "dev": true, "license": "MIT", "dependencies": { "@types/chai": "^5.2.2", - "@vitest/mocker": "5.0.0", - "chai": "^6.2.2", + "@vitest/mocker": "5.1.1", + "chai": "^6.3.0", "es-module-lexer": "^2.3.2", "expect-type": "^1.4.0", - "magic-string": "^1.2.3", - "obug": "^2.1.4", + "magic-string": "^1.4.5", + "obug": "^3.0.0", "picomatch": "^4.0.7", - "std-env": "^4.2.0", - "tinybench": "6.1.4", - "tinyexec": "1.3.0", + "std-env": "^4.3.0", + "tinybench": "^6.2.3", + "tinyexec": "^1.3.1", "tinyglobby": "^0.2.17", - "why-is-node-running": "^2.3.0" + "why-is-node-running": "3.2.1" }, "bin": { "vitest": "vitest.mjs" @@ -5424,12 +5441,12 @@ "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^22.0.0 || >=24.0.0", - "@vitest/browser-playwright": "5.0.0", - "@vitest/browser-preview": "5.0.0", + "@vitest/browser-playwright": "5.1.1", + "@vitest/browser-preview": "5.1.1", "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", - "@vitest/coverage-istanbul": "5.0.0", - "@vitest/coverage-v8": "5.0.0", - "@vitest/ui": "5.0.0", + "@vitest/coverage-istanbul": "5.1.1", + "@vitest/coverage-v8": "5.1.1", + "@vitest/ui": "5.1.1", "happy-dom": "*", "jsdom": "*", "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" @@ -5579,20 +5596,16 @@ } }, "node_modules/why-is-node-running": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", + "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==", "dev": true, "license": "MIT", - "dependencies": { - "siginfo": "^2.0.0", - "stackback": "0.0.2" - }, "bin": { "why-is-node-running": "cli.js" }, "engines": { - "node": ">=8" + "node": ">=20.11" } }, "node_modules/word-wrap": { @@ -5626,9 +5639,9 @@ } }, "node_modules/zod": { - "version": "4.6.5", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz", - "integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==", + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "dev": true, "license": "MIT", "funding": { diff --git a/frontend/package.json b/frontend/package.json index 1975070..ebf99f7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,13 +1,14 @@ { "name": "eventlens-web", - "version": "1.0.6", + "version": "1.1.0", "private": true, "scripts": { "dev": "vite", - "lint": "eslint src", + "lint": "eslint src && prettier --check src e2e", "build": "tsc --noEmit && vite build", "test": "vitest run --passWithNoTests", - "test:e2e": "playwright test" + "test:e2e": "playwright test", + "format": "prettier --write src e2e" }, "dependencies": { "react": "^19.0.0", @@ -23,6 +24,7 @@ "eslint-plugin-react": "^7.37.5", "eslint-plugin-react-hooks": "^7.1.1", "globals": "^17.12.0", + "prettier": "3.6.2", "typescript": "^5.8.0", "typescript-eslint": "^8.70.1", "vite": "^6.0.0", diff --git a/frontend/src/app/App.tsx b/frontend/src/app/App.tsx index d72f081..f7914f2 100644 --- a/frontend/src/app/App.tsx +++ b/frontend/src/app/App.tsx @@ -1,9 +1,25 @@ -import { type ChangeEvent, type DragEvent, useEffect, useMemo, useRef, useState } from "react"; -import { analysisToMarkdown, prepareExport } from "../export"; +import { type ChangeEvent, type DragEvent, useDeferredValue, useEffect, useMemo, useRef, useState } from "react"; +import { markdownFromPrepared, prepareExport, type PreparedExport } from "../export"; +import { redactInBackground } from "../redactClient"; +import type { RedactionSummary } from "../redact"; +import { analysisIndex } from "./indexes"; import { filterEvents, uniqueProviders, type EventFilters } from "../filter"; import type { Analysis, EventItem, Incident } from "../types"; import { downloadText, exportStem } from "./format"; -import { DEFAULT_SETTINGS, EMPTY_FILTERS, EMPTY_HUNTING, ROW_HEIGHTS, SETTINGS_KEY, readSettings, type FilterState, type HuntingState, type InspectorTab, type UiSettings, type Workspace, workspaceFromHash } from "./model"; +import { + DEFAULT_SETTINGS, + EMPTY_FILTERS, + EMPTY_HUNTING, + ROW_HEIGHTS, + SETTINGS_KEY, + readSettings, + type FilterState, + type HuntingState, + type InspectorTab, + type UiSettings, + type Workspace, + workspaceFromHash, +} from "./model"; import { isAnalysis } from "./validation"; import { AppTopbar, GlobalActions, InvestigationContext, Statusbar } from "../components/shell"; import { ErrorBanner, ParserIssueNotice, PartialAnalysisWarning } from "../components/states"; @@ -13,7 +29,10 @@ import { ReportsView } from "../workspaces/ReportsView"; import { SettingsView } from "../workspaces/SettingsView"; import { TimelineView } from "../workspaces/TimelineView"; -const API = (import.meta.env.VITE_API_BASE_URL ?? (import.meta.env.DEV ? "http://127.0.0.1:8000" : "")).replace(/\/$/, ""); +const API = (import.meta.env.VITE_API_BASE_URL ?? (import.meta.env.DEV ? "http://127.0.0.1:8000" : "")).replace( + /\/$/, + "", +); const APP_VERSION = import.meta.env.VITE_EVENTLENS_VERSION ?? "development"; function analysisErrorMessage(status: number, body: unknown): string { @@ -30,7 +49,9 @@ function analysisErrorMessage(status: number, body: unknown): string { export function App() { const [settings, setSettings] = useState(readSettings); - const [activeWorkspace, setActiveWorkspace] = useState(() => workspaceFromHash() ?? readSettings().defaultWorkspace); + const [activeWorkspace, setActiveWorkspace] = useState( + () => workspaceFromHash() ?? readSettings().defaultWorkspace, + ); const [data, setData] = useState(null); const [selectedEventId, setSelectedEventId] = useState(null); const [activeIncidentId, setActiveIncidentId] = useState(""); @@ -45,6 +66,9 @@ export function App() { const [settingsNotice, setSettingsNotice] = useState(""); const [settingsPersistenceFailed, setSettingsPersistenceFailed] = useState(false); const [settingsStorageConfirmed, setSettingsStorageConfirmed] = useState(false); + const [redactionPreview, setRedactionPreview] = useState<{ data: Analysis; summary: RedactionSummary } | null>(null); + const [redactionFailed, setRedactionFailed] = useState(false); + const [exporting, setExporting] = useState(false); const fileInput = useRef(null); const requestRef = useRef(null); @@ -83,37 +107,87 @@ export function App() { setActiveWorkspace(workspace); }; - const activeIncident = useMemo(() => data?.incidents.find((incident) => incident.id === activeIncidentId) ?? null, [data, activeIncidentId]); - const selected = useMemo(() => data?.events.find((event) => event.id === selectedEventId) ?? null, [data, selectedEventId]); - const evidenceIds = useMemo(() => focusIncident && activeIncident ? new Set(activeIncident.evidence_event_ids) : null, [focusIncident, activeIncident]); + const index = useMemo(() => (data ? analysisIndex(data) : null), [data]); + // Filtering 100,000 events runs at a lower priority than typing, so inputs stay responsive. + const deferredFilters = useDeferredValue(filters); + const deferredHunting = useDeferredValue(hunting); + const activeIncident = useMemo(() => index?.incidentById.get(activeIncidentId) ?? null, [index, activeIncidentId]); + const selected = useMemo( + () => (selectedEventId ? index?.eventById.get(selectedEventId) : null) ?? null, + [index, selectedEventId], + ); + const anchorCandidate = selected?.timestamp ?? activeIncident?.start ?? null; + const evidenceIds = useMemo( + () => (focusIncident && activeIncident ? new Set(activeIncident.evidence_event_ids) : null), + [focusIncident, activeIncident], + ); const providers = useMemo(() => uniqueProviders(data?.events ?? []), [data]); const visibleEvents = useMemo(() => { const eventFilters: EventFilters = { - search: filters.search, - category: filters.category, - level: filters.level, - provider: filters.provider, - noiseMode: filters.attentionOnly ? "attention" : "all", + search: deferredFilters.search, + category: deferredFilters.category, + level: deferredFilters.level, + provider: deferredFilters.provider, + noiseMode: deferredFilters.attentionOnly ? "attention" : "all", evidenceIds, - windowMinutes: filters.windowMinutes, - anchorTimestamp: selected?.timestamp ?? activeIncident?.start ?? null, + windowMinutes: deferredFilters.windowMinutes, + anchorTimestamp: deferredFilters.windowAnchor, }; return filterEvents(data?.events ?? [], eventFilters); - }, [data, filters, evidenceIds, selected, activeIncident]); - const incidentEventIds = useMemo(() => new Set(data?.incidents.flatMap((incident) => incident.evidence_event_ids) ?? []), [data]); + }, [data, deferredFilters, evidenceIds]); + const incidentEventIds = useMemo(() => index?.incidentEventIds ?? new Set(), [index]); const huntingResults = useMemo(() => { - const filtered = filterEvents(data?.events ?? [], { search: hunting.search, category: hunting.category, level: hunting.level, provider: hunting.provider, noiseMode: "all", windowMinutes: hunting.windowMinutes, anchorTimestamp: selected?.timestamp ?? activeIncident?.start ?? null }); - return filtered.filter((event) => (!hunting.eventId || String(event.event_id ?? "") === hunting.eventId) && (!hunting.computer || (event.computer ?? "").toLowerCase().includes(hunting.computer.toLowerCase())) && (!hunting.incidentOnly || incidentEventIds.has(event.id))); - }, [data, hunting, selected, activeIncident, incidentEventIds]); - const redactionPreview = useMemo(() => data && redactExports ? prepareExport(data, true).redaction : null, [data, redactExports]); + const filtered = filterEvents(data?.events ?? [], { + search: deferredHunting.search, + category: deferredHunting.category, + level: deferredHunting.level, + provider: deferredHunting.provider, + noiseMode: "all", + windowMinutes: deferredHunting.windowMinutes, + anchorTimestamp: deferredHunting.windowAnchor, + }); + return filtered.filter( + (event) => + (!deferredHunting.eventId || String(event.event_id ?? "") === deferredHunting.eventId) && + (!deferredHunting.computer || + (event.computer ?? "").toLowerCase().includes(deferredHunting.computer.toLowerCase())) && + (!deferredHunting.incidentOnly || incidentEventIds.has(event.id)), + ); + }, [data, deferredHunting, incidentEventIds]); + + // Redaction is computed lazily, off the UI thread, and only once Reports needs it. + useEffect(() => { + if (!data || !redactExports || activeWorkspace !== "reports") return; + if (redactionPreview?.data === data) return; + let cancelled = false; + setRedactionFailed(false); + redactInBackground(data).then( + (result) => { + if (!cancelled) setRedactionPreview({ data, summary: result.summary }); + }, + () => { + if (!cancelled) setRedactionFailed(true); + }, + ); + return () => { + cancelled = true; + }; + }, [data, redactExports, activeWorkspace, redactionPreview]); + const currentRedaction = redactionPreview?.data === data ? redactionPreview.summary : null; const rowHeight = ROW_HEIGHTS[settings.density]; - const contextVisible = activeWorkspace === "timeline" ? visibleEvents.length : activeWorkspace === "hunting" ? huntingResults.length : undefined; + const contextVisible = + activeWorkspace === "timeline" + ? visibleEvents.length + : activeWorkspace === "hunting" + ? huntingResults.length + : undefined; function updateSettings(patch: Partial) { setSettingsStorageConfirmed(false); setSettings((current) => ({ ...current, ...patch })); setSettingsNotice("Saving preferences…"); - if (patch.defaultNoise) setFilters((current) => ({ ...current, attentionOnly: patch.defaultNoise === "attention" })); + if (patch.defaultNoise) + setFilters((current) => ({ ...current, attentionOnly: patch.defaultNoise === "attention" })); if (typeof patch.defaultRedaction === "boolean") setRedactExports(patch.defaultRedaction); } @@ -125,12 +199,30 @@ export function App() { setSettingsNotice("Resetting preferences…"); } + /** Choosing a time window pins it to the current selection; later selections do not move it. */ + function windowPatch( + current: T, + patch: Partial, + ): T { + const next = { ...current, ...patch }; + if (patch.windowMinutes !== undefined) + next.windowAnchor = + patch.windowMinutes > 0 + ? current.windowMinutes > 0 && current.windowAnchor + ? current.windowAnchor + : anchorCandidate + : null; + return next; + } + function resetFilters() { setFilters(EMPTY_FILTERS(settings.defaultNoise === "attention")); setFocusIncident(false); } - function resetHunting() { setHunting(EMPTY_HUNTING()); } + function resetHunting() { + setHunting(EMPTY_HUNTING()); + } function resetView(next: Analysis) { setData(next); @@ -146,7 +238,8 @@ export function App() { requestRef.current?.abort(); const controller = new AbortController(); requestRef.current = controller; - setLoading(true); setError(""); + setLoading(true); + setError(""); try { const response = await fetch(`${API}/api/demo`, { cache: "no-store", signal: controller.signal }); const body: unknown = await response.json().catch(() => null); @@ -155,28 +248,62 @@ export function App() { if (requestRef.current !== controller || controller.signal.aborted) return; resetView(body); } catch (reason) { - if (requestRef.current === controller && !controller.signal.aborted) setError(reason instanceof Error && reason.message === "Demo returned an invalid response" ? reason.message : "The local EventLens service is unavailable. Check the service and retry."); - } finally { if (requestRef.current === controller) { requestRef.current = null; setLoading(false); } } + if (requestRef.current === controller && !controller.signal.aborted) + setError( + reason instanceof Error && reason.message === "Demo returned an invalid response" + ? reason.message + : "The local EventLens service is unavailable. Check the service and retry.", + ); + } finally { + if (requestRef.current === controller) { + requestRef.current = null; + setLoading(false); + } + } } async function analyzeFile(file: File) { requestRef.current?.abort(); requestRef.current = null; - if (!file.name.toLowerCase().endsWith(".evtx")) { setLoading(false); setError("Choose a Windows .evtx file."); return; } + if (!file.name.toLowerCase().endsWith(".evtx")) { + setLoading(false); + setError("Choose a Windows .evtx file."); + return; + } const controller = new AbortController(); requestRef.current = controller; - setLoading(true); setError(""); - const form = new FormData(); form.append("file", file); + setLoading(true); + setError(""); + const form = new FormData(); + form.append("file", file); try { - const response = await fetch(`${API}/api/analyze`, { method: "POST", body: form, cache: "no-store", signal: controller.signal }); + const response = await fetch(`${API}/api/analyze`, { + method: "POST", + body: form, + cache: "no-store", + signal: controller.signal, + }); const body: unknown = await response.json().catch(() => null); if (requestRef.current !== controller || controller.signal.aborted) return; - if (!response.ok) { setError(analysisErrorMessage(response.status, body)); return; } + if (!response.ok) { + setError(analysisErrorMessage(response.status, body)); + return; + } if (!isAnalysis(body)) throw new Error("Analysis returned an invalid response."); resetView(body); } catch (reason) { - if (requestRef.current === controller && !controller.signal.aborted) setError(reason instanceof Error && reason.message === "Analysis returned an invalid response." ? reason.message : "The local EventLens service is unavailable. Check the service and retry."); - } finally { if (requestRef.current === controller) { requestRef.current = null; setLoading(false); } } + if (requestRef.current === controller && !controller.signal.aborted) + setError( + reason instanceof Error && reason.message === "Analysis returned an invalid response." + ? reason.message + : "The local EventLens service is unavailable. Check the service and retry.", + ); + } finally { + if (requestRef.current === controller) { + requestRef.current = null; + setLoading(false); + } + } } async function upload(event: ChangeEvent) { @@ -186,67 +313,213 @@ export function App() { } async function drop(event: DragEvent) { - event.preventDefault(); setDragging(false); + event.preventDefault(); + setDragging(false); const file = event.dataTransfer.files?.[0]; if (file) await analyzeFile(file); } function selectIncident(id: string, openTimeline = false) { - const incident = data?.incidents.find((item) => item.id === id); - if (!incident) { setActiveIncidentId(""); return; } + const incident = index?.incidentById.get(id); + if (!incident) { + setActiveIncidentId(""); + return; + } setActiveIncidentId(id); setSelectedEventId(incident.evidence_event_ids[0] ?? null); setInspectorTab("details"); - if (openTimeline) { setFocusIncident(true); navigate("timeline"); } + if (filters.windowMinutes > 0 && incident.start) + setFilters((current) => ({ ...current, windowAnchor: incident.start })); + if (openTimeline) { + setFocusIncident(true); + navigate("timeline"); + } } function selectEvent(event: EventItem) { setSelectedEventId(event.id); - const incident = data?.incidents.find((item) => item.evidence_event_ids.includes(event.id)); + const incident = index?.incidentByEvent.get(event.id); if (incident) setActiveIncidentId(incident.id); } function moveSelection(delta: number, events: EventItem[]) { if (!events.length) return; const index = selected ? events.findIndex((event) => event.id === selected.id) : -1; - const next = index < 0 ? (delta > 0 ? 0 : events.length - 1) : Math.min(events.length - 1, Math.max(0, index + delta)); + const next = + index < 0 ? (delta > 0 ? 0 : events.length - 1) : Math.min(events.length - 1, Math.max(0, index + delta)); selectEvent(events[next]); } - function exportJson() { - if (!data) return; - const prepared = prepareExport(data, redactExports); - downloadText(`${exportStem(data.source)}-eventlens.json`, JSON.stringify(prepared.analysis, null, 2), "application/json"); + async function preparedExport(source: Analysis): Promise { + if (!redactExports) return prepareExport(source, false); + const result = await redactInBackground(source); + return { analysis: result.analysis, redaction: result.summary }; } - function exportMarkdown() { - if (!data) return; - downloadText(`${exportStem(data.source)}-eventlens.md`, analysisToMarkdown(data, redactExports), "text/markdown"); + async function runExport(kind: "json" | "markdown") { + if (!data || exporting) return; + const source = data; + setExporting(true); + try { + const prepared = await preparedExport(source); + if (kind === "json") + downloadText( + `${exportStem(source.source)}-eventlens.json`, + JSON.stringify(prepared.analysis, null, 2), + "application/json", + ); + else + downloadText( + `${exportStem(source.source)}-eventlens.md`, + markdownFromPrepared(prepared, redactExports), + "text/markdown", + ); + } catch { + setError("The export could not be prepared. No file was written; retry the export."); + } finally { + setExporting(false); + } } useEffect(() => { const scopedEvents = activeWorkspace === "hunting" ? huntingResults : visibleEvents; - if (!selectedEventId || !scopedEvents.some((event) => event.id === selectedEventId)) setSelectedEventId(scopedEvents[0]?.id ?? null); + if (!selectedEventId || !scopedEvents.some((event) => event.id === selectedEventId)) + setSelectedEventId(scopedEvents[0]?.id ?? null); }, [activeWorkspace, huntingResults, visibleEvents, selectedEventId]); - return
{ event.preventDefault(); setDragging(true); }} onDragLeave={() => setDragging(false)} onDrop={drop}> - -
- - fileInput.current?.click()} onDemo={() => void loadDemo()} workspace={activeWorkspace} /> - - {loading ?
: null} - {error ? void loadDemo()} /> : null} - {data?.parse?.status === "partial" ? : null} - {data?.parse && data.parse.status !== "partial" && data.parse.issues.length ? : null} -
- {activeWorkspace === "analysis" ? selectIncident(incident.id, true)} onOpenFile={() => fileInput.current?.click()} onDemo={() => void loadDemo()} /> : null} - {activeWorkspace === "timeline" ? setFilters((current) => ({ ...current, ...patch }))} onResetFilters={resetFilters} onFocusChange={setFocusIncident} onSelectIncident={selectIncident} onSelectEvent={selectEvent} onMove={(delta) => moveSelection(delta, visibleEvents)} onTab={setInspectorTab} onOpenFile={() => fileInput.current?.click()} onDemo={() => void loadDemo()} /> : null} - {activeWorkspace === "hunting" ? setHunting((current) => ({ ...current, ...patch }))} onReset={resetHunting} onSelectEvent={selectEvent} onMove={(delta) => moveSelection(delta, huntingResults)} onTab={setInspectorTab} onOpenTimeline={() => navigate("timeline")} onOpenFile={() => fileInput.current?.click()} onDemo={() => void loadDemo()} /> : null} - {activeWorkspace === "reports" ? fileInput.current?.click()} onDemo={() => void loadDemo()} /> : null} - {activeWorkspace === "settings" ? : null} -
- -
-
; + return ( +
{ + event.preventDefault(); + setDragging(true); + }} + onDragLeave={(event) => { + if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setDragging(false); + }} + onDrop={drop} + > + +
+ + fileInput.current?.click()} + onDemo={() => void loadDemo()} + workspace={activeWorkspace} + /> + + {loading ? ( +
+
+ ) : null} + {error ? void loadDemo()} /> : null} + {data?.parse?.status === "partial" ? : null} + {data?.parse && data.parse.status !== "partial" && data.parse.issues.length ? ( + + ) : null} +
+ {activeWorkspace === "analysis" ? ( + selectIncident(incident.id, true)} + onOpenFile={() => fileInput.current?.click()} + onDemo={() => void loadDemo()} + /> + ) : null} + {activeWorkspace === "timeline" ? ( + setFilters((current) => windowPatch(current, patch))} + onResetFilters={resetFilters} + onFocusChange={setFocusIncident} + onSelectIncident={selectIncident} + onSelectEvent={selectEvent} + onMove={(delta) => moveSelection(delta, visibleEvents)} + onTab={setInspectorTab} + onOpenFile={() => fileInput.current?.click()} + onDemo={() => void loadDemo()} + /> + ) : null} + {activeWorkspace === "hunting" ? ( + setHunting((current) => windowPatch(current, patch))} + onReset={resetHunting} + onSelectEvent={selectEvent} + onMove={(delta) => moveSelection(delta, huntingResults)} + onTab={setInspectorTab} + onOpenTimeline={() => navigate("timeline")} + onOpenFile={() => fileInput.current?.click()} + onDemo={() => void loadDemo()} + /> + ) : null} + {activeWorkspace === "reports" ? ( + void runExport("json")} + onExportMarkdown={() => void runExport("markdown")} + timestampDisplay={settings.timestampDisplay} + onOpenFile={() => fileInput.current?.click()} + onDemo={() => void loadDemo()} + /> + ) : null} + {activeWorkspace === "settings" ? ( + + ) : null} +
+ +
+
+ ); } diff --git a/frontend/src/app/format.ts b/frontend/src/app/format.ts index 5b4546b..42aeac2 100644 --- a/frontend/src/app/format.ts +++ b/frontend/src/app/format.ts @@ -41,7 +41,13 @@ export function formatRange(start: string | null, end: string | null, display: T } export function levelLabel(level: string): string { - return level === "error" || level === "critical" ? "High" : level === "warning" ? "Medium" : level === "information" ? "Info" : level; + return level === "error" || level === "critical" + ? "High" + : level === "warning" + ? "Medium" + : level === "information" + ? "Info" + : level; } export function statusLabel(data: Analysis | null): string { @@ -62,6 +68,12 @@ export function downloadText(filename: string, content: string, type: string): v window.setTimeout(() => URL.revokeObjectURL(href), 0); } +export function formatBytes(value: number): string { + if (value < 1024) return `${value} B`; + if (value < 1024 * 1024) return `${(value / 1024).toFixed(1)} KiB`; + return `${(value / (1024 * 1024)).toFixed(1)} MiB`; +} + export function exportStem(source: string): string { const base = sourceLabel(source).replace(/\.evtx$/i, ""); return base.replace(/[^A-Za-z0-9._-]+/g, "_").slice(0, 80) || "eventlens"; diff --git a/frontend/src/app/indexes.ts b/frontend/src/app/indexes.ts new file mode 100644 index 0000000..2922637 --- /dev/null +++ b/frontend/src/app/indexes.ts @@ -0,0 +1,43 @@ +import type { Analysis, Campaign, EventItem, Incident } from "../types"; + +export type AnalysisIndex = { + eventById: Map; + incidentById: Map; + /** First incident (in API order) that lists the event as evidence. */ + incidentByEvent: Map; + campaignById: Map; + incidentEventIds: Set; +}; + +const cache = new WeakMap(); + +/** O(1) lookups shared by all workspaces; built once per loaded analysis. */ +export function analysisIndex(data: Analysis): AnalysisIndex { + const cached = cache.get(data); + if (cached) return cached; + const eventById = new Map(data.events.map((event) => [event.id, event])); + const incidentById = new Map(data.incidents.map((incident) => [incident.id, incident])); + const incidentByEvent = new Map(); + for (const incident of data.incidents) { + for (const id of incident.evidence_event_ids) if (!incidentByEvent.has(id)) incidentByEvent.set(id, incident); + } + const campaignById = new Map((data.campaigns ?? []).map((campaign) => [campaign.id, campaign])); + const index = { + eventById, + incidentById, + incidentByEvent, + campaignById, + incidentEventIds: new Set(incidentByEvent.keys()), + }; + cache.set(data, index); + return index; +} + +export function evidenceEvents(data: Analysis, incident: Incident | null): EventItem[] { + if (!incident) return []; + const { eventById } = analysisIndex(data); + return incident.evidence_event_ids.flatMap((id) => { + const event = eventById.get(id); + return event ? [event] : []; + }); +} diff --git a/frontend/src/app/model.ts b/frontend/src/app/model.ts index dd6539e..6d0395f 100644 --- a/frontend/src/app/model.ts +++ b/frontend/src/app/model.ts @@ -1,4 +1,13 @@ -export const CATEGORIES = ["system", "service", "network", "authentication", "application", "crash", "other"]; +export const CATEGORIES = [ + "system", + "service", + "network", + "authentication", + "security", + "application", + "crash", + "other", +]; export const LEVELS = ["critical", "error", "warning", "information", "verbose"]; export const WINDOWS = [0, 1, 5, 15, 60]; export const WORKSPACES = ["analysis", "timeline", "hunting", "reports", "settings"] as const; @@ -24,10 +33,12 @@ export type FilterState = { level: string; provider: string; windowMinutes: number; + /** Timestamp the time window is pinned to; set when the window is chosen, not on every selection. */ + windowAnchor: string | null; attentionOnly: boolean; }; -export type HuntingState = FilterState & { +export type HuntingState = Omit & { eventId: string; computer: string; incidentOnly: boolean; @@ -49,11 +60,17 @@ export const EMPTY_FILTERS = (attentionOnly: boolean): FilterState => ({ level: "", provider: "", windowMinutes: 0, + windowAnchor: null, attentionOnly, }); export const EMPTY_HUNTING = (): HuntingState => ({ - ...EMPTY_FILTERS(false), + search: "", + category: "", + level: "", + provider: "", + windowMinutes: 0, + windowAnchor: null, eventId: "", computer: "", incidentOnly: false, @@ -70,7 +87,7 @@ export function readSettings(): UiSettings { defaultRedaction: typeof parsed.defaultRedaction === "boolean" ? parsed.defaultRedaction : true, density: parsed.density === "compact" ? "compact" : "comfortable", defaultWorkspace: WORKSPACES.includes(parsed.defaultWorkspace as Workspace) - ? parsed.defaultWorkspace as Workspace + ? (parsed.defaultWorkspace as Workspace) : "analysis", }; } catch { @@ -80,5 +97,5 @@ export function readSettings(): UiSettings { export function workspaceFromHash(hash = typeof window === "undefined" ? "" : window.location.hash): Workspace | null { const value = hash.replace(/^#/, ""); - return WORKSPACES.includes(value as Workspace) ? value as Workspace : null; + return WORKSPACES.includes(value as Workspace) ? (value as Workspace) : null; } diff --git a/frontend/src/app/validation.test.ts b/frontend/src/app/validation.test.ts index fc0d1a7..25db25a 100644 --- a/frontend/src/app/validation.test.ts +++ b/frontend/src/app/validation.test.ts @@ -3,31 +3,35 @@ import { isAnalysis } from "./validation"; const valid = { source: "demo.evtx", - events: [{ - id: "event-1", - timestamp: "2026-09-22T08:00:00Z", - timestamp_source: "event", - timestamp_valid: true, - provider: "Provider", - event_id: 1000, - level: "Error", - category: "crash", - summary: "Example event", - fields: { process: "example.exe" }, - }], - incidents: [{ - id: "incident-1", - rule_id: "crash.sequence", - start: "2026-09-22T08:00:00Z", - end: "2026-09-22T08:00:00Z", - title: "Example incident", - category: "crash", - severity: "high", - reasons: ["Observed crash evidence."], - evidence_event_ids: ["event-1"], - original_count: 1, - compressed_count: 1, - }], + events: [ + { + id: "event-1", + timestamp: "2026-09-22T08:00:00Z", + timestamp_source: "event", + timestamp_valid: true, + provider: "Provider", + event_id: 1000, + level: "Error", + category: "crash", + summary: "Example event", + fields: { process: "example.exe" }, + }, + ], + incidents: [ + { + id: "incident-1", + rule_id: "crash.sequence", + start: "2026-09-22T08:00:00Z", + end: "2026-09-22T08:00:00Z", + title: "Example incident", + category: "crash", + severity: "high", + reasons: ["Observed crash evidence."], + evidence_event_ids: ["event-1"], + original_count: 1, + compressed_count: 1, + }, + ], parse: { parser: "evtx", status: "complete", @@ -57,14 +61,22 @@ describe("isAnalysis", () => { }); it("rejects missing evidence references and duplicate event IDs", () => { - expect(isAnalysis({ ...valid, incidents: [{ ...valid.incidents[0], evidence_event_ids: ["missing"] }] })).toBe(false); - expect(isAnalysis({ ...valid, events: [...valid.events, valid.events[0]], parse: { ...valid.parse, parsed_events: 2 } })).toBe(false); + expect(isAnalysis({ ...valid, incidents: [{ ...valid.incidents[0], evidence_event_ids: ["missing"] }] })).toBe( + false, + ); + expect( + isAnalysis({ ...valid, events: [...valid.events, valid.events[0]], parse: { ...valid.parse, parsed_events: 2 } }), + ).toBe(false); }); it("rejects invalid timestamps and contradictory timestamp metadata", () => { expect(isAnalysis({ ...valid, events: [{ ...valid.events[0], timestamp: "not-a-date" }] })).toBe(false); - expect(isAnalysis({ ...valid, events: [{ ...valid.events[0], timestamp: null, timestamp_valid: true }] })).toBe(false); - expect(isAnalysis({ ...valid, events: [{ ...valid.events[0], timestamp_source: "invalid", timestamp_valid: true }] })).toBe(false); + expect(isAnalysis({ ...valid, events: [{ ...valid.events[0], timestamp: null, timestamp_valid: true }] })).toBe( + false, + ); + expect( + isAnalysis({ ...valid, events: [{ ...valid.events[0], timestamp_source: "invalid", timestamp_valid: true }] }), + ).toBe(false); expect(isAnalysis({ ...valid, incidents: [{ ...valid.incidents[0], start: "not-a-date" }] })).toBe(false); }); diff --git a/frontend/src/app/validation.ts b/frontend/src/app/validation.ts index 4d28cbe..2985360 100644 --- a/frontend/src/app/validation.ts +++ b/frontend/src/app/validation.ts @@ -1,11 +1,14 @@ -import type { Analysis, EventItem, Incident, ParseIssue, ParseStats } from "../types"; +import type { Analysis, Campaign, EventItem, Incident, ParseIssue, ParseStats, SourceInfo } from "../types"; function isRecord(value: unknown): value is Record { return typeof value === "object" && value !== null && !Array.isArray(value); } function isTimestamp(value: unknown): value is string | null { - return value === null || (typeof value === "string" && /(?:Z|[+-]\d{2}:\d{2})$/.test(value) && Number.isFinite(Date.parse(value))); + return ( + value === null || + (typeof value === "string" && /(?:Z|[+-]\d{2}:\d{2})$/.test(value) && Number.isFinite(Date.parse(value))) + ); } function isFiniteNumber(value: unknown): value is number { @@ -23,14 +26,30 @@ function isStringArray(value: unknown): value is string[] { function isEventItem(value: unknown): value is EventItem { if (!isRecord(value)) return false; if (typeof value.id !== "string" || !isTimestamp(value.timestamp)) return false; - if (typeof value.provider !== "string" || !(value.event_id === null || (isNonnegativeInteger(value.event_id) && value.event_id <= 4_294_967_295))) return false; - if (typeof value.level !== "string" || typeof value.category !== "string" || typeof value.summary !== "string") return false; + if ( + typeof value.provider !== "string" || + !(value.event_id === null || (isNonnegativeInteger(value.event_id) && value.event_id <= 4_294_967_295)) + ) + return false; + if (typeof value.level !== "string" || typeof value.category !== "string" || typeof value.summary !== "string") + return false; if (value.channel !== undefined && typeof value.channel !== "string") return false; if (value.computer !== undefined && typeof value.computer !== "string") return false; + if ( + value.outcome !== undefined && + value.outcome !== null && + value.outcome !== "success" && + value.outcome !== "failure" + ) + return false; if (value.fields !== undefined) { if (!isRecord(value.fields) || !Object.values(value.fields).every((item) => typeof item === "string")) return false; } - if (typeof value.timestamp_valid !== "boolean" || !["event", "record", "missing", "invalid"].includes(String(value.timestamp_source))) return false; + if ( + typeof value.timestamp_valid !== "boolean" || + !["event", "record", "missing", "invalid"].includes(String(value.timestamp_source)) + ) + return false; if (value.timestamp === null && value.timestamp_valid) return false; if (["event", "record"].includes(String(value.timestamp_source)) !== value.timestamp_valid) return false; return true; @@ -38,19 +57,54 @@ function isEventItem(value: unknown): value is EventItem { function isIncident(value: unknown): value is Incident { if (!isRecord(value)) return false; - return typeof value.id === "string" - && typeof value.rule_id === "string" - && isTimestamp(value.start) - && isTimestamp(value.end) - && typeof value.title === "string" - && typeof value.category === "string" - && typeof value.severity === "string" - && isStringArray(value.reasons) - && isStringArray(value.evidence_event_ids) - && isNonnegativeInteger(value.original_count) - && value.original_count > 0 - && isNonnegativeInteger(value.compressed_count) - && value.compressed_count > 0; + return ( + typeof value.id === "string" && + typeof value.rule_id === "string" && + isTimestamp(value.start) && + isTimestamp(value.end) && + typeof value.title === "string" && + typeof value.category === "string" && + typeof value.severity === "string" && + isStringArray(value.reasons) && + isStringArray(value.evidence_event_ids) && + isNonnegativeInteger(value.original_count) && + value.original_count > 0 && + isNonnegativeInteger(value.compressed_count) && + value.compressed_count > 0 && + (value.campaign_id === undefined || value.campaign_id === null || typeof value.campaign_id === "string") + ); +} + +function isCampaign(value: unknown): value is Campaign { + if (!isRecord(value)) return false; + return ( + typeof value.id === "string" && + typeof value.rule_id === "string" && + typeof value.title === "string" && + typeof value.category === "string" && + typeof value.severity === "string" && + typeof value.start === "string" && + isTimestamp(value.start) && + typeof value.end === "string" && + isTimestamp(value.end) && + isStringArray(value.incident_ids) && + value.incident_ids.length >= 2 && + isNonnegativeInteger(value.event_count) && + isStringArray(value.reasons) + ); +} + +function isSourceInfo(value: unknown): value is SourceInfo { + return ( + isRecord(value) && + typeof value.sha256 === "string" && + /^[0-9a-f]{64}$/.test(value.sha256) && + isNonnegativeInteger(value.size_bytes) + ); +} + +function isIssueCounts(value: unknown): value is Record { + return isRecord(value) && Object.values(value).every(isNonnegativeInteger); } function isParseIssue(value: unknown): value is ParseIssue { @@ -67,8 +121,18 @@ function isParseStats(value: unknown): value is ParseStats { if (!isNonnegativeInteger(value[key])) return false; } if (typeof value.truncated !== "boolean") return false; - if (value.truncation_reason !== undefined && value.truncation_reason !== null && typeof value.truncation_reason !== "string") return false; - return Array.isArray(value.issues) && value.issues.every(isParseIssue) && value.issue_count === value.issues.length; + if ( + value.truncation_reason !== undefined && + value.truncation_reason !== null && + typeof value.truncation_reason !== "string" + ) + return false; + if (value.issues_truncated !== undefined && typeof value.issues_truncated !== "boolean") return false; + if (value.issue_counts !== undefined && !isIssueCounts(value.issue_counts)) return false; + if (!Array.isArray(value.issues) || !value.issues.every(isParseIssue)) return false; + // The API caps the reported issue list; issue_count keeps the true total. + const issueCount = value.issue_count as number; + return value.issues_truncated === true ? issueCount >= value.issues.length : issueCount === value.issues.length; } export function isAnalysis(value: unknown): value is Analysis { @@ -77,6 +141,18 @@ export function isAnalysis(value: unknown): value is Analysis { if (!Array.isArray(value.incidents) || !value.incidents.every(isIncident)) return false; const eventIds = new Set(value.events.map((event: EventItem) => event.id)); if (eventIds.size !== value.events.length) return false; - if (!value.incidents.every((incident: Incident) => incident.evidence_event_ids.every((id) => eventIds.has(id)))) return false; - return value.parse === undefined || value.parse === null || (isParseStats(value.parse) && value.parse.parsed_events === value.events.length); + if (!value.incidents.every((incident: Incident) => incident.evidence_event_ids.every((id) => eventIds.has(id)))) + return false; + if (value.campaigns !== undefined) { + if (!Array.isArray(value.campaigns) || !value.campaigns.every(isCampaign)) return false; + const incidentIds = new Set(value.incidents.map((incident: Incident) => incident.id)); + if (!value.campaigns.every((campaign: Campaign) => campaign.incident_ids.every((id) => incidentIds.has(id)))) + return false; + } + if (value.source_info !== undefined && value.source_info !== null && !isSourceInfo(value.source_info)) return false; + return ( + value.parse === undefined || + value.parse === null || + (isParseStats(value.parse) && value.parse.parsed_events === value.events.length) + ); } diff --git a/frontend/src/audit.test.ts b/frontend/src/audit.test.ts new file mode 100644 index 0000000..194a798 --- /dev/null +++ b/frontend/src/audit.test.ts @@ -0,0 +1,232 @@ +import { describe, expect, it } from "vitest"; +import { redactAnalysis } from "./redact"; +import { filterEvents } from "./filter"; +import { analysisToMarkdown } from "./export"; +import { isAnalysis } from "./app/validation"; +import { analysisIndex, evidenceEvents } from "./app/indexes"; +import type { Analysis, EventItem } from "./types"; + +function event(id: number, overrides: Partial = {}): EventItem { + return { + id: String(id), + timestamp: "2026-11-20T08:00:00Z", + timestamp_source: "event", + timestamp_valid: true, + provider: "Microsoft-Windows-Security-Auditing", + event_id: 4625, + level: "information", + category: "authentication", + summary: `Failed sign-in for user${id % 500}`, + channel: "Security", + computer: `HOST${id % 20}`, + fields: { + "EventData.TargetUserName": `user${id % 500}`, + "EventData.IpAddress": `192.0.2.${(id % 254) + 1}`, + "EventData.WorkstationName": `WS${id % 300}`, + "EventData.Status": "0xc000006d", + }, + ...overrides, + }; +} + +describe("redaction performance and coverage", () => { + it("redacts thousands of events with many distinct values within budget", () => { + // The previous implementation needed ~73 s for 2,000 such events. + const events = Array.from({ length: 10_000 }, (_, index) => event(index)); + const started = performance.now(); + const result = redactAnalysis({ source: "Security.evtx", events, incidents: [] }); + expect(performance.now() - started).toBeLessThan(5_000); + expect(JSON.stringify(result.analysis)).not.toMatch(/user\d|HOST\d|WS\d|10\.0\./); + }); + + it("uses consistent pseudonyms for the same value across fields and text", () => { + const source: Analysis = { source: "a.evtx", incidents: [], events: [event(1), event(2, { computer: "HOST1" })] }; + const [first, second] = redactAnalysis(source).analysis.events; + expect(first.computer).toBe(second.computer); + expect(first.summary).toContain(first.fields?.["EventData.TargetUserName"]); + expect(first.fields?.["EventData.TargetUserName"]).not.toBe(second.fields?.["EventData.TargetUserName"]); + }); + + it("masks DNS query names, domain fields and internal FQDNs in free text", () => { + const source: Analysis = { + source: "System.evtx", + incidents: [], + events: [ + event(1, { + provider: "Microsoft-Windows-DNS-Client", + event_id: 1014, + category: "network", + summary: "Name resolution for fileserver.corp.contoso.local timed out", + fields: { + "EventData.QueryName": "fileserver.corp.contoso.local", + "EventData.SubjectDomainName": "CONTOSO", + query: "api.example.test", + }, + }), + ], + }; + const result = redactAnalysis(source); + const serialized = JSON.stringify(result.analysis); + expect(serialized).not.toContain("contoso"); + expect(serialized).not.toContain("CONTOSO"); + expect(serialized).not.toContain("api.example.test"); + expect(result.summary.domains).toBeGreaterThanOrEqual(3); + }); + + it("keeps two-label file names and reports untouched field names", () => { + const source: Analysis = { + source: "a.evtx", + incidents: [], + events: [ + event(1, { + summary: "ExampleApp.exe crashed in example.dll", + fields: { "EventData.ExceptionCode": "0xc0000005" }, + }), + ], + }; + const result = redactAnalysis(source); + expect(result.analysis.events[0].summary).toContain("ExampleApp.exe"); + expect(result.summary.untouchedFieldKeys).toEqual(["EventData.ExceptionCode"]); + }); + + it("redacts campaign titles and reasons", () => { + const source: Analysis = { + source: "a.evtx", + events: [event(1)], + incidents: [ + { + id: "i1", + rule_id: "r", + start: "2026-11-20T08:00:00Z", + end: "2026-11-20T08:00:00Z", + title: "t", + category: "authentication", + severity: "warning", + reasons: [], + evidence_event_ids: ["1"], + original_count: 1, + compressed_count: 1, + }, + ], + campaigns: [ + { + id: "c1", + rule_id: "r", + title: "Recurring for user1 on HOST1", + category: "authentication", + severity: "warning", + start: "2026-11-20T08:00:00Z", + end: "2026-11-20T08:10:00Z", + incident_ids: ["i1", "i1"], + event_count: 2, + reasons: ["seen from 192.0.2.1"], + }, + ], + }; + const campaign = redactAnalysis(source).analysis.campaigns?.[0]; + expect(JSON.stringify(campaign)).not.toMatch(/user1|HOST1|10\.0\.1\.1/); + }); +}); + +describe("attention filter", () => { + it("treats Security audit failures as attention even at information level", () => { + const failure = event(1, { outcome: "failure" }); + const success = event(2, { outcome: "success" }); + const visible = filterEvents([failure, success], { + search: "", + category: "", + level: "", + provider: "", + noiseMode: "attention", + }); + expect(visible.map((item) => item.id)).toEqual(["1"]); + }); +}); + +describe("response contract", () => { + const base: Analysis = { + source: "a.evtx", + events: [event(1), event(2)], + incidents: [ + { + id: "i1", + rule_id: "r", + start: "2026-11-20T08:00:00Z", + end: "2026-11-20T08:00:00Z", + title: "a", + category: "authentication", + severity: "warning", + reasons: [], + evidence_event_ids: ["1"], + original_count: 1, + compressed_count: 1, + campaign_id: "c1", + }, + { + id: "i2", + rule_id: "r", + start: "2026-11-20T08:03:00Z", + end: "2026-11-20T08:03:00Z", + title: "b", + category: "authentication", + severity: "warning", + reasons: [], + evidence_event_ids: ["2"], + original_count: 1, + compressed_count: 1, + campaign_id: "c1", + }, + ], + campaigns: [ + { + id: "c1", + rule_id: "r", + title: "Recurring: a", + category: "authentication", + severity: "warning", + start: "2026-11-20T08:00:00Z", + end: "2026-11-20T08:03:00Z", + incident_ids: ["i1", "i2"], + event_count: 2, + reasons: ["x"], + }, + ], + source_info: { sha256: "a".repeat(64), size_bytes: 69632 }, + parse: { + parser: "evtx-rs", + status: "complete", + parsed_events: 2, + records_seen: 2, + skipped_records: 0, + issue_count: 300, + truncated: false, + duration_ms: 3, + issues: [{ code: "invalid_timestamp", message: "m" }], + issues_truncated: true, + issue_counts: { invalid_timestamp: 300 }, + }, + }; + + it("accepts campaigns, source integrity and a truncated issue list", () => { + expect(isAnalysis(base)).toBe(true); + }); + + it("rejects campaigns that reference unknown incidents and malformed hashes", () => { + expect( + isAnalysis({ ...base, campaigns: [{ ...(base.campaigns ?? [])[0], incident_ids: ["i1", "missing"] }] }), + ).toBe(false); + expect(isAnalysis({ ...base, source_info: { sha256: "xyz", size_bytes: 1 } })).toBe(false); + expect( + isAnalysis({ ...base, parse: { ...(base.parse as NonNullable), issues_truncated: false } }), + ).toBe(false); + }); + + it("indexes evidence in incident order and exports campaign and hash metadata", () => { + expect(analysisIndex(base).incidentByEvent.get("2")?.id).toBe("i2"); + expect(evidenceEvents(base, base.incidents[0]).map((item) => item.id)).toEqual(["1"]); + const markdown = analysisToMarkdown(base, false); + expect(markdown).toContain("## Campaigns"); + expect(markdown).toContain("a".repeat(64)); + expect(markdown).toContain("further issue(s)"); + }); +}); diff --git a/frontend/src/components/icons.tsx b/frontend/src/components/icons.tsx index 04f97de..5451b5d 100644 --- a/frontend/src/components/icons.tsx +++ b/frontend/src/components/icons.tsx @@ -22,40 +22,133 @@ export type IconName = type IconProps = SVGProps & { name: IconName; title?: string }; -const ICON_PROPS = { fill: "none", stroke: "currentColor", strokeWidth: 1.8, strokeLinecap: "round" as const, strokeLinejoin: "round" as const }; +const ICON_PROPS = { + fill: "none", + stroke: "currentColor", + strokeWidth: 1.8, + strokeLinecap: "round" as const, + strokeLinejoin: "round" as const, +}; export function Icon({ name, title, ...props }: IconProps) { const content = { - analysis: <>, - timeline: <>, - hunting: <>, - reports: <>, - settings: <>, - file: <>, - upload: <>, - demo: <>, - search: <>, - clock: <>, - warning: <>, + analysis: ( + <> + + + + + + + ), + timeline: ( + <> + + + + + + ), + hunting: ( + <> + + + + ), + reports: ( + <> + + + + ), + settings: ( + <> + + + + + + ), + file: ( + <> + + + + ), + upload: ( + <> + + + ), + demo: ( + <> + + + + ), + search: ( + <> + + + + ), + clock: ( + <> + + + + ), + warning: ( + <> + + + + ), "arrow-left": , "arrow-right": , - reset: <>, - info: <>, - export: <>, + reset: ( + <> + + + + ), + info: ( + <> + + + + ), + export: ( + <> + + + ), check: , - privacy: <>, + privacy: ( + <> + + + + ), }[name]; - return {title ? {title} : null}{content}; + return ( + + {title ? {title} : null} + {content} + + ); } /** The canonical evidence-lens mark, shared by the browser package and topbar. */ export function EventLensMark(props: SVGProps) { - return ; + return ( + + ); } diff --git a/frontend/src/components/shell.tsx b/frontend/src/components/shell.tsx index 97c7cc1..72ed95a 100644 --- a/frontend/src/components/shell.tsx +++ b/frontend/src/components/shell.tsx @@ -4,33 +4,176 @@ import { sourceLabel, statusLabel } from "../app/format"; import { WORKSPACES, type Workspace } from "../app/model"; import { EventLensMark, Icon } from "./icons"; -const WORKSPACE_LABELS: Record = { analysis: "Analysis", timeline: "Timeline", hunting: "Hunting", reports: "Reports", settings: "Settings" }; +const WORKSPACE_LABELS: Record = { + analysis: "Analysis", + timeline: "Timeline", + hunting: "Hunting", + reports: "Reports", + settings: "Settings", +}; -export function WorkspaceNav({ activeWorkspace, onNavigate }: { activeWorkspace: Workspace; onNavigate: (workspace: Workspace) => void }) { +export function WorkspaceNav({ + activeWorkspace, + onNavigate, +}: { + activeWorkspace: Workspace; + onNavigate: (workspace: Workspace) => void; +}) { const activeButton = useRef(null); useEffect(() => { activeButton.current?.scrollIntoView({ block: "nearest", inline: "center" }); }, [activeWorkspace]); - return ; + return ( + + ); } -export function AppTopbar({ activeWorkspace, onNavigate, version }: { activeWorkspace: Workspace; onNavigate: (workspace: Workspace) => void; version: string }) { - return
EventLensWindows incident reconstruction
; +export function AppTopbar({ + activeWorkspace, + onNavigate, + version, +}: { + activeWorkspace: Workspace; + onNavigate: (workspace: Workspace) => void; + version: string; +}) { + return ( +
+
+ + + +
+ EventLens + Windows incident reconstruction +
+
+ +
+
+
+ ); } -export function InvestigationContext({ data, activeIncident, visibleCount, workspace }: { data: Analysis | null; activeIncident: Incident | null; visibleCount?: number; workspace: Workspace }) { - if (workspace === "settings") return
Local preferencesInterface preferences for this session
Event text, files and evidence are never stored here
; +export function InvestigationContext({ + data, + activeIncident, + visibleCount, + workspace, +}: { + data: Analysis | null; + activeIncident: Incident | null; + visibleCount?: number; + workspace: Workspace; +}) { + if (workspace === "settings") + return ( +
+
+ + + Local preferences + Interface preferences for this session + +
+
+ Event text, files and evidence are never stored here +
+
+ ); if (!data) return null; - return
{sourceLabel(data.source)}Current forensic session
{statusLabel(data)}{data.events.length.toLocaleString()} events{data.incidents.length} incident{data.incidents.length === 1 ? "" : "s"}{typeof visibleCount === "number" ? {visibleCount.toLocaleString()} visible : null}
{activeIncident ? Incident: {activeIncident.title} : null}
; + return ( +
+
+ + + {sourceLabel(data.source)} + Current forensic session + +
+
+ {statusLabel(data)} + {data.events.length.toLocaleString()} events + + {data.incidents.length} incident{data.incidents.length === 1 ? "" : "s"} + + {typeof visibleCount === "number" ? {visibleCount.toLocaleString()} visible : null} +
+ {activeIncident ? ( + + Incident: {activeIncident.title} + + ) : null} +
+ ); } -export function GlobalActions({ loading, dragging, onOpen, onDemo, workspace }: { loading: boolean; dragging: boolean; onOpen: () => void; onDemo: () => void; workspace: Workspace }) { +export function GlobalActions({ + loading, + dragging, + onOpen, + onDemo, + workspace, +}: { + loading: boolean; + dragging: boolean; + onOpen: () => void; + onDemo: () => void; + workspace: Workspace; +}) { const secondary = workspace === "reports" || workspace === "settings"; - return
Drop an .evtx file anywhere in the workspace
Local, in-memory analysis
; + return ( +
+
+ + + Drop an .evtx file anywhere in the workspace +
+ Local, in-memory analysis +
+ ); } export function Statusbar({ data }: { data: Analysis | null }) { - return
{data ? sourceLabel(data.source) : "No source loaded"} {data ? `${data.events.length.toLocaleString()} events` : "Local only"}