Publish EventLens v1.1.0 (#1)

This commit was merged in pull request #1.
This commit is contained in:
Jens committed 2026-11-20 12:20:18 +00:00
1 parent c0ade21029
commit 87432f3283
63 files changed
+7381 -1420

No files matched your search

+2
View File
@@ -28,6 +28,8 @@ jobs:
node-version: 22 node-version: 22
cache: npm cache: npm
cache-dependency-path: frontend/package-lock.json cache-dependency-path: frontend/package-lock.json
- name: Validate standalone Compose
run: docker compose config --quiet
- name: Validate backend - name: Validate backend
shell: bash shell: bash
run: | run: |
+2 -1
View File
@@ -26,7 +26,8 @@ ENV PYTHONDONTWRITEBYTECODE=1
ENV EVENTLENS_FRONTEND_DIR=/app/frontend-dist ENV EVENTLENS_FRONTEND_DIR=/app/frontend-dist
ENV TMPDIR=/tmp 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 \ && addgroup -S -g 10001 eventlens \
&& adduser -S -D -H -u 10001 -G eventlens -s /sbin/nologin eventlens && adduser -S -D -H -u 10001 -G eventlens -s /sbin/nologin eventlens
+1 -1
View File
@@ -1,3 +1,3 @@
# Public source export # 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.
+141 -106
View File
@@ -1,6 +1,6 @@
{ {
"schemaVersion": 1, "schemaVersion": 1,
"sourceRevision": "8f9b57a425e88c7efda5bba3212d1c8aae5b4d02", "sourceRevision": "6a2ca12f81a2dcf816c61a86bd8811fcc95e8d8d",
"files": [ "files": [
{ {
"path": ".dockerignore", "path": ".dockerignore",
@@ -9,8 +9,8 @@
}, },
{ {
"path": ".gitea/workflows/ci.yml", "path": ".gitea/workflows/ci.yml",
"sha256": "d2da54058d2caf5095dffc4782376ed3734ab1b58ff6497ca2eb9ea021fb932b", "sha256": "82d644d6877d6a4625ff3712ebf6363731a64d83aad7e8261b9217bf70180421",
"bytes": 1322 "bytes": 1407
}, },
{ {
"path": ".gitignore", "path": ".gitignore",
@@ -19,8 +19,8 @@
}, },
{ {
"path": "Dockerfile", "path": "Dockerfile",
"sha256": "17bc8f55bbd2351ba1936ec81019a048e05c20c27507a1066a726439c117771f", "sha256": "fce2f2d6519eb9e7849ee533bb9fdb997ead59c98c3e05fc742b67e8568d761e",
"bytes": 1853 "bytes": 1885
}, },
{ {
"path": "Makefile", "path": "Makefile",
@@ -29,8 +29,8 @@
}, },
{ {
"path": "README.md", "path": "README.md",
"sha256": "5e8961597355247bf20df8424f60a694d0b94c3281407f3b91d0b034c42c2731", "sha256": "6d070f74b9572b423ebb5f37bc2d5fc3681a82ac17a05ac2c19f8b79c2d5e867",
"bytes": 10087 "bytes": 10252
}, },
{ {
"path": "SECURITY.md", "path": "SECURITY.md",
@@ -39,7 +39,7 @@
}, },
{ {
"path": "VERSION", "path": "VERSION",
"sha256": "51c18dc8694861beb47a67894e61044864214435389f6d3a274704d9566ff96c", "sha256": "1575e1af4a95f12f70b4ee6a6adce8160953d93ea17dc2611b90883ccc3ad3b8",
"bytes": 6 "bytes": 6
}, },
{ {
@@ -49,8 +49,8 @@
}, },
{ {
"path": "backend/app/correlate.py", "path": "backend/app/correlate.py",
"sha256": "0a0e5050e66629716c0d236c98e1e0c805bef0a2817fa334f885df613083dd70", "sha256": "a31fa11894426e9e7dc7ca2ce42fd0533920094bc9aacc9e4d746f887001ac4a",
"bytes": 12470 "bytes": 25294
}, },
{ {
"path": "backend/app/demo.py", "path": "backend/app/demo.py",
@@ -59,23 +59,23 @@
}, },
{ {
"path": "backend/app/main.py", "path": "backend/app/main.py",
"sha256": "4858dc69de23fba45ca61f18495d5bfb5d02c441f80fac33aebd5b86b53c0ebe", "sha256": "d02086c0940a1c6e2e63ea8dd987ac36a5ad73218475df4521684ed91e90b48f",
"bytes": 11411 "bytes": 13631
}, },
{ {
"path": "backend/app/models.py", "path": "backend/app/models.py",
"sha256": "8ae8512d721e8258611eefe6e9badee9aefa0e18bacfcdd6150b491a010f9b3a", "sha256": "a36482a8c4ff0bd8af5de85fd3cd270521c9669d3a4985cd640c009241c3386e",
"bytes": 2912 "bytes": 4048
}, },
{ {
"path": "backend/app/normalize.py", "path": "backend/app/normalize.py",
"sha256": "022a8c77e2de072700f8bd63a56de394ed4a71760b664d72532d2ff68353cf52", "sha256": "9ee4ac09dd254f94051f27bf9b3764f0bf74fcff9fe38c9e44703c8c93dadd7b",
"bytes": 10479 "bytes": 13442
}, },
{ {
"path": "backend/app/parser.py", "path": "backend/app/parser.py",
"sha256": "ee30330c92cae8d9fd7106e798a98d4371a8766894df823dd742f30c63d2ca22", "sha256": "9a923331a7f22902e7e027e5f8511a7ffbc64e7b90bf703729d834b67b246cf9",
"bytes": 8355 "bytes": 8570
}, },
{ {
"path": "backend/app/version.py", "path": "backend/app/version.py",
@@ -84,7 +84,7 @@
}, },
{ {
"path": "backend/pyproject.toml", "path": "backend/pyproject.toml",
"sha256": "00cf1e47d79a0c1b2d5fd7ea2179231c8e3db4670828d750d3f67a16fe0b7097", "sha256": "4636893f7b2ba72a6a2d604ed8983f86bcb6692dbe793bb549f028e8f2812822",
"bytes": 493 "bytes": 493
}, },
{ {
@@ -97,6 +97,11 @@
"sha256": "3c86e9de65b41dc907cdd646d0dd35ed6196a60291698286c2750c92d3c04eba", "sha256": "3c86e9de65b41dc907cdd646d0dd35ed6196a60291698286c2750c92d3c04eba",
"bytes": 6610 "bytes": 6610
}, },
{
"path": "backend/tests/test_audit_improvements.py",
"sha256": "d39b5d45c1af218af00c5e0c41bb5bef476e3e647f795a5518eef90d094ed520",
"bytes": 12570
},
{ {
"path": "backend/tests/test_correlation.py", "path": "backend/tests/test_correlation.py",
"sha256": "c13a6046ca7a104dec01156aeddba7dd273dfdc3c31b2fe727c10075815a07d3", "sha256": "c13a6046ca7a104dec01156aeddba7dd273dfdc3c31b2fe727c10075815a07d3",
@@ -117,6 +122,11 @@
"sha256": "4043c1091ba7897249f0764a27a749a0344eec443d43087bdfcdb2cd937a28b7", "sha256": "4043c1091ba7897249f0764a27a749a0344eec443d43087bdfcdb2cd937a28b7",
"bytes": 997 "bytes": 997
}, },
{
"path": "backend/tests/test_performance.py",
"sha256": "00fda8ff70b192cde735306ce380aef33f0b8651b3f4735d3c20e272b3ea53aa",
"bytes": 4675
},
{ {
"path": "backend/tests/test_post_v1_hardening.py", "path": "backend/tests/test_post_v1_hardening.py",
"sha256": "6a8a1774c9c16ce42397f4ae700ede9f77ae75dd6a50fcc77deef41ef862ba85", "sha256": "6a8a1774c9c16ce42397f4ae700ede9f77ae75dd6a50fcc77deef41ef862ba85",
@@ -129,48 +139,53 @@
}, },
{ {
"path": "backend/uv.lock", "path": "backend/uv.lock",
"sha256": "b5fbd41e4fba64e79799e1412a5f91c426c8e5e7fcd0b0df8c1768757180cda9", "sha256": "8c7d9d14daa3c9e029a91238ad48da7968745868c8fe1056038e9bec3a028a83",
"bytes": 235409 "bytes": 236374
}, },
{ {
"path": "docker-compose.yml", "path": "docker-compose.yml",
"sha256": "7650ac8db82abc276df314c0cb4bdec5b5bb83be17190e3f16a72400efb01f84", "sha256": "af10bbae7a8b754e71970deec44c127645def2b8202de84101f713e8bbd728e6",
"bytes": 666 "bytes": 695
}, },
{ {
"path": "docs/ARCHITECTURE.md", "path": "docs/ARCHITECTURE.md",
"sha256": "730281d8ffed30ce5ff8e2c75f5e17e6e6a2f969f90707516c985f598ca9d847", "sha256": "c5bb5cc22753a5f518539812a2cacd673ba1b954c323b721bae3b595db5eae45",
"bytes": 3902 "bytes": 4011
}, },
{ {
"path": "docs/CORRELATION.md", "path": "docs/CORRELATION.md",
"sha256": "7358216d20bf780994b36ddaad4790c71ebc561959dbfcfe6eec2c41a87f2b3b", "sha256": "ebc1d95e832b1e493c8d3de919a0387a6cad074a0eebe16ee2c9466f6ce3d05a",
"bytes": 3797 "bytes": 6992
}, },
{ {
"path": "docs/PRIVACY.md", "path": "docs/PRIVACY.md",
"sha256": "22b2887bf0e3bf99654d9350188daec617ea38255f89c03cd1e70ea77580d876", "sha256": "e973006e6c05f5e9f53130e7f5bf76c5a9362614a54c1c1db3d4bb6ace354159",
"bytes": 3127 "bytes": 4310
}, },
{ {
"path": "docs/assets/eventlens-demo-overview.png", "path": "docs/assets/eventlens-demo-overview.png",
"sha256": "c24060588edb7004eac6cbd3b2164d84911d868bbc15d7c1deb7eec4faf558a5", "sha256": "d9e0e3f8783d94667ff66a27302f10b56b3c6f84703d5285fc5dafb80af61b43",
"bytes": 285470 "bytes": 674596
}, },
{ {
"path": "docs/assets/eventlens-redaction-export.png", "path": "docs/assets/eventlens-redaction-export.png",
"sha256": "5bed3e7ee9b3e1f96465a9f127a9ac18e358c02f23271478eb5734f05fdd6af0", "sha256": "adaab7eac081563c599067c9aed0352e19821ebb695b271e40c5b77ad5a0b570",
"bytes": 265967 "bytes": 298180
},
{
"path": "frontend/.prettierrc.json",
"sha256": "4752a235d1f2814dca17798159419f73def1f49b8075a1fbea26556dc439736f",
"bytes": 47
}, },
{ {
"path": "frontend/e2e/accessibility.spec.ts", "path": "frontend/e2e/accessibility.spec.ts",
"sha256": "5998b134062bd595cfb3ea65c24fb6ead3d1c5a7936f7a7d264e37257baf29c0", "sha256": "45ce5aee90ad64d50824f015bee2650d8cd1d134481fa37aa12c72879dd4c8f5",
"bytes": 2214 "bytes": 2240
}, },
{ {
"path": "frontend/e2e/api-contract.spec.ts", "path": "frontend/e2e/api-contract.spec.ts",
"sha256": "c4c98acdd0d22b887da0609310bf9b7cb4b10b1588ee3cb81ebfba4198683241", "sha256": "f70bc171eddc65606a5be5ef566925b62733f57a560d7244614551db04a9fb9b",
"bytes": 3291 "bytes": 3381
}, },
{ {
"path": "frontend/e2e/branding.spec.ts", "path": "frontend/e2e/branding.spec.ts",
@@ -179,17 +194,17 @@
}, },
{ {
"path": "frontend/e2e/eventlens.spec.ts", "path": "frontend/e2e/eventlens.spec.ts",
"sha256": "1537f595e5ae5ef612c2697fe801bcb66c7f5705aba38370a48ba592a8be0827", "sha256": "4725a6dc0a8002d3c75765ec1aa0aae16aea38c91efe142469ffbc1b5fd2cb57",
"bytes": 2702 "bytes": 2720
}, },
{ {
"path": "frontend/e2e/partial-and-error.spec.ts", "path": "frontend/e2e/partial-and-error.spec.ts",
"sha256": "23ecb9ef44a8dee31aabaaaeb311390a31196c261ad1ec65608f2e25d205b6c3", "sha256": "f850752ccd5dd7da37e3541fe325974bffa9c0143c3511b89c45f591c993ef70",
"bytes": 2412 "bytes": 2662
}, },
{ {
"path": "frontend/e2e/portfolio-assets.spec.ts", "path": "frontend/e2e/portfolio-assets.spec.ts",
"sha256": "beb4c7dd354bf8244517ef32120986d8a4fe33f61f1317669c7cc86c49837341", "sha256": "78dacc4b0b64bf9210964e39341add1fe934834b38a908a78a45afe34b04770b",
"bytes": 1870 "bytes": 1870
}, },
{ {
@@ -199,13 +214,13 @@
}, },
{ {
"path": "frontend/e2e/responsive.spec.ts", "path": "frontend/e2e/responsive.spec.ts",
"sha256": "9cf6947caefd9a8ca89cb341751784ae0d714e967bb77da2fd6ccea8562e8bab", "sha256": "147c1fb566f68f584fca549c3900319df385c2d4ee4d008161e6818f43aaa403",
"bytes": 1180 "bytes": 1325
}, },
{ {
"path": "frontend/e2e/settings-storage-failure.spec.ts", "path": "frontend/e2e/settings-storage-failure.spec.ts",
"sha256": "fb0269aa65e27c5668c54b171d1c0e73358ba0e82cdc36fa919b9481b5595a17", "sha256": "a93e0d5a01e49da8a8e66d6306249de87b82ece05c94999a43b5a4519d7ef1f1",
"bytes": 1548 "bytes": 1557
}, },
{ {
"path": "frontend/e2e/settings.spec.ts", "path": "frontend/e2e/settings.spec.ts",
@@ -214,13 +229,13 @@
}, },
{ {
"path": "frontend/e2e/virtualization.spec.ts", "path": "frontend/e2e/virtualization.spec.ts",
"sha256": "d14a4914988e0d971c26ec66c87b7cb0d9b11de543892ca920ebb28973aba731", "sha256": "71c351820aa9be7836b49dbde1833738feaf6d9ef63ff6ecf71ea66ca88be452",
"bytes": 1411 "bytes": 1496
}, },
{ {
"path": "frontend/e2e/workspace.spec.ts", "path": "frontend/e2e/workspace.spec.ts",
"sha256": "ce6153b084d3c6ae6ba280a6b1663b95bb5d14eb71c6aa3ca7246a05514c968b", "sha256": "27ef8cb4d3662dcc4b615cada47219c17a3b9434423c52c96928a300a1fecf71",
"bytes": 4529 "bytes": 4530
}, },
{ {
"path": "frontend/eslint.config.mjs", "path": "frontend/eslint.config.mjs",
@@ -234,13 +249,13 @@
}, },
{ {
"path": "frontend/package-lock.json", "path": "frontend/package-lock.json",
"sha256": "2df5851a6e2a0da42cc046fca58b4c483bf8cf5cac2513761726992a46d2db07", "sha256": "7d22d62cce13dd76b1a30bcda0f94d2404a5514659e72efffe04d5bc89fd197f",
"bytes": 193055 "bytes": 193540
}, },
{ {
"path": "frontend/package.json", "path": "frontend/package.json",
"sha256": "83d5fb76468d3fb8825f419817bb3ee452fafb3b618d675439988fcbdb43f259", "sha256": "6dd90d6931474d7166e2772ec672f0c7195b73a8e0baf1c33467f8144561e1f0",
"bytes": 774 "bytes": 869
}, },
{ {
"path": "frontend/playwright.config.ts", "path": "frontend/playwright.config.ts",
@@ -279,128 +294,148 @@
}, },
{ {
"path": "frontend/src/app/App.tsx", "path": "frontend/src/app/App.tsx",
"sha256": "5a605de7d22d01a0e82c77690ce3fa831da8a46d6861cc1a82a78a4b6eb18af6", "sha256": "37469c64b40d92b7532935b400ddde65a03ba171e62a1a60e3d0d13a6e7086ef",
"bytes": 16490 "bytes": 21348
}, },
{ {
"path": "frontend/src/app/format.ts", "path": "frontend/src/app/format.ts",
"sha256": "3b006879ff2eeaafabbbccde0dd06c8695a5275788e1063c0adb46143ed73fbc", "sha256": "8adbe1f33fd5cee549ffac987488b31a3e02a9656491a2c49250bf1314269a50",
"bytes": 2712 "bytes": 2969
},
{
"path": "frontend/src/app/indexes.ts",
"sha256": "0f0ab79633b61d36001fcb420b123a4dab4e3cb33dd8ece1f581740ee5c74de3",
"bytes": 1603
}, },
{ {
"path": "frontend/src/app/model.ts", "path": "frontend/src/app/model.ts",
"sha256": "659dab5db49da5a3ff6f8f6ec2a7358cbbb9d6085814e2c8b29243c19917c491", "sha256": "1daacacccbc22f1de8dd48286f503bcab419603ea0ffed12c0519d458fc4a7e2",
"bytes": 2773 "bytes": 3062
}, },
{ {
"path": "frontend/src/app/validation.test.ts", "path": "frontend/src/app/validation.test.ts",
"sha256": "e85977b980e40f46ffd33ed46bb48ab1decc42c73374c31c6cd03b37a4367608", "sha256": "0bf959ee90744155c40d23fa3116b75d716d0a1aa68adc52f8e6acbed47c2d59",
"bytes": 2988 "bytes": 3104
}, },
{ {
"path": "frontend/src/app/validation.ts", "path": "frontend/src/app/validation.ts",
"sha256": "1cc56bcdcc9f9f9bc582934493d0b58dc641b9d31846e6d8a22f96c1a39a7147", "sha256": "8f999e1795b682c16c2d94a0059ed32b400b0d4eefd3c96338744ff49f8d1c08",
"bytes": 4465 "bytes": 6744
},
{
"path": "frontend/src/audit.test.ts",
"sha256": "14295619f79061a3842926ea649fa1ccac3ddc317368a0b4abe7674f0277354b",
"bytes": 7853
}, },
{ {
"path": "frontend/src/components/icons.tsx", "path": "frontend/src/components/icons.tsx",
"sha256": "aa4be3ad6ec59703c90a9ea58d57964002305279dad695b018842e73c5b49560", "sha256": "9cc8e3c433cfa5881b5a733b5d708ef2746168bf04fbc92d33464ae60726c3c7",
"bytes": 3714 "bytes": 4408
}, },
{ {
"path": "frontend/src/components/shell.tsx", "path": "frontend/src/components/shell.tsx",
"sha256": "2dab2e7f00179f4aca798c694f51b5587333065cf540e5bec36ec3f009482197", "sha256": "ef7bebcb45b0047cf4c67d03435157ca46b3477d21ea7261cfdb95a5199d0a1b",
"bytes": 4577 "bytes": 5502
}, },
{ {
"path": "frontend/src/components/states.tsx", "path": "frontend/src/components/states.tsx",
"sha256": "f1c124f3f1d71ad0fd050796feb2e6117768eff80033a512e3b9abc6239ce98c", "sha256": "01d53d435cf3bf253cb3c6670a4c3a2de0560dba66de8480813426626cb0923c",
"bytes": 4818 "bytes": 5900
}, },
{ {
"path": "frontend/src/components/timeline.tsx", "path": "frontend/src/components/timeline.tsx",
"sha256": "1c4f00f8094b5fb961ee5ba0a3accc39ae2a072c42258202198ca8c3abb68881", "sha256": "48de3459a4070928aa7da87bfdfbee6d0164b7f50dbff1b4f3d2697e13978004",
"bytes": 14451 "bytes": 21013
}, },
{ {
"path": "frontend/src/export.test.ts", "path": "frontend/src/export.test.ts",
"sha256": "4b29b8804b89fa4a24a5a72eae189421d9825413a8f2fe9aff5cef4279afc1ac", "sha256": "73d3068054f7432639f701704a152b428b985b91d8ec2d62a5430605bb146f80",
"bytes": 3084 "bytes": 3521
}, },
{ {
"path": "frontend/src/export.ts", "path": "frontend/src/export.ts",
"sha256": "c9684adc77e1f7f03b65456704da4d98228ed48bcb4a9b45ba3963ad2a1da774", "sha256": "defdaaaf09ad6f37fb63a56ed911ed34fe76d91de2ee4af8610e615a25186b5d",
"bytes": 4723 "bytes": 6417
}, },
{ {
"path": "frontend/src/filter.performance.test.ts", "path": "frontend/src/filter.performance.test.ts",
"sha256": "5dce8af288421b31623113d5b99ed3833d6e534c959c4f125274bb53c9b2f63b", "sha256": "391978b421774e3ce1fbdbf3c545c23253a78317b7e9a251684cf432b65a1ee4",
"bytes": 1065 "bytes": 1100
}, },
{ {
"path": "frontend/src/filter.test.ts", "path": "frontend/src/filter.test.ts",
"sha256": "9b11358017ca756d40f8dfa26501deb13ac29dc311c94a78b1cfcb80c50f6587", "sha256": "bf006614726d067def85a3f7dd8da556ebede372f60ed8adaf1789de24e58f42",
"bytes": 2306 "bytes": 2458
}, },
{ {
"path": "frontend/src/filter.ts", "path": "frontend/src/filter.ts",
"sha256": "5079417fd973938cec7d8be4c53f696c32e9b5af856440463c89b6131ece96eb", "sha256": "fa4a78e6424388b31331521a08d5581a068f0c7fb2ebfb5ab7ec662400787f37",
"bytes": 2388 "bytes": 2637
}, },
{ {
"path": "frontend/src/main.tsx", "path": "frontend/src/main.tsx",
"sha256": "17bf4515b6bbb2bb45a23a5aad2c0009997431679b766877c97383f38fd3a6b8", "sha256": "7294c1382bfe63876033c002d4f8a2c0e851279f240dd7a71a490027f9e1603d",
"bytes": 332 "bytes": 345
}, },
{ {
"path": "frontend/src/redact.test.ts", "path": "frontend/src/redact.test.ts",
"sha256": "845433d1d3816c41724da85e3c292afae2b9b8c6803fa5686db2b9db42d1c682", "sha256": "bdc4a6772b695e7a9f4b0cd0f52a518dcb2a016e6b082c833dcd21595c52d6b7",
"bytes": 4462 "bytes": 4869
}, },
{ {
"path": "frontend/src/redact.ts", "path": "frontend/src/redact.ts",
"sha256": "c0feba977c333d53066e8f13282a4e43c74ecfcad9bbd9a086eab9251e1132c1", "sha256": "5411f57dce98be37e4341eef730f0d417a7e636ec5be0f207358ac15963724e2",
"bytes": 7753 "bytes": 10588
},
{
"path": "frontend/src/redactClient.ts",
"sha256": "85f37b44b652caf418a60b987f3423191b08818dd20aa063b85b3a0ada6fb55c",
"bytes": 1567
}, },
{ {
"path": "frontend/src/styles.css", "path": "frontend/src/styles.css",
"sha256": "45595619d70e62e28d11c5696b1173fe3d78db6ec81e273312c24ddc792cbc3e", "sha256": "10e2268a4c5074ea65bf6dd4801e60285533f724d4808e0dc5db4b78434dfc6b",
"bytes": 42831 "bytes": 47616
}, },
{ {
"path": "frontend/src/types.ts", "path": "frontend/src/types.ts",
"sha256": "80eb8a81628f287134af1c10716c0c27a322ec9cf6f6fb6b1ca77634f62a1230", "sha256": "7c29818a1ebf6e3987c38b00fcf69b2763b4a2205e9ee5f22b4b78a05cb32b25",
"bytes": 1162 "bytes": 1659
}, },
{ {
"path": "frontend/src/vite-env.d.ts", "path": "frontend/src/vite-env.d.ts",
"sha256": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5", "sha256": "65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5",
"bytes": 38 "bytes": 38
}, },
{
"path": "frontend/src/workers/redact.worker.ts",
"sha256": "ff45144c7d73fbff63d9d6e43f6f7593444ae89966fbce411b9a896f27b33555",
"bytes": 196
},
{ {
"path": "frontend/src/workspaces/AnalysisView.tsx", "path": "frontend/src/workspaces/AnalysisView.tsx",
"sha256": "8ce9c0e1448222ca158fca4a57783570a1c04d462f42f0b23ab82e64baca15af", "sha256": "3946e3a8367b22ecc9bf29cc3f161e71b6209623d769d59f9efcb03075cc89a3",
"bytes": 2801 "bytes": 7283
}, },
{ {
"path": "frontend/src/workspaces/HuntingView.tsx", "path": "frontend/src/workspaces/HuntingView.tsx",
"sha256": "a50dc627a50a46ef574825beb274c0a76c6e44ff012488f16a58ba772ed20bdc", "sha256": "1b2711c8028df5fc30632b7b567446ecc7cde153667a6785ab3a17a9b136c54d",
"bytes": 6336 "bytes": 10229
}, },
{ {
"path": "frontend/src/workspaces/ReportsView.tsx", "path": "frontend/src/workspaces/ReportsView.tsx",
"sha256": "c9003a3f8989c92da519f64db1c351044e5f8b5df5c973216ae23e69b22b4a47", "sha256": "c5f2c0d8ce86a68ac8df91b30b51674ad5bcf8c6dc782f2368e80cc8a84683fa",
"bytes": 5403 "bytes": 11083
}, },
{ {
"path": "frontend/src/workspaces/SettingsView.tsx", "path": "frontend/src/workspaces/SettingsView.tsx",
"sha256": "3bea2be936f3dcf1fbed7b789953f421b27a13e66dfc43ef9966ba2c6e3f6e69", "sha256": "2445bd5d2cf96814b82986b240cb9193ac0540254818c9e4931e7474008c1843",
"bytes": 7847 "bytes": 8919
}, },
{ {
"path": "frontend/src/workspaces/TimelineView.tsx", "path": "frontend/src/workspaces/TimelineView.tsx",
"sha256": "7a051c83fcac216484db4b14edcddd8fb00c1c14372a62ba5462904f8de8b027", "sha256": "fb402d530732f1e93a1cc374f943cb0e019c46a1a8a26c5b312a836529289051",
"bytes": 2592 "bytes": 3181
}, },
{ {
"path": "frontend/tsconfig.json", "path": "frontend/tsconfig.json",
@@ -409,8 +444,8 @@
}, },
{ {
"path": "frontend/vite.config.ts", "path": "frontend/vite.config.ts",
"sha256": "64afcd7677c678de227f1a86b53d7a4bcf113c9e2cac87612ef5e87c4fa3d8f0", "sha256": "5467dcf3835ee7a8ca0fae6473ba8f9dd7d2f0b20ac034b122820a38a1f6b238",
"bytes": 395 "bytes": 430
}, },
{ {
"path": "frontend/vitest.config.ts", "path": "frontend/vitest.config.ts",
@@ -419,8 +454,8 @@
}, },
{ {
"path": "samples/demo-events.json", "path": "samples/demo-events.json",
"sha256": "3b0bd933f0e067c7f2aa1dc620fc92248d7c422ee0a1edf144fc0a53ebc9ed34", "sha256": "221ebc497b3880f374f437b0c23e8818eb4d9bc1668f6c51ad545f442b3f76f7",
"bytes": 1680 "bytes": 6782
} }
] ]
} }
+8 -6
View File
@@ -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. 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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. - 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 ## Portfolio walkthrough
1. Open the deployed instance or start EventLens locally. 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. 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. 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. 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 ## 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. 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 ## 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.
+1 -1
View File
@@ -1 +1 @@
1.0.6 1.1.0
+387 -56
View File
@@ -3,13 +3,14 @@ from collections.abc import Callable
from dataclasses import dataclass from dataclasses import dataclass
from datetime import UTC, datetime, timedelta from datetime import UTC, datetime, timedelta
from .models import Category, IncidentCluster, NormalizedEvent from .models import Campaign, Category, IncidentCluster, NormalizedEvent, Severity
from .normalize import ( from .normalize import (
is_application_error, is_application_error,
is_dns_client, is_dns_client,
is_event_log, is_event_log,
is_kernel_general, is_kernel_general,
is_kernel_power, is_kernel_power,
is_log_cleared,
is_security_audit, is_security_audit,
is_service_control_manager, is_service_control_manager,
is_windows_error_reporting, is_windows_error_reporting,
@@ -17,18 +18,28 @@ from .normalize import (
TitleBuilder = Callable[[list[NormalizedEvent]], str] TitleBuilder = Callable[[list[NormalizedEvent]], str]
ReasonBuilder = 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) @dataclass(frozen=True)
class Rule: class Rule:
id: str id: str
category: Category category: Category
severity: str severity: Severity
window_seconds: int window_seconds: int
predicate: Callable[[NormalizedEvent], bool] predicate: Callable[[NormalizedEvent], bool]
key: Callable[[NormalizedEvent], str | None] key: Callable[[NormalizedEvent], str | None]
title_for: TitleBuilder title_for: TitleBuilder
reason_for: ReasonBuilder reason_for: ReasonBuilder
accept: GroupFilter | None = None
def _field(event: NormalizedEvent, *names: str) -> str: 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")) 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: def _account(event: NormalizedEvent) -> str | None:
return _dimension(_field(event, "EventData.TargetUserName", "TargetUserName")) 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: def _group_key(*dimensions: str | None) -> str | None:
if any(value is None for value in dimensions): if any(value is None for value in dimensions):
return None return None
return "|".join(value.casefold() for value in dimensions if value is not 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: def _crash(event: NormalizedEvent) -> bool:
return is_application_error(event.provider, event.channel, event.event_id) or is_windows_error_reporting( return is_application_error(event.provider, event.channel, event.event_id) or is_windows_error_reporting(
event.provider, event.channel, event.event_id 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} 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: def _dns_timeout(event: NormalizedEvent) -> bool:
return is_dns_client(event.provider, event.channel) and event.event_id == 1014 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 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: def _normal_startup(event: NormalizedEvent) -> bool:
return (is_kernel_general(event.provider, event.channel) and event.event_id == 12) or ( 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 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: def _crash_title(evidence: list[NormalizedEvent]) -> str:
ids = {event.event_id for event in evidence} ids = {event.event_id for event in evidence}
if {1000, 1001}.issubset(ids): 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." 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: def _dns_title(evidence: list[NormalizedEvent]) -> str:
return "DNS timeout activity" if len(evidence) > 1 else "DNS timeout recorded" 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." 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: def _startup_title(evidence: list[NormalizedEvent]) -> str:
return "Normal startup sequence" if len(evidence) > 1 else "Normal startup evidence" return "Normal startup sequence" if len(evidence) > 1 else "Normal startup evidence"
@@ -188,6 +299,16 @@ def _unexpected_reason(evidence: list[NormalizedEvent]) -> str:
RULES = ( RULES = (
Rule(
"windows.audit.log-cleared",
"security",
"critical",
300,
_log_cleared,
lambda event: _group_key(_host(event)),
_log_cleared_title,
_log_cleared_reason,
),
Rule( Rule(
"windows.crash.application-report", "windows.crash.application-report",
"crash", "crash",
@@ -208,6 +329,16 @@ RULES = (
_service_title, _service_title,
_service_reason, _service_reason,
), ),
Rule(
"windows.service.installed",
"service",
"warning",
300,
_service_installed,
_service_installed_key,
_service_installed_title,
_service_installed_reason,
),
Rule( Rule(
"windows.network.dns-timeout", "windows.network.dns-timeout",
"network", "network",
@@ -228,6 +359,37 @@ RULES = (
_auth_title, _auth_title,
_auth_reason, _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( Rule(
"windows.system.startup", "windows.system.startup",
"system", "system",
@@ -261,6 +423,9 @@ RULES = (
) )
# --- grouping ---------------------------------------------------------------
def _event_sort_key(event: NormalizedEvent) -> tuple[bool, datetime, str]: def _event_sort_key(event: NormalizedEvent) -> tuple[bool, datetime, str]:
reliable_timestamp = event.timestamp is not None and event.timestamp_valid reliable_timestamp = event.timestamp is not None and event.timestamp_valid
return ( 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]]: Signature = tuple[str, str, int | None]
buckets: dict[str, list[NormalizedEvent]] = {}
isolated_number = 0
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: 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 continue
key = rule.key(event) key = key_for(event)
if key is None: if key is None:
isolated_number += 1 isolated.append(event)
key = f"__isolated__{isolated_number}:{event.id}" else:
buckets.setdefault(key, []).append(event) buckets.setdefault(key, []).append(event)
groups: list[list[NormalizedEvent]] = [] groups: list[Group] = []
window = timedelta(seconds=rule.window_seconds) window = timedelta(seconds=window_seconds)
for key in sorted(buckets): for key in sorted(buckets):
ordered = sorted(buckets[key], key=_event_sort_key) ordered = sorted(buckets[key], key=_event_sort_key)
current: list[NormalizedEvent] = [] 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: if not current or event.timestamp - current[0].timestamp <= window:
current.append(event) current.append(event)
else: else:
groups.append(current) groups.append((key, current))
current = [event] current = [event]
if current: if current:
groups.append(current) groups.append((key, current))
groups.extend((None, [event]) for event in sorted(isolated, key=_event_sort_key))
return groups 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: def _incident_id(rule_id: str, evidence: list[NormalizedEvent]) -> str:
seed = f"{rule_id}|{'|'.join(event.id for event in evidence)}".encode() seed = f"{rule_id}|{'|'.join(event.id for event in evidence)}".encode()
return f"incident-{hashlib.sha256(seed).hexdigest()[:16]}" return f"incident-{hashlib.sha256(seed).hexdigest()[:16]}"
def _build(rule: Rule, evidence: list[NormalizedEvent]) -> IncidentCluster: def _signatures(evidence: list[NormalizedEvent]) -> set[tuple[str, int | None, str]]:
signatures = {(event.provider, event.event_id, event.summary) for event in evidence} return {(event.provider, event.event_id, event.summary) for event in evidence}
reasons = [rule.reason_for(evidence)]
if len(evidence) > 1:
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()) seconds = int((evidence[-1].timestamp - evidence[0].timestamp).total_seconds())
reasons.append(f"{len(evidence)} evidence events occurred within {seconds} second(s).") reasons.append(f"{len(evidence)} evidence events occurred within {seconds} second(s).")
signatures = _signatures(evidence)
if len(signatures) < len(evidence): if len(signatures) < len(evidence):
reasons.append(f"Repeated signals compress from {len(evidence)} records to {len(signatures)} distinct signature(s).") 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), id=_incident_id(rule.id, evidence),
rule_id=rule.id, rule_id=rule.id,
start=evidence[0].timestamp, start=evidence[0].timestamp,
end=evidence[-1].timestamp, end=evidence[-1].timestamp,
title=rule.title_for(evidence), title=_bounded_title(rule.title_for(evidence), "Correlated evidence"),
category=rule.category, category=rule.category,
severity=rule.severity, severity=rule.severity,
reasons=reasons, reasons=[rule.reason_for(evidence), *_compression_reasons(evidence)],
evidence_event_ids=[event.id for event in evidence], evidence_event_ids=[event.id for event in evidence],
original_count=len(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]: def correlate(events: list[NormalizedEvent]) -> list[IncidentCluster]:
ordered = sorted(events, key=_event_sort_key) return correlate_with_campaigns(events)[0]
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,
),
)
+164 -102
View File
@@ -1,22 +1,30 @@
import asyncio import asyncio
import gzip
import hashlib
import json import json
import logging import logging
import os import os
import re import re
from collections import Counter
from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from pathlib import Path from pathlib import Path
from typing import Any 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.middleware.cors import CORSMiddleware
from fastapi.staticfiles import StaticFiles from fastapi.staticfiles import StaticFiles
from starlette.datastructures import UploadFile as StarletteUploadFile
from starlette.formparsers import MultiPartException
from starlette.requests import ClientDisconnect from starlette.requests import ClientDisconnect
from .correlate import correlate from .correlate import correlate_with_campaigns
from .demo import load_demo from .demo import load_demo
from .models import AnalysisResponse, ParseIssue, ParseStats from .models import AnalysisResponse, ParseIssue, ParseStats, ParseStatus, SourceInfo
from .parser import ( from .parser import (
MAX_UPLOAD_BYTES, MAX_UPLOAD_BYTES,
EvtxParseError, EvtxParseError,
ParseResult,
UnexpectedParserError, UnexpectedParserError,
parse_evtx_bytes, parse_evtx_bytes,
) )
@@ -43,10 +51,11 @@ app.add_middleware(
MAX_MULTIPART_OVERHEAD_BYTES = 1024 * 1024 MAX_MULTIPART_OVERHEAD_BYTES = 1024 * 1024
MAX_REQUEST_BYTES = MAX_UPLOAD_BYTES + MAX_MULTIPART_OVERHEAD_BYTES MAX_REQUEST_BYTES = MAX_UPLOAD_BYTES + MAX_MULTIPART_OVERHEAD_BYTES
MAX_REPORTED_ISSUES = 200
GZIP_LEVEL = 1
CONTENT_SECURITY_POLICY = ( CONTENT_SECURITY_POLICY = (
"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; " "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 " "img-src 'self' data:; connect-src 'self'; "
"http://localhost:5173 http://127.0.0.1:5173 http://127.0.0.1:4173; "
"font-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'" "font-src 'self'; object-src 'none'; base-uri 'none'; frame-ancestors 'none'; form-action 'self'"
) )
SECURITY_HEADERS = { SECURITY_HEADERS = {
@@ -176,49 +185,67 @@ def health():
@app.get("/api/demo", response_model=AnalysisResponse) @app.get("/api/demo", response_model=AnalysisResponse)
def demo(): def demo():
events = load_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 global _parse_inflight
async with _parse_admission_lock: async with _parse_admission_lock:
if _parse_inflight >= PARSE_CONCURRENCY + PARSE_QUEUE_LIMIT: if _parse_inflight >= PARSE_CONCURRENCY + PARSE_QUEUE_LIMIT:
raise HTTPException( raise _capacity_error("EventLens is already analyzing its maximum concurrent uploads; retry shortly.")
503,
detail={
"code": "parse_capacity_exceeded",
"message": "EventLens is already analyzing its maximum concurrent uploads; retry shortly.",
},
headers={"Retry-After": "1"},
)
_parse_inflight += 1 _parse_inflight += 1
acquired = False
try: try:
try: yield
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
finally: 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: async with _parse_admission_lock:
_parse_inflight -= 1 _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: def _failed_parse_stats() -> ParseStats:
return ParseStats( return ParseStats(
status="failed", status="failed",
@@ -230,77 +257,112 @@ def _failed_parse_stats() -> ParseStats:
truncation_reason=None, truncation_reason=None,
duration_ms=0, duration_ms=0,
issues=[ParseIssue(code="parser_rejected_input", message="The EVTX parser rejected the input.")], 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) def _analyze_bytes(source: str, data: bytes | bytearray, compress: bool = False) -> bytes:
async def analyze(file: UploadFile = File(...)): # noqa: B008 """Parse, correlate, serialize and optionally gzip off the event loop."""
source_info = SourceInfo(sha256=hashlib.sha256(data).hexdigest(), size_bytes=len(data))
try: try:
source = _safe_source_name(file.filename) parsed = parse_evtx_bytes(data)
if not source.lower().endswith(".evtx"): except EvtxParseError as exc:
raise HTTPException(400, "Upload an .evtx file") raise HTTPException(
data = bytearray() 422,
while True: detail={
chunk = await file.read(min(1024 * 1024, MAX_UPLOAD_BYTES + 1 - len(data))) "code": "parser_rejected_input",
if not chunk: "message": str(exc),
break "parse": _failed_parse_stats().model_dump(mode="json"),
data.extend(chunk) },
if len(data) > MAX_UPLOAD_BYTES: ) from exc
raise HTTPException(413, "EVTX file exceeds the 50 MiB MVP limit") if not parsed.events:
try: raise HTTPException(
parsed = await _parse_with_admission(bytes(data)) 422,
except EvtxParseError as exc: detail={
raise HTTPException( "code": "no_readable_events",
422, "message": "No readable Windows events were found in this file.",
detail={ "parse": _stats(parsed, "failed").model_dump(mode="json"),
"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,
),
) )
finally: incidents, campaigns = correlate_with_campaigns(parsed.events)
await file.close() 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: def _safe_source_name(filename: str | None) -> str:
+36 -2
View File
@@ -3,7 +3,11 @@ from typing import Literal
from pydantic import BaseModel, Field, field_validator, model_validator 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"] ParseStatus = Literal["complete", "partial", "failed"]
TimestampSource = Literal["event", "record", "missing", "invalid"] TimestampSource = Literal["event", "record", "missing", "invalid"]
@@ -20,6 +24,7 @@ class NormalizedEvent(BaseModel):
computer: str = Field(default="", max_length=256) computer: str = Field(default="", max_length=256)
category: Category = "other" category: Category = "other"
summary: str = Field(default="", max_length=512) summary: str = Field(default="", max_length=512)
outcome: AuditOutcome | None = None
fields: dict[str, str] = Field(default_factory=dict, max_length=200) fields: dict[str, str] = Field(default_factory=dict, max_length=200)
@field_validator("timestamp") @field_validator("timestamp")
@@ -49,11 +54,31 @@ class IncidentCluster(BaseModel):
end: datetime | None = None end: datetime | None = None
title: str = Field(max_length=256) title: str = Field(max_length=256)
category: Category category: Category
severity: str = Field(max_length=32) severity: Severity
reasons: list[str] = Field(max_length=8) reasons: list[str] = Field(max_length=8)
evidence_event_ids: list[str] evidence_event_ids: list[str]
original_count: int = Field(ge=1) original_count: int = Field(ge=1)
compressed_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): class ParseIssue(BaseModel):
@@ -74,10 +99,19 @@ class ParseStats(BaseModel):
truncation_reason: str | None = Field(default=None, max_length=64) truncation_reason: str | None = Field(default=None, max_length=64)
duration_ms: int = Field(ge=0) duration_ms: int = Field(ge=0)
issues: list[ParseIssue] = Field(default_factory=list) 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): class AnalysisResponse(BaseModel):
source: str source: str
events: list[NormalizedEvent] events: list[NormalizedEvent]
incidents: list[IncidentCluster] incidents: list[IncidentCluster]
campaigns: list[Campaign] = Field(default_factory=list)
parse: ParseStats | None = None parse: ParseStats | None = None
source_info: SourceInfo | None = None
+90 -16
View File
@@ -3,9 +3,12 @@ import json
from datetime import UTC, datetime from datetime import UTC, datetime
from typing import Any 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"} LEVELS = {0: "information", 1: "critical", 2: "error", 3: "warning", 4: "information", 5: "verbose"}
MAX_EVENT_ID = 4_294_967_295 MAX_EVENT_ID = 4_294_967_295
MAX_RECORD_ID = 9_223_372_036_854_775_807 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") 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: 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) bounded_key = _bounded_text(key or "value", MAX_FIELD_KEY_CHARS)
if bounded_key not in output: if bounded_key not in output:
@@ -127,47 +145,78 @@ def _flatten(
if len(output) >= limit: if len(output) >= limit:
return return
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: 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): except (TypeError, ValueError):
rendered = "[unrenderable value]" return "[unrenderable value]"
_store_field(output, prefix or "value", rendered[:MAX_FIELD_VALUE_CHARS], limit)
def _fold(value: str) -> str:
return value.strip().casefold()
EVENTLOG_PROVIDERS = frozenset({"eventlog", "microsoft-windows-eventlog"})
def _channel_matches(channel: str, *accepted: str) -> bool: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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" return "network"
if is_security_audit(provider, channel) and event_id in AUTH_EVENT_IDS: if is_security_audit(provider, channel) and event_id in AUTH_EVENT_IDS:
return "authentication" 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): if is_application_error(provider, channel, event_id) or is_windows_error_reporting(provider, channel, event_id):
return "crash" return "crash"
if ( 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: 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}: 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") 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" 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]}" stable_id = f"event-{hashlib.sha256(seed).hexdigest()[:16]}"
timestamp, timestamp_source = _timestamp(system, record_timestamp) timestamp, timestamp_source = _timestamp(system, record_timestamp)
summary = summarize(provider, event_id, category, fields)[:MAX_SUMMARY_CHARS] 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, id=stable_id,
timestamp=timestamp, timestamp=timestamp,
timestamp_source=timestamp_source, timestamp_source=timestamp_source,
timestamp_valid=timestamp is not None, timestamp_valid=timestamp is not None and timestamp_source in {"event", "record"},
provider=provider, provider=provider,
event_id=event_id, event_id=event_id,
level=level[:32], level=level[:32],
@@ -257,5 +330,6 @@ def normalize_record(
computer=computer, computer=computer,
category=category, category=category,
summary=summary, summary=summary,
outcome=_outcome(system),
fields=fields, fields=fields,
) )
+6 -4
View File
@@ -52,7 +52,7 @@ def _fingerprint(stage: str, exc: BaseException) -> str:
def parse_evtx_bytes( def parse_evtx_bytes(
data: bytes, data: bytes | bytearray,
max_events: int = MAX_EVENTS, max_events: int = MAX_EVENTS,
max_seconds: float = MAX_PARSE_SECONDS, max_seconds: float = MAX_PARSE_SECONDS,
) -> ParseResult: ) -> ParseResult:
@@ -113,9 +113,11 @@ def parse_evtx_bytes(
raw_data = record["data"] raw_data = record["data"]
if not isinstance(raw_data, str): if not isinstance(raw_data, str):
raise TypeError("record data was not textual") raise TypeError("record data was not textual")
if ( # A str of n characters encodes to at most 4n UTF-8 bytes, so the
len(raw_data) > MAX_RECORD_JSON_BYTES # costly encode is only needed for records near the limit.
or len(raw_data.encode("utf-8")) > MAX_RECORD_JSON_BYTES 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( add_issue(
"record_json_limit_exceeded", "record_json_limit_exceeded",
+1 -1
View File
@@ -1,6 +1,6 @@
[project] [project]
name = "eventlens-api" name = "eventlens-api"
version = "1.0.6" version = "1.1.0"
description = "Local EVTX incident reconstruction API for EventLens" description = "Local EVTX incident reconstruction API for EventLens"
requires-python = ">=3.12" requires-python = ">=3.12"
dependencies = [ dependencies = [
+298
View File
@@ -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
+99
View File
@@ -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)
+78 -75
View File
@@ -62,11 +62,11 @@ filecache = [
[[package]] [[package]]
name = "certifi" name = "certifi"
version = "2026.7.22" version = "2026.10.23"
source = { registry = "https://pypi.org/simple" } 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 = [ 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]] [[package]]
@@ -245,7 +245,7 @@ wheels = [
[[package]] [[package]]
name = "eventlens-api" name = "eventlens-api"
version = "1.0.6" version = "1.1.0"
source = { virtual = "." } source = { virtual = "." }
dependencies = [ dependencies = [
{ name = "evtx" }, { name = "evtx" },
@@ -309,11 +309,11 @@ wheels = [
[[package]] [[package]]
name = "filelock" name = "filelock"
version = "3.32.6" version = "4.2.12"
source = { registry = "https://pypi.org/simple" } 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 = [ 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]] [[package]]
@@ -442,76 +442,79 @@ wheels = [
[[package]] [[package]]
name = "msgpack" name = "msgpack"
version = "1.2.2" version = "1.2.4"
source = { registry = "https://pypi.org/simple" } 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 = [ 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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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/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]] [[package]]
+5 -4
View File
@@ -6,11 +6,11 @@ services:
context: . context: .
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
EVENTLENS_REVISION: ${GITEA_COMMIT_SHA:-local} EVENTLENS_REVISION: ${EVENTLENS_REVISION:-local}
container_name: eventlens user: "10001:10001"
restart: unless-stopped restart: unless-stopped
ports: ports:
- "1252:8000" - "127.0.0.1:1252:8000"
labels: labels:
net.unraid.docker.webui: "http://localhost:1252" net.unraid.docker.webui: "http://localhost:1252"
net.unraid.docker.icon: "http://localhost:1252/eventlens-icon-512.png" net.unraid.docker.icon: "http://localhost:1252/eventlens-icon-512.png"
@@ -20,8 +20,9 @@ services:
- ALL - ALL
read_only: true read_only: true
tmpfs: tmpfs:
- /tmp:rw,noexec,nosuid,size=64m - /tmp:rw,noexec,nosuid,size=128m
mem_limit: 1g mem_limit: 1g
memswap_limit: 1g
cpus: 2.0 cpus: 2.0
logging: logging:
driver: json-file driver: json-file
+3 -3
View File
@@ -16,7 +16,7 @@ normalized events (bounded strings/fields, explicit timestamp validity/source, s
deterministic correlation rules -> incidents + reasons + evidence IDs deterministic correlation rules -> incidents + reasons + evidence IDs
| |
v 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 ## 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/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/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/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. - `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/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. - `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. 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. 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.
+25 -1
View File
@@ -13,17 +13,41 @@ Every incident carries a stable `rule_id`, bounded total time window, explicit p
## Rules and boundaries ## 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.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.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.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.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.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.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.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 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. 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. 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`.
+5 -2
View File
@@ -19,6 +19,7 @@ Redaction is enabled by default and operates on a cloned analysis object. It mas
- computer/host values; - computer/host values;
- username/account/e-mail identity fields, including domain-qualified accounts, SIDs and machine accounts; - 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; - e-mail addresses in free text;
- IPv4 and IPv6 addresses in free text or IP-address fields; - IPv4 and IPv6 addresses in free text or IP-address fields;
- Windows and UNC paths (including spaces/parentheses) and path-like 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; - known structured identities propagated into summaries, incident titles and reasons;
- the source filename in the exported report. - 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. 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 ## 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. 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.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 659 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 KiB

After

Width:  |  Height:  |  Size: 291 KiB

+4
View File
@@ -0,0 +1,4 @@
{
"printWidth": 120,
"endOfLine": "auto"
}
+8 -2
View File
@@ -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: "Load demo", exact: true }).first().click();
await page.getByRole("button", { name: "Timeline", exact: false }).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.getByRole("textbox", { name: "Search normalized evidence" })).toBeVisible();
await expect(page.getByLabel("Filter by category")).toBeVisible(); await expect(page.getByLabel("Filter by category")).toBeVisible();
await expect(page.getByLabel("Filter by level")).toBeVisible(); await expect(page.getByLabel("Filter by level")).toBeVisible();
await expect(page.getByLabel("Filter by provider")).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 expect(page.getByRole("listitem").first()).toHaveAttribute("aria-setsize", /[0-9]+/);
await page.getByRole("textbox", { name: "Search normalized evidence" }).focus(); await page.getByRole("textbox", { name: "Search normalized evidence" }).focus();
await page.keyboard.press("Tab"); await page.keyboard.press("Tab");
+27 -13
View File
@@ -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 page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await expect(page.getByRole("region", { name: "Current investigation context" })).toContainText("bundled-demo"); await expect(page.getByRole("region", { name: "Current investigation context" })).toContainText("bundled-demo");
await page.route("**/api/analyze", (route) => route.fulfill({ await page.route("**/api/analyze", (route) =>
status: 200, route.fulfill({
contentType: "application/json", status: 200,
body: JSON.stringify({ source: "bad.evtx", events: [], incidents: [{ id: "broken" }] }), contentType: "application/json",
})); body: JSON.stringify({ source: "bad.evtx", events: [], incidents: [{ id: "broken" }] }),
}),
);
await page.locator('input[type="file"]').setInputFiles(validUpload); await page.locator('input[type="file"]').setInputFiles(validUpload);
await expect(page.getByRole("alert")).toContainText("Analysis returned an invalid response."); 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 }) => { test("structured parser errors have safe, useful wording", async ({ page }) => {
await page.route("**/api/analyze", (route) => route.fulfill({ await page.route("**/api/analyze", (route) =>
status: 422, route.fulfill({
contentType: "application/json", status: 422,
body: JSON.stringify({ detail: { code: "no_readable_events", message: "No readable Windows events were found in this file." } }), 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.goto("/#analysis");
await page.locator('input[type="file"]').setInputFiles(validUpload); 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 routeStarted!: () => void;
let releaseRoute!: () => void; let releaseRoute!: () => void;
const started = new Promise<void>((resolve) => { routeStarted = resolve; }); const started = new Promise<void>((resolve) => {
const released = new Promise<void>((resolve) => { releaseRoute = resolve; }); routeStarted = resolve;
});
const released = new Promise<void>((resolve) => {
releaseRoute = resolve;
});
await page.route("**/api/analyze", async (route) => { await page.route("**/api/analyze", async (route) => {
routeStarted(); routeStarted();
await released; await released;
try { 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 { } catch {
// The route can already be cancelled by the browser request abort. // The route can already be cancelled by the browser request abort.
} }
+6 -2
View File
@@ -4,7 +4,9 @@ test("demo investigation workflow crosses Analysis, Timeline and Reports", async
await page.goto("/#analysis"); await page.goto("/#analysis");
await expect(page.getByRole("heading", { name: "No event log loaded", exact: true })).toBeVisible(); 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 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.getByRole("heading", { name: "Incident windows", exact: true })).toBeVisible();
await expect(page.getByText("Analysis status", { exact: true })).toBeVisible(); await expect(page.getByText("Analysis status", { exact: true })).toBeVisible();
await expect(page.getByText("Deterministic demo fixture", { 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 page.getByText("Service failure recorded", { exact: true }).click();
await expect(page).toHaveURL(/#timeline$/); await expect(page).toHaveURL(/#timeline$/);
await expect(page.getByRole("heading", { name: "Event timeline", exact: true })).toBeVisible(); 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(); await expect(page.getByText("Focus active", { exact: true })).toBeVisible();
const search = page.getByRole("textbox", { name: "Search normalized evidence" }); const search = page.getByRole("textbox", { name: "Search normalized evidence" });
+54 -6
View File
@@ -2,16 +2,62 @@ import { expect, test } from "@playwright/test";
const partialAnalysis = { const partialAnalysis = {
source: "partial.evtx", 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: {} }], events: [
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 }] }, 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 }) => { 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 page.goto("/#analysis");
await expect(page.getByRole("heading", { name: "Analysis", exact: true })).toBeVisible(); 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("Partial analysis");
await expect(page.getByRole("alert")).toContainText("incident reconstruction may be incomplete"); await expect(page.getByRole("alert")).toContainText("incident reconstruction may be incomplete");
await expect(page.getByText("event_limit_reached", { exact: true })).toBeVisible(); 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 page.getByRole("button", { name: "Timeline", exact: false }).click();
await expect(page.getByRole("alert")).toContainText("incident reconstruction may be incomplete"); 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(); await expect(page.getByRole("alert").filter({ hasText: "Choose a Windows .evtx file." })).toBeVisible();
}); });
+1 -1
View File
@@ -1,6 +1,6 @@
import { expect, test } from "@playwright/test"; 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.goto("/#analysis");
await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await expect(page.getByRole("heading", { name: "Incident windows", exact: true })).toBeVisible(); await expect(page.getByRole("heading", { name: "Incident windows", exact: true })).toBeVisible();
+11 -1
View File
@@ -1,9 +1,19 @@
import { expect, test } from "@playwright/test"; import { expect, test } from "@playwright/test";
test("core workspace actions remain usable across supported viewport widths", async ({ page }) => { 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.goto("/#analysis");
await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); 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 page.setViewportSize(viewport);
await expect(page.getByRole("button", { name: "Open .evtx", exact: true }).first()).toBeVisible(); await expect(page.getByRole("button", { name: "Open .evtx", exact: true }).first()).toBeVisible();
for (const workspace of ["Analysis", "Timeline", "Hunting", "Reports", "Settings"]) { for (const workspace of ["Analysis", "Timeline", "Hunting", "Reports", "Settings"]) {
@@ -19,7 +19,9 @@ test("settings keeps session state and reports a persistence failure", async ({
await expect(compact).toBeChecked(); await expect(compact).toBeChecked();
await expect(page.locator(".settings-save-feedback")).toHaveText("Preferences changed for this session only"); 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("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("Not saved to browser storage")).toBeVisible();
await expect(page.getByText("Interface preferences for this session")).toBeVisible(); await expect(page.getByText("Interface preferences for this session")).toBeVisible();
+17 -2
View File
@@ -3,14 +3,29 @@ import { expect, test } from "@playwright/test";
function largeAnalysis(count: number) { function largeAnalysis(count: number) {
return { return {
source: "synthetic-large.evtx", 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: [], incidents: [],
}; };
} }
test("large timelines virtualize DOM rows and keep search usable", async ({ page }) => { test("large timelines virtualize DOM rows and keep search usable", async ({ page }) => {
const analysis = largeAnalysis(10_000); 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.goto("/#analysis");
await page.getByRole("button", { name: "Load demo", exact: true }).first().click(); await page.getByRole("button", { name: "Load demo", exact: true }).first().click();
await expect(page.getByText("10,000", { exact: false }).first()).toBeVisible(); await expect(page.getByText("10,000", { exact: false }).first()).toBeVisible();
+1 -1
View File
@@ -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("button", { name: "Hunting", exact: false }).click();
await page.getByRole("textbox", { name: "Search hunting evidence" }).fill("DNS name resolution"); 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 expect(page.getByRole("button", { name: /DNS name resolution timed out/ })).toBeVisible();
await page.getByRole("button", { name: /DNS name resolution timed out/ }).click(); await page.getByRole("button", { name: /DNS name resolution timed out/ }).click();
await expect(page.getByRole("heading", { name: "Inspector", exact: true })).toBeVisible(); await expect(page.getByRole("heading", { name: "Inspector", exact: true })).toBeVisible();
+166 -153
View File
@@ -1,12 +1,12 @@
{ {
"name": "eventlens-web", "name": "eventlens-web",
"version": "1.0.6", "version": "1.1.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "eventlens-web", "name": "eventlens-web",
"version": "1.0.6", "version": "1.1.0",
"dependencies": { "dependencies": {
"react": "^19.0.0", "react": "^19.0.0",
"react-dom": "^19.0.0" "react-dom": "^19.0.0"
@@ -21,6 +21,7 @@
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1", "eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.12.0", "globals": "^17.12.0",
"prettier": "3.6.2",
"typescript": "^5.8.0", "typescript": "^5.8.0",
"typescript-eslint": "^8.70.1", "typescript-eslint": "^8.70.1",
"vite": "^6.0.0", "vite": "^6.0.0",
@@ -932,6 +933,13 @@
"url": "https://github.com/sponsors/nzakas" "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": { "node_modules/@jridgewell/gen-mapping": {
"version": "0.3.13", "version": "0.3.13",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
@@ -1460,17 +1468,17 @@
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.73.0.tgz",
"integrity": "sha512-nDNrUQ/4ruSNYbu749TRY7cfrzPtoLHEXSNBI8aaNY32LlZCajixqRf3FqcKC4p5Cam4VOHYx/t+i5+nKXvrqA==", "integrity": "sha512-UkygMFer53Yzn29MCYFTHf34hGXf5KJhiDWfIm1tXtXRrym1CS6l5H9Y3yCtPWChpC0/f93H88gdj8tN0dd4kw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.12.2", "@eslint-community/regexpp": "^4.12.2",
"@typescript-eslint/scope-manager": "8.70.1", "@typescript-eslint/scope-manager": "8.73.0",
"@typescript-eslint/type-utils": "8.70.1", "@typescript-eslint/type-utils": "8.73.0",
"@typescript-eslint/utils": "8.70.1", "@typescript-eslint/utils": "8.73.0",
"@typescript-eslint/visitor-keys": "8.70.1", "@typescript-eslint/visitor-keys": "8.73.0",
"ignore": "^7.0.5", "ignore": "^7.0.5",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
@@ -1483,15 +1491,15 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/parser": "^8.70.1", "@typescript-eslint/parser": "^8.73.0",
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
"typescript": ">=4.8.4 <6.1.0" "typescript": ">=4.8.4 <6.1.0"
} }
}, },
"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
"version": "7.0.10", "version": "7.0.16",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.10.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.16.tgz",
"integrity": "sha512-HpbUakT7xp5miBUywCHf36ZEuAJNklBJDDsGpUIjMzOSmM8ELSfA9Sa/QDPeNeqeoN31u+UTCkL4klCOVvRm4Q==", "integrity": "sha512-52N+Y4HRMOJmbLmr+DqO4iSRyyB7N52gm7PWCT6h0p978+oKbqHCB7gIJIwZvBUsjlSdWbrBFqUSmIFNZMpn0A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -1499,16 +1507,16 @@
} }
}, },
"node_modules/@typescript-eslint/parser": { "node_modules/@typescript-eslint/parser": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.73.0.tgz",
"integrity": "sha512-nO974WLllwhSFWQXnMLj6nDGa8f0khKEz1JzpPJ1u7Vm/4X1X6ZHajpoknU4bb41vJyMB0HHVyS2GqdhWfIXZw==", "integrity": "sha512-AuL45bVcmssHfZ3Di3cs9Q0l4gBm4ZFVrJOQEE7VpqW+PVgQaEwSwazz4TVIiFabXkk6U51EprYDwqw+HR8ePw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/scope-manager": "8.70.1", "@typescript-eslint/scope-manager": "8.73.0",
"@typescript-eslint/types": "8.70.1", "@typescript-eslint/types": "8.73.0",
"@typescript-eslint/typescript-estree": "8.70.1", "@typescript-eslint/typescript-estree": "8.73.0",
"@typescript-eslint/visitor-keys": "8.70.1", "@typescript-eslint/visitor-keys": "8.73.0",
"debug": "^4.4.3" "debug": "^4.4.3"
}, },
"engines": { "engines": {
@@ -1524,14 +1532,14 @@
} }
}, },
"node_modules/@typescript-eslint/project-service": { "node_modules/@typescript-eslint/project-service": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.73.0.tgz",
"integrity": "sha512-62xOgboPfwc3/IgPSX/W6oQR3ZbF04194FPGUGH8HL8iLFHbt/456/8Ph1wLNUgVF+s94FlHoipBsz+v7+LMnA==", "integrity": "sha512-/pEf8Rc4Mjk+qJnY0uO1+Gadeal8uv50xpuic+srG2vIVatA0XxvWMUeMtFvs6OCHqftiQ7/+qH4aehG5stzIA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/tsconfig-utils": "^8.70.1", "@typescript-eslint/tsconfig-utils": "^8.73.0",
"@typescript-eslint/types": "^8.70.1", "@typescript-eslint/types": "^8.73.0",
"debug": "^4.4.3" "debug": "^4.4.3"
}, },
"engines": { "engines": {
@@ -1546,14 +1554,14 @@
} }
}, },
"node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.73.0.tgz",
"integrity": "sha512-Pa0EeSeAusQc1WbjQMac+YfenewYTBu0KjgYvkUKwhXaHUKbFog23Dm/rp0DX/6tyYOQ3Xl1a+3EcFNZynGHCw==", "integrity": "sha512-/TjD738Iq2rzj5z0ixVOi+TsvgjAzZPLPaH1yWdDBytR/HTR5gMpyYWZeCe5WTQZLwk3ho8AV7U3muoQCRtXBQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.70.1", "@typescript-eslint/types": "8.73.0",
"@typescript-eslint/visitor-keys": "8.70.1" "@typescript-eslint/visitor-keys": "8.73.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1564,9 +1572,9 @@
} }
}, },
"node_modules/@typescript-eslint/tsconfig-utils": { "node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.73.0.tgz",
"integrity": "sha512-jumze1fPI+sDOaM2TWGQdn39PDxTr7TZGeuyLkAbNyx2vtMT3uRnVKChN0hfht5V2TugphJzF6bYXvBcE09qqg==", "integrity": "sha512-lmtCFOfYaJfpqZywGuXi4FpNtE+NQ+YLe3T0K9rtEDcW8ZuGWvfI++pj8r05sYMI8vWT2CYK4rWyedmD6Rp4og==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -1581,15 +1589,15 @@
} }
}, },
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.73.0.tgz",
"integrity": "sha512-7zKTnyvaVWqzLZHPFQtX1hVHqgkMC+WebPWakNCSyrQVbIP1AM0L0TlBZtACldIRb6PptI8Odk+jyZ5kP3B1VA==", "integrity": "sha512-MOC9i4xy1F7KcDde7Ip8jf1SrRiALb2Km4UWxGNjUE2YlhjIEo1ayE27GHIwIQyfWuHTmEonQT14uyurlyC6aA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.70.1", "@typescript-eslint/types": "8.73.0",
"@typescript-eslint/typescript-estree": "8.70.1", "@typescript-eslint/typescript-estree": "8.73.0",
"@typescript-eslint/utils": "8.70.1", "@typescript-eslint/utils": "8.73.0",
"debug": "^4.4.3", "debug": "^4.4.3",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
}, },
@@ -1606,9 +1614,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.73.0.tgz",
"integrity": "sha512-Dm1ypdhhrGCTyyehxElhgJ6kgk8MVCv5qXdoOVqPr1uqk42jX8KjrZqhROvdShczA8qrDoYiOWn1ykWlx2k81Q==", "integrity": "sha512-O/1ytYzflF16QDKXx4/qOXg1IuZp+n7hr9t+S0nv7N/2Tl8rJiNCshztV1gcSUvHbPtoX3+zmNbtSAyVbzxVfw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -1620,18 +1628,18 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.73.0.tgz",
"integrity": "sha512-TU8PwyGN0PQJUcE96mw8eCQ44SmxGdQlJmlWakHaHQ15eIuuvye5yNtmh/i6oS88jzXVQB71xdNkbkB/fMwL0g==", "integrity": "sha512-InjlBkSdWceIwIBWSwS3ENUp+i0O02PGX3Zv2wnihWJC1WDVGvG7mTHuf8b57uAaITj94d6tRPDH+sUEtXdRQQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/project-service": "8.70.1", "@typescript-eslint/project-service": "8.73.0",
"@typescript-eslint/tsconfig-utils": "8.70.1", "@typescript-eslint/tsconfig-utils": "8.73.0",
"@typescript-eslint/types": "8.70.1", "@typescript-eslint/types": "8.73.0",
"@typescript-eslint/visitor-keys": "8.70.1", "@typescript-eslint/visitor-keys": "8.73.0",
"debug": "^4.4.3", "debug": "^4.4.3",
"minimatch": "^10.2.2", "minimatch": "^11.0.1",
"semver": "^7.7.3", "semver": "^7.7.3",
"tinyglobby": "^0.2.15", "tinyglobby": "^0.2.15",
"ts-api-utils": "^2.5.0" "ts-api-utils": "^2.5.0"
@@ -1644,7 +1652,13 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
}, },
"peerDependencies": { "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" "typescript": ">=4.8.4 <6.1.0"
},
"peerDependenciesMeta": {
"@typescript/native": {
"optional": true
}
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": {
@@ -1658,9 +1672,9 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
"version": "5.0.12", "version": "5.0.13",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz",
"integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -1671,25 +1685,26 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {
"version": "10.2.6", "version": "11.0.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.9.tgz",
"integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", "integrity": "sha512-KCFkfyjqerNlSstjlhIGNXIKZGA/6O4V4RlhZ+Dsr621SPPw0mzlypE9D9ZOoPiVefHID+j7/XuMMlqfD/F60Q==",
"dev": true, "dev": true,
"license": "BlueOak-1.0.0", "license": "BlueOak-1.0.0",
"dependencies": { "dependencies": {
"brace-expansion": "^5.0.8" "@isaacs/nonrecursive-glob-match": "^1.1.0",
"brace-expansion": "^5.0.12"
}, },
"engines": { "engines": {
"node": "18 || 20 || >=22" "node": "20 || >=22"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/isaacs" "url": "https://github.com/sponsors/isaacs"
} }
}, },
"node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": {
"version": "7.8.5", "version": "7.8.6",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz",
"integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==",
"dev": true, "dev": true,
"license": "ISC", "license": "ISC",
"bin": { "bin": {
@@ -1700,16 +1715,16 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.73.0.tgz",
"integrity": "sha512-Esgul8MsnKnRLdYU2Eb2cRV9bS5HJYtKj1ByJnOzzG2M58DGdSUQ1jUuILxipqcpB2h9WLrbD5GijIWUjX/Tqw==", "integrity": "sha512-j2SVJJvVkXdUL0WcEzo4vEH1mO1vIi8KlVukcYA2MgMZvYN2LlZR4PmsW+GTSxSW24j6Q/EP7+MOifLtg5hmsA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.9.1", "@eslint-community/eslint-utils": "^4.9.1",
"@typescript-eslint/scope-manager": "8.70.1", "@typescript-eslint/scope-manager": "8.73.0",
"@typescript-eslint/types": "8.70.1", "@typescript-eslint/types": "8.73.0",
"@typescript-eslint/typescript-estree": "8.70.1" "@typescript-eslint/typescript-estree": "8.73.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1724,13 +1739,13 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.70.1.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.73.0.tgz",
"integrity": "sha512-Vwj9lUIW5Xq3wQ9w6gv3R86g1hMK8f2zNOdGTAgeXUMMXFK78G9ruCjjqutHMNJc0+CH7LYRnHeUB9IT8wFmcw==", "integrity": "sha512-k4lsFVpRZICbltkIEEH4hZRkwXkqDF1GHBpClKQOHQY+RkoZAAuyc1ci3I6p+CB6v3U4jaHIUshc4RzzQXZWLg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/types": "8.70.1", "@typescript-eslint/types": "8.73.0",
"eslint-visitor-keys": "^5.0.0" "eslint-visitor-keys": "^5.0.0"
}, },
"engines": { "engines": {
@@ -1755,22 +1770,22 @@
} }
}, },
"node_modules/@vitest/mocker": { "node_modules/@vitest/mocker": {
"version": "5.0.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.0.0.tgz", "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-5.1.1.tgz",
"integrity": "sha512-66PGTMIiVJP3t4a5yxU9qPtf7MdTBs8jmToMvy+HVflB3Yy13WJZTtPePdvU+wjRV02SKK5doLbSA6o9pwOmiA==", "integrity": "sha512-b2OgTB4+3ImWIVafXKazJXwLKwQxUNnix6b3xUvUTMh7RyXlrtzoxfZr8aEz9zkHOMAS4K5lu3TvFWoiVeVTQg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@jridgewell/trace-mapping": "0.3.31", "@jridgewell/trace-mapping": "0.3.31",
"@vitest/spy": "5.0.0", "@vitest/spy": "5.1.1",
"estree-walker": "^3.0.3", "estree-walker": "^3.0.3",
"magic-string": "^1.2.3" "magic-string": "^1.4.5"
}, },
"funding": { "funding": {
"url": "https://opencollective.com/vitest" "url": "https://opencollective.com/vitest"
}, },
"peerDependencies": { "peerDependencies": {
"msw": "^2.4.9", "msw": "^2.4.9 || ^3.0.0",
"vite": "^6.0.0 || ^7.0.0 || ^8.0.0" "vite": "^6.0.0 || ^7.0.0 || ^8.0.0"
}, },
"peerDependenciesMeta": { "peerDependenciesMeta": {
@@ -1783,9 +1798,9 @@
} }
}, },
"node_modules/@vitest/spy": { "node_modules/@vitest/spy": {
"version": "5.0.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.0.0.tgz", "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-5.1.1.tgz",
"integrity": "sha512-uy+luWBAPw9XfthoHi5AkfHUnuPYEESjl0p/r+meoBnU8bxg5GDQ3Ey8MjcJ6sqahkL4PFyrvfMJJBw7LbU06g==", "integrity": "sha512-6K8C6alQG1/Yc8/ZI22iJS7JEsxPdVzqtqDq+/xM4Z0mGVykemMVjLhqMy/q6/IHYG3kKD8hKSwRen/ZdyI9vQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"funding": { "funding": {
@@ -2213,9 +2228,9 @@
"license": "CC-BY-4.0" "license": "CC-BY-4.0"
}, },
"node_modules/chai": { "node_modules/chai": {
"version": "6.2.2", "version": "6.3.0",
"resolved": "https://registry.npmjs.org/chai/-/chai-6.2.2.tgz", "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz",
"integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", "integrity": "sha512-XWAtwJ6OHO+tj0EKCs0Y2UamnyOxseZWltU4x2U2wh8g4AigdjwvtUjvLP2tqkA/avxHEtzxNaqGq/YGNwckKg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -4063,9 +4078,9 @@
} }
}, },
"node_modules/magic-string": { "node_modules/magic-string": {
"version": "1.3.1", "version": "1.4.5",
"resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.3.1.tgz", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-1.4.5.tgz",
"integrity": "sha512-rm91zr2Ou+XueDTohjQQjdQEcYM6zVi8KVUCG8Ec3vHwUEKrhSdCNyfuIywkA6hcCAteIn0ZOtAHA6eGpiX+Pg==", "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -4266,9 +4281,9 @@
} }
}, },
"node_modules/obug": { "node_modules/obug": {
"version": "2.2.1", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/obug/-/obug-2.2.1.tgz", "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz",
"integrity": "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q==", "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==",
"dev": true, "dev": true,
"funding": [ "funding": [
"https://github.com/sponsors/sxzz", "https://github.com/sponsors/sxzz",
@@ -4486,6 +4501,22 @@
"node": ">= 0.8.0" "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": { "node_modules/prop-types": {
"version": "15.8.1", "version": "15.8.1",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz",
@@ -4879,34 +4910,20 @@
"url": "https://github.com/sponsors/ljharb" "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": { "node_modules/source-map-js": {
"version": "1.2.1", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.4.tgz",
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "integrity": "sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==",
"dev": true, "dev": true,
"license": "BSD-3-Clause", "license": "BSD-3-Clause",
"engines": { "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": { "node_modules/std-env": {
"version": "4.2.0", "version": "4.3.0",
"resolved": "https://registry.npmjs.org/std-env/-/std-env-4.2.0.tgz", "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz",
"integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", "integrity": "sha512-OtU/EgQ1kIm5KwqQpBC6ZEMXrZRui11w8zgfTWp8cdO9B8OaPsbA8bTHO2P+HNo1VlUTGMVBwPhydu6poeXiag==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
@@ -5078,9 +5095,9 @@
} }
}, },
"node_modules/tinybench": { "node_modules/tinybench": {
"version": "6.1.4", "version": "6.2.4",
"resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.1.4.tgz", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.4.tgz",
"integrity": "sha512-9APumHG7r4yOk4X4WlkmE71aZcv1gvin1czO3OQ1U9iJcFA5Ja/ygyb0vPOVHTthFozUYs8CLoLUlM8grb2lTQ==", "integrity": "sha512-SQ52jEncXxbMCzJuY2A/jGIbbAu6NYsBWW7grz2pNE+EnzQdoGaoBfpk4qC/opE7qiUcGmGgaGIz5EoHdS1O9w==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -5088,9 +5105,9 @@
} }
}, },
"node_modules/tinyexec": { "node_modules/tinyexec": {
"version": "1.3.0", "version": "1.3.1",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.0.tgz", "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.3.1.tgz",
"integrity": "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ==", "integrity": "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"engines": { "engines": {
@@ -5232,16 +5249,16 @@
} }
}, },
"node_modules/typescript-eslint": { "node_modules/typescript-eslint": {
"version": "8.70.1", "version": "8.73.0",
"resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.70.1.tgz", "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.73.0.tgz",
"integrity": "sha512-AcWG7KDjZ2THNXsgwttMaGmzVi0VFRlFYfqFHYQRbDpF3owuYbuiL8c7UUrd2k8s3PoSfIQrWfrGXfcElrWLYA==", "integrity": "sha512-+EnKy9rkYPun4l+kG2bDuYWQ6y1tGVgdR/tY1U9AC6h21CjEwOoc7gsjwe0FXB8uWFzk4QiCFbuRWgX758PiAg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@typescript-eslint/eslint-plugin": "8.70.1", "@typescript-eslint/eslint-plugin": "8.73.0",
"@typescript-eslint/parser": "8.70.1", "@typescript-eslint/parser": "8.73.0",
"@typescript-eslint/typescript-estree": "8.70.1", "@typescript-eslint/typescript-estree": "8.73.0",
"@typescript-eslint/utils": "8.70.1" "@typescript-eslint/utils": "8.73.0"
}, },
"engines": { "engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0" "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -5316,9 +5333,9 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "6.4.3", "version": "6.4.6",
"resolved": "https://registry.npmjs.org/vite/-/vite-6.4.3.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-6.4.6.tgz",
"integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", "integrity": "sha512-RtsraAwEG68idOA6iUOoIpOlcSKROnf815aIq9qHTSrDNpLoBrBa12suyfcEd8qn0xwOVQI1Yhm1GbmTjF600A==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
@@ -5391,25 +5408,25 @@
} }
}, },
"node_modules/vitest": { "node_modules/vitest": {
"version": "5.0.0", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-5.0.0.tgz", "resolved": "https://registry.npmjs.org/vitest/-/vitest-5.1.1.tgz",
"integrity": "sha512-gpsMNoRhMjMktVxPtstOH4/PJuPyovVaMDr4oDilXaGH1EcqM2OE96SoHT2VIQ6fTGtTjqmHDrEu2X9RQiXf8Q==", "integrity": "sha512-trVmzUFOSraCZcI3uZIMD5FqBh4atFkC/XuJP/IU7qtyQay0FCs3Ia+0QiQ2JJwGyWG/xrcBoJNel2+O7kEZ0g==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@types/chai": "^5.2.2", "@types/chai": "^5.2.2",
"@vitest/mocker": "5.0.0", "@vitest/mocker": "5.1.1",
"chai": "^6.2.2", "chai": "^6.3.0",
"es-module-lexer": "^2.3.2", "es-module-lexer": "^2.3.2",
"expect-type": "^1.4.0", "expect-type": "^1.4.0",
"magic-string": "^1.2.3", "magic-string": "^1.4.5",
"obug": "^2.1.4", "obug": "^3.0.0",
"picomatch": "^4.0.7", "picomatch": "^4.0.7",
"std-env": "^4.2.0", "std-env": "^4.3.0",
"tinybench": "6.1.4", "tinybench": "^6.2.3",
"tinyexec": "1.3.0", "tinyexec": "^1.3.1",
"tinyglobby": "^0.2.17", "tinyglobby": "^0.2.17",
"why-is-node-running": "^2.3.0" "why-is-node-running": "3.2.1"
}, },
"bin": { "bin": {
"vitest": "vitest.mjs" "vitest": "vitest.mjs"
@@ -5424,12 +5441,12 @@
"@edge-runtime/vm": "*", "@edge-runtime/vm": "*",
"@opentelemetry/api": "^1.9.0", "@opentelemetry/api": "^1.9.0",
"@types/node": "^22.0.0 || >=24.0.0", "@types/node": "^22.0.0 || >=24.0.0",
"@vitest/browser-playwright": "5.0.0", "@vitest/browser-playwright": "5.1.1",
"@vitest/browser-preview": "5.0.0", "@vitest/browser-preview": "5.1.1",
"@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0",
"@vitest/coverage-istanbul": "5.0.0", "@vitest/coverage-istanbul": "5.1.1",
"@vitest/coverage-v8": "5.0.0", "@vitest/coverage-v8": "5.1.1",
"@vitest/ui": "5.0.0", "@vitest/ui": "5.1.1",
"happy-dom": "*", "happy-dom": "*",
"jsdom": "*", "jsdom": "*",
"vite": "^6.4.0 || ^7.0.0 || ^8.0.0" "vite": "^6.4.0 || ^7.0.0 || ^8.0.0"
@@ -5579,20 +5596,16 @@
} }
}, },
"node_modules/why-is-node-running": { "node_modules/why-is-node-running": {
"version": "2.3.0", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz",
"integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "integrity": "sha512-Tb2FUhB4vUsGQlfSquQLYkApkuPAFQXGFzxWKHHumVz2dK+X1RUm/HnID4+TfIGYJ1kTcwOaCk/buYCEJr6YjQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
},
"bin": { "bin": {
"why-is-node-running": "cli.js" "why-is-node-running": "cli.js"
}, },
"engines": { "engines": {
"node": ">=8" "node": ">=20.11"
} }
}, },
"node_modules/word-wrap": { "node_modules/word-wrap": {
@@ -5626,9 +5639,9 @@
} }
}, },
"node_modules/zod": { "node_modules/zod": {
"version": "4.6.5", "version": "4.6.7",
"resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz", "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz",
"integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==", "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"funding": { "funding": {
+5 -3
View File
@@ -1,13 +1,14 @@
{ {
"name": "eventlens-web", "name": "eventlens-web",
"version": "1.0.6", "version": "1.1.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"lint": "eslint src", "lint": "eslint src && prettier --check src e2e",
"build": "tsc --noEmit && vite build", "build": "tsc --noEmit && vite build",
"test": "vitest run --passWithNoTests", "test": "vitest run --passWithNoTests",
"test:e2e": "playwright test" "test:e2e": "playwright test",
"format": "prettier --write src e2e"
}, },
"dependencies": { "dependencies": {
"react": "^19.0.0", "react": "^19.0.0",
@@ -23,6 +24,7 @@
"eslint-plugin-react": "^7.37.5", "eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^7.1.1", "eslint-plugin-react-hooks": "^7.1.1",
"globals": "^17.12.0", "globals": "^17.12.0",
"prettier": "3.6.2",
"typescript": "^5.8.0", "typescript": "^5.8.0",
"typescript-eslint": "^8.70.1", "typescript-eslint": "^8.70.1",
"vite": "^6.0.0", "vite": "^6.0.0",
+341 -68
View File
@@ -1,9 +1,25 @@
import { type ChangeEvent, type DragEvent, useEffect, useMemo, useRef, useState } from "react"; import { type ChangeEvent, type DragEvent, useDeferredValue, useEffect, useMemo, useRef, useState } from "react";
import { analysisToMarkdown, prepareExport } from "../export"; 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 { filterEvents, uniqueProviders, type EventFilters } from "../filter";
import type { Analysis, EventItem, Incident } from "../types"; import type { Analysis, EventItem, Incident } from "../types";
import { downloadText, exportStem } from "./format"; 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 { isAnalysis } from "./validation";
import { AppTopbar, GlobalActions, InvestigationContext, Statusbar } from "../components/shell"; import { AppTopbar, GlobalActions, InvestigationContext, Statusbar } from "../components/shell";
import { ErrorBanner, ParserIssueNotice, PartialAnalysisWarning } from "../components/states"; import { ErrorBanner, ParserIssueNotice, PartialAnalysisWarning } from "../components/states";
@@ -13,7 +29,10 @@ import { ReportsView } from "../workspaces/ReportsView";
import { SettingsView } from "../workspaces/SettingsView"; import { SettingsView } from "../workspaces/SettingsView";
import { TimelineView } from "../workspaces/TimelineView"; 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"; const APP_VERSION = import.meta.env.VITE_EVENTLENS_VERSION ?? "development";
function analysisErrorMessage(status: number, body: unknown): string { function analysisErrorMessage(status: number, body: unknown): string {
@@ -30,7 +49,9 @@ function analysisErrorMessage(status: number, body: unknown): string {
export function App() { export function App() {
const [settings, setSettings] = useState<UiSettings>(readSettings); const [settings, setSettings] = useState<UiSettings>(readSettings);
const [activeWorkspace, setActiveWorkspace] = useState<Workspace>(() => workspaceFromHash() ?? readSettings().defaultWorkspace); const [activeWorkspace, setActiveWorkspace] = useState<Workspace>(
() => workspaceFromHash() ?? readSettings().defaultWorkspace,
);
const [data, setData] = useState<Analysis | null>(null); const [data, setData] = useState<Analysis | null>(null);
const [selectedEventId, setSelectedEventId] = useState<string | null>(null); const [selectedEventId, setSelectedEventId] = useState<string | null>(null);
const [activeIncidentId, setActiveIncidentId] = useState(""); const [activeIncidentId, setActiveIncidentId] = useState("");
@@ -45,6 +66,9 @@ export function App() {
const [settingsNotice, setSettingsNotice] = useState(""); const [settingsNotice, setSettingsNotice] = useState("");
const [settingsPersistenceFailed, setSettingsPersistenceFailed] = useState(false); const [settingsPersistenceFailed, setSettingsPersistenceFailed] = useState(false);
const [settingsStorageConfirmed, setSettingsStorageConfirmed] = 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<HTMLInputElement>(null); const fileInput = useRef<HTMLInputElement>(null);
const requestRef = useRef<AbortController | null>(null); const requestRef = useRef<AbortController | null>(null);
@@ -83,37 +107,87 @@ export function App() {
setActiveWorkspace(workspace); setActiveWorkspace(workspace);
}; };
const activeIncident = useMemo(() => data?.incidents.find((incident) => incident.id === activeIncidentId) ?? null, [data, activeIncidentId]); const index = useMemo(() => (data ? analysisIndex(data) : null), [data]);
const selected = useMemo(() => data?.events.find((event) => event.id === selectedEventId) ?? null, [data, selectedEventId]); // Filtering 100,000 events runs at a lower priority than typing, so inputs stay responsive.
const evidenceIds = useMemo(() => focusIncident && activeIncident ? new Set(activeIncident.evidence_event_ids) : null, [focusIncident, activeIncident]); 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 providers = useMemo(() => uniqueProviders(data?.events ?? []), [data]);
const visibleEvents = useMemo(() => { const visibleEvents = useMemo(() => {
const eventFilters: EventFilters = { const eventFilters: EventFilters = {
search: filters.search, search: deferredFilters.search,
category: filters.category, category: deferredFilters.category,
level: filters.level, level: deferredFilters.level,
provider: filters.provider, provider: deferredFilters.provider,
noiseMode: filters.attentionOnly ? "attention" : "all", noiseMode: deferredFilters.attentionOnly ? "attention" : "all",
evidenceIds, evidenceIds,
windowMinutes: filters.windowMinutes, windowMinutes: deferredFilters.windowMinutes,
anchorTimestamp: selected?.timestamp ?? activeIncident?.start ?? null, anchorTimestamp: deferredFilters.windowAnchor,
}; };
return filterEvents(data?.events ?? [], eventFilters); return filterEvents(data?.events ?? [], eventFilters);
}, [data, filters, evidenceIds, selected, activeIncident]); }, [data, deferredFilters, evidenceIds]);
const incidentEventIds = useMemo(() => new Set(data?.incidents.flatMap((incident) => incident.evidence_event_ids) ?? []), [data]); const incidentEventIds = useMemo(() => index?.incidentEventIds ?? new Set<string>(), [index]);
const huntingResults = useMemo(() => { 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 }); const filtered = filterEvents(data?.events ?? [], {
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))); search: deferredHunting.search,
}, [data, hunting, selected, activeIncident, incidentEventIds]); category: deferredHunting.category,
const redactionPreview = useMemo(() => data && redactExports ? prepareExport(data, true).redaction : null, [data, redactExports]); 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 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<UiSettings>) { function updateSettings(patch: Partial<UiSettings>) {
setSettingsStorageConfirmed(false); setSettingsStorageConfirmed(false);
setSettings((current) => ({ ...current, ...patch })); setSettings((current) => ({ ...current, ...patch }));
setSettingsNotice("Saving preferences…"); 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); if (typeof patch.defaultRedaction === "boolean") setRedactExports(patch.defaultRedaction);
} }
@@ -125,12 +199,30 @@ export function App() {
setSettingsNotice("Resetting preferences…"); setSettingsNotice("Resetting preferences…");
} }
/** Choosing a time window pins it to the current selection; later selections do not move it. */
function windowPatch<T extends { windowMinutes: number; windowAnchor: string | null }>(
current: T,
patch: Partial<T>,
): 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() { function resetFilters() {
setFilters(EMPTY_FILTERS(settings.defaultNoise === "attention")); setFilters(EMPTY_FILTERS(settings.defaultNoise === "attention"));
setFocusIncident(false); setFocusIncident(false);
} }
function resetHunting() { setHunting(EMPTY_HUNTING()); } function resetHunting() {
setHunting(EMPTY_HUNTING());
}
function resetView(next: Analysis) { function resetView(next: Analysis) {
setData(next); setData(next);
@@ -146,7 +238,8 @@ export function App() {
requestRef.current?.abort(); requestRef.current?.abort();
const controller = new AbortController(); const controller = new AbortController();
requestRef.current = controller; requestRef.current = controller;
setLoading(true); setError(""); setLoading(true);
setError("");
try { try {
const response = await fetch(`${API}/api/demo`, { cache: "no-store", signal: controller.signal }); const response = await fetch(`${API}/api/demo`, { cache: "no-store", signal: controller.signal });
const body: unknown = await response.json().catch(() => null); const body: unknown = await response.json().catch(() => null);
@@ -155,28 +248,62 @@ export function App() {
if (requestRef.current !== controller || controller.signal.aborted) return; if (requestRef.current !== controller || controller.signal.aborted) return;
resetView(body); resetView(body);
} catch (reason) { } 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."); if (requestRef.current === controller && !controller.signal.aborted)
} finally { if (requestRef.current === controller) { requestRef.current = null; setLoading(false); } } 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) { async function analyzeFile(file: File) {
requestRef.current?.abort(); requestRef.current?.abort();
requestRef.current = null; 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(); const controller = new AbortController();
requestRef.current = controller; requestRef.current = controller;
setLoading(true); setError(""); setLoading(true);
const form = new FormData(); form.append("file", file); setError("");
const form = new FormData();
form.append("file", file);
try { 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); const body: unknown = await response.json().catch(() => null);
if (requestRef.current !== controller || controller.signal.aborted) return; 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."); if (!isAnalysis(body)) throw new Error("Analysis returned an invalid response.");
resetView(body); resetView(body);
} catch (reason) { } 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."); if (requestRef.current === controller && !controller.signal.aborted)
} finally { if (requestRef.current === controller) { requestRef.current = null; setLoading(false); } } 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<HTMLInputElement>) { async function upload(event: ChangeEvent<HTMLInputElement>) {
@@ -186,67 +313,213 @@ export function App() {
} }
async function drop(event: DragEvent<HTMLElement>) { async function drop(event: DragEvent<HTMLElement>) {
event.preventDefault(); setDragging(false); event.preventDefault();
setDragging(false);
const file = event.dataTransfer.files?.[0]; const file = event.dataTransfer.files?.[0];
if (file) await analyzeFile(file); if (file) await analyzeFile(file);
} }
function selectIncident(id: string, openTimeline = false) { function selectIncident(id: string, openTimeline = false) {
const incident = data?.incidents.find((item) => item.id === id); const incident = index?.incidentById.get(id);
if (!incident) { setActiveIncidentId(""); return; } if (!incident) {
setActiveIncidentId("");
return;
}
setActiveIncidentId(id); setActiveIncidentId(id);
setSelectedEventId(incident.evidence_event_ids[0] ?? null); setSelectedEventId(incident.evidence_event_ids[0] ?? null);
setInspectorTab("details"); 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) { function selectEvent(event: EventItem) {
setSelectedEventId(event.id); 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); if (incident) setActiveIncidentId(incident.id);
} }
function moveSelection(delta: number, events: EventItem[]) { function moveSelection(delta: number, events: EventItem[]) {
if (!events.length) return; if (!events.length) return;
const index = selected ? events.findIndex((event) => event.id === selected.id) : -1; 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]); selectEvent(events[next]);
} }
function exportJson() { async function preparedExport(source: Analysis): Promise<PreparedExport> {
if (!data) return; if (!redactExports) return prepareExport(source, false);
const prepared = prepareExport(data, redactExports); const result = await redactInBackground(source);
downloadText(`${exportStem(data.source)}-eventlens.json`, JSON.stringify(prepared.analysis, null, 2), "application/json"); return { analysis: result.analysis, redaction: result.summary };
} }
function exportMarkdown() { async function runExport(kind: "json" | "markdown") {
if (!data) return; if (!data || exporting) return;
downloadText(`${exportStem(data.source)}-eventlens.md`, analysisToMarkdown(data, redactExports), "text/markdown"); 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(() => { useEffect(() => {
const scopedEvents = activeWorkspace === "hunting" ? huntingResults : visibleEvents; 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]); }, [activeWorkspace, huntingResults, visibleEvents, selectedEventId]);
return <main className={`event-app-shell density-${settings.density}`} onDragOver={(event) => { event.preventDefault(); setDragging(true); }} onDragLeave={() => setDragging(false)} onDrop={drop}> return (
<AppTopbar activeWorkspace={activeWorkspace} onNavigate={navigate} version={APP_VERSION} /> <main
<section className="event-main" aria-label={`${activeWorkspace} workspace`}> className={`event-app-shell density-${settings.density}`}
<InvestigationContext data={data} activeIncident={activeIncident} visibleCount={contextVisible} workspace={activeWorkspace} /> onDragOver={(event) => {
<GlobalActions loading={loading} dragging={dragging} onOpen={() => fileInput.current?.click()} onDemo={() => void loadDemo()} workspace={activeWorkspace} /> event.preventDefault();
<input className="hidden-input" aria-label="Choose EVTX file" ref={fileInput} type="file" accept=".evtx" onChange={upload} /> setDragging(true);
{loading ? <div className="loading-banner" role="status" aria-live="polite"><span className="loading-spinner" aria-hidden="true" />Analyzing event log… The application shell remains available.</div> : null} }}
{error ? <ErrorBanner message={error} onDemo={() => void loadDemo()} /> : null} onDragLeave={(event) => {
{data?.parse?.status === "partial" ? <PartialAnalysisWarning parse={data.parse} /> : null} if (!event.currentTarget.contains(event.relatedTarget as Node | null)) setDragging(false);
{data?.parse && data.parse.status !== "partial" && data.parse.issues.length ? <ParserIssueNotice parse={data.parse} /> : null} }}
<div className="workspace-content"> onDrop={drop}
{activeWorkspace === "analysis" ? <AnalysisView data={data} timestampDisplay={settings.timestampDisplay} activeIncidentId={activeIncidentId} onOpen={(incident: Incident) => selectIncident(incident.id, true)} onOpenFile={() => fileInput.current?.click()} onDemo={() => void loadDemo()} /> : null} >
{activeWorkspace === "timeline" ? <TimelineView data={data} filters={filters} providers={providers} visibleEvents={visibleEvents} selected={selected} activeIncident={activeIncident} activeIncidentId={activeIncidentId} focusIncident={focusIncident} timestampDisplay={settings.timestampDisplay} rowHeight={rowHeight} inspectorTab={inspectorTab} onFilterChange={(patch) => 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} <AppTopbar activeWorkspace={activeWorkspace} onNavigate={navigate} version={APP_VERSION} />
{activeWorkspace === "hunting" ? <HuntingView data={data} state={hunting} providers={providers} results={huntingResults} selected={selected} activeIncident={activeIncident} timestampDisplay={settings.timestampDisplay} inspectorTab={inspectorTab} incidentEventIds={incidentEventIds} onChange={(patch) => 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} <section className="event-main" aria-label={`${activeWorkspace} workspace`}>
{activeWorkspace === "reports" ? <ReportsView data={data} redactExports={redactExports} redactionPreview={redactionPreview} onRedactionChange={setRedactExports} onExportJson={exportJson} onExportMarkdown={exportMarkdown} timestampDisplay={settings.timestampDisplay} onOpenFile={() => fileInput.current?.click()} onDemo={() => void loadDemo()} /> : null} <InvestigationContext
{activeWorkspace === "settings" ? <SettingsView settings={settings} saveNotice={settingsPersistenceFailed ? "Preferences changed for this session only" : settingsNotice} storageFailed={settingsPersistenceFailed} storageConfirmed={settingsStorageConfirmed} onChange={updateSettings} onReset={resetSettings} /> : null} data={data}
</div> activeIncident={activeIncident}
<Statusbar data={data} /> visibleCount={contextVisible}
</section> workspace={activeWorkspace}
</main>; />
<GlobalActions
loading={loading}
dragging={dragging}
onOpen={() => fileInput.current?.click()}
onDemo={() => void loadDemo()}
workspace={activeWorkspace}
/>
<input
className="hidden-input"
aria-label="Choose EVTX file"
ref={fileInput}
type="file"
accept=".evtx"
onChange={upload}
/>
{loading ? (
<div className="loading-banner" role="status" aria-live="polite">
<span className="loading-spinner" aria-hidden="true" />
Analyzing event log… The application shell remains available.
</div>
) : null}
{error ? <ErrorBanner message={error} onDemo={() => void loadDemo()} /> : null}
{data?.parse?.status === "partial" ? <PartialAnalysisWarning parse={data.parse} /> : null}
{data?.parse && data.parse.status !== "partial" && data.parse.issues.length ? (
<ParserIssueNotice parse={data.parse} />
) : null}
<div className="workspace-content">
{activeWorkspace === "analysis" ? (
<AnalysisView
data={data}
timestampDisplay={settings.timestampDisplay}
activeIncidentId={activeIncidentId}
onOpen={(incident: Incident) => selectIncident(incident.id, true)}
onOpenFile={() => fileInput.current?.click()}
onDemo={() => void loadDemo()}
/>
) : null}
{activeWorkspace === "timeline" ? (
<TimelineView
data={data}
anchorCandidate={anchorCandidate}
filters={filters}
providers={providers}
visibleEvents={visibleEvents}
selected={selected}
activeIncident={activeIncident}
activeIncidentId={activeIncidentId}
focusIncident={focusIncident}
timestampDisplay={settings.timestampDisplay}
rowHeight={rowHeight}
inspectorTab={inspectorTab}
onFilterChange={(patch) => 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" ? (
<HuntingView
data={data}
anchorCandidate={anchorCandidate}
state={hunting}
providers={providers}
results={huntingResults}
selected={selected}
activeIncident={activeIncident}
timestampDisplay={settings.timestampDisplay}
inspectorTab={inspectorTab}
incidentEventIds={incidentEventIds}
onChange={(patch) => 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" ? (
<ReportsView
data={data}
redactExports={redactExports}
redactionPreview={currentRedaction}
redactionPending={redactExports && !currentRedaction && !redactionFailed}
redactionFailed={redactionFailed}
exporting={exporting}
onRedactionChange={setRedactExports}
onExportJson={() => void runExport("json")}
onExportMarkdown={() => void runExport("markdown")}
timestampDisplay={settings.timestampDisplay}
onOpenFile={() => fileInput.current?.click()}
onDemo={() => void loadDemo()}
/>
) : null}
{activeWorkspace === "settings" ? (
<SettingsView
settings={settings}
saveNotice={settingsPersistenceFailed ? "Preferences changed for this session only" : settingsNotice}
storageFailed={settingsPersistenceFailed}
storageConfirmed={settingsStorageConfirmed}
onChange={updateSettings}
onReset={resetSettings}
/>
) : null}
</div>
<Statusbar data={data} />
</section>
</main>
);
} }
+13 -1
View File
@@ -41,7 +41,13 @@ export function formatRange(start: string | null, end: string | null, display: T
} }
export function levelLabel(level: string): string { 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 { 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); 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 { export function exportStem(source: string): string {
const base = sourceLabel(source).replace(/\.evtx$/i, ""); const base = sourceLabel(source).replace(/\.evtx$/i, "");
return base.replace(/[^A-Za-z0-9._-]+/g, "_").slice(0, 80) || "eventlens"; return base.replace(/[^A-Za-z0-9._-]+/g, "_").slice(0, 80) || "eventlens";
+43
View File
@@ -0,0 +1,43 @@
import type { Analysis, Campaign, EventItem, Incident } from "../types";
export type AnalysisIndex = {
eventById: Map<string, EventItem>;
incidentById: Map<string, Incident>;
/** First incident (in API order) that lists the event as evidence. */
incidentByEvent: Map<string, Incident>;
campaignById: Map<string, Campaign>;
incidentEventIds: Set<string>;
};
const cache = new WeakMap<Analysis, AnalysisIndex>();
/** 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<string, Incident>();
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] : [];
});
}
+22 -5
View File
@@ -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 LEVELS = ["critical", "error", "warning", "information", "verbose"];
export const WINDOWS = [0, 1, 5, 15, 60]; export const WINDOWS = [0, 1, 5, 15, 60];
export const WORKSPACES = ["analysis", "timeline", "hunting", "reports", "settings"] as const; export const WORKSPACES = ["analysis", "timeline", "hunting", "reports", "settings"] as const;
@@ -24,10 +33,12 @@ export type FilterState = {
level: string; level: string;
provider: string; provider: string;
windowMinutes: number; windowMinutes: number;
/** Timestamp the time window is pinned to; set when the window is chosen, not on every selection. */
windowAnchor: string | null;
attentionOnly: boolean; attentionOnly: boolean;
}; };
export type HuntingState = FilterState & { export type HuntingState = Omit<FilterState, "attentionOnly"> & {
eventId: string; eventId: string;
computer: string; computer: string;
incidentOnly: boolean; incidentOnly: boolean;
@@ -49,11 +60,17 @@ export const EMPTY_FILTERS = (attentionOnly: boolean): FilterState => ({
level: "", level: "",
provider: "", provider: "",
windowMinutes: 0, windowMinutes: 0,
windowAnchor: null,
attentionOnly, attentionOnly,
}); });
export const EMPTY_HUNTING = (): HuntingState => ({ export const EMPTY_HUNTING = (): HuntingState => ({
...EMPTY_FILTERS(false), search: "",
category: "",
level: "",
provider: "",
windowMinutes: 0,
windowAnchor: null,
eventId: "", eventId: "",
computer: "", computer: "",
incidentOnly: false, incidentOnly: false,
@@ -70,7 +87,7 @@ export function readSettings(): UiSettings {
defaultRedaction: typeof parsed.defaultRedaction === "boolean" ? parsed.defaultRedaction : true, defaultRedaction: typeof parsed.defaultRedaction === "boolean" ? parsed.defaultRedaction : true,
density: parsed.density === "compact" ? "compact" : "comfortable", density: parsed.density === "compact" ? "compact" : "comfortable",
defaultWorkspace: WORKSPACES.includes(parsed.defaultWorkspace as Workspace) defaultWorkspace: WORKSPACES.includes(parsed.defaultWorkspace as Workspace)
? parsed.defaultWorkspace as Workspace ? (parsed.defaultWorkspace as Workspace)
: "analysis", : "analysis",
}; };
} catch { } catch {
@@ -80,5 +97,5 @@ export function readSettings(): UiSettings {
export function workspaceFromHash(hash = typeof window === "undefined" ? "" : window.location.hash): Workspace | null { export function workspaceFromHash(hash = typeof window === "undefined" ? "" : window.location.hash): Workspace | null {
const value = hash.replace(/^#/, ""); const value = hash.replace(/^#/, "");
return WORKSPACES.includes(value as Workspace) ? value as Workspace : null; return WORKSPACES.includes(value as Workspace) ? (value as Workspace) : null;
} }
+41 -29
View File
@@ -3,31 +3,35 @@ import { isAnalysis } from "./validation";
const valid = { const valid = {
source: "demo.evtx", source: "demo.evtx",
events: [{ events: [
id: "event-1", {
timestamp: "2026-09-22T08:00:00Z", id: "event-1",
timestamp_source: "event", timestamp: "2026-09-22T08:00:00Z",
timestamp_valid: true, timestamp_source: "event",
provider: "Provider", timestamp_valid: true,
event_id: 1000, provider: "Provider",
level: "Error", event_id: 1000,
category: "crash", level: "Error",
summary: "Example event", category: "crash",
fields: { process: "example.exe" }, summary: "Example event",
}], fields: { process: "example.exe" },
incidents: [{ },
id: "incident-1", ],
rule_id: "crash.sequence", incidents: [
start: "2026-09-22T08:00:00Z", {
end: "2026-09-22T08:00:00Z", id: "incident-1",
title: "Example incident", rule_id: "crash.sequence",
category: "crash", start: "2026-09-22T08:00:00Z",
severity: "high", end: "2026-09-22T08:00:00Z",
reasons: ["Observed crash evidence."], title: "Example incident",
evidence_event_ids: ["event-1"], category: "crash",
original_count: 1, severity: "high",
compressed_count: 1, reasons: ["Observed crash evidence."],
}], evidence_event_ids: ["event-1"],
original_count: 1,
compressed_count: 1,
},
],
parse: { parse: {
parser: "evtx", parser: "evtx",
status: "complete", status: "complete",
@@ -57,14 +61,22 @@ describe("isAnalysis", () => {
}); });
it("rejects missing evidence references and duplicate event IDs", () => { 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, incidents: [{ ...valid.incidents[0], evidence_event_ids: ["missing"] }] })).toBe(
expect(isAnalysis({ ...valid, events: [...valid.events, valid.events[0]], parse: { ...valid.parse, parsed_events: 2 } })).toBe(false); 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", () => { 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: "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: null, timestamp_valid: true }] })).toBe(
expect(isAnalysis({ ...valid, events: [{ ...valid.events[0], timestamp_source: "invalid", timestamp_valid: true }] })).toBe(false); 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); expect(isAnalysis({ ...valid, incidents: [{ ...valid.incidents[0], start: "not-a-date" }] })).toBe(false);
}); });
+98 -22
View File
@@ -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<string, unknown> { function isRecord(value: unknown): value is Record<string, unknown> {
return typeof value === "object" && value !== null && !Array.isArray(value); return typeof value === "object" && value !== null && !Array.isArray(value);
} }
function isTimestamp(value: unknown): value is string | null { 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 { 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 { function isEventItem(value: unknown): value is EventItem {
if (!isRecord(value)) return false; if (!isRecord(value)) return false;
if (typeof value.id !== "string" || !isTimestamp(value.timestamp)) 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 (
if (typeof value.level !== "string" || typeof value.category !== "string" || typeof value.summary !== "string") return false; 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.channel !== undefined && typeof value.channel !== "string") return false;
if (value.computer !== undefined && typeof value.computer !== "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 (value.fields !== undefined) {
if (!isRecord(value.fields) || !Object.values(value.fields).every((item) => typeof item === "string")) return false; 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 (value.timestamp === null && value.timestamp_valid) return false;
if (["event", "record"].includes(String(value.timestamp_source)) !== value.timestamp_valid) return false; if (["event", "record"].includes(String(value.timestamp_source)) !== value.timestamp_valid) return false;
return true; return true;
@@ -38,19 +57,54 @@ function isEventItem(value: unknown): value is EventItem {
function isIncident(value: unknown): value is Incident { function isIncident(value: unknown): value is Incident {
if (!isRecord(value)) return false; if (!isRecord(value)) return false;
return typeof value.id === "string" return (
&& typeof value.rule_id === "string" typeof value.id === "string" &&
&& isTimestamp(value.start) typeof value.rule_id === "string" &&
&& isTimestamp(value.end) isTimestamp(value.start) &&
&& typeof value.title === "string" isTimestamp(value.end) &&
&& typeof value.category === "string" typeof value.title === "string" &&
&& typeof value.severity === "string" typeof value.category === "string" &&
&& isStringArray(value.reasons) typeof value.severity === "string" &&
&& isStringArray(value.evidence_event_ids) isStringArray(value.reasons) &&
&& isNonnegativeInteger(value.original_count) isStringArray(value.evidence_event_ids) &&
&& value.original_count > 0 isNonnegativeInteger(value.original_count) &&
&& isNonnegativeInteger(value.compressed_count) value.original_count > 0 &&
&& value.compressed_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<string, number> {
return isRecord(value) && Object.values(value).every(isNonnegativeInteger);
} }
function isParseIssue(value: unknown): value is ParseIssue { 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 (!isNonnegativeInteger(value[key])) return false;
} }
if (typeof value.truncated !== "boolean") 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; if (
return Array.isArray(value.issues) && value.issues.every(isParseIssue) && value.issue_count === value.issues.length; 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 { 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; if (!Array.isArray(value.incidents) || !value.incidents.every(isIncident)) return false;
const eventIds = new Set(value.events.map((event: EventItem) => event.id)); const eventIds = new Set(value.events.map((event: EventItem) => event.id));
if (eventIds.size !== value.events.length) return false; 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; if (!value.incidents.every((incident: Incident) => incident.evidence_event_ids.every((id) => eventIds.has(id))))
return value.parse === undefined || value.parse === null || (isParseStats(value.parse) && value.parse.parsed_events === value.events.length); 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)
);
} }
+232
View File
@@ -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> = {}): 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<Analysis["parse"]>), 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)");
});
});
+118 -25
View File
@@ -22,40 +22,133 @@ export type IconName =
type IconProps = SVGProps<SVGSVGElement> & { name: IconName; title?: string }; type IconProps = SVGProps<SVGSVGElement> & { 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) { export function Icon({ name, title, ...props }: IconProps) {
const content = { const content = {
analysis: <><path {...ICON_PROPS} d="M4 5h16v14H4z" /><path {...ICON_PROPS} d="M7 15h2m3-4h2m3-3h0" /><circle cx="8" cy="15" r="1" fill="currentColor" /><circle cx="13" cy="11" r="1" fill="currentColor" /><circle cx="18" cy="8" r="1" fill="currentColor" /></>, analysis: (
timeline: <><path {...ICON_PROPS} d="M5 5v14M12 5v14M19 5v14" /><circle cx="5" cy="9" r="2" fill="currentColor" /><circle cx="12" cy="15" r="2" fill="currentColor" /><circle cx="19" cy="7" r="2" fill="currentColor" /></>, <>
hunting: <><circle {...ICON_PROPS} cx="10.5" cy="10.5" r="5.5" /><path {...ICON_PROPS} d="m15 15 5 5M4 4l2 2m12 12 2 2" /></>, <path {...ICON_PROPS} d="M4 5h16v14H4z" />
reports: <><path {...ICON_PROPS} d="M6 3h8l4 4v14H6z" /><path {...ICON_PROPS} d="M14 3v5h5M9 12h6m-6 4h6" /></>, <path {...ICON_PROPS} d="M7 15h2m3-4h2m3-3h0" />
settings: <><path {...ICON_PROPS} d="M5 7h14M5 12h14M5 17h14" /><circle {...ICON_PROPS} cx="9" cy="7" r="2" /><circle {...ICON_PROPS} cx="15" cy="12" r="2" /><circle {...ICON_PROPS} cx="11" cy="17" r="2" /></>, <circle cx="8" cy="15" r="1" fill="currentColor" />
file: <><path {...ICON_PROPS} d="M6 3h8l4 4v14H6z" /><path {...ICON_PROPS} d="M14 3v5h5" /></>, <circle cx="13" cy="11" r="1" fill="currentColor" />
upload: <><path {...ICON_PROPS} d="M12 16V4m0 0L8 8m4-4 4 4M5 20h14" /></>, <circle cx="18" cy="8" r="1" fill="currentColor" />
demo: <><path {...ICON_PROPS} d="M12 3 20 8v8l-8 5-8-5V8z" /><path {...ICON_PROPS} d="m10 9 5 3-5 3z" fill="currentColor" stroke="none" /></>, </>
search: <><circle {...ICON_PROPS} cx="10.5" cy="10.5" r="6" /><path {...ICON_PROPS} d="m15 15 5 5" /></>, ),
clock: <><circle {...ICON_PROPS} cx="12" cy="12" r="8" /><path {...ICON_PROPS} d="M12 7v5l3 2" /></>, timeline: (
warning: <><path {...ICON_PROPS} d="M12 3 22 20H2L12 3Z" /><path {...ICON_PROPS} d="M12 8v5m0 3v.2" /></>, <>
<path {...ICON_PROPS} d="M5 5v14M12 5v14M19 5v14" />
<circle cx="5" cy="9" r="2" fill="currentColor" />
<circle cx="12" cy="15" r="2" fill="currentColor" />
<circle cx="19" cy="7" r="2" fill="currentColor" />
</>
),
hunting: (
<>
<circle {...ICON_PROPS} cx="10.5" cy="10.5" r="5.5" />
<path {...ICON_PROPS} d="m15 15 5 5M4 4l2 2m12 12 2 2" />
</>
),
reports: (
<>
<path {...ICON_PROPS} d="M6 3h8l4 4v14H6z" />
<path {...ICON_PROPS} d="M14 3v5h5M9 12h6m-6 4h6" />
</>
),
settings: (
<>
<path {...ICON_PROPS} d="M5 7h14M5 12h14M5 17h14" />
<circle {...ICON_PROPS} cx="9" cy="7" r="2" />
<circle {...ICON_PROPS} cx="15" cy="12" r="2" />
<circle {...ICON_PROPS} cx="11" cy="17" r="2" />
</>
),
file: (
<>
<path {...ICON_PROPS} d="M6 3h8l4 4v14H6z" />
<path {...ICON_PROPS} d="M14 3v5h5" />
</>
),
upload: (
<>
<path {...ICON_PROPS} d="M12 16V4m0 0L8 8m4-4 4 4M5 20h14" />
</>
),
demo: (
<>
<path {...ICON_PROPS} d="M12 3 20 8v8l-8 5-8-5V8z" />
<path {...ICON_PROPS} d="m10 9 5 3-5 3z" fill="currentColor" stroke="none" />
</>
),
search: (
<>
<circle {...ICON_PROPS} cx="10.5" cy="10.5" r="6" />
<path {...ICON_PROPS} d="m15 15 5 5" />
</>
),
clock: (
<>
<circle {...ICON_PROPS} cx="12" cy="12" r="8" />
<path {...ICON_PROPS} d="M12 7v5l3 2" />
</>
),
warning: (
<>
<path {...ICON_PROPS} d="M12 3 22 20H2L12 3Z" />
<path {...ICON_PROPS} d="M12 8v5m0 3v.2" />
</>
),
"arrow-left": <path {...ICON_PROPS} d="m14 5-7 7 7 7" />, "arrow-left": <path {...ICON_PROPS} d="m14 5-7 7 7 7" />,
"arrow-right": <path {...ICON_PROPS} d="m10 5 7 7-7 7" />, "arrow-right": <path {...ICON_PROPS} d="m10 5 7 7-7 7" />,
reset: <><path {...ICON_PROPS} d="M4 12a8 8 0 1 0 2-5.3" /><path {...ICON_PROPS} d="M4 4v4h4" /></>, reset: (
info: <><circle {...ICON_PROPS} cx="12" cy="12" r="8" /><path {...ICON_PROPS} d="M12 10v5m0-8v.2" /></>, <>
export: <><path {...ICON_PROPS} d="M12 3v12m0 0 4-4m-4 4-4-4M5 20h14" /></>, <path {...ICON_PROPS} d="M4 12a8 8 0 1 0 2-5.3" />
<path {...ICON_PROPS} d="M4 4v4h4" />
</>
),
info: (
<>
<circle {...ICON_PROPS} cx="12" cy="12" r="8" />
<path {...ICON_PROPS} d="M12 10v5m0-8v.2" />
</>
),
export: (
<>
<path {...ICON_PROPS} d="M12 3v12m0 0 4-4m-4 4-4-4M5 20h14" />
</>
),
check: <path {...ICON_PROPS} d="m5 12 4.2 4.2L19.5 6" />, check: <path {...ICON_PROPS} d="m5 12 4.2 4.2L19.5 6" />,
privacy: <><path {...ICON_PROPS} d="M12 3 20 6v5c0 4.8-3.2 8.2-8 10-4.8-1.8-8-5.2-8-10V6l8-3Z" /><path {...ICON_PROPS} d="m8.5 12 2.2 2.2 4.8-4.8" /></>, privacy: (
<>
<path {...ICON_PROPS} d="M12 3 20 6v5c0 4.8-3.2 8.2-8 10-4.8-1.8-8-5.2-8-10V6l8-3Z" />
<path {...ICON_PROPS} d="m8.5 12 2.2 2.2 4.8-4.8" />
</>
),
}[name]; }[name];
return <svg viewBox="0 0 24 24" aria-hidden={title ? undefined : true} role={title ? "img" : undefined} {...props}>{title ? <title>{title}</title> : null}{content}</svg>; return (
<svg viewBox="0 0 24 24" aria-hidden={title ? undefined : true} role={title ? "img" : undefined} {...props}>
{title ? <title>{title}</title> : null}
{content}
</svg>
);
} }
/** The canonical evidence-lens mark, shared by the browser package and topbar. */ /** The canonical evidence-lens mark, shared by the browser package and topbar. */
export function EventLensMark(props: SVGProps<SVGSVGElement>) { export function EventLensMark(props: SVGProps<SVGSVGElement>) {
return <svg viewBox="0 0 64 64" aria-hidden="true" {...props}> return (
<circle cx="27" cy="27" r="16" fill="none" stroke="#65d9d0" strokeWidth="5" /> <svg viewBox="0 0 64 64" aria-hidden="true" {...props}>
<path d="M16 29h22" fill="none" stroke="#dff8f5" strokeWidth="2.7" strokeLinecap="round" /> <circle cx="27" cy="27" r="16" fill="none" stroke="#65d9d0" strokeWidth="5" />
<circle cx="20" cy="29" r="2.4" fill="#65d9d0" /> <path d="M16 29h22" fill="none" stroke="#dff8f5" strokeWidth="2.7" strokeLinecap="round" />
<circle cx="27" cy="29" r="2.4" fill="#65d9d0" /> <circle cx="20" cy="29" r="2.4" fill="#65d9d0" />
<circle cx="34" cy="29" r="2.4" fill="#65d9d0" /> <circle cx="27" cy="29" r="2.4" fill="#65d9d0" />
<path d="m39 39 12 12" fill="none" stroke="#f4b860" strokeWidth="6" strokeLinecap="round" /> <circle cx="34" cy="29" r="2.4" fill="#65d9d0" />
</svg>; <path d="m39 39 12 12" fill="none" stroke="#f4b860" strokeWidth="6" strokeLinecap="round" />
</svg>
);
} }
+156 -13
View File
@@ -4,33 +4,176 @@ import { sourceLabel, statusLabel } from "../app/format";
import { WORKSPACES, type Workspace } from "../app/model"; import { WORKSPACES, type Workspace } from "../app/model";
import { EventLensMark, Icon } from "./icons"; import { EventLensMark, Icon } from "./icons";
const WORKSPACE_LABELS: Record<Workspace, string> = { analysis: "Analysis", timeline: "Timeline", hunting: "Hunting", reports: "Reports", settings: "Settings" }; const WORKSPACE_LABELS: Record<Workspace, string> = {
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<HTMLButtonElement>(null); const activeButton = useRef<HTMLButtonElement>(null);
useEffect(() => { useEffect(() => {
activeButton.current?.scrollIntoView({ block: "nearest", inline: "center" }); activeButton.current?.scrollIntoView({ block: "nearest", inline: "center" });
}, [activeWorkspace]); }, [activeWorkspace]);
return <nav className="workspace-nav" aria-label="EventLens workspaces"> return (
{WORKSPACES.map((workspace) => <button key={workspace} ref={activeWorkspace === workspace ? activeButton : undefined} type="button" className={activeWorkspace === workspace ? "active" : ""} aria-current={activeWorkspace === workspace ? "page" : undefined} onClick={() => onNavigate(workspace)}><Icon name={workspace} /><span>{WORKSPACE_LABELS[workspace]}</span></button>)} <nav className="workspace-nav" aria-label="EventLens workspaces">
</nav>; {WORKSPACES.map((workspace) => (
<button
key={workspace}
ref={activeWorkspace === workspace ? activeButton : undefined}
type="button"
className={activeWorkspace === workspace ? "active" : ""}
aria-current={activeWorkspace === workspace ? "page" : undefined}
onClick={() => onNavigate(workspace)}
>
<Icon name={workspace} />
<span>{WORKSPACE_LABELS[workspace]}</span>
</button>
))}
</nav>
);
} }
export function AppTopbar({ activeWorkspace, onNavigate, version }: { activeWorkspace: Workspace; onNavigate: (workspace: Workspace) => void; version: string }) { export function AppTopbar({
return <header className="event-topbar"><div className="event-brand"><span className="event-logo"><EventLensMark /></span><div><strong>EventLens</strong><small>Windows incident reconstruction</small></div></div><WorkspaceNav activeWorkspace={activeWorkspace} onNavigate={onNavigate} /><div className="instance-status"><span aria-hidden="true" /><div><b>Local Instance</b><small>v{version}</small></div></div></header>; activeWorkspace,
onNavigate,
version,
}: {
activeWorkspace: Workspace;
onNavigate: (workspace: Workspace) => void;
version: string;
}) {
return (
<header className="event-topbar">
<div className="event-brand">
<span className="event-logo">
<EventLensMark />
</span>
<div>
<strong>EventLens</strong>
<small>Windows incident reconstruction</small>
</div>
</div>
<WorkspaceNav activeWorkspace={activeWorkspace} onNavigate={onNavigate} />
<div className="instance-status">
<span aria-hidden="true" />
<div>
<b>Local Instance</b>
<small>v{version}</small>
</div>
</div>
</header>
);
} }
export function InvestigationContext({ data, activeIncident, visibleCount, workspace }: { data: Analysis | null; activeIncident: Incident | null; visibleCount?: number; workspace: Workspace }) { export function InvestigationContext({
if (workspace === "settings") return <section className="investigation-context preferences-context" aria-label="Local preferences context"><div className="investigation-source"><Icon name="settings" /><span><b>Local preferences</b><small>Interface preferences for this session</small></span></div><div className="context-facts"><span>Event text, files and evidence are never stored here</span></div></section>; data,
activeIncident,
visibleCount,
workspace,
}: {
data: Analysis | null;
activeIncident: Incident | null;
visibleCount?: number;
workspace: Workspace;
}) {
if (workspace === "settings")
return (
<section className="investigation-context preferences-context" aria-label="Local preferences context">
<div className="investigation-source">
<Icon name="settings" />
<span>
<b>Local preferences</b>
<small>Interface preferences for this session</small>
</span>
</div>
<div className="context-facts">
<span>Event text, files and evidence are never stored here</span>
</div>
</section>
);
if (!data) return null; if (!data) return null;
return <section className="investigation-context" aria-label="Current investigation context"><div className="investigation-source"><Icon name="file" /><span><b title={data.source}>{sourceLabel(data.source)}</b><small>Current forensic session</small></span></div><div className="context-facts"><span className={`status-badge status-${data.parse?.status ?? "demo"}`}>{statusLabel(data)}</span><span>{data.events.length.toLocaleString()} events</span><span>{data.incidents.length} incident{data.incidents.length === 1 ? "" : "s"}</span>{typeof visibleCount === "number" ? <span>{visibleCount.toLocaleString()} visible</span> : null}</div>{activeIncident ? <span className="context-incident" title={activeIncident.title}>Incident: <b>{activeIncident.title}</b></span> : null}</section>; return (
<section className="investigation-context" aria-label="Current investigation context">
<div className="investigation-source">
<Icon name="file" />
<span>
<b title={data.source}>{sourceLabel(data.source)}</b>
<small>Current forensic session</small>
</span>
</div>
<div className="context-facts">
<span className={`status-badge status-${data.parse?.status ?? "demo"}`}>{statusLabel(data)}</span>
<span>{data.events.length.toLocaleString()} events</span>
<span>
{data.incidents.length} incident{data.incidents.length === 1 ? "" : "s"}
</span>
{typeof visibleCount === "number" ? <span>{visibleCount.toLocaleString()} visible</span> : null}
</div>
{activeIncident ? (
<span className="context-incident" title={activeIncident.title}>
Incident: <b>{activeIncident.title}</b>
</span>
) : null}
</section>
);
} }
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"; const secondary = workspace === "reports" || workspace === "settings";
return <section className={`global-actions ${dragging ? "dragging" : ""} ${secondary ? "global-actions-secondary" : ""}`} aria-label="Analysis actions"><div className="action-buttons"><button type="button" className="primary-button" onClick={onOpen} disabled={loading}><Icon name="upload" />{loading ? "Analyzing…" : "Open .evtx"}</button><button type="button" className="secondary-button" onClick={onDemo} disabled={loading}><Icon name="demo" />Load demo</button><span className="drop-hint">Drop an .evtx file anywhere in the workspace</span></div><span className="context-muted">Local, in-memory analysis</span></section>; return (
<section
className={`global-actions ${dragging ? "dragging" : ""} ${secondary ? "global-actions-secondary" : ""}`}
aria-label="Analysis actions"
>
<div className="action-buttons">
<button type="button" className="primary-button" onClick={onOpen} disabled={loading}>
<Icon name="upload" />
{loading ? "Analyzing…" : "Open .evtx"}
</button>
<button type="button" className="secondary-button" onClick={onDemo} disabled={loading}>
<Icon name="demo" />
Load demo
</button>
<span className="drop-hint">Drop an .evtx file anywhere in the workspace</span>
</div>
<span className="context-muted">Local, in-memory analysis</span>
</section>
);
} }
export function Statusbar({ data }: { data: Analysis | null }) { export function Statusbar({ data }: { data: Analysis | null }) {
return <footer className="event-statusbar"><span><Icon name="file" /> {data ? sourceLabel(data.source) : "No source loaded"}</span><span><Icon name="info" /> {data ? `${data.events.length.toLocaleString()} events` : "Local only"}</span><span className={data?.parse?.status === "partial" ? "partial" : "complete"}><i className="status-dot" aria-hidden="true" /> {statusLabel(data)}</span></footer>; return (
<footer className="event-statusbar">
<span>
<Icon name="file" /> {data ? sourceLabel(data.source) : "No source loaded"}
</span>
<span>
<Icon name="info" /> {data ? `${data.events.length.toLocaleString()} events` : "Local only"}
</span>
<span className={data?.parse?.status === "partial" ? "partial" : "complete"}>
<i className="status-dot" aria-hidden="true" /> {statusLabel(data)}
</span>
</footer>
);
} }
+175 -12
View File
@@ -4,33 +4,196 @@ import { formatRange } from "../app/format";
import type { TimestampDisplay } from "../app/model"; import type { TimestampDisplay } from "../app/model";
import { Icon } from "./icons"; import { Icon } from "./icons";
export function WorkspaceHeader({ eyebrow, title, description, action }: { eyebrow: string; title: string; description: string; action?: ReactNode }) { export function WorkspaceHeader({
return <header className="workspace-header"><div><p className="eyebrow">{eyebrow}</p><h1>{title}</h1><p className="workspace-description">{description}</p></div>{action ? <div className="workspace-header-action">{action}</div> : null}</header>; eyebrow,
title,
description,
action,
}: {
eyebrow: string;
title: string;
description: string;
action?: ReactNode;
}) {
return (
<header className="workspace-header">
<div>
<p className="eyebrow">{eyebrow}</p>
<h1>{title}</h1>
<p className="workspace-description">{description}</p>
</div>
{action ? <div className="workspace-header-action">{action}</div> : null}
</header>
);
} }
export function EmptyState({ onOpen, onDemo, title = "No event log loaded", description = "Open a local EVTX file or load the deterministic demo to begin an evidence-based investigation." }: { onOpen: () => void; onDemo: () => void; title?: string; description?: string }) { export function EmptyState({
return <section className="empty-state" aria-live="polite"><div className="empty-state-mark"><Icon name="file" /></div><div><h2>{title}</h2><p>{description}</p><ol className="workflow-steps" aria-label="EventLens investigation workflow"><li>EVTX</li><li>Normalize</li><li>Correlate</li><li>Inspect evidence</li><li>Review/export</li></ol><p className="empty-privacy">Analysis stays local, uploads are not intentionally persisted, parsing is bounded, and exports have a redaction preview.</p><div className="empty-actions"><button type="button" className="primary-button" onClick={onOpen}><Icon name="upload" />Open .evtx</button><button type="button" className="secondary-button" onClick={onDemo}><Icon name="demo" />Load demo</button></div></div></section>; onOpen,
onDemo,
title = "No event log loaded",
description = "Open a local EVTX file or load the deterministic demo to begin an evidence-based investigation.",
}: {
onOpen: () => void;
onDemo: () => void;
title?: string;
description?: string;
}) {
return (
<section className="empty-state" aria-live="polite">
<div className="empty-state-mark">
<Icon name="file" />
</div>
<div>
<h2>{title}</h2>
<p>{description}</p>
<ol className="workflow-steps" aria-label="EventLens investigation workflow">
<li>EVTX</li>
<li>Normalize</li>
<li>Correlate</li>
<li>Inspect evidence</li>
<li>Review/export</li>
</ol>
<p className="empty-privacy">
Analysis stays local, uploads are not intentionally persisted, parsing is bounded, and exports have a
redaction preview.
</p>
<div className="empty-actions">
<button type="button" className="primary-button" onClick={onOpen}>
<Icon name="upload" />
Open .evtx
</button>
<button type="button" className="secondary-button" onClick={onDemo}>
<Icon name="demo" />
Load demo
</button>
</div>
</div>
</section>
);
} }
export function PartialAnalysisWarning({ parse }: { parse?: ParseStats | null }) { export function PartialAnalysisWarning({ parse }: { parse?: ParseStats | null }) {
if (!parse || parse.status !== "partial") return null; if (!parse || parse.status !== "partial") return null;
return <section className="partial-warning" role="alert" aria-live="assertive"><div className="notice-title"><Icon name="warning" /><div><strong>Partial analysis — incident reconstruction may be incomplete</strong><span>{parse.parsed_events.toLocaleString()} events retained from {parse.records_seen.toLocaleString()} records seen; {parse.skipped_records.toLocaleString()} observed record(s) were not retained.</span></div></div><p>Review parser issues before treating the timeline or exports as a complete investigation.</p><ul>{parse.issues.slice(0, 5).map((issue, index) => <li key={`${issue.code}-${issue.record_id ?? "none"}-${index}`}><code>{issue.code}</code> — {issue.message}</li>)}</ul></section>; return (
<section className="partial-warning" role="alert" aria-live="assertive">
<div className="notice-title">
<Icon name="warning" />
<div>
<strong>Partial analysis — incident reconstruction may be incomplete</strong>
<span>
{parse.parsed_events.toLocaleString()} events retained from {parse.records_seen.toLocaleString()} records
seen; {parse.skipped_records.toLocaleString()} observed record(s) were not retained.
</span>
</div>
</div>
<p>Review parser issues before treating the timeline or exports as a complete investigation.</p>
<ul>
{parse.issues.slice(0, 5).map((issue, index) => (
<li key={`${issue.code}-${issue.record_id ?? "none"}-${index}`}>
<code>{issue.code}</code> — {issue.message}
</li>
))}
</ul>
</section>
);
} }
export function ParserIssueNotice({ parse }: { parse?: ParseStats | null }) { export function ParserIssueNotice({ parse }: { parse?: ParseStats | null }) {
if (!parse || !parse.issues.length) return null; if (!parse || !parse.issues.length) return null;
return <section className="parser-issues" role="status"><strong>Parser notes</strong><span>{parse.issues.length} non-fatal parser issue(s) were retained with the evidence. Review data-quality notes before exporting.</span><ul>{parse.issues.slice(0, 4).map((issue, index) => <li key={`${issue.code}-${issue.record_id ?? "none"}-${index}`}><code>{issue.code}</code> — {issue.message}</li>)}</ul></section>; return (
<section className="parser-issues" role="status">
<strong>Parser notes</strong>
<span>
{parse.issues.length} non-fatal parser issue(s) were retained with the evidence. Review data-quality notes
before exporting.
</span>
<ul>
{parse.issues.slice(0, 4).map((issue, index) => (
<li key={`${issue.code}-${issue.record_id ?? "none"}-${index}`}>
<code>{issue.code}</code> — {issue.message}
</li>
))}
</ul>
</section>
);
} }
export function ErrorBanner({ message, onDemo }: { message: string; onDemo: () => void }) { export function ErrorBanner({ message, onDemo }: { message: string; onDemo: () => void }) {
return <section className="error-banner" role="alert"><div><strong>Analysis could not be completed</strong><span>{message}</span></div><button type="button" className="text-button" onClick={onDemo}>Load demo instead</button></section>; return (
<section className="error-banner" role="alert">
<div>
<strong>Analysis could not be completed</strong>
<span>{message}</span>
</div>
<button type="button" className="text-button" onClick={onDemo}>
Load demo instead
</button>
</section>
);
} }
export function MetricCard({ icon, value, label, tone = "blue" }: { icon: ReactNode; value: string | number; label: string; tone?: "blue" | "amber" | "green" }) { export function MetricCard({
return <div className={`metric-card tone-${tone}`}><span className="metric-icon">{icon}</span><strong>{value}</strong><span>{label}</span></div>; icon,
value,
label,
tone = "blue",
}: {
icon: ReactNode;
value: string | number;
label: string;
tone?: "blue" | "amber" | "green";
}) {
return (
<div className={`metric-card tone-${tone}`}>
<span className="metric-icon">{icon}</span>
<strong>{value}</strong>
<span>{label}</span>
</div>
);
} }
export function IncidentCard({ incident, timestampDisplay, selected, onOpen }: { incident: Incident; timestampDisplay: TimestampDisplay; selected: boolean; onOpen: (incident: Incident) => void }) { export function IncidentCard({
const severity = incident.severity === "critical" || incident.severity === "error" ? "high" : incident.severity === "warning" ? "medium" : "info"; incident,
return <button type="button" className={`incident-card severity-${severity} ${selected ? "selected" : ""}`} onClick={() => onOpen(incident)}><div className="incident-card-heading"><span className="incident-icon"><Icon name="warning" /></span><strong>{incident.title}</strong><span className="severity-pill">{severity === "high" ? "High" : severity === "medium" ? "Medium" : "Info"}</span></div><p>{incident.reasons[0] ?? "Evidence was grouped by a deterministic EventLens rule."}</p><footer><span>{formatRange(incident.start, incident.end, timestampDisplay)}</span><b>{incident.original_count} event{incident.original_count === 1 ? "" : "s"}</b></footer><span className="incident-card-action">Inspect evidence <Icon name="arrow-right" /></span></button>; timestampDisplay,
selected,
onOpen,
}: {
incident: Incident;
timestampDisplay: TimestampDisplay;
selected: boolean;
onOpen: (incident: Incident) => void;
}) {
const severity =
incident.severity === "critical" || incident.severity === "error"
? "high"
: incident.severity === "warning"
? "medium"
: "info";
return (
<button
type="button"
className={`incident-card severity-${severity} ${selected ? "selected" : ""}`}
onClick={() => onOpen(incident)}
>
<div className="incident-card-heading">
<span className="incident-icon">
<Icon name="warning" />
</span>
<strong>{incident.title}</strong>
<span className="severity-pill">
{severity === "high" ? "High" : severity === "medium" ? "Medium" : "Info"}
</span>
</div>
<p>{incident.reasons[0] ?? "Evidence was grouped by a deterministic EventLens rule."}</p>
<footer>
<span>{formatRange(incident.start, incident.end, timestampDisplay)}</span>
<b>
{incident.original_count} event{incident.original_count === 1 ? "" : "s"}
</b>
</footer>
<span className="incident-card-action">
Inspect evidence <Icon name="arrow-right" />
</span>
</button>
);
} }
+562 -18
View File
@@ -1,29 +1,280 @@
import { useEffect, useRef, useState } from "react"; import { useEffect, useRef, useState } from "react";
import type { Analysis, EventItem, Incident } from "../types"; import type { Analysis, EventItem, Incident } from "../types";
import { formatClock, formatDate, formatDateTime, levelLabel } from "../app/format"; import { formatClock, formatDate, formatDateTime, levelLabel } from "../app/format";
import { CATEGORIES, LEVELS, OVERSCAN, WINDOWS, type FilterState, type InspectorTab, type TimestampDisplay } from "../app/model"; import {
CATEGORIES,
LEVELS,
OVERSCAN,
WINDOWS,
type FilterState,
type InspectorTab,
type TimestampDisplay,
} from "../app/model";
import { Icon } from "./icons"; import { Icon } from "./icons";
import { analysisIndex, evidenceEvents } from "../app/indexes";
export const MAX_INCIDENT_OPTIONS = 500;
export function filterCount(filters: FilterState): number { export function filterCount(filters: FilterState): number {
return [filters.search, filters.category, filters.level, filters.provider, filters.windowMinutes > 0 ? filters.windowMinutes : "", filters.attentionOnly ? "attention" : ""].filter(Boolean).length; return [
filters.search,
filters.category,
filters.level,
filters.provider,
filters.windowMinutes > 0 ? filters.windowMinutes : "",
filters.attentionOnly ? "attention" : "",
].filter(Boolean).length;
} }
export function FilterToolbar({ filters, providers, visibleCount, totalCount, anchorTimestamp, activeIncident, focusIncident, onFocusChange, onChange, onReset }: { filters: FilterState; providers: string[]; visibleCount: number; totalCount: number; anchorTimestamp: string | null; activeIncident: Incident | null; focusIncident: boolean; onFocusChange: (value: boolean) => void; onChange: (patch: Partial<FilterState>) => void; onReset: () => void }) { export function FilterToolbar({
filters,
providers,
visibleCount,
totalCount,
anchorTimestamp,
activeIncident,
focusIncident,
onFocusChange,
onChange,
onReset,
}: {
filters: FilterState;
providers: string[];
visibleCount: number;
totalCount: number;
anchorTimestamp: string | null;
activeIncident: Incident | null;
focusIncident: boolean;
onFocusChange: (value: boolean) => void;
onChange: (patch: Partial<FilterState>) => void;
onReset: () => void;
}) {
const active = filterCount(filters); const active = filterCount(filters);
return <section className="filter-toolbar" aria-label="Timeline filters"><div className="filter-primary"><label className="search-field"><Icon name="search" /><span className="sr-only">Search normalized evidence</span><input aria-label="Search normalized evidence" value={filters.search} onChange={(event) => onChange({ search: event.target.value })} placeholder="Search evidence, paths, IDs, fields…" /></label><span className="result-count" role="status"><strong>{visibleCount.toLocaleString()}</strong> of {totalCount.toLocaleString()} visible</span></div><div className="filter-secondary"><label><span>Category</span><select aria-label="Filter by category" value={filters.category} onChange={(event) => onChange({ category: event.target.value })}><option value="">All categories</option>{CATEGORIES.map((value) => <option key={value}>{value}</option>)}</select></label><label><span>Level</span><select aria-label="Filter by level" value={filters.level} onChange={(event) => onChange({ level: event.target.value })}><option value="">All levels</option>{LEVELS.map((value) => <option key={value}>{value}</option>)}</select></label><label className="provider-filter"><span>Provider</span><select aria-label="Filter by provider" value={filters.provider} onChange={(event) => onChange({ provider: event.target.value })}><option value="">All providers</option>{providers.map((value) => <option key={value}>{value}</option>)}</select></label><label><span>Time window</span><select aria-label="Evidence time window" value={filters.windowMinutes} onChange={(event) => onChange({ windowMinutes: Number(event.target.value) })} disabled={!anchorTimestamp}><option value={0}>All time</option>{WINDOWS.filter(Boolean).map((value) => <option value={value} key={value}>± {value} min</option>)}</select></label></div><div className="filter-actions"><label className="toggle-control"><input type="checkbox" checked={filters.attentionOnly} onChange={(event) => onChange({ attentionOnly: event.target.checked })} /><span className="toggle-track" /><span>Hide informational noise</span></label><label className="toggle-control"><input type="checkbox" checked={focusIncident} onChange={(event) => onFocusChange(event.target.checked)} disabled={!activeIncident} /><span className="toggle-track" /><span>Focus incident</span></label><button type="button" className="reset-button" onClick={onReset} disabled={!active}><Icon name="reset" />Reset filters{active ? ` (${active})` : ""}</button></div>{active || (focusIncident && activeIncident) ? <div className="filter-chips" aria-label="Active filters">{filters.search ? <span>Search: {filters.search}</span> : null}{filters.category ? <span>Category: {filters.category}</span> : null}{filters.level ? <span>Level: {filters.level}</span> : null}{filters.provider ? <span>Provider: {filters.provider}</span> : null}{filters.windowMinutes ? <span>± {filters.windowMinutes} min</span> : null}{filters.attentionOnly ? <span>Informational hidden</span> : null}{focusIncident && activeIncident ? <span>Incident focus: {activeIncident.title}</span> : null}</div> : null}</section>; return (
<section className="filter-toolbar" aria-label="Timeline filters">
<div className="filter-primary">
<label className="search-field">
<Icon name="search" />
<span className="sr-only">Search normalized evidence</span>
<input
aria-label="Search normalized evidence"
value={filters.search}
onChange={(event) => onChange({ search: event.target.value })}
placeholder="Search evidence, paths, IDs, fields…"
/>
</label>
<span className="result-count" role="status">
<strong>{visibleCount.toLocaleString()}</strong> of {totalCount.toLocaleString()} visible
</span>
</div>
<div className="filter-secondary">
<label>
<span>Category</span>
<select
aria-label="Filter by category"
value={filters.category}
onChange={(event) => onChange({ category: event.target.value })}
>
<option value="">All categories</option>
{CATEGORIES.map((value) => (
<option key={value}>{value}</option>
))}
</select>
</label>
<label>
<span>Level</span>
<select
aria-label="Filter by level"
value={filters.level}
onChange={(event) => onChange({ level: event.target.value })}
>
<option value="">All levels</option>
{LEVELS.map((value) => (
<option key={value}>{value}</option>
))}
</select>
</label>
<label className="provider-filter">
<span>Provider</span>
<select
aria-label="Filter by provider"
value={filters.provider}
onChange={(event) => onChange({ provider: event.target.value })}
>
<option value="">All providers</option>
{providers.map((value) => (
<option key={value}>{value}</option>
))}
</select>
</label>
<label>
<span>Time window</span>
<select
aria-label="Evidence time window"
value={filters.windowMinutes}
onChange={(event) => onChange({ windowMinutes: Number(event.target.value) })}
disabled={!anchorTimestamp}
>
<option value={0}>All time</option>
{WINDOWS.filter(Boolean).map((value) => (
<option value={value} key={value}>
± {value} min
</option>
))}
</select>
</label>
</div>
<div className="filter-actions">
<label className="toggle-control">
<input
type="checkbox"
checked={filters.attentionOnly}
onChange={(event) => onChange({ attentionOnly: event.target.checked })}
/>
<span className="toggle-track" />
<span>Hide informational noise</span>
</label>
<label className="toggle-control">
<input
type="checkbox"
checked={focusIncident}
onChange={(event) => onFocusChange(event.target.checked)}
disabled={!activeIncident}
/>
<span className="toggle-track" />
<span>Focus incident</span>
</label>
<button type="button" className="reset-button" onClick={onReset} disabled={!active}>
<Icon name="reset" />
Reset filters{active ? ` (${active})` : ""}
</button>
</div>
{active || (focusIncident && activeIncident) ? (
<div className="filter-chips" aria-label="Active filters">
{filters.search ? <span>Search: {filters.search}</span> : null}
{filters.category ? <span>Category: {filters.category}</span> : null}
{filters.level ? <span>Level: {filters.level}</span> : null}
{filters.provider ? <span>Provider: {filters.provider}</span> : null}
{filters.windowMinutes ? (
<span title={filters.windowAnchor ?? undefined}>± {filters.windowMinutes} min around pinned evidence</span>
) : null}
{filters.attentionOnly ? <span>Informational hidden</span> : null}
{focusIncident && activeIncident ? <span>Incident focus: {activeIncident.title}</span> : null}
</div>
) : null}
</section>
);
} }
export function IncidentContext({ incidents, activeIncidentId, focusIncident, onSelect, onFocus }: { incidents: Incident[]; activeIncidentId: string; focusIncident: boolean; onSelect: (id: string) => void; onFocus: (value: boolean) => void }) { export function IncidentContext({
incidents,
activeIncidentId,
focusIncident,
onSelect,
onFocus,
}: {
incidents: Incident[];
activeIncidentId: string;
focusIncident: boolean;
onSelect: (id: string) => void;
onFocus: (value: boolean) => void;
}) {
if (!incidents.length) return null; if (!incidents.length) return null;
const active = incidents.find((incident) => incident.id === activeIncidentId) ?? null; const active = incidents.find((incident) => incident.id === activeIncidentId) ?? null;
return <section className="incident-context"><label><span>Selected incident</span><select aria-label="Select incident" value={activeIncidentId} onChange={(event) => onSelect(event.target.value)}><option value="">No incident selected</option>{incidents.map((incident) => <option key={incident.id} value={incident.id}>{incident.title}</option>)}</select></label>{active ? <div className="incident-context-detail"><span className={`incident-focus-chip ${focusIncident ? "active" : ""}`}>{focusIncident ? "Focus active" : "Incident selected"}</span><span>{active.evidence_event_ids.length} linked evidence IDs</span><button type="button" className="text-button" onClick={() => onFocus(!focusIncident)}>{focusIncident ? "Stop focus" : "Focus evidence"}</button></div> : null}</section>; const options = incidents.length > MAX_INCIDENT_OPTIONS ? incidents.slice(0, MAX_INCIDENT_OPTIONS) : incidents;
if (active && options !== incidents && !options.includes(active)) options.push(active);
return (
<section className="incident-context">
<label>
<span>Selected incident</span>
<select
aria-label="Select incident"
value={activeIncidentId}
onChange={(event) => onSelect(event.target.value)}
>
<option value="">No incident selected</option>
{options.map((incident) => (
<option key={incident.id} value={incident.id}>
{incident.title}
</option>
))}
{incidents.length > options.length ? (
<option disabled value="__more">
{(incidents.length - options.length).toLocaleString()} more incidents — open them from Analysis
</option>
) : null}
</select>
</label>
{active ? (
<div className="incident-context-detail">
<span className={`incident-focus-chip ${focusIncident ? "active" : ""}`}>
{focusIncident ? "Focus active" : "Incident selected"}
</span>
<span>{active.evidence_event_ids.length} linked evidence IDs</span>
<button type="button" className="text-button" onClick={() => onFocus(!focusIncident)}>
{focusIncident ? "Stop focus" : "Focus evidence"}
</button>
</div>
) : null}
</section>
);
} }
function EventRow({ event, selected, position, total, rowHeight, timestampDisplay, onSelect }: { event: EventItem; selected: boolean; position: number; total: number; rowHeight: number; timestampDisplay: TimestampDisplay; onSelect: (event: EventItem) => void }) { function EventRow({
return <div role="listitem" aria-posinset={position} aria-setsize={total} style={{ height: rowHeight }}><button type="button" className={`event-row ${selected ? "active" : ""}`} style={{ height: rowHeight }} aria-label={`${event.provider}, event ${event.event_id ?? "unknown"}, ${event.summary}`} onClick={() => onSelect(event)}><span className={`event-rail rail-${event.level}`} aria-hidden="true"><span /></span><time>{formatClock(event.timestamp, timestampDisplay)}</time><b className="event-id">{event.event_id ?? "—"}</b><span className="event-copy"><strong>{event.provider}</strong><span>{event.summary}</span></span><span className="event-host">{event.computer || "—"}</span><span className={`event-level level-${event.level}`}>{levelLabel(event.level)}</span></button></div>; event,
selected,
position,
total,
rowHeight,
timestampDisplay,
onSelect,
}: {
event: EventItem;
selected: boolean;
position: number;
total: number;
rowHeight: number;
timestampDisplay: TimestampDisplay;
onSelect: (event: EventItem) => void;
}) {
return (
<div role="listitem" aria-posinset={position} aria-setsize={total} style={{ height: rowHeight }}>
<button
type="button"
className={`event-row ${selected ? "active" : ""}`}
style={{ height: rowHeight }}
aria-label={`${event.provider}, event ${event.event_id ?? "unknown"}, ${event.summary}`}
onClick={() => onSelect(event)}
>
<span className={`event-rail rail-${event.level}`} aria-hidden="true">
<span />
</span>
<time>{formatClock(event.timestamp, timestampDisplay)}</time>
<b className="event-id">{event.event_id ?? "—"}</b>
<span className="event-copy">
<strong>{event.provider}</strong>
<span>{event.summary}</span>
</span>
<span className="event-host">{event.computer || "—"}</span>
<span className={`event-level level-${event.level}`}>{levelLabel(event.level)}</span>
</button>
</div>
);
} }
export function VirtualizedEventList({ events, selectedId, rowHeight, timestampDisplay, onSelect }: { events: EventItem[]; selectedId?: string | null; rowHeight: number; timestampDisplay: TimestampDisplay; onSelect: (event: EventItem) => void }) { export function VirtualizedEventList({
events,
selectedId,
rowHeight,
timestampDisplay,
onSelect,
}: {
events: EventItem[];
selectedId?: string | null;
rowHeight: number;
timestampDisplay: TimestampDisplay;
onSelect: (event: EventItem) => void;
}) {
const [scrollTop, setScrollTop] = useState(0); const [scrollTop, setScrollTop] = useState(0);
const listRef = useRef<HTMLDivElement>(null); const listRef = useRef<HTMLDivElement>(null);
const [viewportHeight, setViewportHeight] = useState(520); const [viewportHeight, setViewportHeight] = useState(520);
@@ -36,11 +287,43 @@ export function VirtualizedEventList({ events, selectedId, rowHeight, timestampD
observer.observe(node); observer.observe(node);
return () => observer.disconnect(); return () => observer.disconnect();
}, []); }, []);
if (!events.length) return <div className="event-list empty-list"><p role="status">No events match the current filters. Reset a filter or show informational noise to continue.</p></div>; if (!events.length)
return (
<div className="event-list empty-list">
<p role="status">
No events match the current filters. Reset a filter or show informational noise to continue.
</p>
</div>
);
const first = Math.max(0, Math.floor(scrollTop / rowHeight) - OVERSCAN); const first = Math.max(0, Math.floor(scrollTop / rowHeight) - OVERSCAN);
const visibleCount = Math.ceil(viewportHeight / rowHeight) + OVERSCAN * 2; const visibleCount = Math.ceil(viewportHeight / rowHeight) + OVERSCAN * 2;
const last = Math.min(events.length, first + visibleCount); const last = Math.min(events.length, first + visibleCount);
return <div className="event-list" ref={listRef} onScroll={(event) => setScrollTop(event.currentTarget.scrollTop)} role="list" aria-label="Normalized event timeline"><div className="event-list-inner" style={{ height: events.length * rowHeight }}><div className="event-list-window" style={{ transform: `translateY(${first * rowHeight}px)` }}>{events.slice(first, last).map((event, index) => <EventRow key={event.id} event={event} selected={selectedId === event.id} position={first + index + 1} total={events.length} rowHeight={rowHeight} timestampDisplay={timestampDisplay} onSelect={onSelect} />)}</div></div></div>; return (
<div
className="event-list"
ref={listRef}
onScroll={(event) => setScrollTop(event.currentTarget.scrollTop)}
role="list"
aria-label="Normalized event timeline"
>
<div className="event-list-inner" style={{ height: events.length * rowHeight }}>
<div className="event-list-window" style={{ transform: `translateY(${first * rowHeight}px)` }}>
{events.slice(first, last).map((event, index) => (
<EventRow
key={event.id}
event={event}
selected={selectedId === event.id}
position={first + index + 1}
total={events.length}
rowHeight={rowHeight}
timestampDisplay={timestampDisplay}
onSelect={onSelect}
/>
))}
</div>
</div>
</div>
);
} }
export type InspectorProps = { export type InspectorProps = {
@@ -56,14 +339,275 @@ export type InspectorProps = {
onOpenTimeline?: () => void; onOpenTimeline?: () => void;
}; };
export function EvidenceInspector({ data, event, visibleEvents, activeIncident, timestampDisplay, tab, onTab, onSelectEvent, onMove, onOpenTimeline }: InspectorProps) { export function EvidenceInspector({
data,
event,
visibleEvents,
activeIncident,
timestampDisplay,
tab,
onTab,
onSelectEvent,
onMove,
onOpenTimeline,
}: InspectorProps) {
const selectedIndex = event ? visibleEvents.findIndex((item) => item.id === event.id) : -1; const selectedIndex = event ? visibleEvents.findIndex((item) => item.id === event.id) : -1;
const relatedIncident = event ? data.incidents.find((incident) => incident.evidence_event_ids.includes(event.id)) ?? activeIncident : activeIncident; const index = analysisIndex(data);
const relatedEvents = relatedIncident ? data.events.filter((item) => relatedIncident.evidence_event_ids.includes(item.id)) : []; const relatedIncident = event ? (index.incidentByEvent.get(event.id) ?? activeIncident) : activeIncident;
const copy = async (value: string) => { if (navigator.clipboard) await navigator.clipboard.writeText(value); }; const relatedEvents = evidenceEvents(data, relatedIncident);
return <aside className="inspector-panel"><header className="panel-header"><div><p className="eyebrow">Evidence</p><h2>Inspector</h2></div><div className="inspector-navigation"><button type="button" aria-label="Previous evidence" onClick={() => onMove(-1)} disabled={!visibleEvents.length || selectedIndex <= 0}><Icon name="arrow-left" /></button><span>{selectedIndex >= 0 ? selectedIndex + 1 : 0} of {visibleEvents.length}</span><button type="button" aria-label="Next evidence" onClick={() => onMove(1)} disabled={!visibleEvents.length || selectedIndex === visibleEvents.length - 1}><Icon name="arrow-right" /></button></div></header>{event ? <><div className="inspector-title"><div><h3>{event.summary}</h3><p>Event ID {event.event_id ?? "—"} · {event.provider}</p></div><span className={`event-level level-${event.level}`}>{levelLabel(event.level)}</span></div>{onOpenTimeline ? <div className="inspector-actions"><button type="button" className="text-button" onClick={onOpenTimeline}>Open in Timeline <Icon name="arrow-right" /></button></div> : null}<div className="inspector-tabs" role="tablist" aria-label="Evidence views"><button type="button" role="tab" aria-selected={tab === "details"} className={tab === "details" ? "active" : ""} onClick={() => onTab("details")}>Details</button><button type="button" role="tab" aria-selected={tab === "raw"} className={tab === "raw" ? "active" : ""} onClick={() => onTab("raw")}>Normalized JSON</button><button type="button" role="tab" aria-selected={tab === "related"} className={tab === "related" ? "active" : ""} onClick={() => onTab("related")}>Related ({relatedEvents.length})</button><button type="button" role="tab" aria-selected={tab === "insights"} className={tab === "insights" ? "active" : ""} onClick={() => onTab("insights")}>Insights</button></div>{tab === "details" ? <div className="inspector-content"><div className="copy-row"><button type="button" className="quiet-button" onClick={() => void copy(event.id)}>Copy event ID</button><button type="button" className="quiet-button" onClick={() => void copy(JSON.stringify(event, null, 2))}>Copy JSON</button></div><dl className="fact-grid"><div><dt>Timestamp</dt><dd>{formatDateTime(event.timestamp, timestampDisplay)}</dd></div><div><dt>Timestamp source</dt><dd>{event.timestamp_source ?? (event.timestamp ? "event" : "missing")} · {event.timestamp_valid === false ? "unreliable" : "valid"}</dd></div><div><dt>Provider</dt><dd>{event.provider}</dd></div><div><dt>Event ID</dt><dd>{event.event_id ?? "—"}</dd></div><div><dt>Level</dt><dd><span className={`level-dot ${event.level}`} />{event.level}</dd></div><div><dt>Category</dt><dd>{event.category}</dd></div><div><dt>Channel</dt><dd>{event.channel || "—"}</dd></div><div><dt>Computer</dt><dd>{event.computer || "—"}</dd></div></dl><section className="normalized-fields"><header><b>Normalized fields</b><span>{Object.keys(event.fields ?? {}).length}</span></header>{Object.keys(event.fields ?? {}).length ? <div>{Object.entries(event.fields ?? {}).map(([key, value]) => <p key={key}><code>{key.replace(/^EventData\./, "").replace(/^UserData\./, "")}</code><span>{value}</span></p>)}</div> : <p className="muted-copy">No additional normalized fields.</p>}</section></div> : null}{tab === "raw" ? <pre className="inspector-raw">{JSON.stringify(event, null, 2)}</pre> : null}{tab === "related" ? <div className="inspector-content related-events">{relatedIncident ? <><p className="muted-copy">{relatedIncident.title} · {relatedIncident.rule_id}</p>{relatedEvents.map((related) => <button type="button" className={related.id === event.id ? "related-event active" : "related-event"} key={related.id} onClick={() => onSelectEvent(related)}><span>{formatClock(related.timestamp, timestampDisplay)}</span><strong>{related.event_id ?? "—"}</strong><span>{related.summary}</span></button>)}</> : <p className="muted-copy">Select an incident to inspect related evidence.</p>}</div> : null}{tab === "insights" ? <div className="inspector-content insight-copy"><p><strong>Evidence relationship</strong></p><p>{relatedIncident ? relatedIncident.reasons[0] ?? "This event is linked by a deterministic rule." : "This event is not currently linked to a selected incident."}</p><p>EventLens describes evidence-supported temporal or semantic relationships. It does not claim causality.</p></div> : null}</> : <div className="inspector-placeholder"><p>No visible event is selected.</p><span>Clear a filter or show informational noise to continue.</span></div>}</aside>; const relatedCampaign = relatedIncident?.campaign_id
? (index.campaignById.get(relatedIncident.campaign_id) ?? null)
: null;
const copy = async (value: string) => {
if (navigator.clipboard) await navigator.clipboard.writeText(value);
};
return (
<aside className="inspector-panel">
<header className="panel-header">
<div>
<p className="eyebrow">Evidence</p>
<h2>Inspector</h2>
</div>
<div className="inspector-navigation">
<button
type="button"
aria-label="Previous evidence"
onClick={() => onMove(-1)}
disabled={!visibleEvents.length || selectedIndex <= 0}
>
<Icon name="arrow-left" />
</button>
<span>
{selectedIndex >= 0 ? selectedIndex + 1 : 0} of {visibleEvents.length}
</span>
<button
type="button"
aria-label="Next evidence"
onClick={() => onMove(1)}
disabled={!visibleEvents.length || selectedIndex === visibleEvents.length - 1}
>
<Icon name="arrow-right" />
</button>
</div>
</header>
{event ? (
<>
<div className="inspector-title">
<div>
<h3>{event.summary}</h3>
<p>
Event ID {event.event_id ?? "—"} · {event.provider}
</p>
</div>
<span className={`event-level level-${event.level}`}>{levelLabel(event.level)}</span>
</div>
{onOpenTimeline ? (
<div className="inspector-actions">
<button type="button" className="text-button" onClick={onOpenTimeline}>
Open in Timeline <Icon name="arrow-right" />
</button>
</div>
) : null}
<div className="inspector-tabs" role="tablist" aria-label="Evidence views">
<button
type="button"
role="tab"
aria-selected={tab === "details"}
className={tab === "details" ? "active" : ""}
onClick={() => onTab("details")}
>
Details
</button>
<button
type="button"
role="tab"
aria-selected={tab === "raw"}
className={tab === "raw" ? "active" : ""}
onClick={() => onTab("raw")}
>
Normalized JSON
</button>
<button
type="button"
role="tab"
aria-selected={tab === "related"}
className={tab === "related" ? "active" : ""}
onClick={() => onTab("related")}
>
Related ({relatedEvents.length})
</button>
<button
type="button"
role="tab"
aria-selected={tab === "insights"}
className={tab === "insights" ? "active" : ""}
onClick={() => onTab("insights")}
>
Insights
</button>
</div>
{tab === "details" ? (
<div className="inspector-content">
<div className="copy-row">
<button type="button" className="quiet-button" onClick={() => void copy(event.id)}>
Copy event ID
</button>
<button
type="button"
className="quiet-button"
onClick={() => void copy(JSON.stringify(event, null, 2))}
>
Copy JSON
</button>
</div>
<dl className="fact-grid">
<div>
<dt>Timestamp</dt>
<dd>{formatDateTime(event.timestamp, timestampDisplay)}</dd>
</div>
<div>
<dt>Timestamp source</dt>
<dd>
{event.timestamp_source ?? (event.timestamp ? "event" : "missing")} ·{" "}
{event.timestamp_valid === false ? "unreliable" : "valid"}
</dd>
</div>
<div>
<dt>Provider</dt>
<dd>{event.provider}</dd>
</div>
<div>
<dt>Event ID</dt>
<dd>{event.event_id ?? "—"}</dd>
</div>
<div>
<dt>Level</dt>
<dd>
<span className={`level-dot ${event.level}`} />
{event.level}
</dd>
</div>
<div>
<dt>Category</dt>
<dd>{event.category}</dd>
</div>
<div>
<dt>Channel</dt>
<dd>{event.channel || "—"}</dd>
</div>
<div>
<dt>Computer</dt>
<dd>{event.computer || "—"}</dd>
</div>
</dl>
<section className="normalized-fields">
<header>
<b>Normalized fields</b>
<span>{Object.keys(event.fields ?? {}).length}</span>
</header>
{Object.keys(event.fields ?? {}).length ? (
<div>
{Object.entries(event.fields ?? {}).map(([key, value]) => (
<p key={key}>
<code>{key.replace(/^EventData\./, "").replace(/^UserData\./, "")}</code>
<span>{value}</span>
</p>
))}
</div>
) : (
<p className="muted-copy">No additional normalized fields.</p>
)}
</section>
</div>
) : null}
{tab === "raw" ? <pre className="inspector-raw">{JSON.stringify(event, null, 2)}</pre> : null}
{tab === "related" ? (
<div className="inspector-content related-events">
{relatedIncident ? (
<>
<p className="muted-copy">
{relatedIncident.title} · {relatedIncident.rule_id}
</p>
{relatedCampaign ? (
<p className="campaign-note">
<Icon name="clock" /> Part of a recurring campaign: {relatedCampaign.incident_ids.length} adjacent
windows, {relatedCampaign.event_count.toLocaleString()} events.
</p>
) : null}
{relatedEvents.map((related) => (
<button
type="button"
className={related.id === event.id ? "related-event active" : "related-event"}
key={related.id}
onClick={() => onSelectEvent(related)}
>
<span>{formatClock(related.timestamp, timestampDisplay)}</span>
<strong>{related.event_id ?? "—"}</strong>
<span>{related.summary}</span>
</button>
))}
</>
) : (
<p className="muted-copy">Select an incident to inspect related evidence.</p>
)}
</div>
) : null}
{tab === "insights" ? (
<div className="inspector-content insight-copy">
<p>
<strong>Evidence relationship</strong>
</p>
<p>
{relatedIncident
? (relatedIncident.reasons[0] ?? "This event is linked by a deterministic rule.")
: "This event is not currently linked to a selected incident."}
</p>
<p>
EventLens describes evidence-supported temporal or semantic relationships. It does not claim causality.
</p>
</div>
) : null}
</>
) : (
<div className="inspector-placeholder">
<p>No visible event is selected.</p>
<span>Clear a filter or show informational noise to continue.</span>
</div>
)}
</aside>
);
} }
export function TimelinePanel({ events, selectedId, rowHeight, timestampDisplay, onSelect }: { events: EventItem[]; selectedId: string | null; rowHeight: number; timestampDisplay: TimestampDisplay; onSelect: (event: EventItem) => void }) { export function TimelinePanel({
return <article className="timeline-panel panel"><header className="panel-header"><div><p className="eyebrow">Chronological evidence</p><h2>Event timeline</h2></div><span className="panel-count">{events.length.toLocaleString()} visible</span></header><div className="date-band">{formatDate(events[0]?.timestamp ?? null, timestampDisplay)}</div><VirtualizedEventList events={events} selectedId={selectedId} rowHeight={rowHeight} timestampDisplay={timestampDisplay} onSelect={onSelect} /></article>; events,
selectedId,
rowHeight,
timestampDisplay,
onSelect,
}: {
events: EventItem[];
selectedId: string | null;
rowHeight: number;
timestampDisplay: TimestampDisplay;
onSelect: (event: EventItem) => void;
}) {
return (
<article className="timeline-panel panel">
<header className="panel-header">
<div>
<p className="eyebrow">Chronological evidence</p>
<h2>Event timeline</h2>
</div>
<span className="panel-count">{events.length.toLocaleString()} visible</span>
</header>
<div className="date-band">{formatDate(events[0]?.timestamp ?? null, timestampDisplay)}</div>
<VirtualizedEventList
events={events}
selectedId={selectedId}
rowHeight={rowHeight}
timestampDisplay={timestampDisplay}
onSelect={onSelect}
/>
</article>
);
} }
+54 -6
View File
@@ -2,12 +2,28 @@ import { describe, expect, it } from "vitest";
import { analysisToMarkdown, prepareExport } from "./export"; import { analysisToMarkdown, prepareExport } from "./export";
import type { Analysis } from "./types"; import type { Analysis } from "./types";
const analysis: Analysis = { source:"demo.evtx", incidents:[], events:[{id:"1",timestamp:"2026-09-09T10:00:00Z",provider:"Security",event_id:4625,level:"warning",category:"authentication",summary:"Login for admin@example.com",computer:"PC-01",fields:{"EventData.TargetUserName":"admin"}}] }; const analysis: Analysis = {
source: "demo.evtx",
incidents: [],
events: [
{
id: "1",
timestamp: "2026-09-09T10:00:00Z",
provider: "Security",
event_id: 4625,
level: "warning",
category: "authentication",
summary: "Login for admin@example.com",
computer: "PC-01",
fields: { "EventData.TargetUserName": "admin" },
},
],
};
describe("export", () => { describe("export", () => {
it("redacts by default", () => { it("redacts by default", () => {
const prepared = prepareExport(analysis, true); const prepared = prepareExport(analysis, true);
expect(prepared.analysis.events[0].computer).toBe("[REDACTED_HOST]"); expect(prepared.analysis.events[0].computer).toMatch(/^\[REDACTED_HOST_\d+\]$/);
expect(prepared.analysis.source).toBe("[REDACTED_SOURCE].evtx"); expect(prepared.analysis.source).toBe("[REDACTED_SOURCE].evtx");
expect(prepared.redaction?.total).toBeGreaterThan(0); expect(prepared.redaction?.total).toBeGreaterThan(0);
}); });
@@ -15,15 +31,40 @@ describe("export", () => {
it("produces an incident/evidence markdown report", () => { it("produces an incident/evidence markdown report", () => {
const markdown = analysisToMarkdown(analysis, true); const markdown = analysisToMarkdown(analysis, true);
expect(markdown).toContain("# EventLens incident report — [REDACTED_SOURCE].evtx"); expect(markdown).toContain("# EventLens incident report — [REDACTED_SOURCE].evtx");
expect(markdown).toContain("[REDACTED_EMAIL]"); expect(markdown).toMatch(/\[REDACTED_EMAIL_\d+\]/);
expect(markdown).toContain("## Evidence events"); expect(markdown).toContain("## Evidence events");
}); });
it("escapes markdown control syntax from untrusted event text", () => { it("escapes markdown control syntax from untrusted event text", () => {
const malicious: Analysis = { const malicious: Analysis = {
source: "report#](https://example.invalid).evtx", source: "report#](https://example.invalid).evtx",
incidents: [{ id: "i", rule_id: "rule|x", start: null, end: null, title: "# heading", category: "other", severity: "warning", reasons: ["![x](https://example.invalid/a) <img src=x> ``` | table |"], evidence_event_ids: ["1"], original_count: 1, compressed_count: 1 }], incidents: [
events: [{ id: "1", timestamp: null, provider: "Provider", event_id: 1, level: "warning", category: "other", summary: "# heading [click](https://example.invalid) <script>alert(1)</script>", fields: { payload: "```\n| remote |" } }], {
id: "i",
rule_id: "rule|x",
start: null,
end: null,
title: "# heading",
category: "other",
severity: "warning",
reasons: ["![x](https://example.invalid/a) <img src=x> ``` | table |"],
evidence_event_ids: ["1"],
original_count: 1,
compressed_count: 1,
},
],
events: [
{
id: "1",
timestamp: null,
provider: "Provider",
event_id: 1,
level: "warning",
category: "other",
summary: "# heading [click](https://example.invalid) <script>alert(1)</script>",
fields: { payload: "```\n| remote |" },
},
],
}; };
const markdown = analysisToMarkdown(malicious, false); const markdown = analysisToMarkdown(malicious, false);
expect(markdown).not.toContain("\n![x](https://example.invalid/a)"); expect(markdown).not.toContain("\n![x](https://example.invalid/a)");
@@ -46,7 +87,14 @@ describe("export", () => {
truncated: true, truncated: true,
truncation_reason: "event_limit_reached", truncation_reason: "event_limit_reached",
duration_ms: 12, duration_ms: 12,
issues: [{ code: "event_limit_reached", record_id: 4, message: "later records were not analyzed", skipped_record: true }], issues: [
{
code: "event_limit_reached",
record_id: 4,
message: "later records were not analyzed",
skipped_record: true,
},
],
}, },
}; };
const json = prepareExport(partial, false).analysis; const json = prepareExport(partial, false).analysis;
+57 -20
View File
@@ -1,29 +1,33 @@
import { formatBytes } from "./app/format";
import { redactAnalysis, type RedactionSummary } from "./redact"; import { redactAnalysis, type RedactionSummary } from "./redact";
import type { Analysis, Incident, ParseIssue } from "./types"; import type { Analysis, Incident, ParseIssue } from "./types";
export type PreparedExport = { analysis: Analysis; redaction: RedactionSummary | null }; export type PreparedExport = { analysis: Analysis; redaction: RedactionSummary | null };
const REDACTION_TOKEN_RE = /^\[REDACTED_[A-Z]+\](?:\.evtx)?$/; const REDACTION_TOKEN_RE = /^\[REDACTED_[A-Z]+(?:_\d+)?\](?:\.evtx)?$/;
function markdownText(value: string): string { function markdownText(value: string): string {
const compact = value.replace(/[\r\n]+/g, " "); const compact = value.replace(/[\r\n]+/g, " ");
return compact.split(/(\[REDACTED_[A-Z]+\])/g).map((part) => { return compact
if (REDACTION_TOKEN_RE.test(part)) return part; .split(/(\[REDACTED_[A-Z]+(?:_\d+)?\])/g)
return part .map((part) => {
.replaceAll("\\", "\\\\") if (REDACTION_TOKEN_RE.test(part)) return part;
.replaceAll("`", "\\`") return part
.replaceAll("*", "\\*") .replaceAll("\\", "\\\\")
.replaceAll("_", "\\_") .replaceAll("`", "\\`")
.replaceAll("[", "\\[") .replaceAll("*", "\\*")
.replaceAll("]", "\\]") .replaceAll("_", "\\_")
.replaceAll("(", "\\(") .replaceAll("[", "\\[")
.replaceAll(")", "\\)") .replaceAll("]", "\\]")
.replaceAll("!", "\\!") .replaceAll("(", "\\(")
.replaceAll("#", "\\#") .replaceAll(")", "\\)")
.replaceAll(">", "\\>") .replaceAll("!", "\\!")
.replaceAll("<", "\\<") .replaceAll("#", "\\#")
.replaceAll("|", "\\|"); .replaceAll(">", "\\>")
}).join(""); .replaceAll("<", "\\<")
.replaceAll("|", "\\|");
})
.join("");
} }
function markdownCode(value: string): string { function markdownCode(value: string): string {
@@ -53,13 +57,21 @@ export function prepareExport(source: Analysis, redact: boolean): PreparedExport
} }
export function analysisToMarkdown(source: Analysis, redact = true): string { export function analysisToMarkdown(source: Analysis, redact = true): string {
const prepared = prepareExport(source, redact); return markdownFromPrepared(prepareExport(source, redact), redact);
}
export function markdownFromPrepared(prepared: PreparedExport, redact: boolean): string {
const analysis = prepared.analysis; const analysis = prepared.analysis;
const campaigns = analysis.campaigns ?? [];
const lines = [ const lines = [
`# EventLens incident report — ${markdownText(analysis.source)}`, `# EventLens incident report — ${markdownText(analysis.source)}`,
"", "",
`- Events: ${analysis.events.length}`, `- Events: ${analysis.events.length}`,
`- Incidents: ${analysis.incidents.length}`, `- Incidents: ${analysis.incidents.length}`,
`- Campaigns (recurring incidents): ${campaigns.length}`,
analysis.source_info
? `- Source SHA-256: ${markdownCode(analysis.source_info.sha256)} (${formatBytes(analysis.source_info.size_bytes)})`
: "",
`- Redaction: ${redact ? `enabled (${prepared.redaction?.total ?? 0} replacement(s))` : "disabled"}`, `- Redaction: ${redact ? `enabled (${prepared.redaction?.total ?? 0} replacement(s))` : "disabled"}`,
analysis.parse analysis.parse
? `- Parser status: ${analysis.parse.status}; records seen ${analysis.parse.records_seen}; parsed ${analysis.parse.parsed_events}; skipped ${analysis.parse.skipped_records}; issues ${analysis.parse.issue_count}; truncated ${analysis.parse.truncated ? "yes" : "no"}` ? `- Parser status: ${analysis.parse.status}; records seen ${analysis.parse.records_seen}; parsed ${analysis.parse.parsed_events}; skipped ${analysis.parse.skipped_records}; issues ${analysis.parse.issue_count}; truncated ${analysis.parse.truncated ? "yes" : "no"}`
@@ -71,7 +83,30 @@ export function analysisToMarkdown(source: Analysis, redact = true): string {
"", "",
]; ];
if (analysis.parse?.issues.length) { if (analysis.parse?.issues.length) {
lines.push("## Parser issues", "", ...analysis.parse.issues.map(issueLine), ""); lines.push("## Parser issues", "");
const counts = Object.entries(analysis.parse.issue_counts ?? {});
if (counts.length) lines.push(...counts.map(([code, count]) => `- ${markdownCode(code)}: ${count}`), "");
lines.push(...analysis.parse.issues.map(issueLine));
if (analysis.parse.issues_truncated) {
lines.push(
`- … ${analysis.parse.issue_count - analysis.parse.issues.length} further issue(s) are counted above but not listed individually.`,
);
}
lines.push("");
}
if (campaigns.length) {
lines.push("## Campaigns", "");
for (const campaign of campaigns) {
lines.push(
`### ${markdownText(campaign.title)}`,
`- Rule: ${markdownCode(campaign.rule_id)}`,
`- Severity: ${markdownText(campaign.severity)}`,
`- Window: ${markdownCode(`${campaign.start} → ${campaign.end}`)}`,
`- Incidents: ${campaign.incident_ids.length} · evidence events: ${campaign.event_count}`,
...campaign.reasons.map((reason) => `- Reason: ${markdownCode(reason)}`),
"",
);
}
} }
lines.push("## Incidents", ""); lines.push("## Incidents", "");
for (const incident of analysis.incidents) { for (const incident of analysis.incidents) {
@@ -81,6 +116,7 @@ export function analysisToMarkdown(source: Analysis, redact = true): string {
`- Severity: ${markdownText(incident.severity)}`, `- Severity: ${markdownText(incident.severity)}`,
`- Window: ${markdownCode(incidentWindow(incident))}`, `- Window: ${markdownCode(incidentWindow(incident))}`,
`- Evidence: ${markdownCode(incident.evidence_event_ids.join(", "))}`, `- Evidence: ${markdownCode(incident.evidence_event_ids.join(", "))}`,
...(incident.campaign_id ? [`- Campaign: ${markdownCode(incident.campaign_id)}`] : []),
...incident.reasons.map((reason) => `- Reason: ${markdownCode(reason)}`), ...incident.reasons.map((reason) => `- Reason: ${markdownCode(reason)}`),
"", "",
); );
@@ -93,6 +129,7 @@ export function analysisToMarkdown(source: Analysis, redact = true): string {
`- Provider: ${markdownCode(event.provider)}`, `- Provider: ${markdownCode(event.provider)}`,
`- Event ID: ${event.event_id ?? "—"}`, `- Event ID: ${event.event_id ?? "—"}`,
`- Level: ${markdownText(event.level)}`, `- Level: ${markdownText(event.level)}`,
...(event.outcome ? [`- Audit outcome: ${markdownText(event.outcome)}`] : []),
`- Category: ${markdownText(event.category)}`, `- Category: ${markdownText(event.category)}`,
`- Computer: ${markdownCode(event.computer || "—")}`, `- Computer: ${markdownCode(event.computer || "—")}`,
`- Timestamp source: ${markdownCode(event.timestamp_source ?? (event.timestamp ? "event" : "missing"))}`, `- Timestamp source: ${markdownCode(event.timestamp_source ?? (event.timestamp ? "event" : "missing"))}`,
+7 -1
View File
@@ -19,7 +19,13 @@ describe("large result performance", () => {
it("searches 100,000 normalized events within a deterministic budget", () => { it("searches 100,000 normalized events within a deterministic budget", () => {
const events = makeEvents(100_000); const events = makeEvents(100_000);
const started = performance.now(); const started = performance.now();
const result = filterEvents(events, { search: "needle-value", category: "", level: "", provider: "", noiseMode: "all" }); const result = filterEvents(events, {
search: "needle-value",
category: "",
level: "",
provider: "",
noiseMode: "all",
});
const elapsed = performance.now() - started; const elapsed = performance.now() - started;
expect(result.map((event) => event.id)).toEqual(["99999"]); expect(result.map((event) => event.id)).toEqual(["99999"]);
expect(elapsed).toBeLessThan(3_000); expect(elapsed).toBeLessThan(3_000);
+39 -5
View File
@@ -3,9 +3,37 @@ import { filterEvents, uniqueProviders } from "./filter";
import type { EventItem } from "./types"; import type { EventItem } from "./types";
const events: EventItem[] = [ const events: EventItem[] = [
{ id: "1", timestamp: "2026-09-09T10:00:00Z", provider: "DNS Client", event_id: 1014, level: "warning", category: "network", summary: "DNS timeout", computer: "PC-01", fields: { Query: "api.example.test" } }, {
{ id: "2", timestamp: "2026-09-09T10:00:10Z", provider: "Kernel General", event_id: 12, level: "information", category: "system", summary: "System started", computer: "PC-01" }, id: "1",
{ id: "3", timestamp: "2026-09-09T10:10:20Z", provider: "Application Error", event_id: 1000, level: "error", category: "crash", summary: "Example.exe crashed", computer: "PC-01" }, timestamp: "2026-09-09T10:00:00Z",
provider: "DNS Client",
event_id: 1014,
level: "warning",
category: "network",
summary: "DNS timeout",
computer: "PC-01",
fields: { Query: "api.example.test" },
},
{
id: "2",
timestamp: "2026-09-09T10:00:10Z",
provider: "Kernel General",
event_id: 12,
level: "information",
category: "system",
summary: "System started",
computer: "PC-01",
},
{
id: "3",
timestamp: "2026-09-09T10:10:20Z",
provider: "Application Error",
event_id: 1000,
level: "error",
category: "crash",
summary: "Example.exe crashed",
computer: "PC-01",
},
]; ];
const base = { search: "", category: "", level: "", provider: "", noiseMode: "all" as const }; const base = { search: "", category: "", level: "", provider: "", noiseMode: "all" as const };
@@ -29,11 +57,17 @@ describe("event filters", () => {
}); });
it("keeps informational incident evidence when focus overrides noise suppression", () => { it("keeps informational incident evidence when focus overrides noise suppression", () => {
expect(filterEvents(events, { ...base, noiseMode: "attention", evidenceIds: new Set(["2"]) }).map((event) => event.id)).toEqual(["2"]); expect(
filterEvents(events, { ...base, noiseMode: "attention", evidenceIds: new Set(["2"]) }).map((event) => event.id),
).toEqual(["2"]);
}); });
it("applies a symmetric time window around selected evidence", () => { it("applies a symmetric time window around selected evidence", () => {
expect(filterEvents(events, { ...base, anchorTimestamp: "2026-09-09T10:00:10Z", windowMinutes: 1 }).map((event) => event.id)).toEqual(["1", "2"]); expect(
filterEvents(events, { ...base, anchorTimestamp: "2026-09-09T10:00:10Z", windowMinutes: 1 }).map(
(event) => event.id,
),
).toEqual(["1", "2"]);
}); });
it("returns stable sorted provider options", () => { it("returns stable sorted provider options", () => {
+16 -2
View File
@@ -14,6 +14,11 @@ export type EventFilters = {
}; };
const ATTENTION_LEVELS = new Set(["critical", "error", "warning"]); const ATTENTION_LEVELS = new Set(["critical", "error", "warning"]);
/** Errors/warnings, plus Security audit failures (which Windows logs at level 0). */
export function needsAttention(event: EventItem): boolean {
return ATTENTION_LEVELS.has(event.level.toLowerCase()) || event.outcome === "failure";
}
const searchDocuments = new WeakMap<EventItem, string>(); const searchDocuments = new WeakMap<EventItem, string>();
function searchDocument(event: EventItem): string { function searchDocument(event: EventItem): string {
@@ -22,7 +27,16 @@ function searchDocument(event: EventItem): string {
const fieldText = Object.entries(event.fields ?? {}) const fieldText = Object.entries(event.fields ?? {})
.map(([key, value]) => `${key} ${value}`) .map(([key, value]) => `${key} ${value}`)
.join(" "); .join(" ");
const document = [event.id, event.summary, event.provider, event.event_id ?? "", event.category, event.channel ?? "", event.computer ?? "", fieldText] const document = [
event.id,
event.summary,
event.provider,
event.event_id ?? "",
event.category,
event.channel ?? "",
event.computer ?? "",
fieldText,
]
.join(" ") .join(" ")
.toLowerCase(); .toLowerCase();
searchDocuments.set(event, document); searchDocuments.set(event, document);
@@ -39,7 +53,7 @@ export function filterEvents(events: EventItem[], filters: EventFilters): EventI
if (filters.category && event.category !== filters.category) return false; if (filters.category && event.category !== filters.category) return false;
if (filters.level && event.level.toLowerCase() !== filters.level.toLowerCase()) return false; if (filters.level && event.level.toLowerCase() !== filters.level.toLowerCase()) return false;
if (filters.provider && event.provider !== filters.provider) return false; if (filters.provider && event.provider !== filters.provider) return false;
if (filters.noiseMode === "attention" && !filters.evidenceIds && !ATTENTION_LEVELS.has(event.level.toLowerCase())) return false; if (filters.noiseMode === "attention" && !filters.evidenceIds && !needsAttention(event)) return false;
if (anchor !== null && windowMs !== null) { if (anchor !== null && windowMs !== null) {
if (!event.timestamp) return false; if (!event.timestamp) return false;
const eventTime = Date.parse(event.timestamp); const eventTime = Date.parse(event.timestamp);
+5 -1
View File
@@ -6,4 +6,8 @@ import "./styles.css";
const rootElement = document.getElementById("root"); const rootElement = document.getElementById("root");
if (!rootElement) throw new Error("App root element was not found"); if (!rootElement) throw new Error("App root element was not found");
createRoot(rootElement).render(<React.StrictMode><App /></React.StrictMode>); createRoot(rootElement).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
+88 -51
View File
@@ -4,20 +4,50 @@ import type { Analysis } from "./types";
const source: Analysis = { const source: Analysis = {
source: "Security.evtx", source: "Security.evtx",
incidents: [{ id:"i1", rule_id:"windows.auth.failed-logon", start:"2026-09-09T10:00:00Z", end:"2026-09-09T10:00:01Z", title:"Failed login", category:"authentication", severity:"warning", reasons:["Connection from 192.168.1.15"], evidence_event_ids:["1"], original_count:1, compressed_count:1 }], incidents: [
events: [{ id:"1", timestamp:"2026-09-09T10:00:00Z", provider:"Security", event_id:4625, level:"warning", category:"authentication", summary:"C:\\Users\\jens\\tool.exe contacted admin@example.com at 192.168.1.15", computer:"DEMO-PC", fields:{"EventData.TargetUserName":"jens","EventData.IpAddress":"10.0.0.5","EventData.ProcessName":"C:\\Windows\\System32\\cmd.exe"} }], {
id: "i1",
rule_id: "windows.auth.failed-logon",
start: "2026-09-09T10:00:00Z",
end: "2026-09-09T10:00:01Z",
title: "Failed login",
category: "authentication",
severity: "warning",
reasons: ["Connection from 192.168.1.15"],
evidence_event_ids: ["1"],
original_count: 1,
compressed_count: 1,
},
],
events: [
{
id: "1",
timestamp: "2026-09-09T10:00:00Z",
provider: "Security",
event_id: 4625,
level: "warning",
category: "authentication",
summary: "C:\\Users\\jens\\tool.exe contacted admin@example.com at 192.168.1.15",
computer: "DEMO-PC",
fields: {
"EventData.TargetUserName": "jens",
"EventData.IpAddress": "10.0.0.5",
"EventData.ProcessName": "C:\\Windows\\System32\\cmd.exe",
},
},
],
}; };
describe("redaction", () => { describe("redaction", () => {
it("redacts sensitive event values without mutating the source", () => { it("redacts sensitive event values without mutating the source", () => {
const result = redactAnalysis(source); const result = redactAnalysis(source);
const event = result.analysis.events[0]; const event = result.analysis.events[0];
expect(event.computer).toBe("[REDACTED_HOST]"); expect(event.computer).toMatch(/^\[REDACTED_HOST_\d+\]$/);
expect(event.fields?.["EventData.TargetUserName"]).toBe("[REDACTED_IDENTITY]"); expect(event.fields?.["EventData.TargetUserName"]).toMatch(/^\[REDACTED_IDENTITY_\d+\]$/);
expect(event.fields?.["EventData.IpAddress"]).toBe("[REDACTED_IP]"); expect(event.fields?.["EventData.IpAddress"]).toMatch(/^\[REDACTED_IP_\d+\]$/);
expect(event.fields?.["EventData.ProcessName"]).toBe("[REDACTED_PATH]"); expect(event.fields?.["EventData.ProcessName"]).toMatch(/^\[REDACTED_PATH_\d+\]$/);
expect(event.summary).toContain("[REDACTED_EMAIL]"); expect(event.summary).toMatch(/\[REDACTED_EMAIL_\d+\]/);
expect(event.summary).toContain("[REDACTED_IP]"); expect(event.summary).toMatch(/\[REDACTED_IP_\d+\]/);
expect(source.events[0].computer).toBe("DEMO-PC"); expect(source.events[0].computer).toBe("DEMO-PC");
expect(result.summary.total).toBeGreaterThanOrEqual(6); expect(result.summary.total).toBeGreaterThanOrEqual(6);
}); });
@@ -25,37 +55,42 @@ describe("redaction", () => {
it("propagates identities and redacts Windows/UNC paths and IPv6 in free-form text", () => { it("propagates identities and redacts Windows/UNC paths and IPv6 in free-form text", () => {
const sensitive: Analysis = { const sensitive: Analysis = {
source: "private.evtx", source: "private.evtx",
incidents: [{ incidents: [
id: "incident-1", {
rule_id: "windows.auth.failed-logon", id: "incident-1",
start: "2026-09-09T10:00:00Z", rule_id: "windows.auth.failed-logon",
end: "2026-09-09T10:00:01Z", start: "2026-09-09T10:00:00Z",
title: "Failed sign-in for jens", end: "2026-09-09T10:00:01Z",
category: "authentication", title: "Failed sign-in for jens",
severity: "warning", category: "authentication",
reasons: ["jens used C:\\Program Files\\SecretTool\\agent.exe from 2001:db8::42"], severity: "warning",
evidence_event_ids: ["1"], reasons: ["jens used C:\\Program Files\\SecretTool\\agent.exe from 2001:db8::42"],
original_count: 1, evidence_event_ids: ["1"],
compressed_count: 1, original_count: 1,
}], compressed_count: 1,
events: [{
id: "1",
timestamp: "2026-09-09T10:00:00Z",
provider: "Security",
event_id: 4625,
level: "warning",
category: "authentication",
summary: "Failed sign-in for DOMAIN\\jens at C:\\Program Files\\SecretTool\\agent.exe from 2001:db8::42, fe80::1 and ::ffff:192.0.2.1; SID S-1-5-21-123-456-789-1001; machine BUILD01$; UNC \\\\server\\Share With Space\\agent.exe",
computer: "DEMO-PC",
fields: {
"EventData.TargetUserName": "jens",
"EventData.SubjectUserName": "DOMAIN\\jens",
"EventData.ProcessName": "C:\\Program Files\\SecretTool\\agent.exe",
"EventData.UncPath": "\\\\server\\Share With Space\\agent.exe",
"EventData.MachineAccount": "DOMAIN\\BUILD01$",
"EventData.Sid": "S-1-5-21-123-456-789-1001",
}, },
}], ],
events: [
{
id: "1",
timestamp: "2026-09-09T10:00:00Z",
provider: "Security",
event_id: 4625,
level: "warning",
category: "authentication",
summary:
"Failed sign-in for DOMAIN\\jens at C:\\Program Files\\SecretTool\\agent.exe from 2001:db8::42, fe80::1 and ::ffff:192.0.2.1; SID S-1-5-21-123-456-789-1001; machine BUILD01$; UNC \\\\server\\Share With Space\\agent.exe",
computer: "DEMO-PC",
fields: {
"EventData.TargetUserName": "jens",
"EventData.SubjectUserName": "DOMAIN\\jens",
"EventData.ProcessName": "C:\\Program Files\\SecretTool\\agent.exe",
"EventData.UncPath": "\\\\server\\Share With Space\\agent.exe",
"EventData.MachineAccount": "DOMAIN\\BUILD01$",
"EventData.Sid": "S-1-5-21-123-456-789-1001",
},
},
],
}; };
const result = redactAnalysis(sensitive); const result = redactAnalysis(sensitive);
const serialized = JSON.stringify(result.analysis); const serialized = JSON.stringify(result.analysis);
@@ -67,7 +102,7 @@ describe("redaction", () => {
expect(serialized).not.toContain("192.0.2.1"); expect(serialized).not.toContain("192.0.2.1");
expect(serialized).not.toContain("BUILD01$"); expect(serialized).not.toContain("BUILD01$");
expect(serialized).not.toContain("S-1-5-21"); expect(serialized).not.toContain("S-1-5-21");
expect(result.analysis.incidents[0].title).toContain("[REDACTED_IDENTITY]"); expect(result.analysis.incidents[0].title).toMatch(/\[REDACTED_IDENTITY_\d+\]/);
expect(result.summary.paths).toBeGreaterThan(0); expect(result.summary.paths).toBeGreaterThan(0);
expect(result.summary.ips).toBeGreaterThanOrEqual(3); expect(result.summary.ips).toBeGreaterThanOrEqual(3);
}); });
@@ -76,20 +111,22 @@ describe("redaction", () => {
const sourceField: Analysis = { const sourceField: Analysis = {
source: "private.evtx", source: "private.evtx",
incidents: [], incidents: [],
events: [{ events: [
id: "1", {
timestamp: null, id: "1",
provider: "Security", timestamp: null,
event_id: 1, provider: "Security",
level: "information", event_id: 1,
category: "other", level: "information",
summary: "Observed source Collector-A", category: "other",
computer: "", summary: "Observed source Collector-A",
fields: { "EventData.SourceName": "Collector-A" }, computer: "",
}], fields: { "EventData.SourceName": "Collector-A" },
},
],
}; };
const result = redactAnalysis(sourceField); const result = redactAnalysis(sourceField);
expect(result.analysis.events[0].summary).toContain("[REDACTED_SOURCE]"); expect(result.analysis.events[0].summary).toMatch(/\[REDACTED_SOURCE_\d+\]/);
expect(result.summary.sources).toBeGreaterThan(1); expect(result.summary.sources).toBeGreaterThan(1);
}); });
}); });
+170 -80
View File
@@ -1,4 +1,4 @@
import type { Analysis, EventItem } from "./types"; import type { Analysis, Campaign, EventItem } from "./types";
export type RedactionSummary = { export type RedactionSummary = {
hosts: number; hosts: number;
@@ -6,12 +6,29 @@ export type RedactionSummary = {
emails: number; emails: number;
ips: number; ips: number;
paths: number; paths: number;
domains: number;
sources: number; sources: number;
total: number; total: number;
/** Field keys whose non-empty values were exported unchanged in at least one event. */
untouchedFieldKeys: string[];
/** Number of distinct pseudonyms per category, e.g. 3 hosts → [REDACTED_HOST_1..3]. */
distinct: Record<RedactionCategory, number>;
}; };
export type RedactionResult = { analysis: Analysis; summary: RedactionSummary }; export type RedactionResult = { analysis: Analysis; summary: RedactionSummary };
type RedactionCategory = keyof Omit<RedactionSummary, "total">; export type RedactionCategory = "hosts" | "identities" | "emails" | "ips" | "paths" | "domains" | "sources";
type KnownValue = { value: string; replacement: string; category: RedactionCategory };
type KnownValue = { value: string; category: RedactionCategory };
const LABELS: Record<RedactionCategory, string> = {
hosts: "HOST",
identities: "IDENTITY",
emails: "EMAIL",
ips: "IP",
paths: "PATH",
domains: "DOMAIN",
sources: "SOURCE",
};
export const MAX_UNTOUCHED_KEYS = 50;
const EMAIL_RE = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi; const EMAIL_RE = /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi;
const DOMAIN_IDENTITY_RE = /(?<![\w:])[A-Za-z0-9][A-Za-z0-9._-]{1,}\\[A-Za-z0-9._-]{1,}\$?(?![\w])/g; const DOMAIN_IDENTITY_RE = /(?<![\w:])[A-Za-z0-9][A-Za-z0-9._-]{1,}\\[A-Za-z0-9._-]{1,}\$?(?![\w])/g;
@@ -21,27 +38,58 @@ const IPV4_RE = /(?<![\d.])(?:\d{1,3}\.){3}\d{1,3}(?![\d.])/g;
const IPV4_MAPPED_IPV6_RE = /(?<![0-9A-Fa-f:])(?:[0-9A-Fa-f]{0,4}:){2,8}(?:\d{1,3}\.){3}\d{1,3}(?![\w:])/gi; const IPV4_MAPPED_IPV6_RE = /(?<![0-9A-Fa-f:])(?:[0-9A-Fa-f]{0,4}:){2,8}(?:\d{1,3}\.){3}\d{1,3}(?![\w:])/gi;
const IPV6_RE = /(?<![0-9A-Fa-f:])(?:[0-9A-Fa-f]{0,4}:){2,8}[0-9A-Fa-f]{0,4}(?![0-9A-Fa-f:])/g; const IPV6_RE = /(?<![0-9A-Fa-f:])(?:[0-9A-Fa-f]{0,4}:){2,8}[0-9A-Fa-f]{0,4}(?![0-9A-Fa-f:])/g;
const QUOTED_PATH_RE = /(["'])(?=((?:[A-Za-z]:\\|\\\\)))([\s\S]*?)\1/g; const QUOTED_PATH_RE = /(["'])(?=((?:[A-Za-z]:\\|\\\\)))([\s\S]*?)\1/g;
const UNQUOTED_PATH_RE = /(?<![\w])(?:[A-Za-z]:\\|\\\\)(?:[^\\/:*?"<>|\r\n]+\\)+[^\\/:*?"<>|\r\n]*?\.[A-Za-z0-9]{1,8}(?=$|[\s,;:!?)]|["'])/g; const UNQUOTED_PATH_RE =
const IDENTITY_KEY_RE = /(user(name)?|account|upn|principal|subject.*user|target.*user|machineaccount|sid|email)/i; /(?<![\w])(?:[A-Za-z]:\\|\\\\)(?:[^\\/:*?"<>|\r\n]+\\)+[^\\/:*?"<>|\r\n]*?\.[A-Za-z0-9]{1,8}(?=$|[\s,;:!?)]|["'])/g;
// Three or more DNS labels ending in an alphabetic TLD (fileserver.corp.example).
// Two-label names are skipped on purpose so file names such as app.exe survive.
const FQDN_RE =
/(?<![\w.-])(?:[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.){2,}[A-Za-z][A-Za-z0-9-]{1,62}(?![\w.-])/g;
const IDENTITY_KEY_RE =
/(user(name)?|account|upn|principal|subject.*user|target.*user|machineaccount|sid|email|membername)/i;
const EMAIL_KEY_RE = /(email|mail)/i; const EMAIL_KEY_RE = /(email|mail)/i;
const HOST_KEY_RE = /(computer|host(name)?|workstation|machine)/i; const HOST_KEY_RE = /(computer|host(name)?|workstation|machine|servername|dnshostname)/i;
const DOMAIN_KEY_RE = /(domain(name)?|queryname|(^|[._])query$|realm)$/i;
const PATH_KEY_RE = /(path|filename|image|executable|process(name)?|command(line)?)/i; const PATH_KEY_RE = /(path|filename|image|executable|process(name)?|command(line)?)/i;
const IP_KEY_RE = /(^|[._])(ip|ipaddress|sourceaddress|destinationaddress|remoteaddress)$/i; const IP_KEY_RE = /(^|[._])(ip|ipaddress|sourceaddress|destinationaddress|remoteaddress|clientaddress|address)$/i;
const SOURCE_KEY_RE = /(^|[._])(source|sourcename|sourcefile|logfile)$/i; const SOURCE_KEY_RE = /(^|[._])(source|sourcename|sourcefile|logfile)$/i;
const REPLACEMENT_RE = /^\[REDACTED_[A-Z]+\]$/; const REPLACEMENT_RE = /^\[REDACTED_[A-Z]+(?:_\d+)?\]$/;
const PATTERNED_RE = /\[REDACTED_[A-Z]+(?:_\d+)?\]/;
/** Consistent pseudonyms: the same value always maps to the same numbered token. */
class Pseudonyms {
private readonly tokens = new Map<string, string>();
readonly distinct: Record<RedactionCategory, number> = {
hosts: 0,
identities: 0,
emails: 0,
ips: 0,
paths: 0,
domains: 0,
sources: 0,
};
token(category: RedactionCategory, value: string): string {
const key = `${category}\u0000${value.trim().toLocaleLowerCase()}`;
const existing = this.tokens.get(key);
if (existing) return existing;
this.distinct[category] += 1;
const token = `[REDACTED_${LABELS[category]}_${this.distinct[category]}]`;
this.tokens.set(key, token);
return token;
}
}
type Context = { names: Pseudonyms; summary: RedactionSummary; known: KnownMatcher | null };
function increment(summary: RedactionSummary, category: RedactionCategory): void { function increment(summary: RedactionSummary, category: RedactionCategory): void {
summary[category] += 1; summary[category] += 1;
summary.total += 1; summary.total += 1;
} }
function replacementFor(category: RedactionCategory): string { export function fieldCategory(key: string): RedactionCategory | null {
return `[REDACTED_${category === "ips" ? "IP" : category === "emails" ? "EMAIL" : category === "hosts" ? "HOST" : category === "paths" ? "PATH" : category === "sources" ? "SOURCE" : "IDENTITY"}]`;
}
function fieldCategory(key: string): RedactionCategory | null {
if (EMAIL_KEY_RE.test(key)) return "emails"; if (EMAIL_KEY_RE.test(key)) return "emails";
if (IDENTITY_KEY_RE.test(key)) return "identities"; if (IDENTITY_KEY_RE.test(key)) return "identities";
if (DOMAIN_KEY_RE.test(key)) return "domains";
if (HOST_KEY_RE.test(key)) return "hosts"; if (HOST_KEY_RE.test(key)) return "hosts";
if (PATH_KEY_RE.test(key)) return "paths"; if (PATH_KEY_RE.test(key)) return "paths";
if (IP_KEY_RE.test(key)) return "ips"; if (IP_KEY_RE.test(key)) return "ips";
@@ -49,40 +97,50 @@ function fieldCategory(key: string): RedactionCategory | null {
return null; return null;
} }
function addKnown(known: Map<string, KnownValue>, value: string, category: RedactionCategory): void {
const candidate = value.trim();
if (candidate.length < 2 || REPLACEMENT_RE.test(candidate)) return;
const key = `${category}\u0000${candidate.toLocaleLowerCase()}`;
if (!known.has(key)) known.set(key, { value: candidate, category, replacement: replacementFor(category) });
}
function collectKnownValues(source: Analysis): Map<string, KnownValue> {
const known = new Map<string, KnownValue>();
for (const event of source.events) {
addKnown(known, event.computer ?? "", "hosts");
for (const [key, value] of Object.entries(event.fields ?? {})) {
const category = fieldCategory(key);
if (category) addKnown(known, value, category);
}
}
return known;
}
function escapeRegExp(value: string): string { function escapeRegExp(value: string): string {
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
} }
function replaceKnownValues(value: string, known: Map<string, KnownValue>, summary: RedactionSummary): string { /**
let next = value; * Matches every known structured value in one pass. Building a single
const values = [...known.values()].sort((a, b) => b.value.length - a.value.length); * alternation once per redaction run replaces the previous per-string,
for (const item of values) { * per-value RegExp construction that made redaction quadratic.
const pattern = new RegExp(`(?<![A-Za-z0-9_])${escapeRegExp(item.value)}(?![A-Za-z0-9_])`, "gi"); */
next = next.replace(pattern, () => { type KnownMatcher = { pattern: RegExp; byValue: Map<string, KnownValue> };
increment(summary, item.category);
return item.replacement; function collectKnownValues(source: Analysis): KnownMatcher | null {
}); const byValue = new Map<string, KnownValue>();
const add = (value: string, category: RedactionCategory) => {
const candidate = value.trim();
if (candidate.length < 2 || REPLACEMENT_RE.test(candidate)) return;
const key = candidate.toLocaleLowerCase();
if (!byValue.has(key)) byValue.set(key, { value: candidate, category });
};
for (const event of source.events) {
add(event.computer ?? "", "hosts");
for (const [key, value] of Object.entries(event.fields ?? {})) {
const category = fieldCategory(key);
if (category) add(value, category);
}
} }
return next; if (!byValue.size) return null;
const alternatives = [...byValue.values()]
.map((item) => item.value)
.sort((a, b) => b.length - a.length)
.map(escapeRegExp);
return { pattern: new RegExp(`(?<![A-Za-z0-9_])(?:${alternatives.join("|")})(?![A-Za-z0-9_])`, "gi"), byValue };
}
function replaceKnownValues(value: string, context: Context): string {
if (!context.known) return value;
const { pattern, byValue } = context.known;
pattern.lastIndex = 0;
return value.replace(pattern, (match) => {
const item = byValue.get(match.toLocaleLowerCase());
if (!item) return match;
increment(context.summary, item.category);
return context.names.token(item.category, item.value);
});
} }
function isValidIpv4(value: string): boolean { function isValidIpv4(value: string): boolean {
@@ -101,77 +159,109 @@ function isValidIpv6(value: string): boolean {
return count + 1; return count + 1;
}, 0); }, 0);
if (hasCompression ? expandedCount >= 8 : expandedCount !== 8) return false; if (hasCompression ? expandedCount >= 8 : expandedCount !== 8) return false;
return pieces.filter(Boolean).every((piece) => piece.includes(".") ? isValidIpv4(piece) : /^[0-9A-Fa-f]{1,4}$/.test(piece)); return pieces
.filter(Boolean)
.every((piece) => (piece.includes(".") ? isValidIpv4(piece) : /^[0-9A-Fa-f]{1,4}$/.test(piece)));
} }
function replacePattern( function replacePattern(
value: string, value: string,
pattern: RegExp, pattern: RegExp,
replacement: string,
category: RedactionCategory, category: RedactionCategory,
summary: RedactionSummary, context: Context,
validate?: (match: string) => boolean, validate?: (match: string) => boolean,
): string { ): string {
return value.replace(pattern, (match) => { return value.replace(pattern, (match: string) => {
if (validate && !validate(match)) return match; if (validate && !validate(match)) return match;
increment(summary, category); increment(context.summary, category);
return replacement; return context.names.token(category, match);
}); });
} }
function redactPaths(value: string, summary: RedactionSummary): string { function redactPaths(value: string, context: Context): string {
const next = value.replace(QUOTED_PATH_RE, (match, _quote: string, _root: string, path: string) => { const next = value.replace(QUOTED_PATH_RE, (match: string, _quote: string, _root: string, path: string) => {
if (!path) return match; if (!path) return match;
increment(summary, "paths"); increment(context.summary, "paths");
return "[REDACTED_PATH]"; return context.names.token("paths", path);
}); });
return next.replace(UNQUOTED_PATH_RE, () => { return next.replace(UNQUOTED_PATH_RE, (match: string) => {
increment(summary, "paths"); increment(context.summary, "paths");
return "[REDACTED_PATH]"; return context.names.token("paths", match);
}); });
} }
function redactText(value: string, known: Map<string, KnownValue>, summary: RedactionSummary): string { function redactText(value: string, context: Context): string {
let next = redactPaths(value, summary); if (!value) return value;
next = replacePattern(next, EMAIL_RE, "[REDACTED_EMAIL]", "emails", summary); let next = redactPaths(value, context);
next = replacePattern(next, DOMAIN_IDENTITY_RE, "[REDACTED_IDENTITY]", "identities", summary); next = replacePattern(next, EMAIL_RE, "emails", context);
next = replacePattern(next, SID_RE, "[REDACTED_IDENTITY]", "identities", summary); next = replacePattern(next, DOMAIN_IDENTITY_RE, "identities", context);
next = replacePattern(next, MACHINE_ACCOUNT_RE, "[REDACTED_IDENTITY]", "identities", summary); next = replacePattern(next, SID_RE, "identities", context);
next = replacePattern(next, IPV4_MAPPED_IPV6_RE, "[REDACTED_IP]", "ips", summary, isValidIpv6); next = replacePattern(next, MACHINE_ACCOUNT_RE, "identities", context);
next = replacePattern(next, IPV4_RE, "[REDACTED_IP]", "ips", summary, isValidIpv4); next = replacePattern(next, IPV4_MAPPED_IPV6_RE, "ips", context, isValidIpv6);
next = replacePattern(next, IPV6_RE, "[REDACTED_IP]", "ips", summary, isValidIpv6); next = replacePattern(next, IPV4_RE, "ips", context, isValidIpv4);
return replaceKnownValues(next, known, summary); next = replacePattern(next, IPV6_RE, "ips", context, isValidIpv6);
next = replaceKnownValues(next, context);
return replacePattern(next, FQDN_RE, "domains", context);
} }
function redactField(key: string, value: string, known: Map<string, KnownValue>, summary: RedactionSummary): string { function redactField(key: string, value: string, context: Context, untouched: Set<string>): string {
const category = fieldCategory(key); const category = fieldCategory(key);
if (category && value) { if (category && value) {
increment(summary, category); increment(context.summary, category);
return replacementFor(category); return context.names.token(category, value);
} }
return redactText(value, known, summary); const next = redactText(value, context);
if (value && next === value && !PATTERNED_RE.test(value)) untouched.add(key);
return next;
} }
function redactEvent(event: EventItem, known: Map<string, KnownValue>, summary: RedactionSummary): EventItem { function redactEvent(event: EventItem, context: Context, untouched: Set<string>): EventItem {
const fields = Object.fromEntries( const fields = Object.fromEntries(
Object.entries(event.fields ?? {}).map(([key, value]) => [key, redactField(key, value, known, summary)]), Object.entries(event.fields ?? {}).map(([key, value]) => [key, redactField(key, value, context, untouched)]),
); );
let computer = event.computer ?? ""; let computer = event.computer ?? "";
if (computer) { if (computer) {
increment(summary, "hosts"); increment(context.summary, "hosts");
computer = "[REDACTED_HOST]"; computer = context.names.token("hosts", computer);
} }
return { ...event, computer, summary: redactText(event.summary, known, summary), fields }; return { ...event, computer, summary: redactText(event.summary, context), fields };
}
function redactCampaign(campaign: Campaign, context: Context): Campaign {
return {
...campaign,
title: redactText(campaign.title, context),
reasons: campaign.reasons.map((reason) => redactText(reason, context)),
};
} }
export function redactAnalysis(source: Analysis): RedactionResult { export function redactAnalysis(source: Analysis): RedactionResult {
const summary: RedactionSummary = { hosts: 0, identities: 0, emails: 0, ips: 0, paths: 0, sources: source.source ? 1 : 0, total: source.source ? 1 : 0 }; const names = new Pseudonyms();
const known = collectKnownValues(source); const summary: RedactionSummary = {
const events = source.events.map((event) => redactEvent(event, known, summary)); hosts: 0,
identities: 0,
emails: 0,
ips: 0,
paths: 0,
domains: 0,
sources: source.source ? 1 : 0,
total: source.source ? 1 : 0,
untouchedFieldKeys: [],
distinct: names.distinct,
};
const context: Context = { names, summary, known: collectKnownValues(source) };
const untouched = new Set<string>();
const events = source.events.map((event) => redactEvent(event, context, untouched));
const incidents = source.incidents.map((incident) => ({ const incidents = source.incidents.map((incident) => ({
...incident, ...incident,
title: redactText(incident.title, known, summary), title: redactText(incident.title, context),
reasons: incident.reasons.map((reason) => redactText(reason, known, summary)), reasons: incident.reasons.map((reason) => redactText(reason, context)),
})); }));
return { analysis: { ...source, source: "[REDACTED_SOURCE].evtx", events, incidents }, summary }; const campaigns = source.campaigns?.map((campaign) => redactCampaign(campaign, context));
summary.untouchedFieldKeys = [...untouched].sort((a, b) => a.localeCompare(b)).slice(0, MAX_UNTOUCHED_KEYS);
summary.distinct = { ...names.distinct };
return {
analysis: { ...source, source: "[REDACTED_SOURCE].evtx", events, incidents, ...(campaigns ? { campaigns } : {}) },
summary,
};
} }
+46
View File
@@ -0,0 +1,46 @@
import { redactAnalysis, type RedactionResult } from "./redact";
import type { Analysis } from "./types";
const results = new WeakMap<Analysis, Promise<RedactionResult>>();
function runInline(analysis: Analysis): Promise<RedactionResult> {
try {
return Promise.resolve(redactAnalysis(analysis));
} catch (reason) {
return Promise.reject(reason);
}
}
/**
* Redact in a Web Worker so large analyses never block the UI thread.
* Results are cached per loaded analysis; the original object is never mutated.
*/
export function redactInBackground(analysis: Analysis): Promise<RedactionResult> {
const cached = results.get(analysis);
if (cached) return cached;
const pending =
typeof Worker === "undefined"
? runInline(analysis)
: new Promise<RedactionResult>((resolve, reject) => {
let worker: Worker;
try {
worker = new Worker(new URL("./workers/redact.worker.ts", import.meta.url), { type: "module" });
} catch {
runInline(analysis).then(resolve, reject);
return;
}
worker.onmessage = (message: MessageEvent<RedactionResult>) => {
worker.terminate();
resolve(message.data);
};
worker.onerror = (event) => {
event.preventDefault();
worker.terminate();
runInline(analysis).then(resolve, reject);
};
worker.postMessage(analysis);
});
results.set(analysis, pending);
pending.catch(() => results.delete(analysis));
return pending;
}
+2463 -460
View File
File diff suppressed because it is too large. Load diff
+24
View File
@@ -10,6 +10,7 @@ export type EventItem = {
computer?: string; computer?: string;
category: string; category: string;
summary: string; summary: string;
outcome?: "success" | "failure" | null;
fields?: Record<string, string>; fields?: Record<string, string>;
}; };
@@ -25,6 +26,25 @@ export type Incident = {
evidence_event_ids: string[]; evidence_event_ids: string[];
original_count: number; original_count: number;
compressed_count: number; compressed_count: number;
campaign_id?: string | null;
};
export type Campaign = {
id: string;
rule_id: string;
title: string;
category: string;
severity: string;
start: string;
end: string;
incident_ids: string[];
event_count: number;
reasons: string[];
};
export type SourceInfo = {
sha256: string;
size_bytes: number;
}; };
export type ParseStats = { export type ParseStats = {
@@ -38,6 +58,8 @@ export type ParseStats = {
truncation_reason?: string | null; truncation_reason?: string | null;
duration_ms: number; duration_ms: number;
issues: ParseIssue[]; issues: ParseIssue[];
issues_truncated?: boolean;
issue_counts?: Record<string, number>;
}; };
export type ParseIssue = { export type ParseIssue = {
@@ -51,5 +73,7 @@ export type Analysis = {
source: string; source: string;
events: EventItem[]; events: EventItem[];
incidents: Incident[]; incidents: Incident[];
campaigns?: Campaign[];
parse?: ParseStats | null; parse?: ParseStats | null;
source_info?: SourceInfo | null;
}; };
+6
View File
@@ -0,0 +1,6 @@
import { redactAnalysis } from "../redact";
import type { Analysis } from "../types";
self.onmessage = (message: MessageEvent<Analysis>) => {
self.postMessage(redactAnalysis(message.data));
};
+194 -6
View File
@@ -1,12 +1,200 @@
import type { Analysis, Incident } from "../types"; import { useState } from "react";
import { statusLabel } from "../app/format"; import type { Analysis, Campaign, Incident } from "../types";
import { formatRange, statusLabel } from "../app/format";
import { analysisIndex } from "../app/indexes";
import type { TimestampDisplay } from "../app/model"; import type { TimestampDisplay } from "../app/model";
import { Icon } from "../components/icons"; import { Icon } from "../components/icons";
import { EmptyState, IncidentCard, MetricCard, WorkspaceHeader } from "../components/states"; import { EmptyState, IncidentCard, MetricCard, WorkspaceHeader } from "../components/states";
export function AnalysisView({ data, timestampDisplay, activeIncidentId, onOpen, onOpenFile, onDemo }: { data: Analysis | null; timestampDisplay: TimestampDisplay; activeIncidentId: string; onOpen: (incident: Incident) => void; onOpenFile: () => void; onDemo: () => void }) { const PAGE_SIZE = 60;
if (!data) return <><WorkspaceHeader eyebrow="Workspace 01" title="Analysis" description="A compact overview of the current event-log reconstruction." /><EmptyState onOpen={onOpenFile} onDemo={onDemo} /></>; const SEVERITY_RANK: Record<string, number> = { critical: 3, error: 2, warning: 1, info: 0 };
const statusDetail = data.parse ? `${data.parse.skipped_records} skipped · ${data.parse.issue_count} parser issue${data.parse.issue_count === 1 ? "" : "s"}` : "Deterministic demo fixture";
function CampaignCard({
campaign,
timestampDisplay,
onOpen,
}: {
campaign: Campaign;
timestampDisplay: TimestampDisplay;
onOpen: () => void;
}) {
const tone =
campaign.severity === "critical" || campaign.severity === "error"
? "high"
: campaign.severity === "warning"
? "medium"
: "info";
return (
<button type="button" className={`incident-card campaign-card severity-${tone}`} onClick={onOpen}>
<div className="incident-card-heading">
<span className="incident-icon">
<Icon name="clock" />
</span>
<strong>{campaign.title}</strong>
<span className="severity-pill">{campaign.incident_ids.length} windows</span>
</div>
<p>{campaign.reasons[0]}</p>
<footer>
<span>{formatRange(campaign.start, campaign.end, timestampDisplay)}</span>
<b>{campaign.event_count.toLocaleString()} events</b>
</footer>
<span className="incident-card-action">
Inspect first window <Icon name="arrow-right" />
</span>
</button>
);
}
export function AnalysisView({
data,
timestampDisplay,
activeIncidentId,
onOpen,
onOpenFile,
onDemo,
}: {
data: Analysis | null;
timestampDisplay: TimestampDisplay;
activeIncidentId: string;
onOpen: (incident: Incident) => void;
onOpenFile: () => void;
onDemo: () => void;
}) {
const [visible, setVisible] = useState(PAGE_SIZE);
if (!data)
return (
<>
<WorkspaceHeader
eyebrow="Workspace 01"
title="Analysis"
description="A compact overview of the current event-log reconstruction."
/>
<EmptyState onOpen={onOpenFile} onDemo={onDemo} />
</>
);
const statusDetail = data.parse
? `${data.parse.skipped_records} skipped · ${data.parse.issue_count} parser issue${data.parse.issue_count === 1 ? "" : "s"}`
: "Deterministic demo fixture";
const sourceMode = data.parse ? "EVTX file" : "Demo fixture"; const sourceMode = data.parse ? "EVTX file" : "Demo fixture";
return <><WorkspaceHeader eyebrow="Workspace 01 · Overview" title="Analysis" description="Understand completeness and incident windows before opening the evidence timeline." /><section className="analysis-summary" aria-label="Analysis summary"><div className={`analysis-status-card status-${data.parse?.status ?? "complete"}`}><span className="eyebrow">Analysis status</span><strong>{statusLabel(data)}</strong><p>{statusDetail}</p></div><div className="metric-grid"><MetricCard icon={<Icon name="file" />} value={data.events.length.toLocaleString()} label="events parsed" /><MetricCard icon={<Icon name="warning" />} value={data.incidents.length} label="incident windows" tone={data.incidents.length ? "amber" : "green"} /><MetricCard icon={<Icon name="clock" />} value={sourceMode} label="source mode" /></div></section><section className="analysis-section"><div className="section-heading"><div><p className="eyebrow">Deterministic reconstruction</p><h2>Incident windows</h2></div><span className="section-count">{data.incidents.length} found</span></div>{data.incidents.length ? <div className="incident-grid">{data.incidents.map((incident) => <IncidentCard key={incident.id} incident={incident} timestampDisplay={timestampDisplay} selected={activeIncidentId === incident.id} onOpen={onOpen} />)}</div> : <div className="quiet-empty"><h3>No incident windows found</h3><p>Warning and error evidence remains available in Timeline and Hunting for manual review.</p></div>}</section>{!data.parse ? <section className="analysis-note analysis-note-demo"><Icon name="info" /><div><strong>How to continue</strong><p>Select an incident to open its linked evidence in Timeline, or use Hunting to search the complete normalized event set.</p></div></section> : null}</>; const campaigns = data.campaigns ?? [];
const index = analysisIndex(data);
// Incidents inside a campaign are summarized by the campaign card; the rest are ranked by severity, then time.
const standalone = data.incidents
.filter((incident) => !incident.campaign_id)
.map((incident, order) => ({ incident, order }))
.sort(
(a, b) =>
(SEVERITY_RANK[b.incident.severity] ?? 0) - (SEVERITY_RANK[a.incident.severity] ?? 0) || a.order - b.order,
)
.map(({ incident }) => incident);
const shown = standalone.slice(0, visible);
return (
<>
<WorkspaceHeader
eyebrow="Workspace 01 · Overview"
title="Analysis"
description="Understand completeness and incident windows before opening the evidence timeline."
/>
<section className="analysis-summary" aria-label="Analysis summary">
<div className={`analysis-status-card status-${data.parse?.status ?? "complete"}`}>
<span className="eyebrow">Analysis status</span>
<strong>{statusLabel(data)}</strong>
<p>{statusDetail}</p>
</div>
<div className="metric-grid">
<MetricCard icon={<Icon name="file" />} value={data.events.length.toLocaleString()} label="events parsed" />
<MetricCard
icon={<Icon name="warning" />}
value={data.incidents.length.toLocaleString()}
label="incident windows"
tone={data.incidents.length ? "amber" : "green"}
/>
<MetricCard
icon={<Icon name="clock" />}
value={campaigns.length.toLocaleString()}
label="recurring campaigns"
/>
<MetricCard icon={<Icon name="clock" />} value={sourceMode} label="source mode" />
</div>
</section>
{campaigns.length ? (
<section className="analysis-section">
<div className="section-heading">
<div>
<p className="eyebrow">Recurring activity</p>
<h2>Campaigns</h2>
</div>
<span className="section-count">{campaigns.length.toLocaleString()} found</span>
</div>
<div className="incident-grid">
{campaigns.map((campaign) => (
<CampaignCard
key={campaign.id}
campaign={campaign}
timestampDisplay={timestampDisplay}
onOpen={() => {
const first = index.incidentById.get(campaign.incident_ids[0]);
if (first) onOpen(first);
}}
/>
))}
</div>
</section>
) : null}
<section className="analysis-section">
<div className="section-heading">
<div>
<p className="eyebrow">Deterministic reconstruction</p>
<h2>Incident windows</h2>
{campaigns.length ? (
<p className="muted-copy">Windows that belong to a campaign are summarized above.</p>
) : null}
</div>
<span className="section-count">{standalone.length.toLocaleString()} found</span>
</div>
{standalone.length ? (
<>
<div className="incident-grid">
{shown.map((incident) => (
<IncidentCard
key={incident.id}
incident={incident}
timestampDisplay={timestampDisplay}
selected={activeIncidentId === incident.id}
onOpen={onOpen}
/>
))}
</div>
{standalone.length > shown.length ? (
<button
type="button"
className="secondary-button show-more"
onClick={() => setVisible((count) => count + PAGE_SIZE)}
>
Show {Math.min(PAGE_SIZE, standalone.length - shown.length)} more of{" "}
{(standalone.length - shown.length).toLocaleString()} remaining
</button>
) : null}
</>
) : (
<div className="quiet-empty">
<h3>{campaigns.length ? "No other incident windows" : "No incident windows found"}</h3>
<p>Warning and error evidence remains available in Timeline and Hunting for manual review.</p>
</div>
)}
</section>
{!data.parse ? (
<section className="analysis-note analysis-note-demo">
<Icon name="info" />
<div>
<strong>How to continue</strong>
<p>
Select an incident to open its linked evidence in Timeline, or use Hunting to search the complete
normalized event set.
</p>
</div>
</section>
) : null}
</>
);
} }
+266 -4
View File
@@ -1,12 +1,274 @@
import { useState } from "react";
import type { Analysis, EventItem, Incident } from "../types"; import type { Analysis, EventItem, Incident } from "../types";
export const HUNTING_PAGE_SIZE = 200;
import { CATEGORIES, LEVELS, WINDOWS, type HuntingState, type InspectorTab, type TimestampDisplay } from "../app/model"; import { CATEGORIES, LEVELS, WINDOWS, type HuntingState, type InspectorTab, type TimestampDisplay } from "../app/model";
import { formatClock, formatDate, levelLabel } from "../app/format"; import { formatClock, formatDate, levelLabel } from "../app/format";
import { Icon } from "../components/icons"; import { Icon } from "../components/icons";
import { EmptyState, WorkspaceHeader } from "../components/states"; import { EmptyState, WorkspaceHeader } from "../components/states";
import { EvidenceInspector } from "../components/timeline"; import { EvidenceInspector } from "../components/timeline";
export function HuntingView({ data, state, providers, results, selected, activeIncident, timestampDisplay, inspectorTab, incidentEventIds, onChange, onReset, onSelectEvent, onMove, onTab, onOpenTimeline, onOpenFile, onDemo }: { data: Analysis | null; state: HuntingState; providers: string[]; results: EventItem[]; selected: EventItem | null; activeIncident: Incident | null; timestampDisplay: TimestampDisplay; inspectorTab: InspectorTab; incidentEventIds: Set<string>; onChange: (patch: Partial<HuntingState>) => void; onReset: () => void; onSelectEvent: (event: EventItem) => void; onMove: (delta: number) => void; onTab: (tab: InspectorTab) => void; onOpenTimeline: () => void; onOpenFile: () => void; onDemo: () => void }) { export function HuntingView({
if (!data) return <><WorkspaceHeader eyebrow="Workspace 03 · Exploration" title="Hunting" description="Search the loaded normalized event set with compact investigative facets." /><EmptyState onOpen={onOpenFile} onDemo={onDemo} /></>; data,
const active = Boolean(state.search || state.eventId || state.provider || state.category || state.level || state.computer || state.windowMinutes || state.incidentOnly); anchorCandidate,
return <><WorkspaceHeader eyebrow="Workspace 03 · Exploration" title="Hunting" description="Combine event, provider, host and severity facets to find evidence without changing the source analysis." /><section className="hunting-query panel"><div className="hunting-query-main"><label className="search-field large"><Icon name="search" /><span className="sr-only">Search hunting evidence</span><input aria-label="Search hunting evidence" value={state.search} onChange={(event) => onChange({ search: event.target.value })} placeholder="Search summaries, fields, paths, IDs or providers…" /></label><span className="result-count" role="status"><strong>{results.length.toLocaleString()}</strong> of {data.events.length.toLocaleString()} matching events</span></div><div className="hunting-facets"><label><span>Event ID</span><input aria-label="Hunting event ID" inputMode="numeric" value={state.eventId} onChange={(event) => onChange({ eventId: event.target.value.replace(/[^0-9]/g, "") })} placeholder="4625" /></label><label><span>Provider</span><select aria-label="Hunting provider" value={state.provider} onChange={(event) => onChange({ provider: event.target.value })}><option value="">All providers</option>{providers.map((provider) => <option key={provider}>{provider}</option>)}</select></label><label><span>Category</span><select aria-label="Hunting category" value={state.category} onChange={(event) => onChange({ category: event.target.value })}><option value="">All categories</option>{CATEGORIES.map((category) => <option key={category}>{category}</option>)}</select></label><label><span>Level</span><select aria-label="Hunting level" value={state.level} onChange={(event) => onChange({ level: event.target.value })}><option value="">All levels</option>{LEVELS.map((level) => <option key={level}>{level}</option>)}</select></label><label><span>Computer / host</span><input aria-label="Hunting computer" value={state.computer} onChange={(event) => onChange({ computer: event.target.value })} placeholder="DEMO-PC" /></label><label><span>Time window</span><select aria-label="Hunting time window" value={state.windowMinutes} onChange={(event) => onChange({ windowMinutes: Number(event.target.value) })} disabled={!selected?.timestamp}><option value={0}>All time</option>{WINDOWS.filter(Boolean).map((value) => <option value={value} key={value}>± {value} min</option>)}</select></label><label className="toggle-control facet-toggle"><input type="checkbox" checked={state.incidentOnly} onChange={(event) => onChange({ incidentOnly: event.target.checked })} /><span className="toggle-track" /><span>Known incident evidence only</span></label><button type="button" className="reset-button" onClick={onReset} disabled={!active}><Icon name="reset" />Reset hunting</button></div></section><section className="hunting-layout"><article className="hunting-results panel"><header className="panel-header"><div><p className="eyebrow">Normalized event set</p><h2>Results</h2></div><span className="panel-count">{results.length.toLocaleString()} found</span></header>{results.length ? <div className="hunting-result-list" role="list">{results.map((event) => <div role="listitem" key={event.id}><button type="button" className={`hunting-result ${selected?.id === event.id ? "active" : ""}`} onClick={() => onSelectEvent(event)}><span className="result-time">{formatDate(event.timestamp, timestampDisplay)}<br />{formatClock(event.timestamp, timestampDisplay)}</span><strong>{event.event_id ?? "—"}</strong><span className="result-main"><b>{event.provider}</b><span>{event.summary}</span></span><span className="result-meta">{event.computer || "—"}<br /><small className={`level-text level-${event.level}`}>{levelLabel(event.level)}</small></span><span className={`membership-dot ${incidentEventIds.has(event.id) ? "known" : ""}`} title={incidentEventIds.has(event.id) ? "Known incident evidence" : "Unlinked event"} aria-label={incidentEventIds.has(event.id) ? "Known incident evidence" : "Unlinked event"} /></button></div>)}</div> : <div className="quiet-empty"><h3>No matching events</h3><p>Try clearing a facet or search the complete normalized dataset.</p>{active ? <button type="button" className="text-button" onClick={onReset}>Reset hunting filters</button> : null}</div>}</article><EvidenceInspector data={data} event={selected} visibleEvents={results} activeIncident={activeIncident} timestampDisplay={timestampDisplay} tab={inspectorTab} onTab={onTab} onSelectEvent={onSelectEvent} onMove={onMove} onOpenTimeline={onOpenTimeline} /></section><p className="hunting-hint"><Icon name="info" /> Results are local normalized evidence. A known-incident marker means the event is linked by an existing deterministic rule; it does not establish causality.</p></>; state,
providers,
results,
selected,
activeIncident,
timestampDisplay,
inspectorTab,
incidentEventIds,
onChange,
onReset,
onSelectEvent,
onMove,
onTab,
onOpenTimeline,
onOpenFile,
onDemo,
}: {
data: Analysis | null;
anchorCandidate: string | null;
state: HuntingState;
providers: string[];
results: EventItem[];
selected: EventItem | null;
activeIncident: Incident | null;
timestampDisplay: TimestampDisplay;
inspectorTab: InspectorTab;
incidentEventIds: Set<string>;
onChange: (patch: Partial<HuntingState>) => void;
onReset: () => void;
onSelectEvent: (event: EventItem) => void;
onMove: (delta: number) => void;
onTab: (tab: InspectorTab) => void;
onOpenTimeline: () => void;
onOpenFile: () => void;
onDemo: () => void;
}) {
// Results are rendered in pages so a broad query over 100,000 events does not create 100,000 DOM rows.
const [page, setPage] = useState({ results, limit: HUNTING_PAGE_SIZE });
const limit = page.results === results ? page.limit : HUNTING_PAGE_SIZE;
if (!data)
return (
<>
<WorkspaceHeader
eyebrow="Workspace 03 · Exploration"
title="Hunting"
description="Search the loaded normalized event set with compact investigative facets."
/>
<EmptyState onOpen={onOpenFile} onDemo={onDemo} />
</>
);
const selectedIndex = selected ? results.indexOf(selected) : -1;
const shown = results.slice(0, Math.max(limit, selectedIndex + 1));
const active = Boolean(
state.search ||
state.eventId ||
state.provider ||
state.category ||
state.level ||
state.computer ||
state.windowMinutes ||
state.incidentOnly,
);
return (
<>
<WorkspaceHeader
eyebrow="Workspace 03 · Exploration"
title="Hunting"
description="Combine event, provider, host and severity facets to find evidence without changing the source analysis."
/>
<section className="hunting-query panel">
<div className="hunting-query-main">
<label className="search-field large">
<Icon name="search" />
<span className="sr-only">Search hunting evidence</span>
<input
aria-label="Search hunting evidence"
value={state.search}
onChange={(event) => onChange({ search: event.target.value })}
placeholder="Search summaries, fields, paths, IDs or providers…"
/>
</label>
<span className="result-count" role="status">
<strong>{results.length.toLocaleString()}</strong> of {data.events.length.toLocaleString()} matching events
</span>
</div>
<div className="hunting-facets">
<label>
<span>Event ID</span>
<input
aria-label="Hunting event ID"
inputMode="numeric"
value={state.eventId}
onChange={(event) => onChange({ eventId: event.target.value.replace(/[^0-9]/g, "") })}
placeholder="4625"
/>
</label>
<label>
<span>Provider</span>
<select
aria-label="Hunting provider"
value={state.provider}
onChange={(event) => onChange({ provider: event.target.value })}
>
<option value="">All providers</option>
{providers.map((provider) => (
<option key={provider}>{provider}</option>
))}
</select>
</label>
<label>
<span>Category</span>
<select
aria-label="Hunting category"
value={state.category}
onChange={(event) => onChange({ category: event.target.value })}
>
<option value="">All categories</option>
{CATEGORIES.map((category) => (
<option key={category}>{category}</option>
))}
</select>
</label>
<label>
<span>Level</span>
<select
aria-label="Hunting level"
value={state.level}
onChange={(event) => onChange({ level: event.target.value })}
>
<option value="">All levels</option>
{LEVELS.map((level) => (
<option key={level}>{level}</option>
))}
</select>
</label>
<label>
<span>Computer / host</span>
<input
aria-label="Hunting computer"
value={state.computer}
onChange={(event) => onChange({ computer: event.target.value })}
placeholder="DEMO-PC"
/>
</label>
<label>
<span>Time window</span>
<select
aria-label="Hunting time window"
value={state.windowMinutes}
onChange={(event) => onChange({ windowMinutes: Number(event.target.value) })}
disabled={!state.windowAnchor && !anchorCandidate}
>
<option value={0}>All time</option>
{WINDOWS.filter(Boolean).map((value) => (
<option value={value} key={value}>
± {value} min
</option>
))}
</select>
</label>
<label className="toggle-control facet-toggle">
<input
type="checkbox"
checked={state.incidentOnly}
onChange={(event) => onChange({ incidentOnly: event.target.checked })}
/>
<span className="toggle-track" />
<span>Known incident evidence only</span>
</label>
<button type="button" className="reset-button" onClick={onReset} disabled={!active}>
<Icon name="reset" />
Reset hunting
</button>
</div>
</section>
<section className="hunting-layout">
<article className="hunting-results panel">
<header className="panel-header">
<div>
<p className="eyebrow">Normalized event set</p>
<h2>Results</h2>
</div>
<span className="panel-count">{results.length.toLocaleString()} found</span>
</header>
{results.length ? (
<>
<div className="hunting-result-list" role="list">
{shown.map((event) => (
<div role="listitem" key={event.id}>
<button
type="button"
className={`hunting-result ${selected?.id === event.id ? "active" : ""}`}
onClick={() => onSelectEvent(event)}
>
<span className="result-time">
{formatDate(event.timestamp, timestampDisplay)}
<br />
{formatClock(event.timestamp, timestampDisplay)}
</span>
<strong>{event.event_id ?? "—"}</strong>
<span className="result-main">
<b>{event.provider}</b>
<span>{event.summary}</span>
</span>
<span className="result-meta">
{event.computer || "—"}
<br />
<small className={`level-text level-${event.level}`}>{levelLabel(event.level)}</small>
</span>
<span
className={`membership-dot ${incidentEventIds.has(event.id) ? "known" : ""}`}
title={incidentEventIds.has(event.id) ? "Known incident evidence" : "Unlinked event"}
aria-label={incidentEventIds.has(event.id) ? "Known incident evidence" : "Unlinked event"}
/>
</button>
</div>
))}
</div>
{results.length > shown.length ? (
<button
type="button"
className="secondary-button show-more"
onClick={() => setPage({ results, limit: shown.length + HUNTING_PAGE_SIZE })}
>
Show {Math.min(HUNTING_PAGE_SIZE, results.length - shown.length).toLocaleString()} more of{" "}
{(results.length - shown.length).toLocaleString()} remaining
</button>
) : null}
</>
) : (
<div className="quiet-empty">
<h3>No matching events</h3>
<p>Try clearing a facet or search the complete normalized dataset.</p>
{active ? (
<button type="button" className="text-button" onClick={onReset}>
Reset hunting filters
</button>
) : null}
</div>
)}
</article>
<EvidenceInspector
data={data}
event={selected}
visibleEvents={results}
activeIncident={activeIncident}
timestampDisplay={timestampDisplay}
tab={inspectorTab}
onTab={onTab}
onSelectEvent={onSelectEvent}
onMove={onMove}
onOpenTimeline={onOpenTimeline}
/>
</section>
<p className="hunting-hint">
<Icon name="info" /> Results are local normalized evidence. A known-incident marker means the event is linked by
an existing deterministic rule; it does not establish causality.
</p>
</>
);
} }
+284 -6
View File
@@ -1,13 +1,291 @@
import { prepareExport } from "../export"; import type { RedactionSummary } from "../redact";
import type { Analysis } from "../types"; import type { Analysis } from "../types";
import { sourceLabel, statusLabel } from "../app/format"; import { formatBytes, sourceLabel, statusLabel } from "../app/format";
import type { TimestampDisplay } from "../app/model"; import type { TimestampDisplay } from "../app/model";
import { Icon } from "../components/icons"; import { Icon } from "../components/icons";
import { EmptyState, WorkspaceHeader } from "../components/states"; import { EmptyState, WorkspaceHeader } from "../components/states";
export function ReportsView({ data, redactExports, redactionPreview, onRedactionChange, onExportJson, onExportMarkdown, timestampDisplay, onOpenFile, onDemo }: { data: Analysis | null; redactExports: boolean; redactionPreview: ReturnType<typeof prepareExport>["redaction"]; onRedactionChange: (value: boolean) => void; onExportJson: () => void; onExportMarkdown: () => void; timestampDisplay: TimestampDisplay; onOpenFile: () => void; onDemo: () => void }) { export function ReportsView({
if (!data) return <><WorkspaceHeader eyebrow="Workspace 04 · Output" title="Reports" description="Review completeness and privacy choices before exporting an investigation." /><EmptyState onOpen={onOpenFile} onDemo={onDemo} /></>; data,
redactExports,
redactionPreview,
redactionPending,
redactionFailed,
exporting,
onRedactionChange,
onExportJson,
onExportMarkdown,
timestampDisplay,
onOpenFile,
onDemo,
}: {
data: Analysis | null;
redactExports: boolean;
redactionPreview: RedactionSummary | null;
redactionPending: boolean;
redactionFailed: boolean;
exporting: boolean;
onRedactionChange: (value: boolean) => void;
onExportJson: () => void;
onExportMarkdown: () => void;
timestampDisplay: TimestampDisplay;
onOpenFile: () => void;
onDemo: () => void;
}) {
if (!data)
return (
<>
<WorkspaceHeader
eyebrow="Workspace 04 · Output"
title="Reports"
description="Review completeness and privacy choices before exporting an investigation."
/>
<EmptyState onOpen={onOpenFile} onDemo={onDemo} />
</>
);
const parse = data.parse; const parse = data.parse;
const readiness = parse?.status === "partial" ? "Review completeness before sharing" : redactExports ? "Ready for review/export" : "Privacy review recommended"; const readiness =
return <><WorkspaceHeader eyebrow="Workspace 04 · Output" title="Reports" description="Review the exact analysis metadata, parser issues and redaction behavior before sharing." /><section className={`export-readiness ${parse?.status === "partial" ? "partial" : redactExports ? "ready" : "caution"}`}><Icon name={parse?.status === "partial" || !redactExports ? "warning" : "export"} /><div><strong>{readiness}</strong><span>{parse?.status === "partial" ? "The parser retained a partial result; incident reconstruction may be incomplete." : redactExports ? "Redaction substitutions are enabled. Review the generated output before sharing." : "Raw normalized evidence will be exported unless redaction is enabled."}</span></div></section><div className="report-grid"><section className="report-card panel"><div className="section-heading"><div><p className="eyebrow">Investigation summary</p><h2>Analysis metadata</h2></div></div><dl className="report-facts"><div><dt>Source</dt><dd title={data.source}>{sourceLabel(data.source)}</dd></div><div><dt>Version</dt><dd>EventLens v{import.meta.env.VITE_EVENTLENS_VERSION ?? "development"}</dd></div><div><dt>Events</dt><dd>{data.events.length.toLocaleString()}</dd></div><div><dt>Incidents</dt><dd>{data.incidents.length}</dd></div><div><dt>Timestamp display</dt><dd>{timestampDisplay === "utc" ? "UTC" : "Local browser time"}</dd></div></dl></section><section className="report-card panel"><div className="section-heading"><div><p className="eyebrow">Completeness</p><h2>Parser status</h2></div><span className={`status-badge status-${parse?.status ?? "demo"}`}>{statusLabel(data)}</span></div><div className="completeness-summary"><strong>{parse ? `${parse.parsed_events.toLocaleString()} retained` : "Demo fixture loaded"}</strong><span>{parse ? `${parse.records_seen.toLocaleString()} records seen · ${parse.skipped_records.toLocaleString()} skipped · ${parse.issue_count.toLocaleString()} issue(s)` : "The bundled demo is deterministic and bypasses raw EVTX parsing."}</span></div>{parse?.truncation_reason ? <p className="warning-copy">Truncation reason: <code>{parse.truncation_reason}</code></p> : null}{parse?.issues.length ? <ul className="issue-list">{parse.issues.map((issue, index) => <li key={`${issue.code}-${index}`}><code>{issue.code}</code><span>{issue.message}</span></li>)}</ul> : <p className="muted-copy">No parser issues were reported.</p>}</section><section className="report-card panel privacy-card"><div className="section-heading"><div><p className="eyebrow">Privacy before sharing</p><h2>Redaction preview</h2></div><label className="toggle-control"><input type="checkbox" checked={redactExports} onChange={(event) => onRedactionChange(event.target.checked)} /><span className="toggle-track" /><span>Redact export</span></label></div><p>Redaction is best effort. It propagates known structured values into summaries and applies conservative patterns; review the exported file before sharing.</p>{redactExports ? <div className="redaction-stats">{([["replacements", redactionPreview?.total ?? 0], ["hosts", redactionPreview?.hosts ?? 0], ["identities", redactionPreview?.identities ?? 0], ["emails", redactionPreview?.emails ?? 0], ["IPs", redactionPreview?.ips ?? 0], ["paths", redactionPreview?.paths ?? 0], ["sources", redactionPreview?.sources ?? 0]] as const).map(([label, value]) => <span key={label}><strong>{value}</strong>{label}</span>)}</div> : <div className="raw-export-warning"><Icon name="warning" /><span>Raw normalized evidence will be exported. Review carefully before sharing.</span></div>}</section><section className="report-card panel export-card"><div className="section-heading"><div><p className="eyebrow">Portable output</p><h2>Export report</h2></div></div><p>JSON preserves the analysis contract. Markdown is formatted for human review. Both include completeness metadata, parser issues and evidence IDs.</p><div className="export-actions"><button type="button" className="primary-button" onClick={onExportMarkdown}><Icon name="export" />Export Markdown</button><button type="button" className="secondary-button" onClick={onExportJson}><Icon name="export" />Export JSON</button></div></section></div></>; parse?.status === "partial"
? "Review completeness before sharing"
: redactExports
? "Ready for review/export"
: "Privacy review recommended";
return (
<>
<WorkspaceHeader
eyebrow="Workspace 04 · Output"
title="Reports"
description="Review the exact analysis metadata, parser issues and redaction behavior before sharing."
/>
<section
className={`export-readiness ${parse?.status === "partial" ? "partial" : redactExports ? "ready" : "caution"}`}
>
<Icon name={parse?.status === "partial" || !redactExports ? "warning" : "export"} />
<div>
<strong>{readiness}</strong>
<span>
{parse?.status === "partial"
? "The parser retained a partial result; incident reconstruction may be incomplete."
: redactExports
? "Redaction substitutions are enabled. Review the generated output before sharing."
: "Raw normalized evidence will be exported unless redaction is enabled."}
</span>
</div>
</section>
<div className="report-grid">
<section className="report-card panel">
<div className="section-heading">
<div>
<p className="eyebrow">Investigation summary</p>
<h2>Analysis metadata</h2>
</div>
</div>
<dl className="report-facts">
<div>
<dt>Source</dt>
<dd title={data.source}>{sourceLabel(data.source)}</dd>
</div>
<div>
<dt>Version</dt>
<dd>EventLens v{import.meta.env.VITE_EVENTLENS_VERSION ?? "development"}</dd>
</div>
<div>
<dt>Events</dt>
<dd>{data.events.length.toLocaleString()}</dd>
</div>
<div>
<dt>Incidents</dt>
<dd>{data.incidents.length.toLocaleString()}</dd>
</div>
<div>
<dt>Campaigns</dt>
<dd>{(data.campaigns ?? []).length.toLocaleString()}</dd>
</div>
{data.source_info ? (
<div className="source-hash">
<dt>Source SHA-256</dt>
<dd>
<code title="SHA-256 of the uploaded bytes, computed in memory before parsing">
{data.source_info.sha256}
</code>
<small>{formatBytes(data.source_info.size_bytes)}</small>
</dd>
</div>
) : (
<div>
<dt>Source integrity</dt>
<dd>Demo fixture — no uploaded bytes</dd>
</div>
)}
<div>
<dt>Timestamp display</dt>
<dd>{timestampDisplay === "utc" ? "UTC" : "Local browser time"}</dd>
</div>
</dl>
</section>
<section className="report-card panel">
<div className="section-heading">
<div>
<p className="eyebrow">Completeness</p>
<h2>Parser status</h2>
</div>
<span className={`status-badge status-${parse?.status ?? "demo"}`}>{statusLabel(data)}</span>
</div>
<div className="completeness-summary">
<strong>{parse ? `${parse.parsed_events.toLocaleString()} retained` : "Demo fixture loaded"}</strong>
<span>
{parse
? `${parse.records_seen.toLocaleString()} records seen · ${parse.skipped_records.toLocaleString()} skipped · ${parse.issue_count.toLocaleString()} issue(s)`
: "The bundled demo is deterministic and bypasses raw EVTX parsing."}
</span>
</div>
{parse?.truncation_reason ? (
<p className="warning-copy">
Truncation reason: <code>{parse.truncation_reason}</code>
</p>
) : null}
{parse && Object.keys(parse.issue_counts ?? {}).length ? (
<div className="issue-counts">
{Object.entries(parse.issue_counts ?? {}).map(([code, count]) => (
<span key={code}>
<code>{code}</code>
<strong>{count.toLocaleString()}</strong>
</span>
))}
</div>
) : null}
{parse?.issues.length ? (
<ul className="issue-list">
{parse.issues.map((issue, index) => (
<li key={`${issue.code}-${index}`}>
<code>{issue.code}</code>
<span>{issue.message}</span>
</li>
))}
</ul>
) : (
<p className="muted-copy">No parser issues were reported.</p>
)}
{parse?.issues_truncated ? (
<p className="muted-copy">
Showing the first {parse.issues.length.toLocaleString()} of {parse.issue_count.toLocaleString()} issues;
the counts above include all of them.
</p>
) : null}
</section>
<section className="report-card panel privacy-card">
<div className="section-heading">
<div>
<p className="eyebrow">Privacy before sharing</p>
<h2>Redaction preview</h2>
</div>
<label className="toggle-control">
<input
type="checkbox"
checked={redactExports}
onChange={(event) => onRedactionChange(event.target.checked)}
/>
<span className="toggle-track" />
<span>Redact export</span>
</label>
</div>
<p>
Redaction is best effort. It propagates known structured values into summaries and applies conservative
patterns; review the exported file before sharing.
</p>
{redactExports && redactionFailed ? (
<div className="raw-export-warning" role="alert">
<Icon name="warning" />
<span>
The redaction preview could not be computed. Exports stay blocked from raw fallback; retry or disable
redaction deliberately.
</span>
</div>
) : redactExports && redactionPending ? (
<div className="redaction-pending" role="status">
<span className="loading-spinner" aria-hidden="true" />
Preparing redaction preview in the background…
</div>
) : redactExports ? (
<>
<div className="redaction-stats">
{(
[
["replacements", redactionPreview?.total ?? 0],
["hosts", redactionPreview?.hosts ?? 0],
["identities", redactionPreview?.identities ?? 0],
["emails", redactionPreview?.emails ?? 0],
["IPs", redactionPreview?.ips ?? 0],
["paths", redactionPreview?.paths ?? 0],
["domains", redactionPreview?.domains ?? 0],
["sources", redactionPreview?.sources ?? 0],
] as const
).map(([label, value]) => (
<span key={label}>
<strong>{value.toLocaleString()}</strong>
{label}
</span>
))}
</div>
<p className="muted-copy">
Values become consistent pseudonyms such as <code>[REDACTED_HOST_1]</code>, so relationships stay
readable without exposing the original.
</p>
{redactionPreview?.untouchedFieldKeys.length ? (
<details className="untouched-fields">
<summary>
{redactionPreview.untouchedFieldKeys.length} field name(s) exported without masking — review these
</summary>
<ul>
{redactionPreview.untouchedFieldKeys.map((key) => (
<li key={key}>
<code>{key}</code>
</li>
))}
</ul>
</details>
) : null}
</>
) : (
<div className="raw-export-warning">
<Icon name="warning" />
<span>Raw normalized evidence will be exported. Review carefully before sharing.</span>
</div>
)}
</section>
<section className="report-card panel export-card">
<div className="section-heading">
<div>
<p className="eyebrow">Portable output</p>
<h2>Export report</h2>
</div>
</div>
<p>
JSON preserves the analysis contract. Markdown is formatted for human review. Both include completeness
metadata, parser issues and evidence IDs.
</p>
<div className="export-actions">
<button
type="button"
className="primary-button"
onClick={onExportMarkdown}
disabled={exporting || (redactExports && redactionFailed)}
>
<Icon name="export" />
{exporting ? "Preparing…" : "Export Markdown"}
</button>
<button
type="button"
className="secondary-button"
onClick={onExportJson}
disabled={exporting || (redactExports && redactionFailed)}
>
<Icon name="export" />
Export JSON
</button>
</div>
</section>
</div>
</>
);
} }
+85 -15
View File
@@ -33,11 +33,25 @@ function OptionCard({ checked, description, name, onChange, title }: OptionCardP
); );
} }
export function SettingsView({ settings, saveNotice, storageFailed, storageConfirmed, onChange, onReset }: SettingsViewProps) { export function SettingsView({
settings,
saveNotice,
storageFailed,
storageConfirmed,
onChange,
onReset,
}: SettingsViewProps) {
const headerAction = ( const headerAction = (
<div className="settings-header-status"> <div className="settings-header-status">
{storageConfirmed && !storageFailed ? <span className="settings-saved-automatically"><Icon name="check" />Saved automatically in this browser</span> : null} {storageConfirmed && !storageFailed ? (
<span className="settings-save-feedback" role="status" aria-live="polite">{saveNotice}</span> <span className="settings-saved-automatically">
<Icon name="check" />
Saved automatically in this browser
</span>
) : null}
<span className="settings-save-feedback" role="status" aria-live="polite">
{saveNotice}
</span>
</div> </div>
); );
@@ -62,15 +76,39 @@ export function SettingsView({ settings, saveNotice, storageFailed, storageConfi
<fieldset> <fieldset>
<legend>Timestamp display</legend> <legend>Timestamp display</legend>
<div className="preference-option-grid"> <div className="preference-option-grid">
<OptionCard name="timestamp-display" title="UTC" description="Stable forensic reference time" checked={settings.timestampDisplay === "utc"} onChange={() => onChange({ timestampDisplay: "utc" })} /> <OptionCard
<OptionCard name="timestamp-display" title="Local browser time" description="Useful for local investigation context" checked={settings.timestampDisplay === "local"} onChange={() => onChange({ timestampDisplay: "local" })} /> name="timestamp-display"
title="UTC"
description="Stable forensic reference time"
checked={settings.timestampDisplay === "utc"}
onChange={() => onChange({ timestampDisplay: "utc" })}
/>
<OptionCard
name="timestamp-display"
title="Local browser time"
description="Useful for local investigation context"
checked={settings.timestampDisplay === "local"}
onChange={() => onChange({ timestampDisplay: "local" })}
/>
</div> </div>
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>Interface density</legend> <legend>Interface density</legend>
<div className="preference-option-grid"> <div className="preference-option-grid">
<OptionCard name="density" title="Comfortable" description="More breathing room for review" checked={settings.density === "comfortable"} onChange={() => onChange({ density: "comfortable" })} /> <OptionCard
<OptionCard name="density" title="Compact" description="More evidence visible at once" checked={settings.density === "compact"} onChange={() => onChange({ density: "compact" })} /> name="density"
title="Comfortable"
description="More breathing room for review"
checked={settings.density === "comfortable"}
onChange={() => onChange({ density: "comfortable" })}
/>
<OptionCard
name="density"
title="Compact"
description="More evidence visible at once"
checked={settings.density === "compact"}
onChange={() => onChange({ density: "compact" })}
/>
</div> </div>
</fieldset> </fieldset>
</section> </section>
@@ -89,7 +127,11 @@ export function SettingsView({ settings, saveNotice, storageFailed, storageConfi
<strong>Informational noise</strong> <strong>Informational noise</strong>
<small>Hide routine informational events by default and update the current Timeline filter.</small> <small>Hide routine informational events by default and update the current Timeline filter.</small>
</span> </span>
<select aria-label="Default noise mode" value={settings.defaultNoise} onChange={(event) => onChange({ defaultNoise: event.target.value as UiSettings["defaultNoise"] })}> <select
aria-label="Default noise mode"
value={settings.defaultNoise}
onChange={(event) => onChange({ defaultNoise: event.target.value as UiSettings["defaultNoise"] })}
>
<option value="attention">Hide by default</option> <option value="attention">Hide by default</option>
<option value="all">Show by default</option> <option value="all">Show by default</option>
</select> </select>
@@ -99,8 +141,18 @@ export function SettingsView({ settings, saveNotice, storageFailed, storageConfi
<strong>Default workspace</strong> <strong>Default workspace</strong>
<small>Workspace opened when EventLens starts without a deep link.</small> <small>Workspace opened when EventLens starts without a deep link.</small>
</span> </span>
<select aria-label="Default workspace" value={settings.defaultWorkspace} onChange={(event) => onChange({ defaultWorkspace: event.target.value as UiSettings["defaultWorkspace"] })}> <select
{WORKSPACES.map((workspace) => <option key={workspace} value={workspace}>{workspace[0].toUpperCase() + workspace.slice(1)}</option>)} aria-label="Default workspace"
value={settings.defaultWorkspace}
onChange={(event) =>
onChange({ defaultWorkspace: event.target.value as UiSettings["defaultWorkspace"] })
}
>
{WORKSPACES.map((workspace) => (
<option key={workspace} value={workspace}>
{workspace[0].toUpperCase() + workspace.slice(1)}
</option>
))}
</select> </select>
</label> </label>
<label className="preference-row preference-switch-row"> <label className="preference-row preference-switch-row">
@@ -109,8 +161,17 @@ export function SettingsView({ settings, saveNotice, storageFailed, storageConfi
<small>Recommended · Redaction remains best effort and should be reviewed.</small> <small>Recommended · Redaction remains best effort and should be reviewed.</small>
</span> </span>
<span className="preference-switch"> <span className="preference-switch">
<input className="sr-only" type="checkbox" role="switch" aria-label="Export redaction by default" checked={settings.defaultRedaction} onChange={(event) => onChange({ defaultRedaction: event.target.checked })} /> <input
<span className="preference-switch-track" aria-hidden="true"><span /></span> className="sr-only"
type="checkbox"
role="switch"
aria-label="Export redaction by default"
checked={settings.defaultRedaction}
onChange={(event) => onChange({ defaultRedaction: event.target.checked })}
/>
<span className="preference-switch-track" aria-hidden="true">
<span />
</span>
<b aria-hidden="true">{settings.defaultRedaction ? "On" : "Off"}</b> <b aria-hidden="true">{settings.defaultRedaction ? "On" : "Off"}</b>
</span> </span>
</label> </label>
@@ -126,7 +187,11 @@ export function SettingsView({ settings, saveNotice, storageFailed, storageConfi
<h2 id="local-privacy-heading">Local data & privacy</h2> <h2 id="local-privacy-heading">Local data & privacy</h2>
</div> </div>
</header> </header>
<p className="privacy-lead">{storageFailed ? "Preferences are available for this session only because browser storage is unavailable." : "Only your interface preferences remain in this browser."}</p> <p className="privacy-lead">
{storageFailed
? "Preferences are available for this session only because browser storage is unavailable."
: "Only your interface preferences remain in this browser."}
</p>
<div className="privacy-facts"> <div className="privacy-facts">
<section> <section>
<strong>{storageFailed ? "Not saved to browser storage" : "Stored locally"}</strong> <strong>{storageFailed ? "Not saved to browser storage" : "Stored locally"}</strong>
@@ -144,11 +209,16 @@ export function SettingsView({ settings, saveNotice, storageFailed, storageConfi
</div> </div>
<details className="settings-technical-details"> <details className="settings-technical-details">
<summary>Technical details</summary> <summary>Technical details</summary>
<p>{storageFailed ? "When browser storage is available, preferences use this validated record:" : "The browser uses one validated preference record:"}</p> <p>
{storageFailed
? "When browser storage is available, preferences use this validated record:"
: "The browser uses one validated preference record:"}
</p>
<code>eventlens.preferences.v1</code> <code>eventlens.preferences.v1</code>
</details> </details>
<button type="button" className="secondary-button settings-reset" onClick={onReset}> <button type="button" className="secondary-button settings-reset" onClick={onReset}>
<Icon name="reset" />Reset all preferences <Icon name="reset" />
Reset all preferences
</button> </button>
</aside> </aside>
</div> </div>
+104 -3
View File
@@ -3,7 +3,108 @@ import type { FilterState, InspectorTab, TimestampDisplay } from "../app/model";
import { EmptyState, WorkspaceHeader } from "../components/states"; import { EmptyState, WorkspaceHeader } from "../components/states";
import { EvidenceInspector, FilterToolbar, IncidentContext, TimelinePanel } from "../components/timeline"; import { EvidenceInspector, FilterToolbar, IncidentContext, TimelinePanel } from "../components/timeline";
export function TimelineView({ data, filters, providers, visibleEvents, selected, activeIncident, activeIncidentId, focusIncident, timestampDisplay, rowHeight, inspectorTab, onFilterChange, onResetFilters, onFocusChange, onSelectIncident, onSelectEvent, onMove, onTab, onOpenFile, onDemo }: { data: Analysis | null; filters: FilterState; providers: string[]; visibleEvents: EventItem[]; selected: EventItem | null; activeIncident: Incident | null; activeIncidentId: string; focusIncident: boolean; timestampDisplay: TimestampDisplay; rowHeight: number; inspectorTab: InspectorTab; onFilterChange: (patch: Partial<FilterState>) => void; onResetFilters: () => void; onFocusChange: (value: boolean) => void; onSelectIncident: (id: string) => void; onSelectEvent: (event: EventItem) => void; onMove: (delta: number) => void; onTab: (tab: InspectorTab) => void; onOpenFile: () => void; onDemo: () => void }) { export function TimelineView({
if (!data) return <><WorkspaceHeader eyebrow="Workspace 02 · Investigation" title="Timeline" description="Search and inspect normalized evidence in chronological context." /><EmptyState onOpen={onOpenFile} onDemo={onDemo} /></>; data,
return <><WorkspaceHeader eyebrow="Workspace 02 · Investigation" title="Timeline" description="The primary forensic workspace for event sequence, incident evidence and normalized details." /><IncidentContext incidents={data.incidents} activeIncidentId={activeIncidentId} focusIncident={focusIncident} onSelect={onSelectIncident} onFocus={onFocusChange} /><FilterToolbar filters={filters} providers={providers} visibleCount={visibleEvents.length} totalCount={data.events.length} anchorTimestamp={selected?.timestamp ?? activeIncident?.start ?? null} activeIncident={activeIncident} focusIncident={focusIncident} onFocusChange={onFocusChange} onChange={onFilterChange} onReset={onResetFilters} /><section className="timeline-layout"><TimelinePanel events={visibleEvents} selectedId={selected?.id ?? null} rowHeight={rowHeight} timestampDisplay={timestampDisplay} onSelect={onSelectEvent} /><EvidenceInspector data={data} event={selected} visibleEvents={visibleEvents} activeIncident={activeIncident} timestampDisplay={timestampDisplay} tab={inspectorTab} onTab={onTab} onSelectEvent={onSelectEvent} onMove={onMove} /></section></>; anchorCandidate,
filters,
providers,
visibleEvents,
selected,
activeIncident,
activeIncidentId,
focusIncident,
timestampDisplay,
rowHeight,
inspectorTab,
onFilterChange,
onResetFilters,
onFocusChange,
onSelectIncident,
onSelectEvent,
onMove,
onTab,
onOpenFile,
onDemo,
}: {
data: Analysis | null;
anchorCandidate: string | null;
filters: FilterState;
providers: string[];
visibleEvents: EventItem[];
selected: EventItem | null;
activeIncident: Incident | null;
activeIncidentId: string;
focusIncident: boolean;
timestampDisplay: TimestampDisplay;
rowHeight: number;
inspectorTab: InspectorTab;
onFilterChange: (patch: Partial<FilterState>) => void;
onResetFilters: () => void;
onFocusChange: (value: boolean) => void;
onSelectIncident: (id: string) => void;
onSelectEvent: (event: EventItem) => void;
onMove: (delta: number) => void;
onTab: (tab: InspectorTab) => void;
onOpenFile: () => void;
onDemo: () => void;
}) {
if (!data)
return (
<>
<WorkspaceHeader
eyebrow="Workspace 02 · Investigation"
title="Timeline"
description="Search and inspect normalized evidence in chronological context."
/>
<EmptyState onOpen={onOpenFile} onDemo={onDemo} />
</>
);
return (
<>
<WorkspaceHeader
eyebrow="Workspace 02 · Investigation"
title="Timeline"
description="The primary forensic workspace for event sequence, incident evidence and normalized details."
/>
<IncidentContext
incidents={data.incidents}
activeIncidentId={activeIncidentId}
focusIncident={focusIncident}
onSelect={onSelectIncident}
onFocus={onFocusChange}
/>
<FilterToolbar
filters={filters}
providers={providers}
visibleCount={visibleEvents.length}
totalCount={data.events.length}
anchorTimestamp={filters.windowAnchor ?? anchorCandidate}
activeIncident={activeIncident}
focusIncident={focusIncident}
onFocusChange={onFocusChange}
onChange={onFilterChange}
onReset={onResetFilters}
/>
<section className="timeline-layout">
<TimelinePanel
events={visibleEvents}
selectedId={selected?.id ?? null}
rowHeight={rowHeight}
timestampDisplay={timestampDisplay}
onSelect={onSelectEvent}
/>
<EvidenceInspector
data={data}
event={selected}
visibleEvents={visibleEvents}
activeIncident={activeIncident}
timestampDisplay={timestampDisplay}
tab={inspectorTab}
onTab={onTab}
onSelectEvent={onSelectEvent}
onMove={onMove}
/>
</section>
</>
);
} }
+3
View File
@@ -6,6 +6,9 @@ import { fileURLToPath } from "node:url";
const version = readFileSync(resolve(fileURLToPath(new URL(".", import.meta.url)), "../VERSION"), "utf-8").trim(); const version = readFileSync(resolve(fileURLToPath(new URL(".", import.meta.url)), "../VERSION"), "utf-8").trim();
export default defineConfig({ export default defineConfig({
worker: {
format: "es",
},
define: { define: {
"import.meta.env.VITE_EVENTLENS_VERSION": JSON.stringify(version), "import.meta.env.VITE_EVENTLENS_VERSION": JSON.stringify(version),
}, },
+14 -1
View File
@@ -4,5 +4,18 @@
{"id":"e3","timestamp":"2026-09-09T08:32:07Z","provider":"Service Control Manager","event_id":7031,"level":"Error","channel":"System","computer":"DEMO-PC","category":"service","summary":"Example Sync Service terminated unexpectedly","fields":{"service":"Example Sync Service"}}, {"id":"e3","timestamp":"2026-09-09T08:32:07Z","provider":"Service Control Manager","event_id":7031,"level":"Error","channel":"System","computer":"DEMO-PC","category":"service","summary":"Example Sync Service terminated unexpectedly","fields":{"service":"Example Sync Service"}},
{"id":"e4","timestamp":"2026-09-09T08:32:11Z","provider":"Microsoft-Windows-DNS-Client","event_id":1014,"level":"Warning","channel":"System","computer":"DEMO-PC","category":"network","summary":"DNS name resolution timed out","fields":{"query":"api.example.test"}}, {"id":"e4","timestamp":"2026-09-09T08:32:11Z","provider":"Microsoft-Windows-DNS-Client","event_id":1014,"level":"Warning","channel":"System","computer":"DEMO-PC","category":"network","summary":"DNS name resolution timed out","fields":{"query":"api.example.test"}},
{"id":"e5","timestamp":"2026-09-09T08:34:54Z","provider":"Application Error","event_id":1000,"level":"Error","channel":"Application","computer":"DEMO-PC","category":"crash","summary":"ExampleApp.exe crashed","fields":{"process":"ExampleApp.exe","module":"example.dll","exception":"0xc0000005"}}, {"id":"e5","timestamp":"2026-09-09T08:34:54Z","provider":"Application Error","event_id":1000,"level":"Error","channel":"Application","computer":"DEMO-PC","category":"crash","summary":"ExampleApp.exe crashed","fields":{"process":"ExampleApp.exe","module":"example.dll","exception":"0xc0000005"}},
{"id":"e6","timestamp":"2026-09-09T08:35:02Z","provider":"Windows Error Reporting","event_id":1001,"level":"Information","channel":"Application","computer":"DEMO-PC","category":"crash","summary":"Crash report created for ExampleApp.exe","fields":{"process":"ExampleApp.exe"}} {"id":"e6","timestamp":"2026-09-09T08:35:02Z","provider":"Windows Error Reporting","event_id":1001,"level":"Information","channel":"Application","computer":"DEMO-PC","category":"crash","summary":"Crash report created for ExampleApp.exe","fields":{"process":"ExampleApp.exe"}},
{"id":"e7","timestamp":"2026-09-09T08:41:05Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for svc-backup","fields":{"EventData.TargetUserName":"svc-backup","EventData.IpAddress":"192.0.2.50","EventData.LogonType":"3","EventData.Status":"0xc000006d"},"outcome":"failure"},
{"id":"e8","timestamp":"2026-09-09T08:41:31Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for svc-backup","fields":{"EventData.TargetUserName":"svc-backup","EventData.IpAddress":"192.0.2.50","EventData.LogonType":"3","EventData.Status":"0xc000006d"},"outcome":"failure"},
{"id":"e9","timestamp":"2026-09-09T08:41:58Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for svc-backup","fields":{"EventData.TargetUserName":"svc-backup","EventData.IpAddress":"192.0.2.50","EventData.LogonType":"3","EventData.Status":"0xc000006d"},"outcome":"failure"},
{"id":"e10","timestamp":"2026-09-09T08:42:20Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for svc-backup","fields":{"EventData.TargetUserName":"svc-backup","EventData.IpAddress":"192.0.2.50","EventData.LogonType":"3","EventData.Status":"0xc000006d"},"outcome":"failure"},
{"id":"e19","timestamp":"2026-09-09T08:43:30Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for svc-backup","fields":{"EventData.TargetUserName":"svc-backup","EventData.IpAddress":"192.0.2.50","EventData.LogonType":"3","EventData.Status":"0xc000006d"},"outcome":"failure"},
{"id":"e11","timestamp":"2026-09-09T08:43:45Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4740,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Account locked out: svc-backup","fields":{"EventData.TargetUserName":"svc-backup","EventData.TargetDomainName":"DEMO-PC"},"outcome":"success"},
{"id":"e12","timestamp":"2026-09-09T08:44:02Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for admin","fields":{"EventData.TargetUserName":"admin","EventData.IpAddress":"192.0.2.77","EventData.LogonType":"3","EventData.Status":"0xc000006a"},"outcome":"failure"},
{"id":"e13","timestamp":"2026-09-09T08:44:09Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for guest","fields":{"EventData.TargetUserName":"guest","EventData.IpAddress":"192.0.2.77","EventData.LogonType":"3","EventData.Status":"0xc000006a"},"outcome":"failure"},
{"id":"e14","timestamp":"2026-09-09T08:44:15Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4625,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"authentication","summary":"Failed sign-in for operator","fields":{"EventData.TargetUserName":"operator","EventData.IpAddress":"192.0.2.77","EventData.LogonType":"3","EventData.Status":"0xc000006a"},"outcome":"failure"},
{"id":"e15","timestamp":"2026-09-09T08:47:30Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4720,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"security","summary":"User account created: helpdesk2","fields":{"EventData.TargetUserName":"helpdesk2","EventData.SubjectUserName":"admin"},"outcome":"success"},
{"id":"e16","timestamp":"2026-09-09T08:47:52Z","provider":"Microsoft-Windows-Security-Auditing","event_id":4732,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"security","summary":"Member added to security group Administrators","fields":{"EventData.TargetUserName":"Administrators","EventData.MemberName":"helpdesk2","EventData.SubjectUserName":"admin"},"outcome":"success"},
{"id":"e17","timestamp":"2026-09-09T08:49:10Z","provider":"Service Control Manager","event_id":7045,"level":"Information","channel":"System","computer":"DEMO-PC","category":"service","summary":"Service installed: Remote Helper","fields":{"EventData.ServiceName":"Remote Helper","EventData.ImagePath":"C:\\ProgramData\\RemoteHelper\\rhelper.exe","EventData.StartType":"auto start"}},
{"id":"e18","timestamp":"2026-09-09T08:52:44Z","provider":"Microsoft-Windows-Eventlog","event_id":1102,"level":"Information","channel":"Security","computer":"DEMO-PC","category":"security","summary":"Security audit log cleared","fields":{"UserData.LogFileCleared.SubjectUserName":"admin"},"outcome":"success"}
] ]