• 产品与解决方案
  • 行业解决方案
  • 服务
  • 支持
  • 合作伙伴
  • 新华三人才研学中心
  • 关于我们

03-安全策略命令参考

目录

17-入侵防御及病毒防护命令

本章节下载 17-入侵防御及病毒防护命令  (163.53 KB)

docurl=/cn/Service/Document_Software/Document_Center/IP_Security/ACG/H3C_SecPath_ACG1000/Command/Command_Manual/ACG1000_CR(R6611P06_E6401)-6W102/03/202008/1317744_30005_0.htm

17-入侵防御及病毒防护命令


1 入侵防御命令

1.1  入侵防御配置命令

1.1.1  Ips set

ips 命令用来创建IPS事件集。

no ips 命令用来删除IPS事件集。

【命令】

ips set { SETNAME }

ips log { limited | unlimited }

no ips set { SETNAME }

【视图】

系统视图

【参数】

setname:指定IPS事件集的名称。

【举例】

#创建一条IPS事件集

host# system-view

host(config)# ips set test

1.1.2  Ips log

ips log命令用来设置日志限速功能。

【命令】

ips log { limited | unlimited }

【视图】

系统视图

【参数】

limited:启用日志限速功能。

Unlimited不开启日志限速。

【使用指导】

开启日志限速功能后,一个签名(ips事件集下边一个规则就是一个签名,不关心报文的源目ip,源目端口)小于4g的是最大3s一条,大于等于4g的最多1s一条。

【举例】

#启用日志限速

host# system-view

host(config)# ips log limited

 

1.2  IPS事件集修改命令

1.2.1  level

level命令用来修改事件集级别。

no level命令用来删除事件集级别使其为默认级别。

【命令】

level { high | low | middle }

no level

【视图】

Ips-set 视图

【参数】

high:事件集级别为高。

low事件集级别为低。

middle事件集级别为中。

【举例】

#修改IPS事件集级别为高。

host# system-view

host(config)# ips set test

host(config-ips-set)# level high

1.2.2  Member

member命令用来增加事件集事件。

no member 命令用来删除事件集事件。

【命令】

member event id level { info | notice | warning | alert } action { pass | drop | reset | drop_session | block_source } log { on | off } { enable | disable }

no member event id

【视图】

Ips-set 视图

【参数】

Id:事件集规则ID。

Level:设置事件级别。

Info:事件级别为信息。

Notice:事件级别为通知。

Warning:事件级别警告。

alert:事件级别告警。

Action:设置事件动作。

Pass:动作为允许。

Drop:动作为丢弃。

Reset:动作为拒绝。

drop_session:动作为丢弃会话。

block_source:动作为阻断源地址。

log:设置事件日志是否开启。

on:开启日志。

off:不开启日志。

enable:事件启用。

disable:事件不启用。

【举例】

# 修改IPS事件集规则。

host# system-view

host(config)# ips set test

host(config-ips-set)# member event 9174500 level alert action pass log on enable

2 IPS自定义规则命令

2.1  IPS自定义规则配置命令

2.1.1  ips-custom rule

ips-custom rule命令用来增加入侵检测自定义规则并进入ips-custom视图,如果指定的入侵检测自定义规则已经存在,则直接进入ips-custom视图。

no ips-custom rule命令用来删除入侵检测自定义规则。

【命令】

ips-custom rule NAME

no ips-custom rule NAME

【视图】

系统视图

【参数】

NAME:自定义规则名称。

【使用指导】

最多可添加32条自定义规则。

【举例】

#添加ips自定义规则aaa。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#

【相关命令】

display running-config ips-custom

2.1.2  action

action命令用来配置规则的处理动作。

【命令】

action { deny | permit }

【视图】

ips-custom视图。

【参数】

deny:处理动作为拒绝。

permit:处理动作为允许。

【举例】

#ips自定义规则aaa的处理动作为拒绝。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#action deny

【相关命令】

 display running-config ips-custom

2.1.3  log

log 命令用来配置规则的日志界别。

【命令】

log { ignore | alert | warning | notice | info }

【视图】

ips-custom视图

【参数】

ignore:不记录日志。

alert:日志级别为告警。

warning:日志级别为警告。

notice:日志级别为通知。

info:日志级别为信息。

【举例】

#设置ips自定义规则aaa的日志级别为告警。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#log alert

【相关命令】

display running-config ips-custom

2.1.4  enable

enable命令用来启用IPS自定义规则。

disable命令用来禁用IPS自定义规则。

【命令】

enable

disable

【缺省情况】

缺省情况下,IPS自定义规则是启用的。

【视图】

ips-custom视图

【举例】

# 禁用ips自定义规则aaa。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#enable

【相关命令】

display running-config ips-custom

2.1.5  clear

clear命令用来清除该条IPS自定义规则的计数。

【命令】

clear

【视图】

ips-custom视图

【举例】

# 清除ips规则1的计数。

Host# configure terminal

Host(config)#ips-custom rule 1

Host(config-ips-custom)#clear

【相关命令】

display running-config ips-custom

2.1.6  check

check命令用来增加ips自定义规则匹配规则。

【命令】

check <0-7>

【参数】

<0-7>:check 规则的id号。

【视图】

ips-custom视图

【举例】

# 在IPS自定义策略中配置检查IP协议号为10。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# ip proto equal 10

【使用指导】

ips自定义规则可以配置两层匹配规则,check配置的为第一层,每条ips自定义规则可以配置8条check 规则,id号固定为<0-7>,check规则之间的关系为逻辑与。

【相关命令】

display running-config ips-custom

2.1.7  check配置命令

1. IP

ip length命令用来配置ip协议匹配规则的负载长度。

ip payload contain命令用来配置ip协议匹配规则的负载。

ip proto命令用来配置ip协议匹配规则的协议。

【命令】

ip length {equal | greater | less } <0-65535>

 ip payload contain

 ip proto {equal | unequal } <0-255>

【参数】

equal:等于。

greater:大于。

less:小于。

<0-65535>:负载长度的值。

contain设置负载包含的字符。

unequal:不等于。

<0-255>负载协议的匹配值。

【视图】

ips-custom-check视图

【举例】

#添加ip 协议号为6的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# ip proto equal 6

#添加ip 负载长度大于100字节。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# ip length greater 100

#添加ip 负载包含字符“aaa”。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)#ip payload contain

Please input the content to match, length scope is 1-127. It is case insensitive: aaa

【相关命令】

display running-config ips-custom

2. TCP

tcp命令用来增加tcp协议匹配规则。

【命令】

tcp {sport | dport} {equal | unequal| greater} <0-65535>

tcp length {equal | greater | less} <0-65535>

tcp payload contain

【参数】

sport:设置tcp协议的源端口号。

dport:设置tcp协议的目的端口号。

equal:等于。

greater:大于。

unequal:不等于。

<0-65535>:编号,范围为0-65535

length:设置负载长度。

payload contain设置负载包含的字符。

【视图】

ips-custom-check视图

【举例】

#添加tcp源端口不等于5000的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# tcp sport unequal 5000

#添加tcp 负载长度大于100字节。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# tcp length greater 100

#添加tcp 负载包含字符“aaa”。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)#tcp payload contain

Please input the content to match, length scope is 1-127. It is case insensitive: aaa

3. UDP

udp命令用来增加udp协议匹配规则。

【命令】

udp {sport | dport} {equal | unequal| greater} <0-65535>

udp length {equal | greater | less} <0-65535>

udp payload contain

【参数】

sport:设置tcp协议的源端口号。

dport:设置tcp协议的目的端口号。

equal:等于。

greater:大于。

unequal:不等于。

<0-65535>:编号,范围为0-65535

length:设置负载长度。

Payload contain:设置负载包含的字符。

【视图】

ips-custom-check视图

【举例】

#添加tcp源端口不等于5000的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# udp sport unequal 5000

#添加tcp 负载长度大于100字节。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# udp length greater 100

#添加tcp 负载包含字符“aaa”。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# udp payload contain

Please input the content to match, length scope is 1-127. It is case insensitive: aaa

4. ICMP

icmp命令用来增加icmp协议匹配规则。

【命令】

icmp code {equal | unequal | greater} <0-255>

icmp length {equal | greater | less} <0-65535>

icmp payload {contain | regular}

icmp type {equal | unequal | greater} <0-255>

【视图】

ips-custom-check视图

【举例】

#添加icmp代码等于0的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# icmp code equal 0

#添加icmp 类型等于。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# icmp type equal 8

#添加icmp负载包含字符“aaa”。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# icmp payload contain

Please input the content to match, length scope is 1-127. It is case insensitive: aaa

#添加icmp负载长度小于100。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# icmp length less 100

5. HTTP

http命令用来增加http协议匹配规则。

【命令】

http {method | version | url | host| cookie| header| user-agent} length {equal | greater | less} <0-65535>

http {url | host | cookie | header | user-agent} {contain | regular}

http method {equal | unequal} {get|head|put|delete|post|options|trace|connect}

【视图】

ips-custom-check视图

【举例】

#添加http方法等于post的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# http method equal post

#添加http url 正则匹配aaa。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# http url regular

Please input the content to match, length scope is 1-127. It is case insensitive: [a][b][c]

#添加http host字段的长度大于50字节。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# http host length greater 50

6. FTP

ftp命令用来增加ftp协议匹配规则。

【命令】

ftp {cmd | cmd-parameter} {contain | regular}

ftp {cmd | cmd-parameter} length {equal | greater | less} <0-65535>

【视图】

ips-custom-check视图

【举例】

#添加ftp命令包含STOR的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# ftp cmd contain stor

#添加ftp 命令参数长度等于10字节。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# ftp cmd-parameter

#添加http host字段的长度大于50字节。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# http host length greater 50

7. POP3

pop3命令用来增加pop3协议匹配规则。

【命令】

pop3 {cmd | cmd-parameter} {contain | regular}

pop3 {cmd | cmd-parameter} length {equal | greater | less} <0-65535>

【视图】

ips-custom-check视图

【举例】

#添加pop3命令包含user的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# pop3 cmd contain user

#添加pop3 命令参数小于100字节

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# pop3 cmd-parameter length less 100

8. SMTP

smtp命令用来增加smtp协议匹配规则。

【命令】

smtp {cmd | cmd-parameter} {contain | regular}

smtp {cmd | cmd-parameter} length {equal | greater | less} <0-65535>

【视图】

ips-custom-check视图

【举例】

#添加smtp命令包含mail的规则。

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# smtp cmd contain mail

#添加smtp命令参数小于100字节

Host# configure terminal

Host(config)#ips-custom rule aaa

Host(config-ips-custom)#check 0

Host(config-ips-custom-check)# smtp cmd-parameter length less 100

3 防病毒设定命令

3.1  防病毒设定

3.1.1  病毒扫描

av scan命令用来指定扫描的病毒文件类型

no av sacn 命令用来删除指定的病毒文件类型

【命令】

Av scan file { expr | any } { disable | enable }

no av scan file expr

【视图】

系统视图

【参数】

expr:具体文件名称。

【使用指导】

文件类型必须以*.开头。

【举例】

#创建av 扫描类型为txt 状态为启用

host# system-view

host(config)# av scan file *.txt enable

3.1.2  扫描解压层数

Av unpack 命令用来指定是否启用解压以及最大解压层数

【命令】

Av unpack { off | on | level } <5-20>

【视图】

系统视图

【参数】

【使用指导】

最大解压层数支持20层。

【举例】

#启用病毒设定解压功能以及最大解压层数为6

host# system-view

host(config)# av unpack on

host(config)# av unpack level 6

 

不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!

新华三官网
联系我们