LoginSignup
1
0

Microsoft Defender for Endpoint on Linux が eBPF に対応し高速化!

Last updated at Posted at 2023-07-21

1. はじめに

Microsoft Defender for Endpoint on Linux (以下 MDE for Linux) が待望の eBPF 対応になりました!これまで課題となっていた auditd に依存していた MDE for Linux のパフォーマンスを改善する大きな性能向上が見込めるようになります。

  • システム全体の監査関連のログノイズを削減
  • アプリケーション間の競合を引き起こすシステム全体の最適化
  • ファイルイベント(ファイルの Read/Open) 監視のオーバーヘッドを削減
  • イベントレートのスループットの向上
  • 特定の構成に対して最適化されたパフォーマンス

本記事執筆時 [2023.7.21] 時点ではプレビュー機能になっており、手動で有効化する必要がありますが、MDE on Linux の性能問題に悩まされているお客様に朗報の機能です。本記事が参考になればと思います。

2023.10.9 GA になりました。
バージョン 101.23082.0006 で eBPF デフォルト有効化されました。
https://learn.microsoft.com/ja-jp/microsoft-365/security/defender-endpoint/linux-whatsnew?view=o365-worldwide

[参考] eBPF とは何か?

image.png
eBPF とは extended Berkeley Packet Filter の略で、Linuxカーネル内でのイベント発生時に動作する処理を、安全・手軽に組み込むための仕組みで、現在ではLinuxカーネルの機能として提供されています。ここ数年で注目が集まっている技術で、カーネルのソースコードを変更したり、カーネルモジュールをロードしたりすることなく、実行時にカーネルの機能を安全かつ効率的に拡張するために使用されます。

なぜ性能向上が見込めるのか?は以下のブログ記事がとっても分かりやすい!ので参考リンクを張らせていただきます。

Linux auditd と比較した研究結果が投稿されていますが、こちらでも linux auditd と比較して性能が 2 倍以上に向上した結果が報告されています。

image.png

2. MDE for Linux における対応

2.1 対応バージョン

以下公式 Docs に掲載がある通り、前提条件として Linux 側が eBPF に対応する Kernel である必要があります。サポートプラットフォームの Kernel 対応バージョン表が Docs に掲載されていますのでご注意ください。

最近の Linux Kernel であれば eBPF 対応済みですが、RHEL/CentOS 6.x などは対象外です。

2.2 eBPF の有効化

プレビュー時点では、機能を有効化する場合は CLI による設定変更となります。

[azureuser@vmlinux001 ~]$ sudo mdatp config ebpf-supplementary-event-provider --value enabled
Configuration property updated. 

設定を有効にすると、mdatp health コマンドで eBPF に切り替えられていることが分かります。
(supplementary_events_subsystem の項目にて表示されます)

[azureuser@vmlinuxamagw ~]$ mdatp health
healthy                                     : true
health_issues                               : []
licensed                                    : true
engine_version                              : "1.1.20300.5"
app_version                                 : "101.23052.0009"
org_id                                      : "52a55a94-b496-4f9d-8bb8-6a6d12283533"
log_level                                   : "info"
machine_guid                                : "18e7deef-be24-47ca-b293-6e7b39023911"
release_ring                                : "Production"
product_expiration                          : Mar 23, 2024 at 08:19:40 PM
cloud_enabled                               : true
cloud_automatic_sample_submission_consent   : "safe"
cloud_diagnostic_enabled                    : false
passive_mode_enabled                        : true
behavior_monitoring                         : "disabled"
real_time_protection_enabled                : false
real_time_protection_available              : true
real_time_protection_subsystem              : "fanotify"
supplementary_events_subsystem              : "ebpf"
tamper_protection                           : "disabled"
automatic_definition_update_enabled         : true
definitions_updated                         : Jul 21, 2023 at 07:13:37 AM
definitions_updated_minutes_ago             : 208
definitions_version                         : "1.393.925.0"
definitions_status                          : "up_to_date"
edr_early_preview_enabled                   : "disabled"
edr_device_tags                             : [{"key":"AzureResourceId","value":"/subscriptions/f6cc3615-eec5-4873-a79c-84ed72c481a2/resourceGroups/RG-SPOKE-JA
PANEAST-EXTHNAKADA-001/providers/Microsoft.Compute/virtualMachines/vmLinuxAMAGW"},{"key":"SecurityWorkspaceId","value":"f6cc3615-eec5-4873-a79c-84ed72c481a2"}]
edr_group_ids                               : ""
edr_configuration_version                   : "30.199999.fixforsiamv2_eus2fix.2023.07.20.01-C5E6E6D57A35B673ECCF5A29E7E574E205B99D42B4FA61FA44D3C398AABC66F3"
edr_machine_id                              : "8ff8ca8ca4a12c68fc0f50a2092a0e8ba130e8a2"
conflicting_applications                    : []
network_protection_status                   : "stopped"
network_protection_enforcement_level        : "disabled"
troubleshooting_mode                        : false
[azureuser@vmlinuxamagw ~]$ 

2023.7 現在、MDE on Linux が eBPF で動作しているかを確認する術は mdatp health コマンドをチェックしたり、auditd に MDE ログが流入していないことをチェックするようなオペレーションにになりそうですが、今後のロードマップとしてトラブルシューティング機能が追加されるようです。早く対応すると良いですね!

  • eBPF リソースを消費する上位プロセスの診断機能
  • BPF 除外を構成するためのトラブルシューティング機能

詳細な情報は以下公式 Docs に掲載されていますので、合わせてご確認ください。

[参考] 他ベンダーの動き : Linux エンドポイントは eBPF が推進されている

Microsoft だけでなく、eBPF による機能改善は様々なベンダーで進んでいるようです。
以下はコンテナ系で有名な Sysdig 社 (Sysdig Falco) の記事です。Kernel モジュールでも十分高速じゃないかと思うんですが、エージェントベースではより付加価値の高い eBPF に切り替えたアナウンスが発表されています。

At Sysdig we’ve recently undergone a pretty interesting shift in our core instrumentation technology, adapting our agent to take advantage of eBPF – a core part of the Linux kernel. Sysdig now supports eBPF as an alternative to our Sysdig kernel module-based architecture. Today we are excited to share more details about our integration and the inner workings of eBPF. To celebrate this exciting technology we’re publishing a series of articles entirely dedicated to eBPF.

EDR を提供している Red Canary の記事です。こちらも audit 環境におけるパフォーマンスを考慮した結果、eBPF を採用しています。

AuditD is relatively slow when it comes to collecting information, and incurs a non-negligible performance penalty on the system under audit. BPF offers us a significant performance advantage: we can perform some filtering, collection, and analysis within the kernel. ”

3. まとめ

以上、MDE on Linux の eBPF 対応について、でした。Linux に知見がある方や、既に Linux OS で auditd を用いた監査をされている方々が待ち望んでいた機能になりますので、本記事を参考に Microsoft Defender for Endpoint の活用を推進していただけたらと思います。本記事がどなたかの参考になれば幸いです。

*本稿は、個人の見解に基づいた内容であり、所属する会社の公式見解ではありません。また、いかなる保証を与えるものでもありません。正式な情報は、各製品の販売元にご確認ください。

参考文献

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0