|
WebLogic Server 7.0 Code Examples, BEA Systems, Inc. | |||||
See:
Description
| Class Summary | |
| FastFilterEntry | Fast filter rule. |
| FilterEntry | Abstract filter rule. |
| SimpleConnectionFilter | Simple rules-based connection filter example. |
| SimpleConnectionFilter2 | Simple rules-based connection filter example. |
| SlowFilterEntry | Slow filter rule. |
The weblogic.security.net package provides a way to restrict client connections to WebLogic Server based on the client's origin and protocol. The net code example provides an implementation of two weblogic.security.net interfaces:
Note: To be able to enter and edit connection filtering rules on the Administration Console, you must implement the ConnectionFilterRulesListener interface; otherwise some other form must be used. For example, a flat file could be used.
Perform the following steps in order to build and run the example:
ant
javac -d %SERVER_CLASSES% *.java
Note: Restarting the server is only necessary when switching filter classes. If the SimpleConnectionFilter2 class is used, rules can be dynamically changed in the Administration Console as needed.
Check the WebLogic Server log file located at %SAMPLES_HOME%\server\config\examples\logs\wl-domain.log for messages about denied connections.
Question: On Microsoft Windows systems, how does WebLogic Server respond when you set up connection filters that deny requests made from your local machine, that is, your local machine is the client?
Answer: On Windows machines, after failing with localhost (that is, IP address 127.0.0.1),
it automatically tries IP address 127.127.127.127. As a result, you will see some type of
message in your myserver.log for one of the first rules being blocked, but then the request
is allowed because of the 127.127.127.127 not matching.
For example, if you try this client on your machine with WebLogic Server running on your machine:
java weblogic.Admin -url t3://spoz:7001 -username system -password password PING 1 1
And you have these filtering rules only:
localhost 127.0.0.1 7001 deny t3
spoz spoz 7001 deny t3
Then the above client will pass because you did not include the filtering rule:
spoz 127.127.127.127 7001 deny t3
However if you specify the following client on your machine with WebLogic Server running
on your machine (specifying localhost:7001 instead of spoz:7001):
java weblogic.Admin -url t3://localhost:7001 -username system -password password PING 1 1
And you specified the following filtering rules:
localhost 127.0.0.1 7001 deny t3
spoz spoz 7001 deny t3
Then the client will fail to connect because it matches the first rule.
NOTE: Normally you would not deny HTTP requests from your own machine to your own machine if that machine was the admin server. Why? Because this would prevent you from accessing the Administration Console and making changes to the connection filter rules or anything else.
Read more about connection filters and security in Programming WebLogic Security.
|
Documentation is available at http://e-docs.bea.com/wls/docs70 |
|||||