



HORB has several features for security.
You can specify hosts and users that are allowed to access to a class or a method in ACL (Access Control List). HORB's ACL is newly invented Distributed ACL. That is, you can conbine some ACLs, one from a file, another from a remote HORB server for example, into one integrated ACL. The conbination should be described in a configuration file. See the previous section for detail. If you use the distribution feature of DACL, you can manage the security of large number of machines like an inheritance tree of object orientated programming. If you change an ACL file, the modification will automatically propagate to other machines.
An ACL file is a set of an ACL name, class access control lists, password lists. Here is very informal syntax of an ACL file.
name=acl_name
className.host=hostname networkaddress domain...
className.host_exclude=hostname networkaddress domain...
className.user=username1 username2...
className.user_exclude=username1 username2...
className.creatable=false
className2....
className3....
username1.password: lklaskjdf
username2....
username3....
Here is an example:
name=etl_acl
horb.orb.HORBAgent.host=bungo.etl.go.jp 192.31.99.23
WClock.Test.host=etl.go.jp 192.31.*.*
WCLock.Test.host_exclude=gate.etl.go.jp ftp.etl.go.jp
WCLock.Test.user=hirano connelly larry
WCLock.Test.user_exclude=hashimoto anonymous
hirano.password=LKU&232ZC
guest.password=*
default.host=*
default.host_exclude=gate.etl.go.jp
default.user=*
default.user_exclude=anonymous
If ACL system is enabled in a HORB server, client must pass the following access control.
String matching is case insensitive. Thus Bungo.Etl.Go.Jp matches with etl.go.jp. As default, access control is performed for classes. However, if you need, you can control accesses for objects, methods or other in your program. You will see an example in the next subsection.
Components of an ACL file:
Hostname list is a space separated list of hostnames and/or network
addresses.
(The future version will support network masks.)
See examples/accessControl for examples.
ACL can be accessed in a program. You can limit access to specific methods or specific objects for example. In this subsection an example of authentication and finer access control will be shown. This class Server has two methods, one is a safety one named greeting(), but the other is a dangerous one named dangerous(). In dangerous() system ACL is checked to see the user of a client can access this method or not.
package horb.examples.accessControl;
import horb.orb.*;
public class Server {
public String greeting() throws HORBException {
IOCIService ioci = HORBServer.getIOCIService();
return ioci.getUsername()+" is allowed to access object Server.";
}
public String dangerous() throws HORBException {
IOCIService ioci = HORBServer.getIOCIService();
ACL acl = HORBServer.getSystemACL();
if (acl.checkUser_Local("horb.examples.accessControl.Server.dangerous", ioci) == true)
return ioci.getUsername()+" is allowed to access Server.dangerous()";
else
return ioci.getUsername()+" is NOT allowed to access Server.dangerous()";
}
}
Obviously ACL must include lines like the following:
horb.examples.accessControl.Server.user=*
horb.examples.accessControl.Server.dangerous.user=administrator
administrator.password=LX242SC
The client side must supply username and password. Any proxy object has another constructor that takes username ans password as arguments.
Server_Proxy server = new Server_Proxy(url, user, pw);
If a user give "hirano" rather than "administrator", this line will throw NoPermissionException;
See examples/accessControl/README.txt EXAMPLE3.