この投稿は、Wazuhの脆弱性検出に関するものです
下記のブログを使用して、wazuhオープンソースセキュリティプラットフォームとwazuhエージェントをインストールします。
1:WAZUHオープンソースセキュリティプラットフォーム
2:WAZUHエージェントのインストール
Wazuhは、Vulnerability Detectorモジュールを使用して、エージェントにインストールされているアプリケーションの脆弱性を検出できます。このソフトウェア監査は、Canonical、Debian、Red Hat、およびNationalVulnerabilityDatabaseによってインデックス付けされた脆弱性フィードの統合を通じて実行されます。
脆弱性を検出できるように、エージェントはインストールされているアプリケーションのリストをネイティブに収集し、定期的にマネージャーに送信できるようになりました(エージェントごとに1つずつ、ローカルのsqliteデータベースに保存されます)。また、マネージャーは、公開されているCVEリポジトリからグローバルな脆弱性データベースを構築し、後でこのデータベースを使用して、この情報をエージェントのアプリケーションインベントリデータと相互相関させます。
グローバル脆弱性データベースは自動的に作成され、現在、次のリポジトリからデータを取得しています。
- https://canonical.com:UbuntuLinuxディストリビューションのCVEをプルするために使用されます。
- https://www.redhat.com:RedHatおよびCentOSLinuxディストリビューションのCVEをプルするために使用されます。
- https://www.debian.org:DebianLinuxディストリビューションのCVEをプルするために使用されます。
- https://nvd.nist.gov/:NationalVulnerabilityDatabaseからCVEをプルするために使用されます。
- https://feed.wazuh.com/:Microsoft製品のCVEおよびパッチを使用してMSUフィードをプルするために使用されます。
このデータベースは定期的に更新されるように構成できるため、ソリューションは最新のCVEをチェックします。
グローバル脆弱性データベース(CVEを含む)が作成されると、検出プロセスはインベントリデータベースで脆弱性パッケージを探します(エージェントごとに一意)。アラートは、CVE(Common Vulnerabilities and Exposures)が、監視対象サーバーの1つにインストールされていることがわかっているパッケージに影響を与える場合に生成されます。パッケージのバージョンがCVEの影響を受ける範囲内に含まれている場合、パッケージは脆弱であるとラベル付けされます。結果はアラートとして表示され、データベースにも保存されます。そのため、最後のスキャンアラートを確認したり、すべてのエージェントの脆弱なソフトウェアDBにクエリを実行したりできます。
Vulnerability Detectorモジュールは、起動時(run_on_start)および特定の期間(間隔)ごとにスキャンを実行できます。これらのいずれの場合でも、すでにスキャンされたパッケージは、ignore_timeが期限切れになるまで再スキャンされるのを待ちます。これにより、パフォーマンスが向上し、構成可能な時間中にアラートが繰り返されるのを防ぎます。次に、2つの異なるタイプのスキャンがあります。
- フルスキャン:初めて、VulnerabilityDetectorはインストールされているすべてのパッケージをスキャンします。この後、設定されたignore_timeの有効期限が切れた場合にのみ、使用可能なすべてのパッケージが再度スキャンされます。
- 部分スキャン:ignore_timeがまだ有効な間は、新しいパッケージのみがスキャンされます。
この動作から生じる考慮事項はほとんどありません:
- フルスキャンごとにすべてのパッケージのアラートが生成されるため、アラートは修正されるまで繰り返されます。
- ユーザーはフルスキャンを手動でトリガーできません。唯一のオプションはignore_time設定を減らすことです。
- 部分スキャンは新しいパッケージのアラートを生成しますが、削除されたパッケージのアラートは削除しません。
- 部分スキャンは、マネージャーの再起動でトリガーできます。
構成の詳細については、脆弱性検出器の設定を確認してください。
次の例は、関連するすべての手順を理解するのに役立つ場合があります

次の表は、脆弱性検出器が現在サポートされているオペレーティングシステムと、各ディストリビューションに必要なプロバイダー構成を示しています。
配布 | バージョン | 構成プロバイダー |
---|---|---|
Red Hat&CentOS | 5 | Red HatNational Vulnerability Database |
6 | ||
7 | ||
8 | ||
Ubuntu | 信頼できる/14 | CanonicalNational脆弱性データベース |
xenial / 16 | ||
バイオニック/18 | ||
フォーカル/20 | ||
Debian | ストレッチ/9 | DebianNational脆弱性データベース |
バスター/10 | ||
ウィンドウ | サポートされているすべてのバージョン | National Vulnerability DatabaseMSU |
MacOS | サポートされているすべてのバージョン | National Vulnerability Database |
次の例は、脆弱性検出プロセスを実行するために必要なコンポーネントを構成する方法を示しています。
- 監視対象システムにインストールされているパッケージの収集に使用されるエージェントモジュールを有効にします。
これは、共有エージェント構成ファイルに次の設定ブロックを追加することで実行できます。
<wodle name="syscollector">
<disabled>no</disabled>
<interval>1h</interval>
<os>yes</os>
<packages>yes</packages>
</wodle>
Windowsエージェントの脆弱性をスキャンする場合は、hotfixes
も追加する必要があります。 スキャン:
<wodle name="syscollector">
<disabled>no</disabled>
<interval>1h</interval>
<os>yes</os>
<packages>yes</packages>
<hotfixes>yes</hotfixes>
</wodle>
これらのスキャンはデフォルトで有効になっています。インベントリモジュールの詳細については、Syscollectorの設定を確認してください。脆弱性の検出に使用されるマネージャーモジュールを有効にしてください。
これを行うには、次のようなブロックをマネージャー構成ファイルに追加します。
<vulnerability-detector>
<enabled>yes</enabled>
<interval>5m</interval>
<run_on_start>yes</run_on_start>
<provider name="canonical">
<enabled>yes</enabled>
<os>bionic</os>
<update_interval>1h</update_interval>
</provider>
<provider name="nvd">
<enabled>yes</enabled>
<update_from_year>2010</update_from_year>
<update_interval>1h</update_interval>
</provider>
</vulnerability-detector>
変更を適用するには、マネージャーを再起動することを忘れないでください:
systemctl restart wazuh-manager
service wazuh-manager restart
ここでは、説明されたフィールドが入力されている実際のアラートを確認できます:
** Alert 1591945867.49829472: - vulnerability-detector,gdpr_IV_35.7.d,pci_dss_11.2.1,pci_dss_11.2.3,tsc_CC7.1,tsc_CC7.2,
2020 Jun 12 07:11:07 (Debian) any->vulnerability-detector
Rule: 23505 (level 10) -> 'CVE-2019-12735 affects vim'
vulnerability.package.name: vim
vulnerability.package.version: 2:8.0.0197-4+deb9u1
vulnerability.package.architecture: amd64
vulnerability.package.condition: Package less than 2:8.0.0197-4+deb9u2
vulnerability.cvss.cvss2.vector.attack_vector: network
vulnerability.cvss.cvss2.vector.access_complexity: medium
vulnerability.cvss.cvss2.vector.authentication: none
vulnerability.cvss.cvss2.vector.confidentiality_impact: complete
vulnerability.cvss.cvss2.vector.integrity_impact: complete
vulnerability.cvss.cvss2.vector.availability: complete
vulnerability.cvss.cvss2.base_score: 9.300000
vulnerability.cvss.cvss3.vector.attack_vector: local
vulnerability.cvss.cvss3.vector.access_complexity: low
vulnerability.cvss.cvss3.vector.privileges_required: none
vulnerability.cvss.cvss3.vector.user_interaction: required
vulnerability.cvss.cvss3.vector.scope: changed
vulnerability.cvss.cvss3.vector.confidentiality_impact: high
vulnerability.cvss.cvss3.vector.integrity_impact: high
vulnerability.cvss.cvss3.vector.availability: high
vulnerability.cvss.cvss3.base_score: 8.600000
vulnerability.cve: CVE-2019-12735
vulnerability.title: CVE-2019-12735
vulnerability.rationale: getchar.c in Vim before 8.1.1365 and Neovim before 0.3.6 allows remote attackers to execute arbitrary OS commands via the :source! command in a modeline, as demonstrated by execute in Vim, and assert_fails or nvim_input in Neovim.
vulnerability.severity: High
vulnerability.published: 2019-06-05
vulnerability.updated: 2019-06-13
vulnerability.cwe_reference: CWE-78
vulnerability.references: ["http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00031.html", "http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00036.html", "http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00037.html", "http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00034.html", "http://lists.opensuse.org/opensuse-security-announce/2019-07/msg00050.html", "http://lists.opensuse.org/opensuse-security-announce/2019-08/msg00075.html", "http://www.securityfocus.com/bid/108724", "https://access.redhat.com/errata/RHSA-2019:1619", "https://access.redhat.com/errata/RHSA-2019:1774", "https://access.redhat.com/errata/RHSA-2019:1793", "https://access.redhat.com/errata/RHSA-2019:1947", "https://bugs.debian.org/930020", "https://bugs.debian.org/930024", "https://github.com/neovim/neovim/pull/10082", "https://github.com/numirias/security/blob/master/doc/2019-06-04_ace-vim-neovim.md", "https://github.com/vim/vim/commit/53575521406739cf20bbe4e384d88e7dca11f040", "https://lists.debian.org/debian-lts-announce/2019/08/msg00003.html", "https://lists.fedoraproject.org/archives/list/[email protected]/message/2BMDSHTF754TITC6AQJPCS5IRIDMMIM7/", "https://lists.fedoraproject.org/archives/list/[email protected]/message/TRIRBC2YRGKPAWVRMZS4SZTGGCVRVZPR/", "https://seclists.org/bugtraq/2019/Jul/39", "https://seclists.org/bugtraq/2019/Jun/33", "https://security.gentoo.org/glsa/202003-04", "https://support.f5.com/csp/article/K93144355", "https://support.f5.com/csp/article/K93144355?utm_source=f5support&utm_medium=RSS", "https://usn.ubuntu.com/4016-1/", "https://usn.ubuntu.com/4016-2/", "https://www.debian.org/security/2019/dsa-4467", "https://www.debian.org/security/2019/dsa-4487", "https://nvd.nist.gov/vuln/detail/CVE-2019-12735", "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-12735"]
vulnerability.assigner: [email protected]
vulnerability.cve_version: 4.0
最後に、ここで、アラートの強調表示されたフィールドがWUIでどのように表示されるかを確認できます。

