Remediation domain model
The Remediation domain is intended to own remediation plans, task decisions, and the deduplicated execution of security actions. It turns an investigation run’s intent into concrete, policy-gated, and deduplicated action executions while keeping an authoritative audit of every decision and attempt.
The service is owned by soc-team.
This is a target domain. The repository currently contains a typed contract package and provisioned infrastructure, not a running bounded-context application. There are implemented contracts (strict Pydantic snapshots, CloudEvent commands, and events) and a separate, richer target design. Throughout this page the implemented contract is kept rigorously separate from the target design; target behavior is never presented as implemented runtime.
Ubiquitous language
| Term | Meaning in this domain |
|---|---|
| RemediationPlan | A plan for one investigation run: a definition status, an execution status, and references to its tasks |
| PlanTask | A plan’s reference to a task: task ID, trigger, and required flag |
| RemediationTask | A task’s own record: trigger, required flag, action, execution status, and audit anchor across retries and reversion |
| TaskDefinition | The authored shape of a task — task ID, trigger, required flag, and action — used when composing a plan |
| RemediationAction | The typed action a task performs, modeled as a union of IncidentAction, ResponseAction, and ManualAction families |
| ActionExecution | The physical execution of an action, keyed by a semantic deduplication fingerprint (target only) |
| ExecutionAttempt | One physical attempt of an ActionExecution; retries and overrides add new attempts rather than mutating history (target only) |
| Deduplication fingerprint | The versioned semantic key that identifies an ActionExecution and prevents racing plans from dispatching the same effect twice (target only) |
| Trigger | Why a task runs within a plan: Primary, OnSuccess, or OnFailure |
| Attempt mode | The authority/bypass of an attempt: Normal, Forced, or PreApproved (target only) |
Ownership boundaries
| Context or system | Remediation owns | Other side owns | Current status |
|---|---|---|---|
| Investigation automation | Accepted remediation plan and task history | Investigation/run identity and findings | Plan command source contracts implemented |
| Incident | Decision intent and execution audit | Incident lifecycle and state change | Target adapter only |
| Conveyor | Dedup ledger, attempt mapping, approval evidence, supersede saga | Rules of engagement and physical response execution | Target adapter only |
| Customer Collaboration | Validation of approval against remediation state | Authenticated communication and returned customer intent | Target integration only |
| Cosmos DB | Intended aggregate event streams | Platform hosting | Infrastructure provisioned; repository absent |
| Service Bus | Remediation command/event contracts | Shared transport | Topics provisioned; processors absent |
Domain status
Only typed contracts and provisioned infrastructure exist today; there is no runtime application. See Implementation for the full Implemented / Provisioned / Absent evidence breakdown, the provisioned topology, and the open target-design decisions.
Static domain model
This page describes the static structure of the Remediation domain. It is split into two clearly separated halves:
- Implemented contract model — the strict snapshots, typed action union, command/event contracts, and enumerated states that exist today as validated wire contracts.
- Target domain design — the richer three-aggregate design. Every target section is target-only and not enforced by any current aggregate.
It is intended to be technology-agnostic — see Implementation for code and infrastructure references.
Implemented contract model
These are validated snapshots and wire contracts, not executable aggregates. No runtime loads streams, enforces transitions, or appends events.
Plan snapshot
| Type | Implemented fields |
|---|---|
RemediationPlan | ID, investigation-run reference, definition status, execution status, task references, timestamps, UUID ETag |
InvestigationRunRef | Workspace ID, security incident ID, investigation ID, run ID, and source system |
PlanTask | Task ID, trigger, and required flag |
Implemented plan states:
- Definition:
Open,Sealed. - Execution:
Pending,Running,Succeeded,Failed,Cancelled. - Task trigger:
Primary,OnSuccess,OnFailure.
The current snapshot does not include the design’s origin actor as a separate value
or a separate IncidentRef; workspace and incident IDs are embedded in
InvestigationRunRef.
Task snapshot
| Type | Implemented fields |
|---|---|
TaskDefinition | Task ID, trigger, required flag, and action |
RemediationTask | Task ID, trigger, required flag, action, execution status, timestamps, and UUID ETag |
Implemented task statuses are Created, PendingApproval, Accepted, Discarded,
Rejected, Cancelled, AwaitingManualExecution, Executing, Completed,
Failed, and Reverted.
The current task snapshot does not encode plan ID, activation state, Skipped,
policy evaluation, origin actor, entity list, execution key or attempts, decision
reasons, manual evidence, or reversion metadata.
Typed action union
| Action family | Implemented content |
|---|---|
| Incident | CloseIncident, ChangeSeverity |
| Manual | Title, instructions, and performer: Cyber Defender, customer, or either |
| Host response | Antivirus, isolate/unisolate, restrict/unrestrict app execution, automated investigation |
| Account response | Mark compromised, dismiss risk, revoke sign-in session |
| Email response | Submit email or URL threat, remediate analyzed email |
| Indicator response | Block/unblock file hash, IP, domain, URL, certificate, or firewall IP |
Response actions use capability-specific parameters and typed account, host, mail,
IP, URL, DNS, file-hash, and certificate entities. Escalate, customer approval
evidence, manual execution evidence, and execution-attempt models are not currently
implemented.
Implemented commands
| CloudEvent command | Payload intent | Current source restriction |
|---|---|---|
CreatePlan | Create an open deterministic plan, optionally with tasks | Gutenberg, Cerebro, or Ziege |
AddTask | Add a task definition to a plan | Gutenberg, Cerebro, or Ziege |
SealPlan | Close plan composition | Gutenberg, Cerebro, or Ziege |
ApproveTask | Approve a task waiting on remediation policy | Not constrained in the typed contract |
RejectTask | Reject a task, optionally with a reason | Not constrained in the typed contract |
ConfirmManualExecution | Confirm human completion | Not constrained in the typed contract |
RejectManualExecution | Reject requested manual work | Not constrained in the typed contract |
CancelTask | Intentionally stop a task | Not constrained in the typed contract |
RevertTask | Request compensation for a completed task | Not constrained in the typed contract |
SubmitPlan, DiscardTask, SupplyCustomerApproval, and ForceReexecuteTask are
part of the target design but absent or commented out in the current contract
package.
Implemented events
| CloudEvent event | Aggregate data carried |
|---|---|
PlanCreated | Full RemediationPlan snapshot |
TaskCreated | Full RemediationTask snapshot |
TaskAdded | Updated plan snapshot and task ID |
PlanSealed | Updated plan snapshot |
TaskDiscarded | Updated task snapshot and reason |
CommandRejected | Message ID, reason code, reason, rejection time, and provenance |
Each aggregate event validates that the CloudEvent ID equals the event-data ETag and
the embedded snapshot ETag. IonMetadata retains the source command or raw payload,
command hash, Service Bus IDs, event position/count, and idempotency key.
Target domain design
The target model separates plan intent, task decisions, and physical execution into three aggregate streams. Everything in this half is target design only; no current aggregate enforces it.
| Target aggregate | Authority | Why separate |
|---|---|---|
RemediationPlan | Composition, sealing, task references, and conditional branch selection | Task execution can progress concurrently without contending on the plan stream |
RemediationTask | Policy result, approval, manual/automatic lifecycle, outcome, and compensation link | Stable audit anchor across retries, supersession, and reversion |
ActionExecution | Semantic deduplication key and all physical execution attempts | Prevents racing plans from dispatching the same effect twice |
Target plan invariants
These rules are target design only; no aggregate methods currently enforce them.
- One plan exists per investigation ID and run ID.
- Tasks can be added or discarded only while definition status is
Open. - Sealing makes completion and branch selection decidable.
OnSuccessactivates only after every required primary task completes.OnFailureactivates when a required primary task reaches an unsuccessful terminal state.- Exactly one conditional branch is selected; the other branch becomes
Skipped. - Array order does not imply execution order.
- Autonomous automation submits and seals atomically; deterministic automation uses create, repeated add/discard, then seal.
Target task lifecycle
This lifecycle is target-only and is not enforced by the implemented task snapshot.
Target rules distinguish policy denial from rejection: denial requires a human gate, while only a human rejects. Instrumental cancellation during execution supersession does not cancel the task.
Target execution and deduplication
ActionExecution is a target-only aggregate keyed by a versioned semantic fingerprint
containing:
- workspace or customer scope;
- action type;
- normalized target identities;
- effect-changing parameters.
It deliberately excludes plan/task IDs, actor display data, comments, and timestamps.
Each retry or override is a new ExecutionAttempt; successful history is not mutated.
| Attempt mode | Authority and bypass |
|---|---|
Normal | Bypasses nothing |
Forced | Privileged Cyber Defender; bypasses remediation dedup only and requires a reason |
PreApproved | Customer authority; bypasses Conveyor’s rules-of-engagement wait only |
The target Conveyor adapter keeps external execution phase on the attempt rather than copying it into task state. Remediation owns deduplication, attempt identity, audit, and the cancel/re-initiate supersede saga; Conveyor owns rules-of-engagement evaluation and physical response-action execution.
Target command and event expansion
These additions are target design only and are not part of the current contract package.
| Area | Target additions beyond current contracts |
|---|---|
| Plan commands | SubmitPlan, DiscardTask, plan cancellation |
| Execution commands | SupplyCustomerApproval, ForceReexecuteTask |
| Plan events | Task discarded, branch selected, plan completed or cancelled |
| Task events | Policy evaluated, approved, rejected, accepted, execution requested, completed, failed, cancelled, skipped, reverted |
| Execution events | Execution claimed, attempt dispatched, external state changed, customer approval supplied, supersede started/aborted, attempt succeeded/failed/cancelled, forced attempt requested |