[TOC]
# Logstash ArcSight模塊
> <font color=#DC143C size=4>NOTE</font>:Logstash ArcSight模塊是基礎授權下的一個[X-Pack](https://www.elastic.co/products/x-pack)特性因此可以免費使用。聯系arcsight@elastic.io獲取更多信息。
Logstash的ArcSight模塊讓你能夠輕松的將ArcSight的數據和Elastic Stack進行結合。通過一條命令,直接連接到ArcSight智能連接器或者事件代理,解析并存儲安全事件到Elasticsearch中,并且安裝了一套Kibana 儀表盤,讓你可以立即瀏覽數據。
## Prerequisite(前提)
這里假定你已經安裝了Logstash,Elasticsearch和Kibana。這些產品都是可以下載的而且很容易安裝。這個模塊需要Elastic Stack5.6或者之后的版本以及X-Pack。如果你使用Elastic Stack6.2或更早的版本,請查看對應版本的[介紹](https://www.elastic.co/guide/en/logstash/6.2/arcsight-module.html)。(是不是有點懵逼,我也是,不過原文就是這樣的。可能是寫錯了吧。The Elastic Stack 5.6 (or later) and X-Pack are required for this module. If you are using the Elastic Stack 6.2 and earlier, please see the [instructions](https://www.elastic.co/guide/en/logstash/6.2/arcsight-module.html) for those versions.)
## Deployment Architecture(架構部署?)
Logstash的ArcSight模塊理解CEF(Common Event Format),可以接收,豐富,索引這些事件以便Elastic Stack進行分析。ADP包含兩個數據流的核心數據收集組件:
+ 智能連接器 *Smart Connectors*(SC)是邊緣日志收集器,在將數據送到Logstash接收器之前解析并將數據規范化到CEF
+ 事件代理是傳入數據的中心樞紐,基于開源的Apache Kafka。Logstash ArcSight模塊可以直接使用事件代理Topic。The Logstash ArcSight module can consume directly from Event Broker topics.
## 智能連接器入門
首先,您可以使用基本的Elastic Stack設置,直接從智能連接器讀取事件。
Smart Connector has been configured to publish ArcSight data (to TCP port `5000`) using the CEF syslog destination.
> <font color=#DC143C size=4>NOTE</font>:Logstash,Elasticsearch,和Kibana必須本地運行。注意你也可以將Logstash,Kibana和Elasticsearch運行在獨立的主機上來從ArcSight獲取數據。
### 智能連接器用法說明
1. 在Logstash安裝目錄使用下面的命令啟動Logstash ArcSight模塊,注意使用自己的連接器主機和端口:
```bash
bin/logstash --modules arcsight --setup \
-M "arcsight.var.input.smartconnector.port=smart_connect_port" \
-M "arcsight.var.elasticsearch.hosts=localhost:9200" \
-M "arcsight.var.kibana.host=localhost:5601"
```
The `--modules arcsight` option spins up an ArcSight CEF-aware Logstash pipeline for ingestion。`--setup`選項在Elasticsearch中創建了一個`arcsight-*`的索引并將其導入到Kibana儀表盤并可視化。接下來的模塊運行或者需要水平擴展Logstash的時候,`--setup`選項無需再次指定以避免覆蓋已經存在的Kibana儀表盤。
更多信息查看[Logstash ArcSight Module Configuration Options](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#arcsight-module-config)。
2. 用Kibana探索你的數據:
a. 在瀏覽器中打開http://localhost:5601(用戶名:“elastic”;密碼:“YOUR_PASSWORD”)
b. 打開**[ArcSight]**概覽儀表盤
c. 有關數據探測的更多詳細信息,請參見 [Exploring Your Security Data](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#exploring-data-arcsight)。
如果要指定控制ArcSight模塊行為的其他選項,請參見 [Configuring the Module](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#configuring-arcsight) 。
## 事件代理入門
首先,您可以使用基本的Elastic Stack設置,直接從智能連接器讀取事件。

By default, the Logstash ArcSight module consumes from the Event Broker "eb-cef" topic. For additional settings, see [Logstash ArcSight Module Configuration Options](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#arcsight-module-config). Consuming from a secured Event Broker port is possible, see [Logstash ArcSight Module Configuration Options](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#arcsight-module-config).
> <font color=#DC143C size=4>NOTE</font>:Logstash,Elasticsearch,和Kibana必須本地運行。注意你也可以將Logstash,Kibana和Elasticsearch運行在獨立的主機上來從ArcSight獲取數據。
### 事件代理使用說明
1. 在Logstash安裝目錄使用下面的命令啟動Logstash ArcSight模塊,注意使用自己的事件代理主機和端口:
```bash
bin/logstash --modules arcsight --setup \
-M "arcsight.var.input.eventbroker.bootstrap_servers=event_broker_host:event_broker_port" \
-M "arcsight.var.elasticsearch.hosts=localhost:9200" \
-M "arcsight.var.kibana.host=localhost:5601"
```
The `--modules arcsight` option spins up an ArcSight CEF-aware Logstash pipeline for ingestion。`--setup`選項在Elasticsearch中創建了一個`arcsight-*`的索引并將其導入到Kibana儀表盤并可視化。接下來的模塊運行或者需要水平擴展Logstash的時候,`--setup`選項無需再次指定以避免覆蓋已經存在的Kibana儀表盤。
查看[Logstash ArcSight Module Configuration Options](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#arcsight-module-config) 獲取更多信息。
2. 用Kibana探索你的數據:
a. 在瀏覽器中打開http://localhost:5601(用戶名:“elastic”;密碼:“YOUR_PASSWORD”)
b. 打開**[ArcSight]**概覽儀表盤
c. 有關數據探測的更多詳細信息,請參見 [Exploring Your Security Data](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#exploring-data-arcsight)。
如果要指定控制ArcSight模塊行為的其他選項,請參見 [Configuring the Module](https://www.elastic.co/guide/en/logstash/6.5/arcsight-module.html#configuring-arcsight) 。
## 探索你的安全數據
一旦Logstash ArcSight模塊開始接收事件,你就可以立即開始使用Kibana儀表盤來瀏覽和可視化您的安全數據。儀表盤極大減少了安全分析師和operators了解情況需要的時間。網絡活動,endpoint,和DNS事件。你可以保持儀表盤的狀態或者根據自己的用例以及需求進行定制。原文:The dashboards rapidly accelerate the time and effort required for security analysts and operators to gain situational and behavioral insights on network, endpoint, and DNS events flowing through the environment. You can use the dashboards as-is, or tailor them to work better with existing use cases and business requirements.
儀表盤有一個導航面板,可用于在三個核心使用情形中進行切換和深入查看:
+ **Network Data**
+ 面板:網絡概覽,可疑網絡活動
+ 數據類型:網絡防火墻,intrusion systems(入侵系統),VPN設備
+ **Endpoint Data**
+ 面板:Endpoint概覽,Endpoint OS Activity
+ 數據類型:操作系統,應用程序,host intrusion systems
+ **DNS Data**
+ 面板:Microsoft DNS Overview
+ 數據類型: Microsoft DNS devices
### Network儀表盤示例


這些Kibana可視化能夠使你快速了解頂級設備、端點、攻擊者和目標。這種洞察力以及即時深入挖掘特定主機,端口,設備或時間范圍的能力,提供了整個環境的整體視圖,以識別可能需要立即關注或操作的特定數據段。您可以輕松找到以下問題的答案:
+ 誰是攻擊者,他們的目標是什么?
+ 我的哪些設備及endpoints負載最高以及它們提供的什么服務。
+ 在指定的時間點觸發了多少特定的攻擊者、技術、簽名或目標?
+ 導致故障次數增加的主要來源、目標、協議和行為是什么?
## 配置模塊
你可以在`logstash.yml`文件中為Logstash ArcSight模塊指定額外的選項或者通過命令行進行覆蓋。更多關于配置模塊的信息,參考[*使用Logstash模塊。*](https://www.elastic.co/guide/en/logstash/6.5/logstash-modules.html).
作為示例,下面的設置可以附加到`logstash.yml`來配置你的模塊:
```yaml
modules:
- name: arcsight
var.input.eventbroker.bootstrap_servers: "eb_host:39092"
var.input.eventbroker.topics: "eb_topic"
var.elasticsearch.host: "localhost:9200"
var.elasticsearch.password: "YOUR_PASSWORD"
var.kibana.host: "locarlhost:5601"
var.kibana.username: "elastic"
var.kibana.password: "YOUR_PASSWORD"
```
### Logstash ArcSight模塊配置選項
ArcSight模塊提供了下面的設置來配置模塊的行為。
這些設置包括特定于ArcSight的選項以及所有Logstash模塊支持的通用選項。
當你在命令行覆蓋設定的時候,記得在設置前面加上模塊名,比如,使用`arcsight.var.inputs`而不是`var.inputs`。
如果不指定配置設置,Logstash將使用默認值。
#### ArcSight模塊選項
`var.inputs`
+ 值的類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 默認值是“eventbroker”
為LogstashArcSight模塊設置要暴露的input(s)。可用的設置為包括"eventbroker","smartconnector",或者"eventbroker,smartconnector"(同事暴露它們)。
Set the input(s) to expose for the Logstash ArcSight module. Valid settings are
"eventbroker", "smartconnector", or "eventbroker,smartconnector" (exposes both
inputs concurrently).
#### ArcSight模塊事件代理特定選項
`var.input.eventbroker.bootstrap_servers`
+ 值的類型是 [string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 默認值是“localhost:39092”
用于建立與群集的初始連接的Event Broker URL列表。 此列表應采用`host1:port1`,`host2:port2`的形式。 這些URL僅用于初始連接以發現完整的集群成員(可能會動態更改)。 此列表不需要包含完整的服務器集。 (如果服務器關閉,您可能需要多個。)
A list of Event Broker URLs to use for establishing the initial connection to the cluster.
This list should be in the form of `host1:port1,host2:port2`. These URLs are
just used for the initial connection to discover the full cluster membership
(which may change dynamically). This list need not contain the full set of
servers. (You may want more than one in case a server is down.)
`var.input.eventbroker.topics`
+ 值的類型是[array](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#array)
+ 默認值是["eb-cef"]
A list of Event Broker topics to subscribe to.
`var.input.eventbroker.security_protocol`
+ 可用的值:`PLAINTEXT`,`SSL`,`SASL_PLAINTEXT`,`SASL_SSL`
+ 默認值是:`PLAINTEXT`
使用的安全協議,可以是 PLAINTEXT, SSL, SASL_PLAINTEXT, SASL_SSL中的任何一個。如果指定除PLAINTEXT以外的任何內容,則還需要指定下面列出的一些選項。當指定`SSL`或`SASL_SSL`,你需要給以`ssl_`開頭的選項指定值,當指定`SASL_PLAINTEXT`或`SASL_SSL`,你需要給`jaas_path`, `kerberos_config`, `sasl_mechanism` 和`sasl_kerberos_service_name`指定值。
`var.input.eventbroker.ssl_key_password`
+ 值的類型為[password](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#password)
+ 此選項沒有默認值
Key store文件中私鑰的密碼
`var.input.eventbroker.ssl_keystore_location`
+ 值的類型是[path](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#path)
+ 此選項沒有默認值
如果需要客戶端身份驗證,則此設置存儲keystore路徑。
`var.input.eventbroker.ssl_keystore_password`
+ 值類型是[password](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#password)
+ 此選項沒有默認值
如果需要客戶端身份驗證,則此設置存儲keystore密碼。
`var.input.eventbroker.ssl_keystore_type`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 此選項沒有默認值
Keystore的類型
`var.input.eventbroker.ssl_truststore_location`
+ 值類型是[path](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#path)
+ 此選項沒有默認值
用于驗證Kafka代理證書的JKS信任庫路徑。
`var.input.eventbroker.ssl_truststore_password`
+ 值類型是[password](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#password)
+ 此選項沒有默認值
Truststore密碼
`var.input.eventbroker.ssl_truststore_type`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 此選項沒有默認值
Truststore 類型
`var.input.eventbroker.sasl_keyberos_service_name`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 此選項沒有默認值
The Kerberos principal name that Kafka broker runs as。可以在Kafka的JAAS配置或Kafka配置中定義。
`var.input.eventbroker.sasl_mechanism`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 默認值是`"GSSAPI"`
用于客戶端連接的[SASL機制](http://kafka.apache.org/documentation.html#security_sasl)。這可以是安全提供者可用的任何機制。 GSSAPI是默認機制。
`var.input.eventbroker.jaas_path`
+ 值類型是[path](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#path)
+ 此選項沒有默認值
Java身份驗證和授權服務(JAAS)API,給Kafka提供用戶身份驗證和授權服務。這個設定提供JAAS文件的路徑。Kafka客戶端JAAS文件示例:
```java
KafkaClient {
com.sun.security.auth.module.Krb5LoginModule required
useTicketCache=true
renewTicket=true
serviceName="kafka";
};
```
請注意,這里指定的`jaas_path`和`kerberos_config`將被添加到JVM全局設定。 這意味著如果你又多個Kafka inputs,他們將會共享同樣的`jaas_path`和`kerberos_config`。如果這不符合預期,你需要在不同的JVM實例運行不同的Logstash實例。
`var.input.eventbroker.kerberos_config`
+ 值類型是[path](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#path)
+ 此選項沒有默認值
Optional path to kerberos config file. This is krb5.conf style as detailed in <https://web.mit.edu/kerberos/krb5-1.12/doc/admin/conf_files/krb5_conf.html>
#### ArcSight Module Smart Connector specific Options
`var.input.smartconnector.port`
+ 值類型是[number](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#number)
+ 默認值是5000
從SCs接收數據監聽的TCP端口
`var.input.smartconnector.ssl_enable`
+ 值類型是[boolean](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#boolean)
+ 默認值是`false`
開啟SSL(必須設置其他`ssl_`選項才能生效)
`var.input.smartconnector.ssl_cert`
+ 值類型是[path](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#path)
+ 此選項沒有默認值
SSL證書路徑
`var.input.smartconnector.ssl_extra_chain_certs`
+ 值類型是[array](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#array)
+ 默認值是`[]`
要添加到證書鏈的額外X509證書的路徑數組。 在系統存儲中不需要CA鏈時很有用。
An Array of paths to extra X509 certificates to be added to the certificate chain. Useful when the CA chain is not necessary in the system store.
`var.input.smartconnector.ssl_key`
+ 值類型是[path](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#path)
+ 從選項沒有默認值
SSL key 路徑
`var.input.smartconnector.ssl_key_passphrase`
+ 值類型是[password](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#password)
+ 默認值是`nil`
SSL key passphrase(密碼)
`var.input.smartconnector.ssl_verify`
+ 值類型是[boolean](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#boolean)
+ 默認值是`true`
根據CA驗證SSL連接的另一端的身份。對于input,將字段sslSubject設置為客戶端證書的字段。
#### Common options(公共選項)
下面這些配置選項支持所有的模塊:
`var.elasticsearch.hosts`
+ 值類型是[uri](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#uri)
+ 默認值是"localhost:9200"
設置Elasticsearch集群的host(s)。每個host都需要指定hostname和port。例如,"myhost:9200"。如果給定一個 [array](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#array),Logstash會在指定的hosts參數中進行均衡訪問。從主機列表中排除[專用主節點](https://www.elastic.co/guide/en/elasticsearch/reference/6.5/modules-node.html)非常重要,以防止Logstash向主節點發送批量請求。因此,此參數應僅引用Elasticsearch中的數據或客戶端節點。
URLs出現的特殊字符必須進行轉義!這意味著 # 應該以 %23 的形式輸入。
`var.elasticsearch.username`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 默認值是"elastic"
一個安全Elasticsearch集群的用戶名
`var.elasticsearch.password`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 默認值是"changeme"(更改我)
一個安全Elasticsearch集群的密碼
`var.elasticsearch.ssl.enabled`
+ 值類型是[boolean](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#boolean)
+ 此選項沒有默認值
給Elasticsearch集群開啟SSL/TLS安全通信。此處不指定則使用在`hosts`中指定的方案。如果`hosts`中不指定,則使用HTTP。如果此處禁用SSL,同時在`hosts`中提供HTTPS URL,則插件將拒絕啟動。
`var.elasticsearch.ssl.verification_mode`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 默認值是"strict"
與Elasticsearch通信時的主機名驗證設置。設置為`disable`來關閉主機名驗證。關閉此選項將帶來極大的安全風險。
`var.elasticsearch.ssl.certificate_authority`
+ 值類型是 [string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 此選項沒有默認值
與Elasticsearch通信時用于驗證SSL證書的X.509證書的路徑。
`var.elasticsearch.ssl.certificate`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 此選項沒有默認值
與Elasticsearch通信時用于客戶端驗證的X.509證書的路徑。
`var.elasticsearch.ssl.key`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 此選項沒有默認值
與Elasticsearch通信時用于客戶端驗證的證書key的路徑。
`var.kibana.host`
+ 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
+ 默認值是"localhost:5601"
設置用來導出dashboards和visualizations的Kibana所在實例的主機名和端口。比如:"myhost:5601"。
`var.kibana.scheme`
- 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
- 默認值是"http"
設置訪問Kibana實例的協議。可選項包括:"http"和"https"。默認是"http"。
`var.kibana.username`
- 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
- 默認值是"elastic"
安全Kibana實例認證所需用戶名
`var.kibana.password`
- 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
- 默認值是"changeme"
安全Kibana實例認證所需密碼
`var.kibana.ssl.enabled`
- 值類型是[boolean](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#boolean)
- 默認值是`false`
開啟Kibana的SSL/TLS訪問。
`var.kibana.ssl.verification_mode`
- 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
- 默認值是"strict"
與kibana通信時的主機名驗證設置。設置為`disable`來關閉主機名驗證。關閉此選項將帶來極大的安全風險。
`var.kibana.ssl.certificate_authority`
- 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
- 此選項沒有默認值
與Kibana通信時用于驗證SSL證書的X.509證書的路徑。
`var.kibana.ssl.vertificate`
- 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
- 此選項沒有默認值
與kibana通信時用于客戶端驗證的X.509證書的路徑。
`var.kibana.ssl.key`
- 值類型是[string](https://www.elastic.co/guide/en/logstash/6.5/configuration-file-structure.html#string)
- 此選項沒有默認值
與Kibana通信時用于客戶端驗證的證書key的路徑。
- Emmm
- Logstash簡介
- 開始使用Logstash
- 安裝Logstash
- 儲存你的第一個事件
- 通過Logstash解析日志
- 多個輸入和輸出插件的混合使用
- Logstash是如何工作的
- 執行模型Execution Model
- 設置并運行Logstash
- Logstash目錄布局
- Logstash配置文件
- logstash.yml
- Secrets keystore for secure settings
- 從命令行運行Logstash
- 以服務的方式運行Logstash
- 在Docker中運行Logstash
- 配置容器版Logstash
- Logging
- 關閉Logstash
- 安裝X-Pack
- 設置X-Pack
- 升級Logstash
- 使用包管理升級
- 直接下載進行升級
- 升級至6.0
- Upgrading with the Persistent Queue Enabled
- 配置Logstash
- 管道配置文件的結構
- 訪問配置中的事件數據和字段
- 在配置中使用環境變量
- Logstash配置示例
- 多管道
- 管道間通信(beta)
- 重載配置文件
- 管理多行事件
- Glob Pattern Support
- Converting Ingest Node Pipelines
- Logstash間通信
- 配置集中式管道管理
- X-Pack Monitoring
- X-Pack Security
- X-Pack Settings
- Field References Deep Dive(深入字段引用)
- 管理Logstash
- 集中式管道管理
- 使用Logstash模塊
- 使用Elastic Cloud
- Logstash ArcSight模塊