15Threat IndicatorsThreat Indicators
Check Point 패키지에 들어 있는 피드와 ThreatCloud 피드만으로는 부족할 때가 있습니다. Threat Indicators 는 Anti-Bot·Anti-Virus·IPS 엔진에 직접 위협 피드를 더해, 조직이 직접 만든 위협 인텔리전스나 외부에서 가져온 인텔리전스를 그대로 단속에 활용하게 해 주는 기능입니다. 위협 지표 파일을 직접 만들 수도 있고 외부 소스에서 가져올 수도 있으며, SmartConsole과 CLI 양쪽 으로 올릴 수 있습니다. 이 장은 지표의 개념부터 SmartConsole 업로드 절차, CLI의 ioc_feeds 명령으로 외부 피드를 가져오는 방법, CSV·STIX·Custom CSV·Snort 형식의 규칙과 제약까지 원문이 다루는 모든 내용을 빠짐없이 풀어 정리합니다.
Indicator와 Observable — 무엇을 다루는가
먼저 두 용어를 구분해 두어야 이후 설명이 정확히 읽힙니다.
- Indicator(지표) 는 사이버 영역에서 악성 활동을 나타내는 관찰 항목(observable)의 묶음 으로, 그것을 어떻게 해석하고 어떻게 다룰지 에 대한 부가 정보를 함께 담습니다.
- Observable(관찰 항목) 은 사이버 영역에서 관찰할 수 있는 사건이나 상태 속성 입니다. 예를 들어 IP 주소, MD5·SHA1·SHA256 파일 시그니처, URL, 메일 발신자 주소 같은 것들이 관찰 항목입니다.
Threat Indicators는 다음 두 가지로 공격을 표현합니다.
- 특정한 관찰 패턴(observable pattern)
- 사이버 보안 맥락에서 관심 대상인 객체·행위를 나타내려는 부가 정보
지표는 인텔리전스, 자체 분석, 정부, 파트너 등 다양한 출처에서 나옵니다. 즉 "이 IP·해시·URL이 보이면 위협"이라는 식의 맞춤 위협 목록을 엔진에 주입해, Check Point 기본 피드 위에 조직만의 위협 정보를 얹는 것입니다.
SmartConsole로 지표 파일 가져오기
SmartConsole에서 위협 지표 파일을 수동으로 올릴 때는 파일이 Check Point CSV 형식 또는 STIX XML(STIX 1.0) 형식 이어야 합니다. 또한 모든 레코드의 필드 수가 같아야 하며, 어떤 지표 파일에 필드 수가 다른 레코드가 섞여 있으면 로드되지 않 습니다.
지표 파일을 로드하는 절차는 다음과 같습니다.
| 단계 | 작업 |
|---|---|
| 1 | SmartConsole 메인 뷰에서 Security Policies > Threat Prevention > Custom Policy > Custom Policy Tools > Indicators 로 갑니다. Autonomous Threat Prevention 을 쓴다면 Security Policies > Threat Prevention > Autonomous Policy > Autonomous Policy Tools > Indicators 로 갑니다. |
| 2 | New 를 누르고 New IOC file 을 선택합니다. Indicator 구성 창이 열립니다. |
| 3 | Name 을 입력합니다. 모든 Indicator는 고유한 이름 을 가져야 합니다. |
| 4 | Object Comment 를 입력합니다(선택). |
| 5 | Import 를 눌러 지표 파일을 찾아 가져옵니다. 각 파일의 내용은 고유해야 하며, 중복 파일은 로드할 수 없습니다. |
| 6 | 이 Indicator에 적용할 동작(action) 을 고릅니다(아래 표 참고). |
| 7 | Tag 를 추가합니다. |
| 8 | OK 를 누릅니다. 선택 필드를 비워 두면 빈 필드에 기본값이 쓰인다는 경고가 뜨며, OK 를 누르면 지표 파일이 로드됩니다. |
| 9 | Threat Prevention Policy 를 설치합니다. |
6단계에서 고를 수 있는 동작은 세 가지입니다.
| 동작 | 의미 |
|---|---|
| Prevent | Threat Prevention 소프트웨어 블레이드가 탐지된 관찰 항목을 차단 합니다. |
| Detect | 로그 항목을 만들되, 탐지된 관찰 항목은 그대로 통과 시킵니다. |
| Inactive | 아무 동작도 하지 않 습니다. |
지표 삭제하기
| 단계 | 작업 |
|---|---|
| 1 | 삭제할 Indicator를 선택합니다. |
| 2 | Delete 를 누릅니다. |
| 3 | 열리는 창에서 Yes 를 눌러 확인합니다. |
Indicator 객체의 속성은 편집할 수 있지만, 그 객체가 사용하는 파일만은 바꿀 수 없 습니다. 다른 파일을 쓰게 하려면 기존 Indicator를 삭제하고 새로 만들어야 합니다.
외부 Custom Intelligence Feed 가져오기
Custom Intelligence Feeds 는 제3자 서버의 피드를 Security Gateway로 직접 가져와 Anti-Virus·Anti-Bot·IPS 블레이드가 단속하게 하는 기능입니다. 최소한의 운영 부담으로 지표를 관리·모니터링하도록 돕습니다.
CLI에서 외부 피드 가져오기
외부 소스의 위협 지표 피드를 Security Gateway에서 직접 CLI로 가져올 수 있습니다. 처음 피드를 가져와 정책을 설치하고 나면, 피드 파일이 갱신될 때마다 Security Gateway가 자동으로 지표 파일을 끌어와 단속 합니다. 파일은 HTTP 또는 HTTPS 로 가져오거나, 로컬 파일·로컬 디렉터리 를 읽어 가져옵니다.
CLI에서 가져올 수 있는 피드 형식은 다음과 같습니다.
- CSV — Check Point 형식
- Custom CSV — 그 밖의 형식
- STIX XML(STIX 1.0)
- Snort — 버전 2.9 이하
피드의 리소스(Feed's Resource)
모든 형식에서 피드의 리소스는 다음 셋 중 하나가 될 수 있습니다.
URL — HTTP 또는 HTTPS
ioc_feeds add --feed_name remote_feed --transport http --resource "http://10.0.0.1/my_feeds/stix_feed.xml"Local File — Security Gateway의 로컬 파일
ioc_feeds add --feed_name local_feed --transport local_file --resource "/home/admin/my_feed.csv"Local Directory — 올바른 피드 형식의 파일이 담긴 Security Gateway의 로컬 디렉터리
ioc_feeds add --feed_name local_feed --transport local_directory --resource "/home/admin/my_feed_folder"`ioc_feeds` 명령으로 외부 피드 관리하기
위협 지표 파일을 가져오고 관리하려면 Security Gateway의 Expert mode 에서 다음 ioc_feeds 명령을 씁니다.
| 명령 | 설명 | 예시 | |
|---|---|---|---|
ioc_feeds -h | 내장 도움말을 보여 줍니다. | ||
ioc_feeds push | 지금 즉시 피드를 푸시 합니다. | ioc_feeds push | |
ioc_feeds show | 존재하는 모든 피드를 보여 줍니다. | ioc_feeds show | |
ioc_feeds show --feed_name <Feed> | 지정한 피드의 상세 정보를 보여 줍니다. | ioc_feeds show --feed_name local_feed | |
ioc_feeds show_interval | 가져오기(fetching) 간격 을 보여 줍니다. | ioc_feeds show_interval | |
ioc_feeds set_interval <sec> | 모든 피드를 가져올 간격(초)을 설정합니다. | ioc_feeds set_interval 1000 | |
ioc_feeds show_scanning_mode | 스캔 모드 의 상태를 보여 줍니다. | ioc_feeds show_scanning_mode | |
| `ioc_feeds set_scanning_mode {on\ | off}` | 스캔 모드를 켜거나(on) 끕니다(off). | ioc_feeds set_scanning_mode off |
피드 추가 — `ioc_feeds add`
새 피드를 추가하는 명령입니다. 몇 가지 예를 보면 쓰임새가 분명합니다.
# 예 1 — 로컬 파일 피드
ioc_feeds add --feed_name local_feed --transport local_file --resource /home/admin/my_feed.csv
# 예 2 — 프록시를 거치는 원격 피드
ioc_feeds add --feed_name remote_feed --transport http --resource "http://10.0.0.1/my_feeds/stix_feed.xml" --proxy 192.168.22.33:8080 --state false --feed_action Detect --user_name admin@example.com
# 예 3 — 원격 피드 dry run(시험 실행)
ioc_feeds add --feed_name remote_stix_file --transport http --resource "http://www.public_indicators.com/ioc_stix_file.xml" --test true필수 파라미터(Mandatory)
| 파라미터 | 설명 | |
|---|---|---|
--feed_name <Feed> | 피드 이름을 지정합니다. | |
| `--transport {http\ | https} --resource <URL>` | 원격 피드 URL을 지정합니다. |
--transport local_file --resource <로컬 파일 절대경로> | 로컬 피드 파일을 지정합니다. | |
--transport local_directory --resource <로컬 디렉터리 절대경로> | 로컬 피드 디렉터리를 지정합니다. 반드시 /home/ 디렉터리 안에 있어야 합니다. |
선택 파라미터(Optional)
| 파라미터 | 설명 | ||
|---|---|---|---|
| `--state {true\ | false}` | 피드 상태를 active(true, 기본값) 또는 inactive(false)로 설정합니다. | |
| `--feed_action {Prevent\ | Detect\ | Ask}` | 피드 동작을 설정합니다(기본값 Prevent). |
--user_name <user> | 피드 소스의 사용자 이름을 지정합니다 — 암호를 묻는 프롬프트 가 뜹니다. | ||
--proxy none | 피드 소스에 연결할 때 어떤 프록시도 쓰지 않 도록 합니다. --no_proxy 도 --proxy 도 지정하지 않으면 Security Gateway 프록시를 사용 합니다. | ||
--proxy <프록시 서버>:<프록시 포트> | 피드 소스에 연결할 때 Security Gateway 프록시를 재정의 합니다. 둘 다 지정하지 않으면 Security Gateway 프록시를 사용합니다. | ||
--proxy_user_name <user> | 프록시 서버의 사용자 이름을 지정합니다 — 암호를 묻는 프롬프트 가 뜹니다. | ||
--test true | dry run(시험 실행) — 지정한 피드를 가져와 파싱하되 구성은 저장하지 않 습니다. |
피드 수정 — `ioc_feeds modify`
기존 피드를 수정합니다. 지정하지 않은 파라미터 값은 이전 그대로 유지됩니다.
ioc_feeds modify --feed_name local_feed --state true피드 삭제 — `ioc_feeds delete`
지정한 기존 피드를 삭제합니다. 필수 파라미터는 --feed_name <feed>(피드 이름) 하나입니다.
ioc_feeds delete --feed_name local_feedCSV(Check Point) · STIX 형식의 필드
CSV Check Point 형식과 STIX XML(STIX 1.0) 형식의 각 레코드는 아래 필드 를 가져야 합니다.
| 필드 | 설명 | 유효 값 | 값 기준 | 필드 종류 |
|---|---|---|---|---|
| UNIQ-NAME | 관찰 항목의 이름 | 자유 텍스트 | 고유해야 함 | 필수 |
| VALUE | 관찰 항목 타입에 맞는 유효한 값 | 아래 TYPE 표 참고 | 파라미터의 값 | 필수 |
| TYPE | 관찰 항목의 타입 | 아래 타입 목록 참고 | (URL은 대소문자 구분 안 함) | 필수 |
| CONFIDENCE | 관찰 항목이 나타내는 확신(confidence) 정도 | low·medium·high·critical | 기본값 high | 선택 |
| SEVERITY | 관찰 항목이 나타내는 위협 심각도(severity) | low·medium·high·critical | 기본값 high | 선택 |
| PRODUCT | 관찰 항목을 처리하는 Check Point 소프트웨어 블레이드 | AV·AB | 기본값 AV | 선택 |
| COMMENT | 자유 텍스트 | 선택 |
TYPE(타입)에 들어갈 수 있는 값은 다음과 같습니다.
| TYPE | 유효 값 |
|---|---|
| URL | 유효한 URL이면 무엇이든(대소문자 구분 안 함) |
| Domain | 유효한 URL 도메인 |
| IP | 표준 IPv4 주소 |
| IP Range | 하이픈으로 구분한 IPv4 주소 범위: <IP1>-<IP2> |
| MD5 | 유효한 MD5 해시 |
| SHA1 | 유효한 SHA1 해시 |
| SHA256 | 유효한 SHA256 해시 |
| Mail-subject | 비어 있지 않은 임의의 텍스트 |
| Mail-from | 단일 이메일 주소(예: abc@domain.com) 또는 이메일 도메인(예: @domain.com, domain.com) |
| Mail-to | 단일 이메일 주소 또는 이메일 도메인 |
| Mail-cc | 단일 이메일 주소 또는 이메일 도메인 |
| Mail-reply-to | 단일 이메일 주소 또는 이메일 도메인 |
PRODUCT(블레이드) 값은 둘 중 하나입니다.
- AV — Check Point Anti-Virus 소프트웨어 블레이드(기본값).
- AB — Check Point Anti-Bot 소프트웨어 블레이드.
형식에 관한 참고 사항
- 선택 필드가 비어 있으면 기본값이 사용 됩니다.
- 필수 필드가 비어 있으면 지표 파일이 로드되지 않 습니다.
- STIX 2.0(JSON 파일)은 지원되지 않 습니다.
- Custom Indicators CLI(
load_indicators)는 지원되지 않 습니다.
지원되는 STIX 요소(element)는 다음과 같습니다.
stix:STIX_Header
stix:Title
stix:Description
stix:Indicators
stix:Indicator
indicator:Title
indicator:Type
indicator:Description
indicator:Observable
cybox:Object
cybox:Properties
FileObj:Hashes
cyboxCommon:Hash
cyboxCommon:Type
cyboxCommon:Simple_Hash_Value
stix:Observables
cybox:Observable
URIObj:Value
URIObject:Value
AddressObject:Address_Value
AddressObj:Address_Value
AddressObj:AddressObjectType
AddressObjet:AddressObjectType
cybox:TitleCondition Type Enum 과 Condition Application Enum 은 Equals 와 Any 값을 지원합니다. 예:
<cyboxCommon:Simple_Hash_Value condition="Equals" apply_condition="ANY">Check Point 형식 CSV 지표 파일의 구문 규칙
- 레코드 안의 필드는 쉼표(
,)로 구분 합니다. - 한 줄에 한 레코드 를 넣거나,
\n으로 레코드를 구분합니다. - 자유 텍스트에 따옴표·쉼표·줄바꿈 이 들어가면 그 텍스트를 따옴표로 감싸야 합니다.
- 자유 텍스트의 일부를 따옴표로 감싸려면 이중 따옴표 를 씁니다:
"<text>".
Check Point 형식 CSV 지표 파일 예시
#! DESCRIPTION = indi file,,,,,,
"#! REFERENCE = Indicator Bulletin; Feb 20, 2014",,,,,,
# FILE FORMAT:,,,,,,
"# All lines beginning ""#"" are comments",,,,,,
"# All lines beginning ""#!"" are metadata read by the SW",,,,,,
"# UNIQ-NAME,VALUE,TYPE,CONFIDENCE,SEVERITY,PRODUCT,COMMENT",,,,,,
observ1,8d9b6b8912a2ed175b77acd40cbe9a73,MD5,medium,medium,AV,FILENAME:WUC Invitation Letter Guests.doc
observ2,76700f862a0c241b8f4b754f76957bda,MD5,high,high,AV,FILENAME:essais~.swf|NOTE:FWS type Flash file
observ4,5dda6d1446b3cdb0bd4a3f0adb85d030ff59e975,SHA1,low,high,AV,file_name.pdf
observ5,db435a875be456f088f11c579aa52f30bc83cfff272cfad5a3f6f4de74de0654,SHA256,high,high,AV,file_name.doc
observ7,http://somemaliciousdomain.com/uploadfiles/upload/exp.swf?info=789c333432d333b4d4b330d133b7b230b03000001b39033b&infosize=00840000,URL,high,high,AV,IPV4ADDR:196.168.25.25
observ8,svr01.passport.ServeUser.com,Domain,low,high,AB,TCP:80|IPV4ADDR:172.18.18.25|NOTE:Embedded EXE Remote C&C and Encoded Data
observ9,somemaliciousdomain2.com,Domain,,low,AV,TCP:8080|IPV4ADDR:172.22.14.10
observ10,http://www.bogusdomain.com/search?q=%24%2B%25&form=MOZSBR&pc=MOZI,URL,low,low,AB,IPV4ADDR:172.25.1.5
observ11,http://somebogussolution.com/register/card/log.asp?isnew=-1&LocalInfo=Microsoft%20Windows%20XP%20Service%20Pack%202&szHostName=ADAM-E512679EFD&tmp3=tmp3,URL,medium,,AB,
observ14,172.16.47.44,IP,high,medium,AB,TCP:8080
observ15,172.16.73.69,IP,medium,medium,AV,TCP:443|NOTE:Related to Flash exploitation
observ16,abc@def.com,mail-to,,high,AV,"NOTE:truncated; samples have appended to the subject the string ""PH000000NNNNNNN"" where NNNNNNN is a varying number"
observ34,stamdomain.com,domain,,,AB,
observ35,stamdomain.com,mail-from,high,medium,AV,
observ37,xyz.com,mail-from,medium,medium,AB,
observ38,@xyz.com,mail-from,medium,medium,AB,
observ39,a@xyz.com,mail-from,medium,medium,AB,# 로 시작하는 줄은 주석이고, #! 로 시작하는 줄은 소프트웨어가 읽는 메타데이터 라는 점을 예시 첫머리에서 확인할 수 있습니다.
STIX 1.0 XML 지표 파일 예시
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:stix="http://stix.mitre.org/stix-1"
xmlns:indicator="http://stix.mitre.org/Indicator-2"
xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
xmlns:FileObj="http://cybox.mitre.org/objects#FileObject-2"
xmlns:cybox="http://cybox.mitre.org/cybox-2"
xmlns:cyboxCommon="http://cybox.mitre.org/common-2"
xmlns:cyboxVocabs="http://cybox.mitre.org/default_vocabularies-2"
xmlns:example="http://example.com/"
xsi:schemaLocation="
http://stix.mitre.org/stix-1 ../stix_core.xsd
http://stix.mitre.org/Indicator-2 ../indicator.xsd
http://stix.mitre.org/default_vocabularies-1 ../stix_default_vocabularies.xsd
http://cybox.mitre.org/objects#FileObject-2 ../cybox/objects/File_Object.xsd
http://cybox.mitre.org/default_vocabularies-2 ../cybox/cybox_default_vocabularies.xsd"
id="example:STIXPackage-ac823873-4c51-4dd1-936e-a39d40151cc3"
version="1.0.1">
<stix:STIX_Header>
<stix:Title>Example file watchlist</stix:Title>
<stix:Package_Intent xsi:type="stixVocabs:PackageIntentVocab-1.0">Indicators - Watchlist</stix:Package_Intent>
</stix:STIX_Header>
<stix:Indicators>
<stix:Indicator xsi:type="indicator:IndicatorType" id="example:Indicator-611935aa-4db5-4b63-88ac-ac651634f09b">
<indicator:Type xsi:type="stixVocabs:IndicatorTypeVocab-1.0">File Hash Watchlist</indicator:Type>
<indicator:Description>Indicator that contains malicious file hashes.</indicator:Description>
<indicator:Observable id="example:Observable-c9ca84dc-4542-4292-af54-3c5c914ccbbc">
<cybox:Object id="example:Object-c670b175-bfa3-48e9-a218-aa7c55f1f884">
<cybox:Properties xsi:type="FileObj:FileObjectType">
<FileObj:Hashes>
<cyboxCommon:Hash>
<cyboxCommon:Type xsi:type="cyboxVocabs:HashNameVocab-1.0" condition="Equals">MD5</cyboxCommon:Type>
<cyboxCommon:Simple_Hash_Value condition="Equals" apply_condition="ANY">0522e955aaee70b102e843f14c13a92c##comma##0522e955aaee70b102e843f14c13a92d##comma##0522e955aaee70b102e843f14c13a92e</cyboxCommon:Simple_Hash_Value>
</cyboxCommon:Hash>
</FileObj:Hashes>
</cybox:Properties>
</cybox:Object>
</indicator:Observable>
</stix:Indicator>
</stix:Indicators>
</stix:STIX_Package>Custom CSV 형식
Custom Intelligence Feeds 기능은 여러 가지 구조의 CSV 파일 을 지원합니다. 즉 외부 소스가 Check Point 표준 형식이 아니더라도, 파일 구조를 직접 기술해 가져올 수 있습니다.
Custom CSV 파일의 구문 규칙
- 지원되는 관찰 항목은 다음과 같습니다 — Name, Value, Type, Confidence, Severity, Product, Comment.
- 파일의 형식·구분자·건너뛸 주석 줄을 정의합니다.
--format으로 관찰 항목을 대괄호[ ]안에 지정합니다.--comment로 원본 파일에서 무시할 내용 을 지정합니다.
- Value 와 Type 관찰 항목은 필수 입니다.
- Value 관찰 항목은 원본 파일에서의 위치로 지정합니다 —
#<항목 위치>. 예를 들어 Value가 CSV 행의 3번째 자리에 있다면 이렇게 씁니다.
--format [value:#3]
- 나머지 관찰 항목은 원본 파일에서의 위치를 적거나, 값 자체를 직접 지정 할 수 있습니다. 예를 들어 Type 관찰 항목의 값을 모든 CSV 행에 대해 도메인(domain)으로 두려면 이렇게 씁니다.
--format [type:domain]
- 피드 리소스가 원격 소스(transport가 HTTP/HTTPS) 일 때는, 피드를 가져올 때마다 이 피드에 지정한 형식대로 파싱 합니다.
예 1 — 도메인 목록
원본 CSV 파일이 도메인 목록인 경우입니다.
# This list consists of High Level Sensitivity website URLs
# Columns (tab delimited):
# (1) site
#
Site
4kqd3hniqgptupi3p.k7oudl.top
stggsjv6mqiibmax.torshop.li
grrgelpetkavanis4.pv
52ou5k3t73ypjije.ie7t8k.top
ja:many.cu.ma다음 명령을 실행하면 Security Gateway는 각 행의 첫 번째 자리에 있는 도메인 을 취하고, # 으로 시작하는 줄과 Site 라는 단어는 무시 합니다.
ioc_feeds add --feed_name domain_list --transport https --resource "https://isc.sans.edu/feeds/suspiciousdomains_High.txt" --format [type:domain,value:1] --comment "#, Site"예 2 — 공백·구분자가 섞인 IP 목록
원본 CSV 파일이 다음과 같다고 합시다.
# category Descriptive tag name for this entry. For this report,
# the text sshpwauth will appear.
#
# A commented footer section shows an aggregate account of ASNs and
# addresses seen in the current report
#
3 | organization A | 18.30.10.26 | 2018-12-15 08:16:39 | sshpwauth
3 | organization B | 18.30.21.197 | 2018-12-28 17:43:41 | sshpwauth
17 | organization C | 128.46.80.71 | 2019-01-04 17:56:00 | sshpwauth
111| organization D | 128.197.31.119 | 2019-01-10 03:12:18| sshpwauth다음 명령을 실행하면 Security Gateway는 행의 3번째 자리에서 IP 주소 를, 2번째 자리에서 comment 를 취하고, # 으로 시작하는 모든 내용을 무시합니다. 여기서는 --delimiter "|" 로 구분자를 세로줄 로 지정했습니다.
ioc_feeds add --feed_name ip_list_with_spaces --transport local_file --resource "/home/admin/ioc/ip_list_with_spaces.txt" --format [value:#3,comment:#2,type:ip] --comment [#] --delimiter "|"Snort 형식
이 기능을 쓰면 Snort 형식의 인텔리전스 피드 도 로드할 수 있어, 전반적인 위협 탐지 능력과 보안 운영의 통제력을 높일 수 있습니다.
Snort 규칙은 시그니처로 공격을 정의합니다. 가져온 Snort 보호(protection)의 이름은 원본 Snort 규칙의 msg 필드 값 이 됩니다. Snort 피드 크기는 관찰 항목 3,000개, 규칙 6,000개 로 제한되며, 이를 초과하면 로드되지 않 습니다. Check Point는 Snort 2.9 버전 이하 를 지원하며, Snort 구문은 snort.org의 공식 문서에 설명되어 있습니다.
Snort 규칙 구문
<Action> <Protocol> <Source IP Address> <Source Port> <Direction> <Destination IP Address> <Destination Port> (msg:"<Text>"; <Keyword>:"<Option>";)Snort 규칙은 Rule Header(규칙 헤더)와 Rule Options(규칙 옵션) 두 논리 부분으로 나뉩니다.
- Snort Rule Header
<Action> <Protocol> <Address> <Port> <Direction> <Address> <Port>
- Snort Rule Options
Snort 파일 예시
다음 규칙은 HTTP 트래픽에서 .pdf 문자열 을 탐지할 때마다 경보를 만들도록 설계되었습니다. PDF 파일을 HTTP로 전송하려는 시도를 차단하거나 추가 조사하기 위한 것입니다.
alert tcp $EXTERNAL_NET any -> $HOME_NET 80 (msg:"Block pdf files over HTTP"; content:".pdf";)| 부분 | 설명 |
|---|---|
alert tcp | 검사할 프로토콜을 지정합니다. 여기서는 TCP. |
$EXTERNAL_NET any -> $HOME_NET 80 | 트래픽 흐름 방향을 정의합니다. 모든 외부 네트워크($EXTERNAL_NET)의 모든 포트(any)에서, 로컬 네트워크($HOME_NET)의 80번 포트(HTTP)로 가는 트래픽을 보라는 뜻입니다. |
(msg:"Block pdf files over HTTP"; content:".pdf";) | 규칙 본문입니다. 큰따옴표로 감싼 설명 메시지(msg)와, HTTP 트래픽에서 .pdf 문자열을 찾는 콘텐츠 매치(content)로 이뤄집니다. |
지원되는 Snort 구문
일반적으로 지원되는 구문 요소는 다음과 같습니다(일부 제약은 아래 "지원되지 않는 Snort 구문" 참고).
| 키워드 | 설명 |
|---|---|
length | protected_content 규칙 다이제스트에 지정된 콘텐츠의 원래 길이 를 지정합니다. |
pcre | Perl 호환 정규식 으로 규칙을 작성하게 해 줍니다. |
flowbits | 전송 프로토콜 세션 동안 상태를 추적 하게 해 줍니다. Session 전처리기의 대화 추적과 함께 사용합니다. |
byte_test | 바이트 필드를 특정 값과 비교(연산자 사용) 합니다. |
byte_jump | 길이 인코딩 프로토콜의 특정 부분을 건너뛰어 매우 구체적인 위치에서 탐지 하게 해 줍니다. |
isdataat | 페이로드의 지정 위치에 데이터가 있는지 확인합니다. |
no_match | 규칙이 매치돼도 트래픽을 차단하지 않 습니다. flowbits 키워드와 함께 써서, 차단 없이 플래그만 설정합니다. |
각 키워드의 예시는 다음과 같습니다.
# pcre
alert tcp any any -> any 80 (content:"/foo.php?id="; pcre:"/\/foo.php?id=[0-9]{1,10}/iU";)
# flowbits
alert tcp $HTTP_SERVERS any -> $EXTERNAL_NET 21 (msg: "Does not match state in FTP path"; flow: established, to_server; content: "targetfile"; nocase; fast_pattern; flowbits: isset,INFTPPATH;no_match;)
# byte_test
alert udp $EXTERNAL_NET any -> $HOME_NET 123 (msg: "Header length longer than maximum"; content: "length|3d|"; byte_test: 4, >, 1024, 1, relative;)
# byte_jump
alert udp any any -> any 123 (msg: "Check for 0001 after 0123"; content: "|30 31 32 33|"; byte_jump: 4,4, relative; content: "|30 30 30 31|"; distance: 1; relative;)
# isdataat
alert tcp $EXTERNAL_NET any -> $HTTP_SERVERS $HTTP_PORTS (msg: "\r\n\r\nHas 300 byte after"; flow: established, to_server; content: "|0a 0d 0a 0d|"; isdataat: 300,relative; sid:11111111;)
# no_match
alert tcp $HTTP_SERVERS any -> $EXTERNAL_NET 21 (msg: "Does not match state in FTP path"; flow: established, to_server; content: "targetfile"; nocase; fast_pattern; flowbits: isset,INFTPPATH;no_match; sid: 55555555;)추가로 다음이 지원됩니다.
- 지원되는 Content 키워드 수정자 —
nocase,rawbytes,depth,offset:,distance:,within,urilen. - 지원되는 Threshold 규칙 타입 —
Threshold,Both(Limit은 지원 안 함). - 지원되는 매크로 —
HTTP_PORTS(80과 8080 포트로 해석).
지원되지 않는 Snort 구문
다음 구문은 지원되지 않으며 변환되지 않 습니다.
- PCRE 수정자:
G,O,A - 전방탐색(lookahead) 단언 이 있는 PCRE 정규식:
?! byte_test키워드를<, >, =, &, ^에 없는 연산자와 함께 쓰는 경우http_method가 Snort 규칙에서 유일한 http 수정자 타입 인 경우- 프로토콜
icmp,ip(all은 UDP·TCP 프로토콜로 해석) content키워드가 없는 Snort 규칙HTTP_PORTS를 제외한 모든 PORT 매크로- 출발지 포트(source port) 지정(
any만 지원) - 목적지 포트
any지정(정확한 목적지 포트 번호 또는 포트 번호 범위를 반드시 지정해야 함)
다음은 변환이 동작 방식을 바꾸는 매크로·구문입니다.
- IP 주소 지정 — 모든 IP 주소 에 단속됩니다.
HOME_NET매크로 —anyIP 주소로 해석됩니다.EXTERNAL_NET매크로 —anyIP 주소로 해석됩니다.HTTP_SERVERS매크로 —anyIP 주소로 해석됩니다.
또한 다음 키워드·수정자 조합은 IPS 블레이드에서 Snort 규칙과는 다르게 구현됩니다.
rawbytes contenthttp_uri content와 함께 쓴BPCRE 수정자UPCRE 수정자- HTTP content 또는 PCRE 수정자가 있는 경우 —
http_raw_uri content또는IPCRE 수정자,http_stat_msg content또는YPCRE 수정자,http_stat_code content또는SPCRE 수정자 - HTTP content 또는 PCRE 수정자가 없는 경우 —
http_header content(또는HPCRE 수정자)를 두 번 이상,http_raw_header content(또는DPCRE 수정자)를 두 번 이상 사용 - 같은 content 키워드에
depth·offsetcontent와 HTTP content가 함께 있거나, 같은pcre키워드에^(caret)와 HTTPpcre수정자가 함께 있는 경우 —http_header(H),http_raw_header(D),http_stat_msg(Y),http_stat_code(S),http_uri(U) - HTTP content 없이
depth·offsetcontent 또는 PCRE의^를 쓰면서, 목적지 포트가HTTP_PORTS매크로가 아닌 경우 http_client_body content또는PPCRE 수정자{}(중괄호) 수량자가 있는 PCRE 키워드content와byte_test키워드를 함께 사용- 원시(raw) http 데이터에만 단속되는
http_headercontent 수정자 또는HPCRE 수정자(디코딩·정규화된 헤더가 아님) urilen키워드 사용 — 단,http_uri와UPCRE 수정자만 있는 규칙, 또는http_raw_uricontent 수정자와IPCRE 수정자가 있는 규칙은 예외http_uricontent 또는UPCRE 수정자만 있으면 디코딩·정규화된 버퍼 크기가 됩니다.http_raw_uricontent 또는IPCRE 수정자만 있으면 원시 URI 버퍼 크기가 됩니다.
변환 디버깅
관리 서버(Management Server)의 $FWDIR/log/SnortConvertor.elg 파일에는 마지막 SnortConvertor 실행(Snort 규칙 가져오기) 의 디버그 메시지가 기록됩니다. 이 파일에서 실패한 규칙 디버그 를 찾으려면 다음 문자열을 검색하세요.
Failed to convert ruleSSL 서비스
일반적인 메타데이터 서비스 옵션 외에도, Check Point는 SSL 트래픽 전용 키워드 를 추가로 지원합니다. SSL 트래픽용 Snort 규칙은 metadata 키워드로 정의합니다. 규칙 옵션에 다음을 추가합니다.
metadata: service <SSL service>;예시:
alert tcp any any -> any 443 (msg:"Fake SSL Certificate"; content:"|08 e4 98 72 49 bc 45 07 48 a4 a7 81 33 cb f0 41 a3 51 00 33|"; metadata: service sslHello;)<ssl service> 에 들어갈 수 있는 값은 다음과 같습니다.
| 서비스 | 설명 |
|---|---|
sslHello | 흐름에 따라 Client Hello 또는 Server Hello 를 검색합니다. |
sslCertificate | 흐름에 따라 Client Certificate 또는 Server Certificate 를 검색합니다. |
sslKeyx | 흐름에 따라 Client Key Exchange 또는 Server Key Exchange 를 검색합니다. |
sslHeartbeat | SSL heartbeat 를 검색합니다. |
sslCiphersuite | 클라이언트가 보낸 Cipher Suite 를 검색합니다. |
sslHello, sslCertificate, sslKeyx 서비스를 쓸 때는 flow: to_server 또는 flow: from_server 로 흐름 방향 을 반드시 정의해야 합니다.
SmartConsole에서 외부 Custom Intelligence Feed 가져오기
CLI 대신 SmartConsole에서도 외부 피드를 가져올 수 있습니다. 앞서 본 것처럼 Custom Intelligence Feeds는 제3자 서버의 피드를 Security Gateway로 직접 가져와 Anti-Virus·Anti-Bot·IPS 블레이드가 단속하게 합니다.
외부 IoC 피드 가져오기 절차
| 단계 | 작업 |
|---|---|
| 1 | Security Policies > Threat Prevention > Custom Policy > Custom Policy Tools > Indicators 로 갑니다. Autonomous Threat Prevention을 쓴다면 Autonomous Policy > Autonomous Policy Tools > Indicators 로 갑니다. |
| 2 | New 를 누르고 New IoC Feed 를 선택합니다. New IoC Feed 구성 창이 열립니다. |
| 3 | 맨 위 필드에 고유한 객체 이름 을 입력합니다. |
| 4 | Action 필드에서 동작을 고릅니다(아래 표 참고). |
| 5 | Feed URL 필드에 http:// 또는 https:// 로 시작하는 전체 URL 을 입력합니다. |
| 6 | Format 드롭다운에서 형식을 고릅니다(sk132193 참고) — Check Point format/STIX, Custom CSV, Snort. 각 형식에 맞는 파싱 설정을 구성합니다. |
| 7 | Advanced 섹션을 펼칩니다(오른쪽의 ^ 아이콘 클릭). |
| 8 | Authentication 섹션에서, 외부 피드가 인증을 요구하면 사용자 이름·암호 를 입력합니다. |
| 9 | Network 섹션에서, Security Gateway가 프록시 서버를 거쳐 외부 피드에 연결해야 하면 Use gateway proxy for connection 을 선택합니다. |
| 10 | Security Gateway가 이 피드를 받을 수 있는지 확인합니다 — (a) Test Feed 클릭, (b) Select the Security Gateway 드롭다운에서 대상 Security Gateway 선택, (c) Test Feed 클릭, (d) Close 클릭. |
| 11 | OK 를 누릅니다. 새 지표가 Indicators 페이지에 나타납니다. |
| 12 | Threat Prevention Policy 를 설치합니다. |
4단계에서 고를 수 있는 Action 은 형식에 따라 다릅니다.
- Check Point / STIX 형식 —
Prevent(탐지된 관찰 항목 차단),Detect(로그를 만들되 통과),Inactive(이 피드를 비활성화 — Security Gateway가 무시). - Snort 형식 —
According to Profile(프로파일 설정에 따라 단속),Inactive(이 피드를 비활성화).
제약 사항(Limitations)
- SmartConsole에서 추가한 외부 IoC(Indicators of Compromise)는 R81 이상 Security Gateway에서만 지원됩니다.
- IoC 피드는 모든 연결에서 가져오며, Threat Prevention 정책의 영향을 받지 않 습니다.
- Security Gateway가 피드를 받지 못해도 정책 설치는 실패하지 않 습니다. 이 경우 Security Gateway는 제어 로그(control log) 를 생성합니다.
이렇게 Threat Indicators는 Check Point 기본 피드 위에 조직만의 위협 정보를 얹어 탐지 범위를 넓히는 도구입니다. 위협이 어떻게 시각화되고 어떤 참조 자료와 연결되는지는 Cyber Attack View·MITRE·참조에서 이어 살펴봅니다.