Identity & Endpoint EDR Active Containment Hooks
Active Directory Kerberos TGT Purge & Computer Account Lockout (DEF-ACT-67-01)
Section titled โActive Directory Kerberos TGT Purge & Computer Account Lockout (DEF-ACT-67-01)โ- Target System: Active Directory Domain Services (Windows Server 2022/2025)
- Reversibility:
FAST| Operational Risk:HIGH - Execution Mode:
API_CALL
Invalidates all active Kerberos Ticket Granting Tickets (TGTs) and session keys for compromised service accounts or NetScaler computer accounts to block pass-the-ticket lateral movement.
Prerequisites
Section titled โPrerequisitesโ- Active Directory Web Services (ADWS) enabled on Domain Controllers
- Hermes service account granted Account Operators or delegated reset permissions
Execution Snippet
Section titled โExecution Snippetโ# Powershell AD containment hookImport-Module ActiveDirectory
$TargetAccount = "SVC-NETSCALER-NSG01$"# Disable computer/service accountDisable-ADAccount -Identity $TargetAccount
# Force Kerberos ticket invalidation by rolling account password twice$DummyPass = [System.Web.Security.Membership]::GeneratePassword(32, 4) | ConvertTo-SecureString -AsPlainText -ForceSet-ADAccountPassword -Identity $TargetAccount -NewPassword $DummyPass -Reset
# Purge cached Kerberos tickets via klist on downstream tier-1 serversInvoke-Command -ComputerName "FS01.corp.internal" -ScriptBlock { klist purge -li 0x3e7 }Health Canary & Rollback
Section titled โHealth Canary & Rollbackโ- Canary Metric:
ldap_auth_failures_ratio(Interval: 60s) - Threshold:
auth_failures_spike_exceeds_1000_per_minute - Rollback Steps:
- Enable-ADAccount -Identity $TargetAccount
- Reset password to known staging credential in PAM vault
- Re-issue service ticket via automated gMSA sync
Microsoft Entra ID Continuous Access Evaluation (CAE) Revocation (DEF-ACT-67-02)
Section titled โMicrosoft Entra ID Continuous Access Evaluation (CAE) Revocation (DEF-ACT-67-02)โ- Target System: Microsoft Entra ID (Azure AD Graph API / MS Graph v1.0)
- Reversibility:
FAST| Operational Risk:MODERATE - Execution Mode:
API_CALL
Triggers immediate token revocation and Continuous Access Evaluation (CAE) critical event signals across all tenant applications for identities tied to compromised gateway access.
Prerequisites
Section titled โPrerequisitesโ- App Registration with User.RevokeSessions.All and Directory.ReadWrite.All permissions
- Tenant configured for Continuous Access Evaluation
Execution Snippet
Section titled โExecution Snippetโimport requests
def revoke_entra_user_sessions(user_id: str, access_token: str): url = f"https://graph.microsoft.com/v1.0/users/{user_id}/revokeSignInSessions" headers = { "Authorization": f"Bearer {access_token}", "Content-Type": "application/json" } resp = requests.post(url, headers=headers) resp.raise_for_status() return resp.json()Health Canary & Rollback
Section titled โHealth Canary & Rollbackโ- Canary Metric:
entra_cae_revocation_event_ack(Interval: 20s) - Threshold:
graph_api_http_error_rate_gt_0 - Rollback Steps:
- Notify user to perform MFA re-authentication
- Re-enable account in Entra ID Admin Portal
CrowdStrike Falcon Real-Time Host Network Isolation (DEF-ACT-67-03)
Section titled โCrowdStrike Falcon Real-Time Host Network Isolation (DEF-ACT-67-03)โ- Target System: CrowdStrike Falcon Platform (OAuth2 API)
- Reversibility:
INSTANT| Operational Risk:HIGH - Execution Mode:
API_CALL
Dispatches host containment action through CrowdStrike Falcon API, restricting infected machines strictly to EDR cloud connectivity and Hermes triage agents.
Prerequisites
Section titled โPrerequisitesโ- Falcon API Client with โHosts:writeโ scope
- Sensor installed on target jumpboxes and pivot management hosts
Execution Snippet
Section titled โExecution Snippetโimport requests
def contain_falcon_host(aid: str, token: str): url = "https://api.crowdstrike.com/devices/entities/devices-actions/v2?action_name=contain" headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"} payload = {"ids": [aid]} r = requests.post(url, headers=headers, json=payload) r.raise_for_status() return r.json()Health Canary & Rollback
Section titled โHealth Canary & Rollbackโ- Canary Metric:
falcon_sensor_heartbeat(Interval: 15s) - Threshold:
sensor_heartbeat_timeout_gt_60s - Rollback Steps:
- Execute Falcon API lift_containment for aid
- Verify network ICMP/TCP ping recovery
- Log uncontainment audit event