如何安裝和設定 VMware Carbon Black Cloud 系統記錄連接器
Summary: 瞭解如何在 CentOS 或 Red Hat Enterprise Linux 型伺服器上安裝和設定 VMware Carbon Black Cloud 系統記錄連接器。
Instructions
本文將說明在 Red Hat Enterprise Linux 型作業系統上安裝、設定和驗證 VMware Carbon Black Cloud 系統記錄連接器的程序。
受影響的產品:
- VMware Carbon Black Cloud
將安全性平台中的資料轉移至集中式安全性資訊和事件管理 (SIEM) 解決方案,便可集中管理多個安全性產品。Carbon Black 可讓您透過 API 下載資料、轉換為系統記錄格式,然後轉送至任意數量的 SIEM 解決方案。
VMware Carbon Black Standard 或更高版本可設定 API,將此資料提取至客戶環境中,以便在自訂的儀表板中允許進階規則組和資料耗用。
VMware Carbon Black 的系統記錄連接器支援 RPM 型 Linux 作業系統,例如 Red Hat Enterprise Linux 或 CentOS。
若要安裝和設定系統記錄連接器,系統管理員必須先處理先決條件、安裝連接器,然後設定連接器。之後,系統管理員可驗證和自動化系統記錄連接器。如需詳細資訊,請按一下適當的程序。
- 使用 SSH 登入正在安裝系統記錄連接器的 Linux 伺服器。
注意:如需透過 SSH 連線的相關資訊,請參閱 保護網路
。
- 驗證伺服器是否為最新狀態,方法是執行
sudo yum update。 - 必須新增儲存庫才能安裝 PIP,因為 PIP 可能不在核心作業系統儲存庫中。類型
sudo yum install epel-release然後按下 Enter 鍵。
注意:如果epel-release找不到,請執行下列命令以新增儲存庫:sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-[VERSION].noarch.rpmsudo rpm -ql epel-release
[VERSION]符合您執行的 Red Hat Enterprise Linux 或 CentOS 版本:- 如果執行 Red Hat Enterprise Linux 8 或 CentOS 8:
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm - 如果執行 Red Hat Enterprise Linux 7 或 CentOS 7:
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
- 類型
Y然後按下 Enter 鍵。 - 輸入以安裝 PIP
sudo yum install python3,然後按 Enter 鍵。

- 輸入以安裝 Python3 產生公用程式
sudo yum install gcc python3-devel,然後按 Enter 鍵。

- 輸入以更新主機作業系統內的所有套件
sudo yum update,然後按 Enter 鍵。

- 以具有 sudo 存取權的帳戶登入要安裝連接器的伺服器。
- 開啟終端機。
- 類型
pip3 install cbc-syslog然後按下 Enter 鍵。
注意:- 此範例會在 CentOS 8 上利用 PIP3。命令可能會因 Python 的版本而略有不同,因此使用的 PIP 版本會有所不同。
- 如果未使用根進行安裝,預設安裝位置為:
/usr/lib/python{version}/site-packages/cbc_syslog
- 如果使用根進行安裝,預設安裝位置為:
/usr/local/lib/python{version}/site-packages/cbc_syslog
系統管理員必須同時設定 VMware Carbon Black Cloud 和系統記錄連接器本身。如需詳細資訊,請按一下適當的程序。
VMware Carbon Black Cloud
必須設定 VMware Carbon Black Cloud 以使用系統記錄連接器。系統管理員必須先產生 API 和 SIEM 金鑰,然後產生 API 的通知。如需詳細資訊,請按一下適當的程序。
產生 API 和 SIEM 金鑰
- 在網頁瀏覽器中,前往 [REGION].conferdeploy.net。
注意:[REGION] = 租戶的地區
- 登入 VMware Carbon Black Cloud。

- 在左側功能表窗格中,展開設定,然後按一下 API 存取。

- 選取新增 API 金鑰。

- 從 新增 API 金鑰 功能表:
- 填入名稱。
- 填入描述名稱。
- 選取存取層級類型。
- 填入應要求 VMware Carbon Black Cloud 資訊的外部授權的 IP 位址。
- 按一下儲存。

- 從 API 登入資料:
- 按一下 API ID 右側的剪貼簿圖示,將 ID 複製到剪貼簿。
- 記錄 API ID。
- 按一下 API 祕密金鑰右側的剪貼簿圖示,將金鑰複製到剪貼簿。
- 記錄 API 祕密金鑰。
- 按一下右上角的 X。

- 選取新增 API 金鑰。

- 從 新增 API 金鑰 功能表:
- 填入名稱。
- 填入描述名稱。
- 選取存取層級類型。
- 填入應要求 VMware Carbon Black Cloud 資訊的外部授權的 IP 位址。
- 按一下儲存。

- 從 API 登入資料:
- 按一下 API ID 右側的剪貼簿圖示,將 ID 複製到剪貼簿。
- 記錄 API ID。
- 按一下 API 祕密金鑰右側的剪貼簿圖示,將金鑰複製到剪貼簿。
- 記錄 API 祕密金鑰。
- 按一下右上角的 X。

產生 API 的通知
資訊會透過在 VMware Carbon Black Cloud 主控台中設定的通知,傳送至先前設定的 API。
- 在網頁瀏覽器中,前往 [REGION].conferdeploy.net。
注意:[REGION] = 租戶的地區
- 登入 VMware Carbon Black Cloud。

- 在左側功能表窗格中,展開設定,然後按一下通知。

- 按一下 Add Notification。

- 從 新增通知 功能表:
- 填入名稱。
- 決定要在何時收到通知。
- 選取要收到通知的適當原則。
- 填入要收到通知的電子郵件,並選擇每天僅針對每個威脅類型傳送 1 封電子郵件。
- 使用先前產生的 API ID 填入 API 金鑰。
- 按一下新增。
注意:具有 Carbon Black Enterprise EDR 的客戶也可以指定透過 SIEM 傳送的觀察清單。這可讓您以更有針對性的方式收集資訊。
系統記錄連接器
- 透過 SSH 連線至主機代管系統記錄連接器的伺服器。
- 輸入以下內容,以產生系統記錄輸出的備份目錄。
sudo mkdir /tmp/output/然後按下 Enter 鍵。

- 透過鍵入以下內容建立設定檔
sudo touch /tmp/cbsyslog-config.txt然後按下 Enter 鍵。

- 輸入以建立記錄檔
sudo touch /tmp/cbsyslog-log.log然後按下 Enter 鍵。

- 使用 nano 以 sudo 權限開啟先前建立的設定檔,方法是輸入
sudo nano /tmp/cbsyslog-config.txt然後按下 Enter 鍵。

- 複製 以下文字,然後將其 粘貼 到文字編輯器中。
[general] # Template for syslog output. # This is a jinja 2 template # NOTE: The source variable corresponds to the Carbon Black Cloud Server used to retrieve results template = {{source}} {{version}}|{{vendor}}|{{product}}|{{dev_version}}|{{signature}}|{{name}}|{{severity}}|{{extension}} #Location of the Backup Directory #This will be the location of back up files in the event that results fail to send to Syslog back_up_dir = /tmp/output/ # This sets the default severity level for POLICY_ACTION notifications. By default it is 4. # 0 - Emergency: System is unusable. # 1 - Alert: Action must be taken immediately. # 2 - Critical: Critical conditions. # 3 - Error: Error conditions. # 4 - Warning: Warning conditions. # 5 - Notice: Normal but significant condition. # 6 - Informational: Informational messages. # 7 - Debug: Debug-level messages. policy_action_severity = 4 # Output format of the data sent. Currently support json or cef formats # Warning: if using json output_format, we recommend NOT using UDP output_type output_format=cef # Configure the specific output. # Valid options are: 'udp', 'tcp', 'tcp+tls', 'http' # udp - Have the events sent over a UDP socket # tcp - Have the events sent over a TCP socket # tcp+tls - Have the events sent over a TLS+TCP socket # http - Have the events sent over a HTTP connection output_type=tcp # tcpout=IP:port - ie 1.2.3.5:514 tcp_out= # udpout=IP:port - ie 1.2.3.5:514 #udp_out= # httpout=http/https endpoint - ie https://server.company.com/endpoint # http_headers= {'key1': 'value1', 'key2': 'value2'} - ie {'content-type': 'application/json'} # https_ssl_verify = True or False #http_out= #http_headers= {'content-type': 'application/json'} #https_ssl_verify=True # Override ca file for self signed certificates when using https # This is typically a .pem file #requests_ca_cert=/usr/share/cb/integrations/cbc-syslog/cert.pem [tls] # Specify a file containing PEM-encoded CA certificates for verifying the peer server when using TLS+TCP syslog #ca_cert = /etc/cb/integrations/cbc-syslog/ca.pem # Optionally specify a file containing PEM-encoded client certificate for verifying this client when using TLS+TCP syslog # If cert is specified, key is a required parameter #cert = /etc/cb/integrations/cbc-syslog/cert.pem # Optionally specify a file containing PEM-encoded private key for verifying this client when using TLS+TCP syslog # If key is specified, cert is a required parameter #key = /etc/cb/integrations/cbc-syslog/cert.key # Optionally specify the password to decrypt the given private key when using TLS+TCP syslog #key_password = p@ssw0rd1 # Uncomment tls_verify and set to "false" in order to disable verification of the peer server certificate #tls_verify = true [CarbonBlackCloudServer1] # Carbon Black Cloud API Connector ID api_connector_id = EXAMP13 # Carbon Black Cloud API Key api_key = EXAMP13EXAMP13EXAMP13 # Carbon Black Cloud SIEM Connector ID siem_connector_id = EXAMP131234 # Carbon Black Cloud SIEM Key siem_api_key = EXAMP13EXAMP13EXAMP13 # Carbon Black Cloud Server URL # NOTE: this is not the url to the web ui, but to the API URL # For more than one Carbon Black Cloud Server, add another server using the following template including the stanza #[CarbonBlackCloudServer2] #api_connector_id = KJARWBZ111 #api_key = CQF35EIH2WDF69PTWKGC4111 #server_url = https://defense-prod05.conferdeploy.net - 若要使用 TCP 傳送輸出,請在 主機 和 連接埠 中填入
output_type設為TCP。
注意:範例影像已修改設定。 - 更新
api_connector_id和api_key根據 API 類型的 API ID 和 API 類型的 API 金鑰。
注意:如需 API 和 SIEM 金鑰建立位置的相關資訊,請參閱上方 的「產生 API 和 SIEM 金鑰 」一節。 - 更新
siem_connector_id和siem_api_key根據 SIEM 類型的 API ID 和 SIEM 類型的 API 金鑰。
注意:如需 API 和 SIEM 金鑰建立位置的相關資訊,請參閱上方 的「產生 API 和 SIEM 金鑰 」一節。 - 按住 CTRL 以儲存檔案,然後按下 X。按下 X 確認儲存檔案
Y。

- 按下 Enter 鍵確認檔案名稱。

系統管理員必須 測試,然後 驗證 系統記錄連接器的輸出。如需詳細資訊,請按一下適當的程序。
試
- 從 Linux 伺服器中,開啟終端機。
- 類型
sudo python[VER] [INSTALLDIRECTORY]/cbc_syslog.py -l [LOGFILELOCATION] -c [CONFIGFILELOCATION]然後按下 Enter 鍵。注意:[VER]= Python 版本[INSTALLDIRECTORY]= 安裝系統記錄連接器的目錄[LOGFILELOCATION]= 記錄檔案的位置[CONFIGFILELOCATION]= 組態檔案的位置
範例:
sudo python3 /usr/local/lib/python3.6/site-packages/cbc_syslog/cbc_syslog.py -l /tmp/cbsyslog-log.log -c /tmp/cbsyslog-config.txt

此命令會執行根據定義的組態檔案的系統記錄連接器一次性執行,並輸出至定義的記錄檔案。
執行測試執行後,請檢查根據測試選項中所產生記錄檔案的輸出。檢查記錄檔以確認連線成功或失敗。
驗證
- 從 Linux 伺服器中,開啟終端機。
- 類型
cat [LOGFILELOCATION]然後按下 Enter 鍵。注意:[LOGFILELOCATION]= 記錄檔案的位置
範例:
cat /tmp/cbsyslog-log.log
成功執行會傳回類似下列回應:
Carbon Black Cloud Syslog 2.0 Carbon Black Cloud Syslog 2.0 Found 1 Carbon Black Cloud Servers in config file Handling notifications for https://defense-prod05.conferdeploy.net Sending Notifications Done Sending Notifications Sending Audit Logs Done Sending Audit Logs

接收的 SIEM 或系統記錄例項會輸出自通知在 VMware Carbon Black Cloud 主控台內建立以來發生的任何事件。
在已設定的 SIEM 或系統記錄伺服器中驗證是否已正確擷取該資訊。這會依每個應用程式而有所不同。
可使用 cron 將執行系統記錄連接器自動化以定期提取資訊。
- 透過鍵入以下內容來產生要用於自動化的文稿
sudo nano /tmp/cbsyslogrun.sh然後按下 Enter 鍵。
注意:此範例會產生下列的 shell 指令檔:/tmp/cbsyslogrun.sh。 - 複製驗證區段中使用的驗證指令檔,然後在文字編輯器中貼上該指令檔。

- 按下 CTRL+X 以結束。
- 提示要儲存時,按下 Y 以繼續,即可儲存變更。

- 更新指令檔以允許其作為指令檔執行,方法是輸入
sudo chmod a+x /tmp/cbsyslogrun.sh然後按下 Enter 鍵。

- 開啟 crontab 檔案,透過鍵入以下內容,將指令檔新增為自動化工作
sudo crontab -e然後按下 Enter 鍵。 - Crontab 會利用 VI 型語法編輯文字。按下 Insert 鍵以新增字元。
- 類型
*/[MINUTES] * * * * /tmp/cbsyslogrun.sh,然後按 Esc 取消文字插入階段。
注意:[MINUTES]= 再次執行命令前要等待的分鐘數- 在範例影像中,範例每 15 分鐘執行一次。
- 壓下冒號 (:) 鍵以輸入命令。
- 類型
wq,然後按下 Enter 鍵寫入並退出 crontab 編輯器。 - 輸入以確認變更
sudo crontab -l然後按下 Enter 鍵。 - 確認已排定的工作 (步驟 7) 出現在清單中。如果工作出現,則會設定自動化。如果工作未出現,請前往步驟 13。

- 類型
sudo systemctl start crond.service然後按下 Enter 鍵。 - 類型
sudo systemctl enable crond.service然後按下 Enter 鍵。 - 類型
sudo crontab -l然後按下 Enter 鍵。

- 確認已排定的工作出現在清單中。
如要聯絡支援部門,請參閱 Dell Data Security 國際支援電話號碼。
請前往 TechDirect,以線上產生技術支援要求。
如需更多深入見解與資源,請加入 Dell 安全性社群論壇。