To configure Pandora FMS with OpenSearch see “Log collection and monitoring” and “SIEM monitoring”.
It is advisable to distribute Pandora FMS server and OpenSearch on independent servers.
Pandora FMS サーバと OpenSearch を独立したサーバに分散することをお勧めします。
9200/TCP
) and between cluster nodes (default port 9300/TCP
).9200/TCP
) およびクラスタノード間の接続 (デフォルトポート 9300/TCP
)。A single node environment with these features can store up to 1 GB of data per day and store it for 30 days. In the case of requiring greater data resilience, greater data processing and storage, and fault tolerance, the configuration of an OpenSearch cluster will be necessary (with a minimum of 3 nodes to guarantee data integrity).
これらの機能を備えた単一ノード環境では、1 日あたり最大 1 GB のデータを保存でき、30 日間保存できます。 より優れたデータ復元力、より優れたデータ処理とストレージ、およびフォールトトレランスが必要な場合は、OpenSearch クラスターの構成が必要になります (データの整合性を保証するには、少なくとも 3 つのノードが必要です)。
By switching to a cluster environment, it is also possible to distribute the load between the nodes, doubling (in the case of 3 nodes) the processing capacity of the environment. A load balancing system will be necessary (Keepalived, for example) if you want to work with the different nodes simultaneously.
クラスタ環境に切り替えることでノード間の負荷分散も可能となり、環境の処理能力は2倍(3ノードの場合)となります。 異なるノードを同時に使用する場合、負荷分散システムが必要になります (Keepalived など)。
This online installer will create an OpenSearch node ready to use with Pandora FMS with basic configuration including HTTPS and password authentication. It features environment variables for customization and is compatible with EL8, EL9 and Ubuntu 22.04 server:
このオンラインインストーラーは、HTTPS やパスワード認証などの基本設定を備えた Pandora FMS で使用できる OpenSearch ノードを作成します。カスタマイズ用の環境変数 を参照し、EL8、EL9、Ubuntu 22.04 server に対応しています。
curl -SsL https://pfms.me/pandorafms-opensearch-el | bash
[ “$CLUSTER_NAME” ]
by default: CLUSTER_NAME='pandora_opensearch
'.[ “$OPENSEARCH_PASS” ]
by default: OPENSEARCH_PASS=“P4nd0r4!FMS”
.[ “$CLUSTER_NAME” ]
のデフォルト: CLUSTER_NAME='pandora_opensearch
'.[ “$OPENSEARCH_PASS” ]
のデフォルト: OPENSEARCH_PASS=“P4nd0r4!FMS”
.env CLUSTER_NAME="pandora_opensearch" \ OPENSEARCH_PASS="P4nd0r4!FMS" \ bash -c "$(curl -SsL https://pfms.me/pandorafms-opensearch-el)"
curl -X GET https://< ip_opensearch >:< opensearch_port > -ku '< user >:< pass >'
curl -X GET https://127.0.0.1:9200 -ku 'admin:P4nd0r4!FMS'
Before running OpenSearch, you should disable memory paging and swap on the host to improve performance and increase the number of memory maps available to OpenSearch. See “Important Settings” for more information:
OpenSearch を実行する前に、パフォーマンスを向上させ、OpenSearch で使用できるメモリマップの数を増やすために、ホスト上のメモリページングとスワップを無効にする必要があります。 詳細については、「重要な設定」を参照してください。
# Disable memory paging and swapping. sudo swapoff -a # Edit the sysctl config file that defines the host's max map count. sudo vi /etc/sysctl.conf # Set max map count to the recommended value of 262144. vm.max_map_count=262144 # Reload the kernel parameters. sudo sysctl -p
For Rocky Linux 8, installation via RPM package is recommended:
For Rocky Linux 8, installation via RPM package is recommended. Once OpenSearch is installed, access to OpenSearch must be checked from Pandora FMS. Before performing this test configure the node or cluster. For this installation check, run:
Rocky Linux 8 の場合、RPM パッケージによるインストール が推奨されます。OpenSearch がインストールされたら、Pandora FMS から OpenSearch へのアクセスを確認する必要があります。このテストを実行する前に、ノード または クラスター を設定してください。このインストール チェックでは、次を実行します。
curl -X GET https://<ip_opensearch>:<opensearch_port> -u 'admin:admin' --insecure
You should get a response similar to:
次のような応答が返されます。
{ "name" : "hostname", "cluster_name" : "opensearch", "cluster_uuid" : "6XNc9m2gTUSIoKDqJit0PA", "version" : { "distribution" : "opensearch", "number" : <version>, "build_type" : <build-type>, "build_hash" : <build-hash>, "build_date" : <build-date>, "build_snapshot" : false, "lucene_version" : <lucene-version>, "minimum_wire_compatibility_version" : "7.10.0", "minimum_index_compatibility_version" : "7.0.0" }, "tagline" : "The OpenSearch Project: https://opensearch.org/" }
By default, the OpenSearch installation enables SSL, username and password which is a good practice; It is recommended to change the default username and password.
デフォルトの OpenSearch のインストールでは SSL、ユーザ名、パスワードが有効になっており、これが推奨事項です。 デフォルトのユーザ名とパスワードを変更することをお勧めします。
First edit the configuration file /etc/opensearch/opensearch.yml
and then the OpenSearch service will be restarted.
まず設定ファイル /etc/opensearch/opensearch.yml
を編集します。その後、OpenSearch サービスを再起動します。
This file contains the configuration of all the parameters of theOpenSearch service; See the official documentation for more information:
このファイルには、OpenSearch サービスのすべてのパラメータ設定が含まれています。 詳細については、公式ドキュメントを参照してください。
https://opensearch.org/docs/latest/install-and-configure/configuration/
Minimum configurations necessary to start the service and its use with Pandora FMS.
サービスを開始して Pandora FMS で使用するために必要な最低限の設定。
# ---------------------------------- Network # Set the bind address to a specific IP (IPv4 or IPv6): network.host: 0.0.0.0 # Set a custom port for HTTP: http.port: 9200 # For more information, consult the network module documentation.
# ----------------------------------- Paths # Path to directory where to store the data (separate multiple locations by comma): path.data: /var/lib/opensearch # Path to log files: path.logs: /var/log/opensearch
It will also be necessary to uncomment and define the following lines:
次の行のコメントを外して定義することも必要になります。
cluster.name: pandorafms node.name: ${HOSTNAME} network.host: 0.0.0.0
cluster.name
: This will be the name that the group or cluster will receive.node.name
: To name the node using the ${HOSTNAME}
system variable, it will automatically take the name of the host.network.host
the value 0.0.0.0
allows OpenSearch to “listen” on all network interfaces (NIC); To use a specific NIC, enter a corresponding specific value.cluster.name
: これは、グループまたはクラスタの名前になります。node.name
: ${HOSTNAME}
システム変数を使用してノードに名前を付けると、ホストの名前が自動的に取得されます。network.host
の値 0.0.0.0
により、OpenSearch はすべてのネットワークインターフェイス (NIC) で待ち受けできます。 特定の NIC を使用するには、対応する特定の値を入力します。If you work with a single node, add the line to the configuration file to allow the single node to start:
単一ノードを使用する場合は、設定ファイルに次の行を追加して、単一ノードが起動できるようにします。
discovery.type: single-node
In case of working with a cluster you need to complete the discovery.seed_hosts
parameter:
クラスターを使用する場合は、discovery.seed_hosts
パラメータを設定する必要があります。
discover.seed_hosts : ["ip:port", "ip", "ip"]
In the most recent versions of OpenSearch, memory management of the Java® virtual machine is done automatically and it is recommended to let it be managed this way in production environments, so it is unnecessary to modify the JVM values.
OpenSearch の最新バージョンでは、Java® 仮想マシンのメモリ管理は自動的に行われ、実稼働環境ではこの方法で管理することをお勧めします。そのため、JVM 値を変更する必要はありません。
To start OpenSearch, execute:
OpenSearch を開始するには、次のように実行します。
systemctl start opensearch.service
To restart use restart
, to stop stop
and status
to check the status.
再起動には restart
、停止には stop
、状態を確認するには status
を使用します。
If the service does not start, check the logs located at /var/log/opensearch/
(in this case the file pandorafms.log
or the name given to the node).
サービスが開始しない場合は、/var/log/opensearch/
にあるログ (この場合はファイル pandorafms.log
またはノードに指定された名前) を確認してください。
Remember that to check the installation and operation of OpenSearch you may run:
OpenSearch のインストールと動作の確認は、次のコマンドで行なえます。
curl -X GET https://<node-ip> -u 'admin:admin' --insecure
For the configuration of an OpenSearch cluster it is recommended to follow the official documentation:
OpenSearch クラスターの設定については、公式ドキュメントに従うことをお勧めします。
https://opensearch.org/blog/optimize-opensearch-index-shard-size/
A configuration guide for Pandora FMS is also provided.
Pandora FMS の設定ガイド も提供しています。
To change the default password from admin
, a series of steps must be followed. The first thing is to export the variable to use the Java® JDK installed by OpenSearch to use any of the tools:
デフォルトのパスワードを admin
から変更するには、一連の手順に従う必要があります。 まず、OpenSearch によってインストールされた Java® JDK を使用していずれかのツールを使用できるように変数をエクスポートします。
export OPENSEARCH_JAVA_HOME=/usr/share/opensearch/jdk
Then, to generate the hashed password to place in the OpenSearch configuration file, the following script is used (replace < password >
with the password to use):
次に、ハッシュ化されたパスワードを生成して OpenSearch 設定ファイルに配置するために、次のスクリプトを使用します (< password >
を使用するパスワードに置き換えます)。
/usr/share/opensearch/plugins/opensearch-security/tools/hash.sh -p <password>
For example:
例:
Then open the file /etc/opensearch/opensearch-security/internal_users.yml
with the text editor vim or nano to modify the password of the required user or users.
次に、テキストエディタ vim または nano でファイル /etc/opensearch/opensearch-security/internal_users.yml
を開き、必要なユーザのパスワードを変更します。
It is recommended to leave only the admin
user for use with Pandora FMS, it is unnecessary to maintain any other user.
Pandora FMS で使用するために admin
ユーザのみを残すことをお勧めします。他のユーザを維持する必要はありません。
Example file:
ファイル例:
To make the changes effective, the following must be executed:
変更を有効にするには、以下を実行する必要があります。
cd /usr/share/opensearch/plugins/opensearch-security/tools
OPENSEARCH_JAVA_HOME=/usr/share/opensearch/jdk ./securityadmin.sh -cd /etc/opensearch/opensearch-security/ -cacert /etc/opensearch/root-ca.pem -cert /etc/opensearch/kirk.pem -key /etc/opensearch/kirk-key.pem -icl -nhnv-t internalusers -icl -nhnv -cacert /etc/opensearch/root-ca.pem -cert /etc/opensearch/kirk.pem -key /etc/opensearch/ kirk-key.pem
A final message Done with success
should be displayed; to check the new password (following the previous example with pandora
used):
最後のメッセージ Done with success
が表示されます。 新しいパスワードを確認するには (pandora
を使用した前の例に従って) 次のようにします:
For more information on user management in OpenSearch:
OpenSearch でのユーザ管理の詳細については、以下を参照してください。
To configure Pandora FMS with OpenSearch see the topic “Log collection and monitoring”.
OpenSearch を使用するように Pandora FMS を設定するには、“ログ収集と監視” を参照してください。
Before setting an environment into production, whether it is a single node or a data cluster, it is recommended to apply the corresponding configurations to this node or cluster based on its use. In the case of indexes generated by Pandora FMS, the most effective way to do so is by defining a template to define the configuration of the fields and the stored data.
本番環境に設定する前に、それが単一ノードであってもデータクラスタであっても、その用途に基づいてこのノードまたはクラスタに対応する設定を適用することをお勧めします。 Pandora FMS によって生成されたインデックスの場合、最も効果的な方法は、フィールドと保存されたデータの設定を定義するテンプレートを定義することです。
Templates are configurations that are only applied at the time of index creation. Changing a template will not have any impact on existing indexes.
テンプレートは、インデックスの作成時にのみ適用される設定です。 テンプレートを変更しても、既存のインデックスには影響しません。
To create a basic template, you only need to define the following fields:
基本テンプレートを作成するには、次のフィールドを定義するだけで済みます。
curl -X PUT -ku 'admin:admin' https://<node_ip>:9200/_index_template/pandorafms -H 'Content-Type: application/json' -d' { "index_patterns": [ "pandorafms*" ], "template": { "aliases": { "pandorafms_logs": {} }, "settings": { "number_of_shards": 1, "auto_expand_replicas" : "0-1", "number_of_replicas": "0" }, "mappings" : { "properties" : { "agent_id" : { "type" : "long" }, "group_id" : { "type" : "long" }, "group_name" : { "type" : "text" }, "logcontent" : { "type" : "text" }, "source_id" : { "type" : "text" }, "suid" : { "type" : "text" }, "type" : { "type" : "text" }, "utimestamp" : { "type" : "long" }, "@timestamp": { "type": "date" } } } } } '
Through Pandora FMS (menu) interface you may upload said template:
Pandora FMS (メニュー) インターフェイスを通じて、上記のテンプレートをアップロードできます。
PUT _template/pandorafms
.PUT _template/pandorafms
です。You may also check the templates through Pandora FMS interface itself:
Pandora FMS インターフェイス自体を通じてテンプレートを確認することもできます。
GET _template/pandorafms
.GET _template/pandorafms
です。To define a multinode template, take into account the following information:
複数ノードテンプレートを定義するには、次の情報を考慮してください。
For example, in a Pandora FMS environment with 3 nodes configured, when you modify the fields number_of_shards
and number_of_replicas
it should look like this:
たとえば、3 つのノードが設定された Pandora FMS 環境で、number_of_shards
フィールドと number_of_replicas
フィールドを変更すると、次のようになります。
{ "index_patterns": ["pandorafms*"], "settings": { "number_of_shards": 3, "auto_expand_replicas" : "0-1", "number_of_replicas" : "2" },
From the command line you may list the environment templates by executing:
コマンドラインから次のコマンドを実行して、環境テンプレートを一覧表示できます。
curl -X GET "localhost:9200/_cat/templates/*?v=true&s=name&pretty"
You may also see the details of a template, for example, created for pandorafms
by running:
次のコマンドを実行すると、たとえば pandorafms
用に作成されたテンプレートの詳細を確認することもできます。
curl -X GET "localhost:9200/_template/pandorafms*?pretty"
which will return the configuration you defined in JSON format.
これにより、定義した設定が JSON 形式で返されます。
You may perform these operations through Pandora FMS interface:
これらの操作は、Pandora FMS インターフェイスを通じて実行できます。
To configure Pandora FMS with OpenSearch see “Log collection and monitoring”.
OpenSearch を使うように Pandora FMS を設定するには、“ログ収集と監視” を参照してください。