aws-samples / aws-samples/sample-autonomous-cloud-coding-agents
feat(security): emergency session containment runbook and APIs
- Vorherrschende Sprache
- TypeScript
- Sterne
- 143
- Forks
- 46
- Ø Merge
- 3 T. 10 Std.
- Gemergte PRs (30 T.)
- 24
Beschreibung
**Context:** ROADMAP.md → Credentials and authorization → Emergency session containment
**Related:** #209 (per-session IAM), #249 (credentials), behavioral circuit breaker draft
---
## Component
API or orchestration
## Describe the feature
Documented operator runbook and platform APIs to contain an active or compromised agent session: cancel the task, terminate the compute session, and revoke short-lived credentials (assumed SessionRole, GitHub App token, Token Vault grants where applicable). Emit a `containment` audit event for incident response.
## Use case
When an operator detects exfiltration, policy bypass attempts, or a tripped circuit breaker, they need a single coordinated containment action—not separate manual steps across Lambda, AgentCore, IAM, and GitHub. Incident response requires predictable, auditable kill switches.
## Proposed solution
1. `POST /tasks/{id}/contain` (operator-only) orchestrating: task cancel → compute termination → credential revocation best-effort.
2. Pair with runbook in `docs/guides/` covering AWS console fallbacks.
3. Wire `containment` event to `TaskEventsTable` and optional SNS/EventBridge (see lifecycle events draft).
4. Integration tests for happy path and partial-failure (e.g. compute already terminal).
5. CLI: `bgagent contain [--reason "..."]`.
## Other information
- Pairs with **Behavioral circuit breaker** (automated containment) and **Per-repo GitHub credentials** (#50, #249).
- Distinct from stranded-task reconciler (scheduled cleanup vs operator-initiated emergency).
- Design context: `docs/design/SECURITY.md`, `docs/design/ORCHESTRATOR.md`.
- [ ] This might be a breaking change
Beitragsleitfaden
Rechercherichtung
Beginnen Sie mit dem Abschnitt „Credentials and authorization“ in ROADMAP.md und lesen Sie anschließend docs/design/SECURITY.md und docs/design/ORCHESTRATOR.md; das Issue nennt keine Implementierungsdateien oder vorhandenen Tests. Als erledigt gilt die Aufgabe, wenn die Containment-API und -CLI die Koordination des Abbruchs, die Beendigung von Compute, den Best-Effort-Widerruf von Zugangsdaten und Audit-Ereignisse koordinieren und das Runbook unter docs/guides sowie Integrations-Tests für den Happy Path und partielle Fehler dieses Verhalten abdecken.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- aws, github, typescript
- Bereich
- api, backend, cli, cloud, documentation, security
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Ruhig
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100