Communitygithub.com

IOC 자동 보강

원시 침해 지표(IOC)를 다중 소스로 자동 보강합니다.

IOC 자동 보강란 무엇인가요?

이 스킬은 보안 분석가가 SIEM 경보를 수신하기 전에 위협 인텔리전스 컨텍스트를 자동으로 보강하는 SOAR 플레이북 또는 Python 파이프라인을 구축하는 방법을 제공합니다. VirusTotal, AbuseIPDB, Shodan, MISP와 같은 여러 소스에서 IP, 도메인, URL, 파일 해시를 동시에 조회하여 복합 신뢰도 점수를 계산하고, 이를 기반으로 경보 우선순위를 자동 분류합니다. Cortex XSOAR, Splunk SOAR, Tines, n8n과 같은 SOAR 플랫폼에서 사용할 수 있으며, Python 3.9+ 환경에서도 직접 구현 가능합니다. API 속도 제한, 재시도 로직, 캐싱 전략을 포함하여 운영 안정성을 확보하고, 분석가의 평균 분류 시간(MTTT)을 단축하는 데 중점을 둡니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/automating-ioc-enrichment

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

IOC 자동 보강 (Automating IOC Enrichment)

사용 시기

이 스킬을 사용해야 하는 경우:

  • SIEM 경보를 분석가에게 라우팅하기 전에 위협 인텔리전스 컨텍스트로 자동 보강하는 SOAR 플레이북을 구축할 때
  • 피싱 이메일 제출에서 추출한 대량 IOC를 보강하는 Python 파이프라인을 만들 때
  • 분석가의 평균 분류 시간(MTTT)을 줄이기 위해 VT, Shodan, MISP 데이터로 경보 컨텍스트를 미리 채울 때

사용하지 말아야 할 경우: 인간 검토 없이 보강 결과만으로 완전 자동 차단 결정을 내리는 경우 — 보강 자동화는 의사 결정을 지원해야 하며, 고영향 조치에 대해 자율적인 차단을 실행해서는 안 됩니다.

사전 요구 사항

  • SOAR 플랫폼(Cortex XSOAR, Splunk SOAR, Tines, n8n) 또는 Python 3.9+ 환경
  • API 키: VirusTotal, AbuseIPDB, Shodan, 그리고 최소 하나의 TIP(MISP 또는 OpenCTI)
  • 경보 수집을 위한 SIEM 통합 엔드포인트
  • API별 속도 제한 예산 문서화(VT: 무료 4회/분, 엔터프라이즈 500회/분)

워크플로

1단계: 보강 파이프라인 아키텍처 설계

각 IOC 유형에 대한 보강 흐름을 정의합니다.

SIEM 경보 → IOC 추출 → 유형 분류 → 보강 함수 라우팅
  IP 주소 → AbuseIPDB + Shodan + VirusTotal IP + MISP
  도메인 → VirusTotal 도메인 + PassiveTotal + Shodan + MISP
  URL → URLScan.io + VirusTotal URL + Google Safe Browsing
  파일 해시 → VirusTotal 파일 + MalwareBazaar + MISP
→ 결과 집계 → 신뢰도 점수 계산 → 경보 업데이트 → 분석가 알림

2단계: Python 보강 함수 구현

import requests
import time
from dataclasses import dataclass, field
from typing import Optional

RATE_LIMIT_DELAY = 0.25  # VT 무료 계층용 4회/초

@dataclass
class EnrichmentResult:
    ioc_value: str
    ioc_type: str
    vt_malicious: int = 0
    vt_total: int = 0
    abuse_confidence: int = 0
    shodan_ports: list = field(default_factory=list)
    misp_events: list = field(default_factory=list)
    confidence_score: int = 0

def enrich_ip(ip: str, vt_key: str, abuse_key: str, shodan_key: str) -> EnrichmentResult:
    result = EnrichmentResult(ip, "ip")

    # VirusTotal IP 조회
    vt_resp = requests.get(
        f"https://www.virustotal.com/api/v3/ip_addresses/{ip}",
        headers={"x-apikey": vt_key}
    )
    if vt_resp.status_code == 200:
        stats = vt_resp.json()["data"]["attributes"]["last_analysis_stats"]
        result.vt_malicious = stats.get("malicious", 0)
        result.vt_total = sum(stats.values())

    time.sleep(RATE_LIMIT_DELAY)

    # AbuseIPDB
    abuse_resp = requests.get(
        "https://api.abuseipdb.com/api/v2/check",
        headers={"Key": abuse_key, "Accept": "application/json"},
        params={"ipAddress": ip, "maxAgeInDays": 90}
    )
    if abuse_resp.status_code == 200:
        result.abuse_confidence = abuse_resp.json()["data"]["abuseConfidenceScore"]

    # 복합 신뢰도 점수 계산
    result.confidence_score = min(
        (result.vt_malicious / max(result.vt_total, 1)) * 60 +
        (result.abuse_confidence / 100) * 40, 100
    )

    return result

def enrich_hash(sha256: str, vt_key: str) -> EnrichmentResult:
    result = EnrichmentResult(sha256, "sha256")
    vt_resp = requests.get(
        f"https://www.virustotal.com/api/v3/files/{sha256}",
        headers={"x-apikey": vt_key}
    )
    if vt_resp.status_code == 200:
        stats = vt_resp.json()["data"]["attributes"]["last_analysis_stats"]
        result.vt_malicious = stats.get("malicious", 0)
        result.vt_total = sum(stats.values())
        result.confidence_score = int((result.vt_malicious / max(result.vt_total, 1)) * 100)
    return result

3단계: SOAR 플레이북 구축 (Cortex XSOAR)

Cortex XSOAR에서 보강 플레이북을 생성합니다.

  1. 트리거: SIEM에서 경보 생성됨 (웹훅 또는 폴링 방식)
  2. IOC 추출: IP, 도메인, URL, 해시에 대한 정규식 패턴으로 "지표 추출" 작업 사용
  3. 병렬 보강: 여러 보강 작업에 동시에 Fan-out
  4. VT 보강: !vt-file-scan 또는 !vt-ip-scan 명령 호출
  5. AbuseIPDB 확인: !abuseipdb-check-ip 명령 호출
  6. MISP 조회: 교차 참조를 위한 !misp-search 호출
  7. 점수 집계: 복합 점수를 계산하는 Python 변환 작업
  8. 조건부 라우팅: 점수 ≥70 → 높은 우선순위 큐; 40–69 → 중간; <40 → 메모와 함께 자동 종료
  9. 경보 보강: 분석가가 볼 수 있도록 보강 결과를 경보 컨텍스트에 기록

4단계: 속도 제한 및 오류 처리

import time
from functools import wraps

def rate_limited(max_per_second):
    min_interval = 1.0 / max_per_second
    def decorator(func):
        last_called = [0.0]
        @wraps(func)
        def wrapper(*args, **kwargs):
            elapsed = time.time() - last_called[0]
            wait = min_interval - elapsed
            if wait > 0:
                time.sleep(wait)
            result = func(*args, **kwargs)
            last_called[0] = time.time()
            return result
        return wrapper
    return decorator

def retry_on_429(max_retries=3):
    def decorator(func):
        @wraps(func)
        def wrapper(*args, **kwargs):
            for attempt in range(max_retries):
                response = func(*args, **kwargs)
                if response.status_code == 429:
                    retry_after = int(response.headers.get("Retry-After", 60))
                    time.sleep(retry_after)
                else:
                    return response
        return wrapper
    return decorator

5단계: 메트릭 및 튜닝

파이프라인 성능을 주별로 추적합니다.

  • 보강 지연 시간: 경보 트리거에서 보강된 출력까지 목표 <30초
  • API 성공률: 목표 >99% (속도 제한 또는 중단 이벤트 식별)
  • 진양성률: 자동화된 신뢰도 점수에 대한 분석가 재정의 추적
  • 비용: 예산 대비 API 호출량 추적 (VT Enterprise: 100만 조회당 X$)

주요 개념

용어정의
SOAR보안 오케스트레이션, 자동화 및 대응 — 보안 워크플로를 자동화하고 다양한 도구를 통합하는 플랫폼
보강 플레이북원시 보안 이벤트에 컨텍스트 정보를 추가하는 자동화된 워크플로 시퀀스
속도 제한API 제공업체의 요청 빈도 제한 (예: VT 무료: 4회/분); 파이프라인은 이러한 제한을 준수해야 함
복합 신뢰도 점수여러 보강 소스의 신호를 가중치 공식을 사용하여 단일 점수로 집계
Fan-out 패턴여러 보강 쿼리를 동시에 병렬 실행하여 총 보강 지연 시간 최소화

도구 및 시스템

  • Cortex XSOAR (Palo Alto): VT, MISP, Shodan, AbuseIPDB 등 700개 이상의 마켓플레이스 통합을 제공하는 엔터프라이즈 SOAR
  • Splunk SOAR (Phantom): Python 기반 플레이북을 갖춘 SOAR 플랫폼; 네이티브 Splunk SIEM 통합
  • Tines: 웹훅 기반 자동화를 제공하는 코드 없는 SOAR 플랫폼; 소규모 팀에 비용 효율적
  • TheHive + Cortex: Cortex 분석기를 통한 관찰 가능 항목 보강 기능을 제공하는 오픈소스 IR/보강 플랫폼

일반적인 실수

  • 보강 지연 시간을 막는 경우: 보강에 5분 이상 걸리면 분석가가 보강되지 않은 경보를 작업하기 시작하여 목적을 상실합니다. 타임아웃 한도를 설정하고 부분 결과를 제공하십시오.
  • 캐싱 미사용: 동일한 IOC를 50번 조회하면 불필요한 API 비용이 발생합니다. 기본적으로 24시간 동안 보강 결과를 캐싱하십시오.
  • API 실패를 무시하는 경우: 실패한 보강 호출은 기록되어야 하며, 대체 로직을 트리거해야 합니다. 조용히 빈 결과를 생성하여 IOC가 정상으로 보이게 해서는 안 됩니다.
  • 보강 점수만으로 차단 자동화: 복합 점수에는 오탐이 포함됩니다. 공유 인프라에 대한 차단 결정에는 인간의 확인이 필요합니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

관련 스킬