檢視次數:
Trend Vision One Container Security 所使用的自訂規則與 Falco 所使用的自訂規則不同。現有的欄位不需要更改,但必須新增欄位以使規則與 Trend Vision One 相容。

Trend Vision One 自訂規則欄位描述

對於Trend Vision One自訂規則,必須包含一些新欄位才能使規則檔案有效:
欄位名稱 欄位描述 範例
id
規則 ID 必須以 "CR-" 開頭,並且在自訂規則中應保持唯一。規則 ID 也必須包含強制性的 "CR-" 前綴在內,總共不超過 20 個字元。
id: CR-00000001
custom_fields
此欄位必須是 YAML 物件。
Container Security 事件是使用 Falco output_fields 產生的,允許您設定額外的輸出。
自訂欄位可以是任何字串鍵和值,其中值可能包含 Falco 輸出欄位。任何包含在 custom_fields 中的 Falco 輸出欄位也必須出現在輸出欄位中。
custom_fields:
    myField: "Sensitive file read access"

custom_fields:
    myField: "Sensitive file read access"
    cmdline: "%proc.cmdline"
    custom3: "a string"
    customField: "%user.name"
    custom5: "%proc.pid"
action
當此規則被檢測到時所採取的緩解行動。允許的值:logisolateterminate
action: log

修改 Falco 規則

以下是一個監控敏感文件訪問的Falco規則範例:
- rule: Monitor Sensitive File Access
  desc: Detect any read access to sensitive files
  condition: >
    (syscall.type = openat and fd.name startswith "/etc/" and
    evt.arg.flags contains "O_RDONLY")
  output: "Sensitive file read access (user=%user.name command=%proc.cmdline
    file=%fd.name)"
  priority: info
要使此規則與Trend Vision One相容,請將規則修改為類似以下內容:
- rule: Monitor Sensitive File Access
  id: CR-00000001
  desc: Detect any read access to sensitive files
  condition: >
    (syscall.type = openat and fd.name startswith "/etc/" and
    evt.arg.flags contains "O_RDONLY")
  output: "Sensitive file read access (user=%user.name command=%proc.cmdline
    file=%fd.name)"
  custom_fields:
     myField: "Sensitive file read access"
  priority: info
  action: log
Trend Vision One 中,output 欄位並未直接使用。相反地,會從 output 中提取欄位以建立與 Trend Vision One 相容的事件格式。這意味著先前的規則在功能上與以下規則相同,因為output欄位中的欄位是相同的:
- rule: Monitor Sensitive File Access
  id: CR-00000001
  desc: Detect any read access to sensitive files
  condition: >
    (syscall.type = openat and fd.name startswith "/etc/" and
    evt.arg.flags contains "O_RDONLY")
  output: %user.name %proc.cmdline %fd.name
  custom_fields:
    myField: "Sensitive file read access"
  priority: info
  action: log

支援的 Falco 輸出欄位

並非所有 Falco 輸出欄位都被 Trend Vision One 支援。下表列出了 Trend Vision One 支援的 Falco 欄位及其對應的欄位名稱。
注意
注意
若要使用 Container Security 不支援的欄位,請使用 custom_fields,如 Trend Vision One 自訂規則欄位描述 中所述。
支援的 Falco 欄位
Name in Trend Vision One
k8s.ns.name
k8sNamespace
k8s.pod.name
k8sPodName
k8s.pod.id
k8sPodId
container.name
containerName
container.id
containerId
container.image.repository
containerImgRepo
container.image.tag
containerImgTag
container.image.digest
containerImageDigest
proc.name
processName
proc.pid
processPid
proc.exeline
processCmd
proc.pname
parentName
proc.ppid
parentPid
proc.pcmdline
parentCmd
fd.filename
objectFileName
fd.directory
objectFileDir
fd.sip
dst
fd.sport
dpt
fd.cip
src
fd.cport
spt
fd.proto
應用程式
fd.l4proto
proto
fd.name
檔案描述

選擇性規則欄位

以下規則欄位是 Container Security 自訂規則的選填項,可以根據一般 Falco 規則指導方針來撰寫。
使用標籤欄位為規則添加通用標籤:
tags:
  - container
  - filesystem
注意
注意
標籤欄位在Trend Vision One中顯示為customTags
使用例外欄位來篩選事件。趨勢科技的服務可能會觸發一些事件,這些事件通常是最小的,可以安全地暫不處理。將以下例外新增到您的規則定義中,以便在指定的 Kubernetes 命名空間內篩選掉這些事件:
exceptions:
  - name: trend_namespace
  fields: [k8s.ns.name]
  comps: [=]
  values:
  - [trendmicro-system]