配置基于机器学习的威胁检测
让我们看下典型的企业网络。最终用户在不知不觉中访问了遭到入侵的网站并下载了恶意内容。此作会导致终结点遭到破坏。端点上的有害内容也会对网络中的其他主机构成威胁。防止下载恶意内容非常重要。
您可以将 SRX 系列防火墙与基于流的防病毒和基于机器学习的威胁检测配合使用,保护用户免受恶意软件攻击,防止恶意软件在网络中传播。
以下配置创建具有以下属性的基于 ML 的防病毒策略:
-
防火墙策略名称为 fw-ml-policy。
-
机器学习策略名称为 ml-policy。
-
如果任何文件返回的判定大于或等于 7,则阻止任何文件,并创建一个日志条目。
-
出现错误情况时,允许下载文件并创建日志条目。
要求
准备工作
-
验证您是否拥有瞻博网络防病毒许可证。有关如何验证设备上的许可证的详细信息,请参阅 SRX 系列防火墙的软件许可证。下面给出了许可证信息示例:
License identifier: JUNOSXXXXXXXX License version: 4 Valid for device: XXXXXXXXXXXX Features: Juniper AV - Juniper Anti-virus Scan Engine date-based, 2022-10-23 17:00:00 PDT - 2022-11-23 16:00:00 PST
-
具有 Junos OS 24.2R1 或更高版本的 SRX 系列防火墙
-
注意:
-
基于机器学习的零日威胁检测支持 IMAP、SMTPS、HTTPS 和 SMB 协议。
-
目前仅支持 .exe 和 .dll 文件类型。
-
配置
分步过程
以下配置要求您在各个配置层级中进行导航。有关作说明,请参阅 《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
-
创建防病毒策略,如果任何文件返回的判定大于或等于 7,则阻止任何文件。
set services anti-virus policy ml-policy action block set services anti-virus policy ml-policy default-notification log set services anti-virus policy ml-policy fallback-options notification log set services anti-virus policy ml-policy http-client-notify message "test message for machine-learning flow" set services anti-virus policy ml-policy notification log set services anti-virus policy ml-policy verdict-threshold 7 set services anti-virus policy ml-policy machine-learning-scan action block set services anti-virus policy ml-policy machine-learning-scan notification log
-
默认情况下,防火墙每周从 CDN 服务器下载签名。
可以通过指定数据库服务器的 URL 来手动更新病毒签名数据库。
set services anti-virus update url https://signatures.juniper.net
-
配置防火墙策略并应用防病毒策略。
set security policies from-zone trust to-zone untrust policy fw-ml-policy match source-address any set security policies from-zone trust to-zone untrust policy fw-ml-policy match destination-address any set security policies from-zone trust to-zone untrust policy fw-ml-policy match application any set security policies from-zone trust to-zone untrust policy fw-ml-policy match dynamic-application any set security policies from-zone trust to-zone untrust policy fw-ml-policy then permit application-services anti-virus-policy ml-policy
-
提交配置。
commit
以下是 ML 扫描的可能完成过程:
set services anti-virus policy ml-policy machine-learning-scan ? Possible completions: action Action when malware is found by machine learning scan + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups > default-notification Notification action taken for action > notification Notification when malware is found by machine learning scan
set services anti-virus machine-learning-scan ? Possible completions: + apply-groups Groups from which to inherit configuration data + apply-groups-except Don't inherit configuration data from these groups max-concurrent Max files concurrent scanned by machine learning scan
结果
在配置模式下,输入 show services anti-virus policy ml-policy
和 show configuration | display set
命令,以确认您的配置。如果输出未显示预期的配置,请重复配置说明进行更正。
检查配置结果:
show services anti-virus update { url https://signatures.juniper.net; } policy ml-policy { action block; default-notification { log; } fallback-options { notification { log; } } http-client-notify { message "test message for machine-learning flow"; } notification { log; } machine-learning-scan { action block; notification { log; } } verdict-threshold 7; }
show security policies from-zone trust to-zone untrust policy fw-ml-policy { match { source-address any; destination-address any; application any; dynamic-application any; } then { permit { application-services { anti-virus-policy ml-policy; } } } }
验证
要验证配置是否工作正常,请使用以下步骤:
获取有关 ML 统计信息的信息
目的
某些流量通过 SRX 系列防火墙后,根据您的配置文件和策略设置,检查统计信息,了解允许、阻止的会话数等。
行动
在作模式下,输入 show services anti-virus machine-learning-scan-statistics
命令。
示例输出
show services anti-virus machine-learning-scan-statistics
show services anti-virus machine-learning-scan-statistics Anti-virus machine learning scan statistics: Machine learning scan engine version: 1696526121 Machine learning scan engine update time: 2023-10-05 22:48:50 UTC Total HTTP HTTPS SMTP SMTPS IMAP IMAPS SMB File scanned: 359382 68947 154549 14367 24591 12494 20025 52309 Virus found: 187713 1417 146795 13840 24591 12494 20025 25165 Virus blocked: 187713 1417 146795 13840 24591 12494 20025 25165 Virus permitted: 0 0 0 0 0 0 0 0
意义
显示有关扫描、识别和阻止或允许的病毒的统计信息。