Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 6 min read

Who Pages You When Your Incident Bot Breaks?

In my last post, I turned an incident response runbook into a Step Functions workflow. Readers asked what happens when the permissions or services the workflow depends on break mid-incident. Start one step earlier. What

Who Pages You When Your Incident Bot Breaks?

In my last post, I turned an incident response runbook into a Step Functions workflow. Readers asked what happens when the permissions or services the workflow depends on break mid-incident.

Start one step earlier. What if it never starts at all?

Picture a drill. A finding comes in. The intake service accepts it. Step Functions never confirms a start. Five minutes later, the on-call engineer still has no page, and there’s no failed execution on the dashboard. There might not even be an execution to look at.

That five-minute silence is the failure I’d test first. The timeline below is simulated. The Python drill later in the post runs locally with synthetic records.

Give the incident a deadline before you start the workflow

The intake service should save an open incident with a named owner or rotation and a deadline for its first update. Save that record before calling StartExecution. If the launch response is lost, the watchdog still has something to check. A timed-out request leaves the start unconfirmed, so reconcile before trying to launch again. For a Standard workflow, keep a stable execution name and the original input for that attempt. AWS returns the existing execution for the same name and input while it’s running. A closed execution can return ExecutionAlreadyExists, which is a reason to look up the prior attempt. AWS StartExecution reference

Once the workflow starts, each meaningful step sets a new deadline. A verified snapshot copy, for example, can move the incident to β€œawaiting approval” and set an approval deadline. A worker that’s still alive but hasn’t made progress shouldn’t get to keep extending the clock.

Two paging paths. Step Functions reports failures through EventBridge, while a scheduled watchdog reads overdue incidents from the intake ledger. Both can page the on-call engineer.

Use two signals. A failure event can page quickly. A scheduled check on open incidents can catch work that never started or stopped reporting. Give the check its own identity and a paging route that can still work if the response role or approval service is down.

There’s still a boundary here. If the finding never reaches intake, there’s no incident record to age out. Cover that gap with a separate check on ingestion, such as a synthetic finding routed to a test destination. Give that test an expected acknowledgment and monitor it from outside the path it exercises.

What AWS will tell you, and where it can go quiet

  • A task fails. A Step Functions catcher can take an explicit escalation branch. Catchers live on tasks, parallel states, and map states. A top-level execution timeout needs a signal from outside the execution. AWS error handling docs
  • A Standard execution fails, times out, or is stopped. An EventBridge rule can match FAILED, TIMED_OUT, or ABORTED for the relevant state machine. AWS describes these events as best effort and says they can arrive out of order. Route them to the incident owner and correlate them to the right execution attempt. AWS EventBridge integration docs
  • EventBridge receives the event but can’t deliver it. Configure target retries and a dead-letter queue, and watch that queue. This covers delivery failures for events that reached the rule. The overdue-incident check covers cases where no usable signal arrives. EventBridge retries Β· EventBridge dead-letter queues

Treat a failure event for an old execution as a clue. Check the incident record and the current attempt before paging, especially after a manual restart. Send the fast signal and the deadline alert through the same incident deduplication key when they represent the same escalation. Put the incident ID, current stage, owner, and case link in the page. Keep the full execution payload in the access-controlled case, and track page delivery separately from the human acknowledgment.

Break-glass access has a dependency list too

A second role in the same member account can give an operator a different identity. It still inherits the applicable AWS Organizations service control policies. An explicit deny that covers both roles still wins. Similarly, direct federation can help during an IAM Identity Center outage if the external identity provider and IAM data plane are still available. That dependency matters if the identity provider is the part you’re testing. AWS SCP evaluation Β· AWS emergency access

Put Can the person who gets this page actually take the next permitted action? on the drill sheet. Use the smallest operation that proves it, like opening the case and reading its evidence manifest with the approved recovery identity. Record the result and who owns the handoff. If the page arrives but nobody can inspect the case, the drill found something worth fixing.

The drill I’d run before the next incident

Use a synthetic finding in a sandbox. Route notifications to a test receiver, and keep destructive actions outside the exercise. Put a person on the receiving end so you can tell the difference between β€œan API accepted the page” and β€œsomebody knows what to do.”

Synthetic timeline. At minute zero intake records the owner and deadline. At minute one the launch is unconfirmed. At minute five the watchdog pages the test responder.

Inject this The drill passes when
Intake succeeds, but launch stays unconfirmed The initial deadline expires and a responder gets the incident ID and takes ownership
A task reports failure The failure signal pages before the deadline and the deadline check doesn’t send a duplicate
An approval expires The incident remains isolated, remediation stays gated, and a person takes over
The paging target rejects delivery The failed delivery is observable and the backup route reaches the test responder
The normal sign-in path is unavailable A responder uses the approved emergency path and can read the synthetic case

Afterward, record when intake accepted the finding, when the page arrived, and when a human acknowledged it. Give every miss an owner and a date to rerun that case. AWS’s guidance on incident response simulations is a good reference for running the exercise and capturing the results.

Run the paging rule locally

This models the decision only. The clock is simulated and PAGE means β€œthe rule would page.” In a real implementation, the watchdog also needs reliable paging delivery, shared deduplication, and a way to correlate failure events with the current execution.

"""Exercise paging decisions locally with synthetic data. No AWS calls."""

from dataclasses import dataclass


@dataclass(frozen=True)
class Incident:
    incident_id: str
    next_update_due: int
    closed: bool = False
    execution_failed: bool = False


def should_page(incident: Incident, now: int) -> bool:
    return not incident.closed and (
        incident.execution_failed or now >= incident.next_update_due
    )


def run_drill() -> None:
    # Integer timestamps are minutes on a simulated clock.
    scenarios = [
        ("Open, within deadline", Incident("drill-01", 5), 4, False),
        ("Failure event received", Incident("drill-02", 5, execution_failed=True), 1, True),
        ("Launch never confirmed", Incident("drill-03", 5), 5, True),
        ("Approval lease expired", Incident("drill-04", 60), 60, True),
        ("Closed before deadline", Incident("drill-05", 5, closed=True), 6, False),
    ]

    for label, incident, now, expected in scenarios:
        actual = should_page(incident, now)
        if actual != expected:
            raise AssertionError(f"{label}: expected page={expected}, got {actual}")
        print(f"{label:<26} {'PAGE' if actual else 'OK'}")

    print(f"\n{len(scenarios)} scenarios passed.")


if __name__ == "__main__":
    run_drill()

Save that as watchdog_drill.py and run python3 watchdog_drill.py. The one I care about most is Launch never confirmed. There’s no failure event in that test. The open record and its expired deadline are enough.

Open, within deadline      OK
Failure event received     PAGE
Launch never confirmed     PAGE
Approval lease expired     PAGE
Closed before deadline     OK

5 scenarios passed.

If your incident workflow never starts tonight, who gets paged, and what signal tells them? I’d love to hear how your team tests that part.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.