| name | remediate-workspace-session-kill |
| description | Contain a Google Workspace account takeover by signing the user out and forcing a password change at next login. Consumes an OCSF 1.8 Detection Finding (class 2004) emitted by detect-google-workspace-suspicious-login (T1110 Brute Force / T1078 Valid Accounts) and calls the Admin SDK Directory API to invalidate active session tokens (POST /users/{userKey} /signOut) and require re-authentication on next sign-in (PATCH /users/{userKey} with changePasswordAtNextLogin=true). Every action is dry-run by default, deny-listed against admin / service-account / break-glass / @google.com principals (extensible via WORKSPACE_SESSION_KILL_DENY_LIST_FILE), gated behind an incident ID plus approver plus an explicit allowed-domain boundary for --apply, and dual-audited (DynamoDB + KMS-encrypted S3). Re-verify reads the Admin SDK Reports API for any login_success since remediation; emits VERIFIED if absent, DRIFT (+ paired OCSF Detection Finding via the shared remediation_verifier contract) if the attacker came back in, UNREACHABLE if the Reports API throws. Use when the user mentions "kill Workspace session," "respond to Google Workspace suspicious login," "contain Workspace account takeover," "Workspace session kill," or "re-verify Workspace session containment." Do NOT use for Okta, Entra, AWS IAM, or GCP IAM sessions — those have their own per-IdP remediation skills. Do NOT bypass the deny-list, run with --apply without an explicit human-approved incident window, or edit the audit trail by hand. Out of scope: cross-Workspace federation (only operates on the target's home tenant), mobile-device wipe (separate API surface and authorization model), and group/role unwind (the suspicious-login finding doesn't carry that context). |
| purpose | Contain a Google Workspace account takeover by signing the user out and forcing a password change at next login. |
| capability | write-identity |
| persistence | cloud_state |
| telemetry | stderr_jsonl |
| privilege_escalation | read_write |
| license | Apache-2.0 |
| approval_model | human_required |
| execution_modes | jit, ci, mcp, persistent |
| side_effects | writes-identity, writes-storage, writes-audit |
| input_formats | ocsf, native |
| output_formats | native |
| concurrency_safety | operator_coordinated |
| network_egress | admin.googleapis.com, oauth2.googleapis.com, s3.amazonaws.com, dynamodb.amazonaws.com |
| caller_roles | security_engineer, incident_responder |
| approver_roles | security_lead, incident_commander |
| min_approvers | 1 |
| compatibility | Requires Python 3.11+, google-api-python-client + google-auth (lazy-imported only under --apply / --reverify), and boto3 for audit writes. Workspace scopes required: admin.directory.user.security (signOut + password change) and admin.reports.audit.readonly (reverify). Service account with domain-wide delegation OR a delegated admin user with User Management role. |
| metadata | {"homepage":"https://github.com/msaad00/cloud-ai-security-skills","source":"https://github.com/msaad00/cloud-ai-security-skills/tree/main/skills/remediation/remediate-workspace-session-kill","version":"0.1.0","frameworks":["MITRE ATT&CK v14","NIST CSF 2.0","SOC 2"],"cloud":["google-workspace"]} |