|
| 1 | +--- |
| 2 | +title: On-Chain Monitoring Plan Template (Builders) |
| 3 | +description: For Builders - turn your threat model into a monitoring plan |
| 4 | +sidebar_position: 10 |
| 5 | +--- |
| 6 | + |
| 7 | +This template turns a completed [threat model](../threat-modeling/README.mdx) into an operational monitoring plan for a protocol or set of smart contracts on Stellar. Where the threat model asks _what could go wrong and how will we design against it_, this plan asks _how will we watch for it in production_. Each threat identified in the threat model becomes one or more observable on-chain effects, and each effect becomes a rule that the monitoring solution watches while the contracts are live. |
| 8 | + |
| 9 | +**Directions**: Fill out each section below to the best of your ability. Carry the threat identifiers over from the STRIDE threat model so the two documents stay linked. Work through the sections in order; every threat should leave the exercise with at least one monitor and a defined response. |
| 10 | + |
| 11 | +**Keep completed plans internal.** A filled-in monitoring plan is a map of what is (and isn’t) monitored. Treat a populated version as sensitive. |
| 12 | + |
| 13 | +## What are we monitoring? |
| 14 | + |
| 15 | +**Directions**: Describe the system in scope, then inventory the components and on-chain addresses this plan covers. |
| 16 | + |
| 17 | +_Input text: high-level description of the protocol, the value it holds, and the parts of it this plan covers._ |
| 18 | + |
| 19 | +| Component | On-chain address (`C...` contract / `G...` account) | Notes | |
| 20 | +| --- | --- | --- | |
| 21 | +| _e.g. Lending pool core_ | _C..._ | _Holds pooled collateral and debt_ | |
| 22 | +| | | | |
| 23 | + |
| 24 | +:::note |
| 25 | + |
| 26 | +Keep this inventory current. Addresses can change with new versions, and an out-of-date address list is the most common reason a monitor silently stops working. If it's discovered later that scope has changed, update this section with the latest information. |
| 27 | + |
| 28 | +::: |
| 29 | + |
| 30 | +## What could go wrong? |
| 31 | + |
| 32 | +**Directions**: List the threats this plan monitors, carried over from the threat model. Reuse the identifiers from the STRIDE model (for example, `Elevation.1`) so each monitor traces back to a known threat. Assign each threat a severity using the reminders below. |
| 33 | + |
| 34 | +### Severity reminders |
| 35 | + |
| 36 | +| Severity | Meaning | |
| 37 | +| --- | --- | |
| 38 | +| **Critical** | Direct, large-scale loss of funds or control; requires immediate response. | |
| 39 | +| **High** | Serious impact to funds, users, or availability; requires prompt response. | |
| 40 | +| **Medium** | Limited or containable impact; response can be scheduled. | |
| 41 | +| **Low** | Minor or informational; monitored for awareness. | |
| 42 | + |
| 43 | +### Threat register |
| 44 | + |
| 45 | +| Threat ID | Threat (from threat model) | Affected component | Severity | |
| 46 | +| --- | --- | --- | --- | |
| 47 | +| _e.g. Elevation.1_ | _Unauthorized change of contract admin/owner_ | _Lending pool core, access control_ | _Critical_ | |
| 48 | +| | | | | |
| 49 | + |
| 50 | +## What does exploitation look like on-chain? |
| 51 | + |
| 52 | +**Directions**: For each threat, describe how exploitation might unfold and the observable on-chain effect(s) it would leave behind. There can be several scenarios, and several effects, per threat. |
| 53 | + |
| 54 | +| Threat ID | Exploitation scenario | Observable on-chain effect(s) | |
| 55 | +| --- | --- | --- | |
| 56 | +| _e.g. Elevation.1_ | _A leaked admin key reassigns ownership, then raises borrow caps and drains reserves._ | _`set_admin` / ownership-transfer event; privileged parameter change from a non-allowlisted caller_ | |
| 57 | +| | | | |
| 58 | + |
| 59 | +:::note |
| 60 | + |
| 61 | +If a threat has no observable on-chain effect (for example, a compromised frontend or an oracle's upstream data source), record it here and plan to monitor it off-chain. Don't drop it just because it isn't visible on-chain. |
| 62 | + |
| 63 | +::: |
| 64 | + |
| 65 | +## What will we monitor for? |
| 66 | + |
| 67 | +**Directions**: Map each observable effect to a monitoring rule, stating the trigger condition and the baseline that makes it meaningful. Uniquely identify each monitor as `<ThreatID>.M.<n>` so it traces back to its threat, the same way remediations in the threat model are identified as `<ThreatID>.R.<n>`. |
| 68 | + |
| 69 | +| Monitor ID | Observable on-chain effect | Trigger condition & baseline | Monitoring rule (plain-language intent) | |
| 70 | +| --- | --- | --- | --- | |
| 71 | +| _e.g. Elevation.1.M.1_ | _Owner/admin address changes_ | _Any `set_admin` event. Baseline: zero; never expected in normal operation._ | _Alert immediately on any admin change on the core contract._ | |
| 72 | +| _e.g. Elevation.1.M.2_ | _Privileged call from an unexpected address_ | _Caller not in the known-admin allowlist. Baseline: only the multisig calls these._ | _Alert on privileged calls from non-allowlisted addresses._ | |
| 73 | +| | | | | |
| 74 | + |
| 75 | +Each monitor can be stated in a single line: |
| 76 | + |
| 77 | +- We address **[Threat ID]** in **[affected component]** by monitoring for **[on-chain effect]** on **[address]**. |
| 78 | +- _For example: **Elevation.1.M.1** - We address **Elevation.1** in **the lending pool factory** by monitoring for **deploy invocations from users not on an approved list** at address **CABC123...**._ |
| 79 | + |
| 80 | +## What happens when an alert fires? |
| 81 | + |
| 82 | +**Directions**: For each monitor, define what happens when it triggers: who is notified, through which channel, any automated action, and who owns the rule. This is where the monitoring vendor's automated-response capability (for example, pausing a contract) is recorded. |
| 83 | + |
| 84 | +| Monitor ID | Severity | Response / action (who, channel, automated action) | Owner | Status | Last reviewed | |
| 85 | +| --- | --- | --- | --- | --- | --- | |
| 86 | +| _e.g. Elevation.1.M.1_ | _Critical_ | _Page on-call security (PagerDuty + Slack); trigger guardian pause; open incident bridge._ | _Protocol Security_ | _Active_ | _YYYY-MM-DD_ | |
| 87 | +| | | | | | | |
| 88 | + |
| 89 | +**Status values**: _Active_ (live and alerting), _Tuning_ (live but thresholds being refined), _Planned_ (agreed but not yet implemented). |
| 90 | + |
| 91 | +## Did we do a good job? |
| 92 | + |
| 93 | +- Does every threat in the threat model have at least one monitor, or a documented reason it can't be monitored on-chain? |
| 94 | +- Is every trigger threshold grounded in an actual baseline rather than a guess? |
| 95 | +- Does every monitor have a defined response, an owner, and a status? |
| 96 | +- Have any monitors fired? Were they true positives? Did the response work as written? |
| 97 | +- Are all on-chain addresses still current after the latest deploy or upgrade? |
| 98 | +- Were any threats found that only surface off-chain, needing a different kind of monitoring? |
| 99 | + |
| 100 | +Treat this plan as a living document: revisit it whenever the contracts, addresses, or threat model change. |
0 commit comments