配置基于流的防病毒策略
概述
让我们看下典型的企业网络。最终用户在不知不觉中访问了遭到入侵的网站并下载了恶意内容。此作会导致终结点遭到破坏。端点上的有害内容也会对网络中的其他主机构成威胁。防止下载恶意内容非常重要。
您可以将 SRX 系列防火墙与基于流的防病毒功能结合使用,保护用户免受病毒攻击,并防止恶意软件在网络中传播。基于流的防病毒软件可扫描网络流量中的病毒、特洛伊木马、rootkit 和其他类型的恶意代码,并在检测到恶意内容时立即阻止。
以下配置创建具有以下属性的基于流的防病毒策略:
-
防火墙策略名称为 fw-av-policy。
-
流防病毒策略是 av-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
-
CDN 服务器必须可从 SRX 系列防火墙访问。对于 Junos OS 24.2.0 之前的版本,必须 https://signatures.juniper.net/phase 瞻博网络内容分发网络 (CDN) 服务器。从 Junos OS 版本 24.2.0 开始,CDN 服务器 https://signatures.juniper.net/。
-
具有 Junos OS 23.4R1 或更高版本的 SRX 系列防火墙
配置
分步过程
以下配置要求您在各个配置层级中进行导航。有关作说明,请参阅 《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
-
创建防病毒策略,如果任何文件返回的判定大于或等于 7,则阻止任何文件。
set services anti-virus policy av-policy action block set services anti-virus policy av-policy default-notification log set services anti-virus policy av-policy fallback-options notification log set services anti-virus policy av-policy http-client-notify message "test message for anti-virus flow" set services anti-virus policy av-policy notification log set services anti-virus policy av-policy verdict-threshold 7
- 默认情况下,最新的防病毒签名包会每五分钟自动从瞻博网络内容分发网络 (CDN) 服务器下载到您的防火墙设备。您可以通过指定 CDN 服务器的 URL 来手动更新病毒库。
set services anti-virus update url https://signatures.juniper.net/
set services anti-virus update automatic interval <5...60>
命令自定义设置。 -
配置防火墙策略并应用防病毒策略。
set security policies from-zone trust to-zone untrust policy fw-av-policy match source-address any set security policies from-zone trust to-zone untrust policy fw-av-policy match destination-address any set security policies from-zone trust to-zone untrust policy fw-av-policy match application any set security policies from-zone trust to-zone untrust policy fw-av-policy match dynamic-application any set security policies from-zone trust to-zone untrust policy fw-av-policy then permit application-services anti-virus-policy av-policy
-
提交配置。
commit
结果
在配置模式下,输入 show services anti-virus policy av-policy
和 show configuration |display set
命令,以确认您的配置。如果输出未显示预期的配置,请重复配置说明进行更正。
检查配置结果:
show services anti-virus update { url https://signatures.juniper.net/; } policy av-policy { action block; default-notification { log; } fallback-options { notification { log; } } http-client-notify { message "test message for anti-virus flow"; } notification { log; } verdict-threshold 7; }
show security policies from-zone trust to-zone untrust policy fw-av-policy { match { source-address any; destination-address any; application any; dynamic-application any; } then { permit { application-services { anti-virus-policy av-policy; } } } }
验证
要验证配置是否工作正常,请使用以下步骤:
获取有关当前防病毒统计信息的信息
目的
某些流量通过 SRX 系列防火墙后,根据您的配置文件和策略设置,检查统计信息,了解允许、阻止的会话数等。
行动
在作模式下,输入 show services anti-virus statistics
命令。
示例输出
show services anti-virus statistics
show services anti-virus statistics Anti-virus scan statistics: Virus DB type: anti-virus Total signatures: 11 Anti-virus DB version: 1654594666 Anti-virus DB update time: 2022-08-25 13:03:58 PDT Total HTTP HTTPS SMTP SMTPS IMAP IMAPS SMB File scanned: 419382 81947 177549 16067 31591 15994 31925 64309 Virus found: 290713 1613 161485 15940 31591 15994 31925 32165 Virus blocked: 290713 1613 161485 15940 31591 15994 31925 32165 Virus permitted: 0 0 0 0 0 0 0 0
意义
显示有关扫描、识别和阻止或允许的病毒的统计信息。