Repository navigation
EDR 8: analyst role, incidents, ATT&CK coverage, Entra ID sign-in, Essential Eight and ISM - #69
Conversation
Analyst role: admin, analyst, viewer. Each route file declares its routes and permission; http/permissions.zig gates every request before a handler runs, and a test checks every route against the matrix for each role. Analysts triage, run hunts, request response actions (destructive ones can wait for admin approval, a tenant setting) and add exceptions with a reason. Incidents (migration 0008, row-level security): alerts group by the target-edr section 8 rules within 4 hours, using process.entity_id lineage from process_entities. Risk is the section 7 noisy-OR with every evidence item and its points stored. List, view, assign and status endpoints, plus alert acknowledge and resolve. ATT&CK coverage: rules/attack/coverage.yaml and a vendored subset of ATT&CK Enterprise 20.1. GET /api/attack/coverage reports telemetry, detection and response separately. Entra ID: OIDC code flow with PKCE, state, nonce and verifier in oauth_states, ID token verified with the RS256 code in crypto/jwt.zig (iss, aud, exp, nbf, nonce, tid). Users match on tid and oid; groups map to roles; no group, no account. Tenant setting limits password sign-in to break-glass admins. Client secret encrypted with TAWNY_INTEGRATION_ENCRYPTION_KEY. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Incidents go to Tawny-SOC through its existing POST /api/ingest/tawny as an alert with a stable id and the risk breakdown. Tawny-SOC's app/api/v1/cases is read-only (GET list and GET by id), so Tawny does not create cases itself. Detection queues one update per incident (30 s debounce); assign and status changes queue another. Contract suite: an analyst and a viewer against live routes, the analyst approval flow, the Office to PowerShell chain as one incident with its score, the three ATT&CK states, and Entra ID sign-in against a mock OIDC provider that signs RS256 tokens with a key from openssl genrsa at start-up (TAWNY_OIDC_ALLOW_LOOPBACK lets the server reach it on 127.0.0.1). Also: action result route pattern matches /api/agents/actions/:id/result, admins can mark break-glass users, the bootstrap admin is break-glass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Incidents list with status filter. Incident page: risk breakdown with each item's points, ATT&CK techniques, alert timeline with triage, and the process tree (opened at the lineage root) and response panel per agent. ATT&CK matrix by tactic, filterable by platform, showing telemetry, detection and response as three separate marks. Analysts get triage, response and exception controls; admins approve queued actions. Sign-in page offers Entra ID when configured and says when passwords are break-glass only. Assets renamed to new hashes since they are served as immutable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/entra-sso.md: app registration, groups claim, Tawny settings, break-glass admins, secret rotation and the mock provider used in tests. docs/api.md: the role and permission matrix per route, tenant settings, incidents, alert triage and the ATT&CK coverage endpoint. docs/compliance/essential-eight.md: per strategy, what Tawny shows and what it does not. Tawny is not application control, a patch scanner or an MFA product. docs/compliance/ism.md: Tawny features against September 2026 ISM controls. Every ID was checked on the cyber.gov.au 2026-09 pages and in ASD OSCAL v2026.09.4; none is left unchecked. Log retention (ISM-1988) is only partly met: raw telemetry is kept 30 days in the database. target-edr: status for sections 6, 7, 8, 11 and 12, and new 12.1 to 12.3 for the analyst role, Entra ID and compliance. Contract suite: admin writes retry past a full rate-limit window. Closes #60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Status: all 11 CI checks pass on Not built here: the §11 exceptions rework, the lineage graph, and the optional per-agent compliance report. Decisions for Justin:
All 30 ISM IDs were checked against the September 2026 ISM (OSCAL Stacked on #68. It's independent of #59 (agent only), so they can merge in either order after #68. |
Stacked on #68; independent of #59 (agent-only), merge either order.
Closes #60. Covers the server side of EDR 8: an analyst role enforced on every route, incident grouping with an explained risk score, ATT&CK coverage, Entra ID sign-in, a Tawny-SOC incident sink, UI, and Essential Eight and ISM docs.
Acceptance criteria
routes/oidc.zig: code flow with PKCE; state, nonce and verifier inoauth_states; RS256 viacrypto/jwt.zig;iss,aud,exp,nbf,nonce,tidchecked; users matched ontidandoid; no mapped group means refused. Client secret encrypted withTAWNY_INTEGRATION_ENCRYPTION_KEY.contract-tests/mock_oidc.pysigns RS256 tokens with a key fromopenssl genrsamade at start-up. Tenant settingpassword_login: break_glass. See the note under Checks.analystrole enforced on every route, with testspub const routeswith a permission.http/permissions.ziggates every request before its handler runs; undeclared routes get 404. Its test checks all 83 routes for admin, analyst, viewer, anonymous and agent, and fails if a declared route is missing from the matrix. The contract suite repeats 22 of them against the live server. Matrix indocs/api.md. Destructive actions from an analyst can wait for admin approval (tenant setting).incidentsandincident_alertswith RLS. The three §8 rules apply within 4 h, usingprocess.entity_idlineage. Noisy-OR score with every item and its points. The Office > PowerShell fixture gives one incident in DB tests and the contract suite. Tawny-SOC: partial, see below.rules/attack/coverage.yamlplus an ATT&CK Enterprise 20.1 subset (rules/attack/techniques.json, source sha256 recorded,subset.pyregenerates it).GET /api/attack/coverageworks out telemetry, detection and response on their own; tests cover each combination. UI matrix at/attackwith a platform filter.Tawny-SOC: decision for Justin
I read Tawny-SOC at
fea2da8.app/api/v1/caseshas GET only (route.tslists cases,[id]/route.tsgets one). Nothing creates or updates a case. So Tawny sends each incident through the existingPOST /api/ingest/tawnyas one alert with a stablealert_id, plus anincidentobject holding the risk, items, techniques, agents and a link (sinks/tawny_soc.zig,jobs/incident_sink.zig, 30 s debounce). Tawny-SOC opens the case. Tawny does no case management.Tawny-SOC stores ingested alerts with
onConflictDoNothing, so later status or owner changes do not update the stored alert. To get real case create and update you need one of these in Tawny-SOC:POST /api/v1/casesendpoint (with an upsert by external id), oringestTawnyforkind: "incident"alerts.ISM IDs
All 30 IDs cited were checked against the September 2026 ISM, in two places: the cyber.gov.au
/ism/2026-09/guidelines-*pages, and ASD OSCAL releasev2026.09.4. None was left blank or unchecked, so there is no issue comment. ISM-1988 (12 months searchable retention) is only partly met, because raw telemetry is purged after 30 days. ISM-1650, ISM-1660 and ISM-1683 are marked not supported.Other notes and decisions
TAWNY_OIDC_ALLOW_LOOPBACK=1lets the server reach the mock provider overhttp://127.0.0.1. CI sets it for the server job only; it must never be set in production. Without it, provider endpoints must be https to a public host./api/agents/actions/{id}/resultis declared in the gate too. My first table had the wrong pattern, and contract run 1 caught it./assets/is served as immutable for a year.Checks run
zig test src/main.zig -lc: All 180 tests passed, noSafeAllocatorlines (baseline was 158).zig test src/main.zig -lc --test-filter fuzz: All 2 tests passed.zig build -Doptimize=ReleaseSafe: built./tmp/run-contract.sh(run twice, the limit):tid/oidmatch and every refusal case passed. It then hit the web-admin-mutate limit (30 per minute) while creating a user for the break-glass section. I removed that extra call and made the retry wait out a full window. That last fix has not been run locally, because I had used both runs; CI will run it. The break-glass rule itself also has unit tests.node --checkandnode ci/ui-fallback.mjspassed (14 routes)./tmp/yamlcheck.sh .github/workflows/*.yml: yaml ok.🤖 Generated with Claude Code