Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

3.3 KB
Raw Blame
id: malware-detection-response-v1
name: Malware Detection Response
description: >
  Responds to malware detections across endpoints. Quarantines the malicious
  file, isolates the host if needed, runs deep scan, and notifies the IR team.
  Supports trojan, spyware, adware, worm, and backdoor classifications.
version: "1.0.0"
author: Beenu - [email protected]
enabled: true
tags:
  - malware
  - endpoint
  - edr
  - antivirus
  - containment

trigger:
  on: alert
  severity:
    - medium
    - high
    - critical
  tags:
    - malware

steps:
  - id: enrich-malware
    name: Enrich Malware Detection
    type: enrich
    params:
      source: edr
      fields:
        - hostname
        - username
        - file_path
        - file_hash
        - malware_family
        - malware_type
        - detection_engine
        - quarantined
        - network_activity
    timeout_seconds: 30
    on_failure: continue

  - id: investigate-hash
    name: Investigate File Hash Reputation
    type: investigate
    params:
      query: "file_reputation hash={{ alert.file_hash }}"
      context_fields:
        - alert.file_hash
        - alert.malware_family
    timeout_seconds: 45
    on_failure: continue

  - id: check-quarantine-status
    name: Check If File Already Quarantined
    type: condition
    condition:
      field: alert.quarantined
      operator: eq
      value: false
    next_true: quarantine-file
    next_false: check-network-activity

  - id: quarantine-file
    name: Quarantine Malicious File
    type: http
    params:
      method: POST
      url: "{{ env.EDR_API_URL }}/hosts/{{ alert.hostname }}/quarantine"
      body:
        file_path: "{{ alert.file_path }}"
        reason: "Malware detected — {{ alert.malware_family }}"
    timeout_seconds: 30
    on_failure: abort
    retry_max: 2

  - id: check-network-activity
    name: Check Malware Network Activity
    type: condition
    condition:
      field: alert.network_activity
      operator: eq
      value: true
    next_true: isolate-host
    next_false: notify-security

  - id: isolate-host
    name: Isolate Host Due to Network Activity
    type: isolate_host
    params:
      reason: "Malware with active network C2 — playbook {{ id }}"
      notify_user: true
    timeout_seconds: 60
    on_failure: continue
    retry_max: 2

  - id: notify-security
    name: Notify IR Team
    type: notify
    params:
      channel: "#security-alerts"
      message: |
        🦠 *Malware Detected*
        Host: `{{ alert.hostname }}`
        User: `{{ alert.username }}`
        Family: `{{ alert.malware_family }}`
        Type: `{{ alert.malware_type }}`
        File: `{{ alert.file_path }}`
        Hash: `{{ alert.file_hash }}`
        Quarantined: {{ steps.quarantine-file.status }}
        Isolated: {{ steps.isolate-host.status }}
    timeout_seconds: 20
    on_failure: continue

  - id: create-ticket
    name: Create Malware Incident Ticket
    type: create_ticket
    params:
      title: "MALWARE: {{ alert.malware_family }} on {{ alert.hostname }}"
      severity: P2
      assignee_group: ir-team
    timeout_seconds: 30
    on_failure: continue

  - id: close-case
    name: Close Malware Case
    type: close_case
    params:
      status: contained
      resolution: "File quarantined; host isolated if C2 active; IR ticket created."
    timeout_seconds: 15
    on_failure: continue