규칙에서 컨텍스트 보강 데이터 사용
조사 중 보안 분석가를 사용 설정하기 위해 Chronicle은 다양한 소스의 문맥 데이터를 수집하고 수집된 데이터를 분석하며 고객 환경의 아티팩트에 대한 추가 컨텍스트를 제공합니다. 이 문서에서는 분석가가 감지 엔진 규칙에서 컨텍스트 보강 데이터를 사용하는 방법을 보여주는 예시를 제공합니다.
Chronicle에서 수신 데이터를 보강하는 방법, 수행된 보강 유형, 보강 필드에 대한 자세한 내용은 로그 수집 중 UDM 데이터 보강을 참조하세요.
규칙에서 보급률 보강 필드
다음 예시에서는 Detection Engine에서 보급 관련 보강 필드를 사용하는 방법을 보여줍니다. 자세한 내용은 보급 관련 보강 필드 목록을 참조하세요.
보급률이 낮은 도메인 액세스 식별
이 감지 규칙은 일치 항목이 발견되면 감지 알림이 아닌 감지 이벤트를 생성합니다. 이는 주로 애셋을 조사할 때 보조 지표로 사용됩니다. 예를 들면 이슈를 트리거한 심각도가 높은 다른 알림이 있는 경우입니다.
rule network_prevalence_low_prevalence_domain_access {
meta:
author = "Chronicle Security"
description = "Detects access to a low prevalence domain. Requires baseline of prevalence be in place for effective deployment."
severity = "LOW"
events:
$e.metadata.event_type = "NETWORK_HTTP"
$e.principal.ip = $ip
// filter out URLs with RFC 1918 IP addresses, i.e., internal assets
not re.regex($e.target.hostname, `(127(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$)|(10(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$)|(192\.168(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}$)|(172\.(?:1[6-9]|2\d|3[0-1])(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2})`)
// only match valid FQDN, filter out background non-routable noise
re.regex($e.target.hostname, `(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]`)
$domainName = $e.target.hostname
//join event ($e) to entity graph ($d)
$e.target.hostname = $d.graph.entity.domain.name
$d.graph.metadata.entity_type = "DOMAIN_NAME"
// tune prevalence as fits your results
$d.graph.entity.domain.prevalence.rolling_max <= 10
match:
$ip over 1h
outcome:
$risk_score = max(
// increment risk score based upon rolling_max prevalence
if ( $d.graph.entity.domain.prevalence.rolling_max >= 10, 10) +
if ( $d.graph.entity.domain.prevalence.rolling_max >= 2 and $d.graph.entity.domain.prevalence.rolling_max <= 9 , 20) +
if ( $d.graph.entity.domain.prevalence.rolling_max = 1, 30)
)
$domain_list = array_distinct($domainName)
$domain_count = count_distinct($domainName)
condition:
$e and $d
}
다음은 이 규칙에서 생성된 감지를 보여주는 예시입니다.
보급률 점수가 낮은 도메인에 대한 액세스 식별
이 규칙은 보급률 점수가 낮은 도메인에 대한 액세스를 감지하는 데 사용될 수 있습니다. 적용하려면 아티팩트의 보급률 점수 기준이 있어야 합니다. 다음 예시에서는 참조 목록을 사용하여 결과를 조정하고 임곗값 보급률 값을 적용합니다.
rule network_prevalence_low_prevalence_domain_access {
meta:
author = "Chronicle Security"
description = "Detects access to a low prevalence domain. Requires baseline of prevalence be in place for effective deployment."
severity = "LOW"
events:
$e.metadata.event_type = "NETWORK_HTTP"
$e.principal.ip = $ip
// filter out URLs with RFC 1918 IP addresses, i.e., internal assets
not re.regex($e.target.hostname, `(127(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$)|(10(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$)|(192\.168(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2}$)|(172\.(?:1[6-9]|2\d|3[0-1])(?:\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){2})`)
// used an explicit exclusion reference list
not $e.target.hostname in %exclusion_network_prevalence_low_prevalence_domain_access
// only match valid FQDN, filter out background non-routable noise
re.regex($e.target.hostname, `(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]`)
$domainName = $e.target.hostname
//join event ($e) to entity graph ($d)
$e.target.hostname = $d.graph.entity.domain.name
$d.graph.metadata.entity_type = "DOMAIN_NAME"
// tune prevalence as fits your results
$d.graph.entity.domain.prevalence.rolling_max <= 10
match:
$ip over 1h
outcome:
$risk_score = max(
// increment risk score based upon rolling_max prevalence
if ( $d.graph.entity.domain.prevalence.rolling_max >= 10, 10) +
if ( $d.graph.entity.domain.prevalence.rolling_max >= 2 and $d.graph.entity.domain.prevalence.rolling_max <= 9 , 20) +
if ( $d.graph.entity.domain.prevalence.rolling_max = 1, 30)
)
$domain_list = array_distinct($domainName)
$domain_count = count_distinct($domainName)
condition:
$e and #d > 10
}
다음은 이 규칙에서 생성된 감지의 예시를 보여주는 화면 캡처입니다.
IOC 일치율로 보급률이 낮은 도메인 식별
이 감지 규칙은 감지 알림을 생성하며 알려진 IOC라고도 하는 보급률이 낮은 도메인을 비교하는 높은 일치도를 제공합니다.
rule network_prevalence_uncommon_domain_ioc_match {
meta:
author = "Chronicle Security"
description = "Lookup Network DNS queries against Entity Graph for low prevalence domains with a matching IOC entry."
severity = "MEDIUM"
events:
$e.metadata.event_type = "NETWORK_DNS"
$e.network.dns.questions.name = $hostname
//only match FQDNs, e.g., exclude chrome dns access tests and other internal hosts
$e.network.dns.questions.name = /(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z0-9][a-z0-9-]{0,61}[a-z0-9]/
//prevalence entity graph lookup
$p.graph.metadata.entity_type = "DOMAIN_NAME"
$p.graph.entity.domain.prevalence.rolling_max <= 3
$p.graph.entity.domain.name = $hostname
//ioc entity graph lookup
$i.graph.metadata.vendor_name = "ET_PRO_IOC"
$i.graph.metadata.entity_type = "DOMAIN_NAME"
$i.graph.entity.hostname = $hostname
match:
$hostname over 10m
outcome:
$risk_score = max(
//increment risk score based upon rolling_max prevalence
if ( $p.graph.entity.domain.prevalence.rolling_max = 3, 50) +
if ( $p.graph.entity.domain.prevalence.rolling_max = 2, 70) +
if ( $p.graph.entity.domain.prevalence.rolling_max = 1, 90)
)
condition:
$e and $p and $i
}
다음은 이 규칙에서 생성된 감지를 보여주는 예시입니다.
규칙에서 세이프 브라우징 보강 필드 사용
Chronicle은 파일 해시와 관련된 위협 목록에서 데이터를 수집합니다. 이 보강 정보는 Chronicle에 항목으로 저장됩니다.
감지 엔진 규칙을 만들어 세이프 브라우징에서 수집된 항목에 대한 일치 항목을 식별할 수 있습니다. 다음은 이 보강된 정보를 대상으로 쿼리하여 컨텍스트 인식 분석을 빌드하는 Detection Engine 규칙의 예시입니다.
rule safe_browsing_file_execution {
meta:
author = "Chronicle Security"
description = "Example usage of Safe Browsing data, to detect execution of a file that's been deemed malicious"
severity = "LOW"
events:
// find a process launch event, match on hostname
$execution.metadata.event_type = "PROCESS_LAUNCH"
$execution.principal.hostname = $hostname
// join execution event with Safe Browsing graph
$sb.graph.entity.file.sha256 = $execution.target.process.file.sha256
// look for files deemed malicious
$sb.graph.metadata.entity_type = "FILE"
$sb.graph.metadata.threat.severity = "CRITICAL"
match:
$hostname over 1h
condition:
$execution and $sb
}