Skip to content

[SECURITY] Record the outcome of Slack-approved commands in the incident audit #207

Backlog

Description

@OkiriGabriel

Problem

When someone approves a command in Slack, DevOpsAgent.execute_approved_action() runs it and posts the result back to Slack, but nothing is written to the incident's logs or audit. /slack/action records the decision (approval-<ts>-approved.json), but not:

  • whether the command succeeded, its exit code or (scrubbed) output,
  • when it ran and how long it took,
  • that the emergency stop blocked it.

So GET /audit shows the agent asked and someone approved, but not what actually changed in production. For containment (#168), that's the record that matters most.

Proposed fix

  • After execution, save approved-action-<ts>.json to the incident's logs (incident_store.save_log) with: command reference and resolved command, approver (from the decision record), start and end time, success, returncode, and scrubbed stdout/stderr (see [BUG] PII scrubber redacts epoch-ms timestamps and long IDs as card numbers (no Luhn check) #205).
  • If the incident has a containment-<action_id>.json record, update its status to applied/failed with applied_at (see the containment follow-up).
  • Expose it in GET /audit as an actions_applied list.
  • Tests: success, failure and emergency-stop cases are each recorded; output is scrubbed.

Files

agent/core.py (execute_approved_action), api/server.py (slack_action, /audit), services/incident_store.py

Activity

  1. added
    enhancement
    security
    on Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementsecurity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions