[WebLogic] Connection Filter Rules Syntax 连接过虑规则语法

Connection Filter Rules Syntax

The syntax of connection filter rules is as follows:

  • Each rule must be written on a single line.

  • Tokens in a rule are separated by white space.

  • A pound sign (#) is the comment character. Everything after a pound sign on a line is ignored.

  • Whitespace before or after a rule is ignored.

  • Lines consisting only of whitespace or comments are skipped.

The format of filter rules differ depending on whether you are using a filter file to enter the filter rules or you enter the filter rules on the Administration Console.

  • When entering the filter rules on the Administration Console, enter them in the following format:

    targetAddress localAddress localPort action protocols
    
  • When specifying rules in the filter file, enter them in the following format:

    targetAddress action protocols 
    
    • targetAddress specifies one or more systems to filter.

    • localAddress defines the host address of the WebLogic Server instance. (If you specify an asterisk (*), the match returns all local IP addresses.)

    • localPort defines the port on which the WebLogic Server instance is listening. (If you specify an asterisk (*), the match returns all available ports on the server).

    • action specifies the action to perform. This value must be allow or deny.

    • protocols is the list of protocol names to match. The following protocols may be specified: http, https, t3, t3s, ldap, ldaps, iiop, iiops, and com. (Although the giop, giops, and dcom protocol names are still supported, their use is deprecated as of release 9.0; you should use the equivalent iiop, iiops, and com protocol names.)

      Note:

      The SecurityConfigurationMBean provides a CompatibilityConnectionFiltersEnabled attribute for enabling compatibility with previous connection filters.
    • If no protocol is defined, all protocols will match a rule.

Types of Connection Filter Rules

Two types of filter rules are recognized:

  • Fast rules

    A fast rule applies to a hostname or IP address with an optional netmask. If a hostname corresponds to multiple IP addresses, multiple rules are generated (in no particular order). Netmasks can be specified either in numeric or dotted-quad form. For example:

    dialup-555-1212.pa.example.net 127.0.0.1 7001 deny t3 t3s #http(s) OK
    192.168.81.0/255.255.254.0   127.0.0.1 8001 allow   #23-bit netmask
    192.168.0.0/16   127.0.0.1 8002 deny   #like /255.255.0.0 
    

    Hostnames for fast rules are looked up once at startup of the WebLogic Server instance. While this design greatly reduces overhead at connect time, it can result in the filter obtaining out of date information about what addresses correspond to a hostname. Oracle recommends using numeric IP addresses instead.

  • Slow rules

    A slow rule applies to part of a domain name. Because a slow rule requires a connect-time DNS lookup on the client-side in order to perform a match, it may take much longer to run than a fast rule. Slow rules are also subject to DNS spoofing. Slow rules are specified as follows:

    *.script-kiddiez.org 127.0.0.1 7001 deny 
    

    An asterisk only matches at the head of a pattern. If you specify an asterisk anywhere else in a rule, it is treated as part of the pattern. Note that the pattern will never match a domain name since an asterisk is not a legal part of a domain name.

How Connection Filter Rules are Evaluated

When a client connects to WebLogic Server, the rules are evaluated in the order in which they were written. The first rule to match determines how the connection is treated. If no rules match, the connection is permitted.

To further protect your server and only allow connections from certain addresses, specify the last rule as:

0.0.0.0/0  *  *  deny

With this as the last rule, only connections that are allowed by preceding rules are allowed, all others are denied. For example, if you specify the following rules:

<Remote IP Address> * * allow https
0.0.0.0/0  *  *  deny

Only machines with the Remote IP Address are allowed to access the instance of WebLogic Server running connection filter. All other systems are denied access.

Note:

The default connection filter implementation interprets a target address of 0 (0.0.0.0/0) as meaning "the rule should apply to all IP addresses." By design, the default filter does not evaluate the port or the local address, just the action. To clearly specify restrictions when using the default filter, modify the rules.

Another option is to implement a custom connection filter.

 

 

原文:http://download.oracle.com/docs/cd/E14571_01/web.1111/e13711/con_filtr.htm

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值