MITRE ATT&CK를 활용한 위협 행위자 TTP 분석
개요
MITRE ATT&CK은 실제 관찰에 기반한 적대적 전술, 기술, 절차(TTP)에 대한 전 세계적으로 접근 가능한 지식 기반입니다. 이 스킬은 위협 행위자 행동을 ATT&CK 프레임워크에 체계적으로 매핑하고, ATT&CK Navigator를 사용하여 기술 적용 범위 히트맵을 구축하며, 탐지 격차를 식별하고 관찰된 IOC를 Enterprise, Mobile, ICS 매트릭스 전반의 특정 적대적 기술에 연결하는 실행 가능한 인텔리전스 보고서를 생성하는 방법을 다룹니다.
사용 시기
- 보안 인시던트를 조사할 때 MITRE ATT&CK을 사용한 위협 행위자 TTP 분석이 필요한 경우
- 이 도메인에 대한 탐지 규칙 또는 위협 헌팅 쿼리를 구축할 때
- SOC 분석가가 이 분석 유형에 대한 구조화된 절차를 필요로 할 때
- 관련 공격 기술에 대한 보안 모니터링 커버리지를 검증할 때
사전 요구 사항
- Python 3.9+ 및
mitreattack-python,attackcti,stix2라이브러리 - MITRE ATT&CK Navigator (웹 기반 또는 로컬 배포)
- ATT&CK 매트릭스 구조 이해: 전술, 기술, 하위 기술
- 위협 인텔리전스 보고서 또는 위협 행위자 데이터를 위한 MISP/OpenCTI 접근 권한
- STIX 2.1 Attack Pattern 객체에 대한 이해
주요 개념
ATT&CK 매트릭스 구조
ATT&CK Enterprise 매트릭스는 적대적 행동을 14개의 전술(‘왜’)로 구성하며, 각 전술에는 기술(‘어떻게’)과 하위 기술(특정 구현)이 포함됩니다. 각 기술에는 관련 데이터 소스, 탐지, 완화 조치, 그리고 관찰된 위협 그룹의 실제 절차 예제가 연결되어 있습니다.
위협 그룹 프로필
ATT&CK은 140개 이상의 위협 그룹(예: APT28, APT29, Lazarus Group, FIN7)을 문서화된 기술 사용 내역과 함께 카탈로그화합니다. 각 그룹 프로필에는 별칭, 표적 산업, 관련 캠페인, 사용된 소프트웨어, 그리고 절차 수준 세부 정보가 포함된 기술 매핑이 포함됩니다.
ATT&CK Navigator
ATT&CK Navigator는 사용자 정의 ATT&CK 매트릭스 시각화를 생성하기 위한 웹 기반 도구입니다. 분석가는 점수, 색상, 주석, 메타데이터로 기술에 주석을 추가하는 레이어(JSON 파일)를 생성하여 위협 행위자 적용 범위, 탐지 기능 또는 위험 평가를 시각화합니다.
워크플로우
1단계: ATT&CK 데이터 프로그래밍 방식으로 조회
from attackcti import attack_client
import json
# ATT&CK 클라이언트 초기화 (MITRE TAXII 서버 조회)
lift = attack_client()
# 모든 Enterprise 기술 가져오기
enterprise_techniques = lift.get_enterprise_techniques()
print(f"전체 Enterprise 기술 수: {len(enterprise_techniques)}")
# 모든 위협 그룹 가져오기
groups = lift.get_groups()
print(f"전체 위협 그룹 수: {len(groups)}")
# 특정 그룹 이름으로 검색
apt29 = [g for g in groups if 'APT29' in g.get('name', '')]
if apt29:
group = apt29[0]
print(f"그룹: {group['name']}")
print(f"별칭: {group.get('aliases', [])}")
print(f"설명: {group.get('description', '')[:200]}")
2단계: 위협 행위자를 ATT&CK 기술에 매핑
from attackcti import attack_client
lift = attack_client()
# APT29가 사용하는 기술 가져오기
apt29_techniques = lift.get_techniques_used_by_group("G0016") # APT29 그룹 ID
technique_map = {}
for entry in apt29_techniques:
tech_id = entry.get("external_references", [{}])[0].get("external_id", "")
tech_name = entry.get("name", "")
description = entry.get("description", "")
tactic_refs = [
phase.get("phase_name", "")
for phase in entry.get("kill_chain_phases", [])
]
technique_map[tech_id] = {
"name": tech_name,
"tactics": tactic_refs,
"description": description[:300],
}
print(f"\nAPT29는 {len(technique_map)}개의 기술을 사용합니다:")
for tid, info in sorted(technique_map.items()):
print(f" {tid}: {info['name']} [{', '.join(info['tactics'])}]")
3단계: ATT&CK Navigator 레이어 생성
import json
def create_navigator_layer(group_name, technique_map, description=""):
"""위협 그룹에 대한 ATT&CK Navigator 레이어 JSON 생성."""
techniques_list = []
for tech_id, info in technique_map.items():
techniques_list.append({
"techniqueID": tech_id,
"tactic": info["tactics"][0] if info["tactics"] else "",
"color": "#ff6666", # 관찰된 기술은 빨간색
"comment": info["description"][:200],
"enabled": True,
"score": 100,
"metadata": [
{"name": "group", "value": group_name},
],
})
layer = {
"name": f"{group_name} TTP Coverage",
"versions": {
"attack": "16.1",
"navigator": "5.1.0",
"layer": "4.5",
},
"domain": "enterprise-attack",
"description": description or f"Techniques attributed to {group_name}",
"filters": {"platforms": ["Windows", "Linux", "macOS", "Cloud"]},
"sorting": 0,
"layout": {
"layout": "side",
"aggregateFunction": "average",
"showID": True,
"showName": True,
"showAggregateScores": False,
"countUnscored": False,
},
"hideDisabled": False,
"techniques": techniques_list,
"gradient": {
"colors": ["#ffffff", "#ff6666"],
"minValue": 0,
"maxValue": 100,
},
"legendItems": [
{"label": "Observed technique", "color": "#ff6666"},
{"label": "Not observed", "color": "#ffffff"},
],
"showTacticRowBackground": True,
"tacticRowBackground": "#dddddd",
"selectTechniquesAcrossTactics": True,
"selectSubtechniquesWithParent": False,
"selectVisibleTechniques": False,
}
return layer
# 레이어 생성 및 저장
layer = create_navigator_layer("APT29", technique_map, "APT29 (Cozy Bear) TTP analysis")
with open("apt29_navigator_layer.json", "w") as f:
json.dump(layer, f, indent=2)
print("[+] Navigator layer saved to apt29_navigator_layer.json")
4단계: 탐지 격차 식별
from attackcti import attack_client
lift = attack_client()
# 데이터 소스가 있는 모든 기술 가져오기
all_techniques = lift.get_enterprise_techniques()
# 데이터 소스 적용 범위 맵 구축
data_source_coverage = {}
for tech in all_techniques:
tech_id = tech.get("external_references", [{}])[0].get("external_id", "")
data_sources = tech.get("x_mitre_data_sources", [])
for ds in data_sources:
if ds not in data_source_coverage:
data_source_coverage[ds] = []
data_source_coverage[ds].append(tech_id)
# 위협 행위자 기술과 사용 가능한 탐지 비교
detected_techniques = {"T1059", "T1071", "T1566"} # 예: 탐지 가능한 기술
actor_techniques = set(technique_map.keys())
covered = actor_techniques.intersection(detected_techniques)
gaps = actor_techniques - detected_techniques
print(f"\n=== APT29 탐지 격차 분석 ===")
print(f"행위자 기술 수: {len(actor_techniques)}")
print(f"탐지됨: {len(covered)} ({len(covered)/len(actor_techniques)*100:.0f}%)")
print(f"격차: {len(gaps)} ({len(gaps)/len(actor_techniques)*100:.0f}%)")
print(f"\n탐지되지 않은 기술:")
for tech_id in sorted(gaps):
if tech_id in technique_map:
print(f" {tech_id}: {technique_map[tech_id]['name']}")
5단계: 그룹 간 기술 비교
from attackcti import attack_client
lift = attack_client()
# 여러 그룹 간 기술 비교
groups_to_compare = {
"G0016": "APT29",
"G0007": "APT28",
"G0032": "Lazarus Group",
}
group_techniques = {}
for gid, gname in groups_to_compare.items():
techs = lift.get_techniques_used_by_group(gid)
tech_ids = set()
for t in techs:
tid = t.get("external_references", [{}])[0].get("external_id", "")
if tid:
tech_ids.add(tid)
group_techniques[gname] = tech_ids
# 공통 및 고유 기술 찾기
all_groups = list(group_techniques.keys())
common_to_all = set.intersection(*group_techniques.values())
print(f"\n모든 {len(all_groups)}개 그룹에 공통된 기술 수: {len(common_to_all)}")
for tid in sorted(common_to_all):
print(f" {tid}")
for gname, techs in group_techniques.items():
unique = techs - set.union(*[t for n, t in group_techniques.items() if n != gname])
print(f"\n{gname}에 고유한 기술: {len(unique)}개")
검증 기준
- TAXII 서버 또는 로컬 복사본을 통해 ATT&CK 데이터가 성공적으로 조회됨
- 위협 행위자가 절차 예제와 함께 특정 기술에 매핑됨
- ATT&CK Navigator 레이어 JSON이 유효하고 올바르게 렌더링됨
- 탐지 격차 분석이 모니터링되지 않은 기술을 식별함
- 그룹 간 비교가 공유 및 고유 TTP를 드러냄
- 출력물이 탐지 엔지니어링 우선순위 지정에 실행 가능해야 함