Minor adjustments for Tomoyo for the fourth benchmark
authorrtrimana <rtrimana@uci.edu>
Mon, 16 Oct 2017 19:02:51 +0000 (12:02 -0700)
committerrtrimana <rtrimana@uci.edu>
Mon, 16 Oct 2017 19:02:51 +0000 (12:02 -0700)
benchmarks/Java/HomeSecurityController/HomeSecurityController.java
iotjava/iotruntime/master/IoTMaster.java
iotjava/iotruntime/master/ProcessJailConfig.java
localconfig/tomoyo/Java.tomoyo.pol

index 6615f83..3b7cf53 100644 (file)
@@ -252,8 +252,10 @@ public class HomeSecurityController implements SmartthingsSensorCallback, Smartt
                                System.out.println("DEBUG: Initialized smartthings sensor! ID: " + sensorId + " Room ID: " + rm.getRoomID());
                                senDetectStatus.put(sensorId, false);
                                System.out.println("DEBUG: Initialized sensor detection to false!");
+                               System.out.println("DEBUG: Now sensor ID is being set!");
                                // Initialize IoTCloud
                                sen.setId(sensorId++);
+                               System.out.println("DEBUG: Set sensor ID to: " + sensorId + "!");
                                sen.registerCallback(this);
                                System.out.println("DEBUG: Registered sensor callback!");
                        } catch (Exception e) {
index f3bae94..6643eee 100644 (file)
@@ -779,9 +779,9 @@ public final class IoTMaster {
                        // Setting up router policies for HTTP/HTTPs
                        if (STR_ACTIVATE_SANDBOXING.equals("Yes")) {
                                if (strControllerName != null) {
-                                       processJailConfig.configureProcessJailInetAddressPolicies(strControllerName, strAddress);
+                                       processJailConfig.configureProcessJailInetAddressPolicies(strControllerName, STR_ROUTER_ADD, strAddress);
                                } else {
-                                       processJailConfig.configureProcessJailInetAddressPolicies(strHostAddress, strAddress);
+                                       processJailConfig.configureProcessJailInetAddressPolicies(strHostAddress, STR_ROUTER_ADD, strAddress);
                                }
                        }
                        routerConfig.configureRouterHTTPPolicies(STR_ROUTER_ADD, strHostAddress, strAddress);
index 4781fbd..757313a 100644 (file)
@@ -344,10 +344,14 @@ public final class ProcessJailConfig {
         * @param   strAddress          String device IP address
         * @return  void
         */
-       public void configureProcessJailInetAddressPolicies(String strConfigHost, String strAddress) {
+       public void configureProcessJailInetAddressPolicies(String strConfigHost, String strRouterAddress, String strAddress) {
 
                PrintWriter pwConfig = getPrintWriter(strConfigHost);
                //System.out.println("\n\nDEBUG: Writing the config host address setup!!!\n\n");
+               pwConfig.println("file read /etc/resolv.conf");
+               pwConfig.println("file read /etc/hosts");
+               pwConfig.println("file read /etc/host.conf");
+               pwConfig.println("network inet dgram send " + strRouterAddress + " " + String.valueOf(53));     // TCP/UDP access through router
                pwConfig.println("network inet stream connect ::ffff:" + strAddress + " " + String.valueOf(80));        // HTTP access for this address
        }
 
index b916747..c58214c 100644 (file)
@@ -44,6 +44,7 @@ network inet stream connect ::ffff:<master-ip-address> <master-com-port>
 file read /home/iotuser/iot2/iotjava/iotruntime/master/\*.class
 file read /home/iotuser/iot2/iotjava/iotruntime/messages/\*.class
 file read /home/iotuser/iot2/iotjava/iotruntime/zigbee/\*.class
+file read /home/iotuser/iot2/iotjava/iotcloud/\*.class
 file read /home/iotuser/iot2/iotjava/iotruntime/resources/\*.csv
 file read /home/iotuser/iot2/iotjava/iotruntime/music/\*.mp3
 file read /dev/random
@@ -52,6 +53,7 @@ file create /home/iotuser/iot2/iotjava/iotruntime/<object-class-name>.jar 0666
 file read/write /home/iotuser/iot2/iotjava/iotruntime/<object-class-name>.jar
 file read /home/iotuser/iot2/iotjava/iotrmi/Java/\*.class
 file ioctl socket:[family=10:type=1:protocol=6] 0x541B
+file ioctl socket:[family=2:type=2:protocol=17] 0x541B
 file read /home/iotuser/iot2/iotjava/iotruntime/\*.class
 file read /usr/share/locale/en_GB/LC_MESSAGES/libc.mo
 file create /tmp/imageio\*.tmp 0600