이번 글에서는 Azure Sentinel과 Entra ID(구 Azure AD) 로그를 활용한 Sigma 탐지를 실전 중심으로 정리해드리겠습니다.

Microsoft 문서는 Sentinel이 Entra ID Sign-in Logs와 Audit Logs를 기본 지원하며, KQL로 탐지 규칙을 작성한다고 설명합니다.

SigmaHQ 파이프라인을 통해 Sigma 규칙을 KQL로 변환하면, 커뮤니티 3,700+ 규칙을 바로 활용할 수 있습니다.

 

◎ Azure Sentinel + Entra ID가 중요한 이유

  • Azure Sentinel은 클라우드 네이티브 SIEM으로, Entra ID의 Sign-in Logs, Audit Logs, Provisioning Logs를 기본으로 수집합니다. 
  • 이 로그들은 비정상 로그인, 역할 변경, 앱 등록 같은 Azure 공격의 핵심을 잡아줍니다. 
  • Sigma를 쓰면 이런 로그를 플랫폼 독립적으로 표준화해, AWS나 GCP 규칙과도 공유할 수 있습니다.

 

 - 탐지 우선순위

  • 고위험 로그인 (위치, 디바이스 불일치).
  • 역할 할당/권한 상승.
  • 앱 등록/서비스 주체 생성.
  • 조건부 액세스 우회 시도.

 

◎ Entra ID 로그 필드 구조

 - Sign-in Logs (SigninLogs 테이블)

  • ResultType: 0(성공), 50053(조건부 액세스 블록).
  • Location: IP, 국가, ISP.
  • RiskLevelDuringSignIn: high, medium.
  • ConditionalAccessStatus: success, failure.

 

 - Audit Logs (AuditLogs 테이블)

  • Category: UserManagement, ApplicationManagement.
  • ActivityDisplayName: Add member to role.
  • TargetResources: 대상 객체.

 

 - Sigma 매핑

logsource:
  product: azure
  service: entra_id
detection:
  selection:
    ResultType: 0
    RiskLevelDuringSignIn: high

 

◎ 기본 Entra ID Sigma 규칙

1. 고위험 로그인 탐지

title: Entra ID High Risk Sign-in
id: entra-high-risk-signin
status: stable
description: Detects high risk sign-ins in Entra ID
logsource:
  product: azure
  service: entra_id
detection:
  selection:
    ResultType: 0
    RiskLevelDuringSignIn: high
  filter:
    IPAddress: "192.168.*"  # 내부 IP 제외
  condition: selection and not filter
level: high
tags:
  - attack.initial_access
  - attack.t1078
falsepositives:
  - Legitimate high-risk approved

 

 - KQL 변환 결과

SigninLogs
| where ResultType == 0
| where RiskLevelDuringSignIn == "high"
| where IPAddress !startswith "192.168."

 

2. 역할 할당 탐지

title: Entra ID Role Assignment
id: entra-role-assignment
logsource:
  product: azure
  service: entra_id
detection:
  selection:
    Category: UserManagement
    ActivityDisplayName: "Add member to role"
    TargetResources[0].displayName contains "Global Administrator"
  condition: selection
level: critical
tags:
  - attack.persistence
  - attack.t1098.003

 

3. 서비스 주체 생성 (백도어)

title: Entra ID Service Principal Creation
id: entra-service-principal
logsource:
  product: azure
  service: entra_id
detection:
  selection:
    Category: ApplicationManagement
    ActivityDisplayName: "Add service principal"
  filter_legit:
    InitiatedBy.app.displayName: "Microsoft Graph"
  condition: selection and not filter_legit
level: medium

 

 

 고급 탐지 패턴

1. 조건부 액세스 우회

detection:
  selection:
    ResultType: 0
    ConditionalAccessStatus: failure
    Location.countryOrRegion: "CN"
  condition: selection
  • 위치 기반 CA 우회 시도.

 

2. 다중 계정 동시 로그인

correlation:
  type: value_count
  rules:
    - entra-high-risk-signin
  group-by:
    - IPAddress
  timespan: 1h
  field: UserPrincipalName
  condition:
    gte: 5
  • 한 IP에서 5개 이상 계정 로그인.

 

3. 앱 등록 + 권한 부여 체인

temporal_ordered:
  rules:
    - entra-service-principal
    - entra-role-assignment
  timespan: 30m

 

 Sentinel 파이프라인 설정

 - Entra ID 커넥터 활성화

Azure Portal → Sentinel → Data Connectors → Microsoft Entra ID

 

 - KQL 테이블

SigninLogs | AuditLogs | AADNonInteractiveUserSignInLogs

 

 - Sigma CLI 변환

sigma plugin install sentinel
sigma convert --target sentinel --pipeline azure-entra-id entra_rules/

 

 - 변환 결과 예시

SigninLogs
| where TimeGenerated > ago(1d)
| where ResultType == 0
| where RiskLevelDuringSignIn == "high"

 

 오탐 튜닝 전략

 - Whitelist

filter_legit:
  UserAgent|contains:
    - 'Outlook'
    - 'Teams'
  Location.city: 'Seoul'

 

 - 위험도 필터

filter_low_risk:
  RiskDetail|contains: 'verified_device'
condition: selection and not filter_low_risk

 

 - 시간 기반

timespan: 24h
condition: value_count(selection, 1, 24h) > 3

 

 실전 워크플로

1. 데이터 온보딩

Entra ID → Log Analytics → Sentinel 워크스페이스

 

2. Sigma 규칙 배포

sigma convert --target sentinel entra_rules/ > kql_rules.kql
# Analytics → Custom Logs → Paste KQL

 

3. 인시던트 대응

Book of SIEM → Entra ID 워크북
Entity Explorer → UserEntity → Timeline

 

4. 자동화

Playbook → Entra ID 계정 잠금
Logic App → Microsoft Graph API

 

 운영 팁

1. P1/P2 차이

  • P1: 기본 Risk Detection.
  • P2: Adaptive Access Control 추가.

 

2. 워크북 활용

Entra ID Sign-in Workbook → Sigma 히트 상관분석

 

3. MITRE 매핑:

T1078.004: Cloud Accounts
T1098.003: Account Manipulation: Additional Cloud Roles

 

 마무리

  • Azure Sentinel + Entra ID는 클라우드 인증 공격의 첫 번째 방어선입니다. 
  • Sigma로 고위험 로그인, 역할 할당, 서비스 주체 생성을 표준화하면, AWS CloudTrail과 함께 클라우드 보안의 양 날개를 갖추게 됩니다.

 

 

 

반응형

+ Recent posts