eagle-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m.@apache.org
Subject [23/47] incubator-eagle git commit: [EAGLE-298] Oozie auditlog integration for Oozie security monitoring
Date Mon, 25 Jul 2016 09:37:00 GMT
http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/TestOozieResourceSensitivityDataJoiner.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/TestOozieResourceSensitivityDataJoiner.java
b/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/TestOozieResourceSensitivityDataJoiner.java
new file mode 100644
index 0000000..50cd1f1
--- /dev/null
+++ b/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/TestOozieResourceSensitivityDataJoiner.java
@@ -0,0 +1,92 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.service.security.oozie;
+
+import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
+import org.apache.eagle.security.entity.OozieResourceEntity;
+import org.apache.eagle.security.entity.OozieResourceSensitivityAPIEntity;
+import org.apache.eagle.service.generic.GenericEntityServiceResource;
+import org.apache.eagle.service.security.oozie.dao.OozieSensitivityMetadataDAO;
+import org.apache.eagle.service.security.oozie.dao.OozieSensitivityMetadataDAOImpl;
+import org.apache.oozie.client.CoordinatorJob;
+import org.apache.oozie.client.rest.JsonTags;
+import org.apache.oozie.client.rest.JsonToBean;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.JSONValue;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.easymock.EasyMock.expect;
+import static org.powermock.api.easymock.PowerMock.createMock;
+import static org.powermock.api.easymock.PowerMock.expectNew;
+import static org.powermock.api.easymock.PowerMock.replay;
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(OozieResourceSensitivityDataJoiner.class)
+public class TestOozieResourceSensitivityDataJoiner {
+    @Test
+    public void testOozieResourceSensitivityDataJoiner() throws Exception {
+
+        List<CoordinatorJob> coordinatorJobs = getCoordinatorJobs();
+        mockGetOozieSensitivityMap();
+        OozieResourceSensitivityDataJoiner joiner = new OozieResourceSensitivityDataJoiner();
+        List<OozieResourceEntity> oozieResourceEntitys = joiner.joinOozieResourceSensitivity("test",
coordinatorJobs);
+
+        Assert.assertEquals(3, oozieResourceEntitys.size());
+        Assert.assertEquals("0007197-160509174709457-oozie-oozi-C", oozieResourceEntitys.get(0).getJobId());
+        Assert.assertEquals("co_pms_ods_adv_click_log", oozieResourceEntitys.get(0).getName());
+        Assert.assertEquals("pms job", oozieResourceEntitys.get(0).getSensitiveType());
+
+        Assert.assertEquals("0007189-160509174709457-oozie-oozi-C", oozieResourceEntitys.get(1).getJobId());
+        Assert.assertEquals("co_tandem_ods_adv_click_log", oozieResourceEntitys.get(1).getName());
+        Assert.assertEquals("tandem job", oozieResourceEntitys.get(1).getSensitiveType());
+
+        Assert.assertEquals("0007188-160509174709457-oozie-oozi-C", oozieResourceEntitys.get(2).getJobId());
+        Assert.assertEquals("co_cpc_new_custorm", oozieResourceEntitys.get(2).getName());
+        Assert.assertEquals(null, oozieResourceEntitys.get(2).getSensitiveType());
+
+    }
+
+    private List<CoordinatorJob> getCoordinatorJobs() {
+        List<CoordinatorJob> coordinatorJobs;
+        InputStream jsonstream = this.getClass().getResourceAsStream("/coordinatorJob.json");
+        JSONObject json = (JSONObject) JSONValue.parse(new InputStreamReader(jsonstream));
+        JSONArray jobs = (JSONArray) json.get(JsonTags.COORDINATOR_JOBS);
+        coordinatorJobs = JsonToBean.createCoordinatorJobList(jobs);
+        return coordinatorJobs;
+    }
+
+    private void mockGetOozieSensitivityMap() throws Exception {
+        OozieSensitivityMetadataDAOImpl oozieSensitivityMetadataDAOMock = createMock(OozieSensitivityMetadataDAOImpl.class);
+        expectNew(OozieSensitivityMetadataDAOImpl.class).andReturn(oozieSensitivityMetadataDAOMock);
+        Map<String, String> oozieSensitivityMap = new HashMap<String, String>();
+        oozieSensitivityMap.put("0007197-160509174709457-oozie-oozi-C", "pms job");
+        oozieSensitivityMap.put("0007189-160509174709457-oozie-oozi-C", "tandem job");
+        expect(oozieSensitivityMetadataDAOMock.getOozieSensitivityMap("test")).andReturn(oozieSensitivityMap);
+        replay(oozieSensitivityMetadataDAOMock, OozieSensitivityMetadataDAOImpl.class);
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieMetadataAccessConfig.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieMetadataAccessConfig.java
b/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieMetadataAccessConfig.java
new file mode 100644
index 0000000..59a3c0b
--- /dev/null
+++ b/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieMetadataAccessConfig.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.service.security.oozie.dao;
+
+import com.typesafe.config.Config;
+import com.typesafe.config.ConfigFactory;
+import com.typesafe.config.ConfigParseOptions;
+import com.typesafe.config.ConfigSyntax;
+import junit.framework.Assert;
+import org.apache.eagle.common.config.EagleConfigConstants;
+import org.junit.Test;
+
+public class TestOozieMetadataAccessConfig {
+    @Test
+    public void testGetOozieConfig() throws Exception {
+        String oozieConfigStr = "classification.accessType=oozie_api\nclassification.oozieUrl=http://localhost:11000/oozie\nclassification.filter=status=RUNNING\nclassification.authType=SIMPLE";
+        ConfigParseOptions options = ConfigParseOptions.defaults()
+                .setSyntax(ConfigSyntax.PROPERTIES)
+                .setAllowMissing(false);
+        Config config = ConfigFactory.parseString(oozieConfigStr, options);
+        config = config.getConfig(EagleConfigConstants.CLASSIFICATION_CONFIG);
+        OozieMetadataAccessConfig oozieMetadataAccessConfig = OozieMetadataAccessConfig.config2Entity(config);
+        System.out.print(oozieMetadataAccessConfig);
+        Assert.assertEquals("oozie_api", oozieMetadataAccessConfig.getAccessType());
+        Assert.assertEquals("http://localhost:11000/oozie", oozieMetadataAccessConfig.getOozieUrl());
+        Assert.assertEquals("status=RUNNING", oozieMetadataAccessConfig.getFilter());
+        Assert.assertEquals("SIMPLE", oozieMetadataAccessConfig.getAuthType());
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieSensitivityMetadataDAOImpl.java
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieSensitivityMetadataDAOImpl.java
b/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieSensitivityMetadataDAOImpl.java
new file mode 100644
index 0000000..33845b9
--- /dev/null
+++ b/eagle-security/eagle-security-oozie-web/src/test/java/org/apache/eagle/service/security/oozie/dao/TestOozieSensitivityMetadataDAOImpl.java
@@ -0,0 +1,120 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.eagle.service.security.oozie.dao;
+
+
+import org.apache.eagle.log.entity.GenericServiceAPIResponseEntity;
+import org.apache.eagle.security.entity.OozieResourceSensitivityAPIEntity;
+import org.apache.eagle.service.generic.GenericEntityServiceResource;
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.powermock.core.classloader.annotations.PrepareForTest;
+import org.powermock.modules.junit4.PowerMockRunner;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.easymock.EasyMock.expect;
+import static org.powermock.api.easymock.PowerMock.*;
+
+
+@RunWith(PowerMockRunner.class)
+@PrepareForTest(OozieSensitivityMetadataDAOImpl.class)
+public class TestOozieSensitivityMetadataDAOImpl {
+    @Test
+    public void testGetAllOozieSensitivityMap() throws Exception {
+
+        String[] sites = new String[]{"test", "test"};
+        mockGenericEntityServiceResourceSearchMethod("OozieResourceSensitivityService[]{*}",sites);
+        OozieSensitivityMetadataDAO oozieSensitivityMetadataDAO = new OozieSensitivityMetadataDAOImpl();
+        Map<String, Map<String, String>> allOozieSensitivityMap = oozieSensitivityMetadataDAO.getAllOozieSensitivityMap();
+        Assert.assertEquals(1, allOozieSensitivityMap.size());
+        Assert.assertTrue(allOozieSensitivityMap.containsKey("test"));
+        Assert.assertTrue(allOozieSensitivityMap.get("test").containsKey("0007197-160509174709457-oozie-oozi-C"));
+        Assert.assertEquals("pms job", allOozieSensitivityMap.get("test").get("0007197-160509174709457-oozie-oozi-C"));
+        Assert.assertTrue(allOozieSensitivityMap.get("test").containsKey("0007189-160509174709457-oozie-oozi-C"));
+        Assert.assertEquals("tandem job", allOozieSensitivityMap.get("test").get("0007189-160509174709457-oozie-oozi-C"));
+
+    }
+
+    @Test
+    public void testGetAllOozieSensitivityMapWithDiffSite() throws Exception {
+
+        String[] sites = new String[]{"test", "test1"};
+        mockGenericEntityServiceResourceSearchMethod("OozieResourceSensitivityService[]{*}",sites);
+        OozieSensitivityMetadataDAO oozieSensitivityMetadataDAO = new OozieSensitivityMetadataDAOImpl();
+        Map<String, Map<String, String>> allOozieSensitivityMap = oozieSensitivityMetadataDAO.getAllOozieSensitivityMap();
+        Assert.assertEquals(2, allOozieSensitivityMap.size());
+        Assert.assertTrue(allOozieSensitivityMap.containsKey("test"));
+        Assert.assertTrue(allOozieSensitivityMap.containsKey("test1"));
+        Assert.assertTrue(allOozieSensitivityMap.get("test1").containsKey("0007197-160509174709457-oozie-oozi-C"));
+        Assert.assertEquals("pms job", allOozieSensitivityMap.get("test1").get("0007197-160509174709457-oozie-oozi-C"));
+        Assert.assertTrue(allOozieSensitivityMap.get("test").containsKey("0007189-160509174709457-oozie-oozi-C"));
+        Assert.assertEquals("tandem job", allOozieSensitivityMap.get("test").get("0007189-160509174709457-oozie-oozi-C"));
+
+    }
+
+    @Test
+    public void testGetOozieSensitivityMap() throws Exception {
+
+        String[] sites = new String[]{"test", "test"};
+        mockGenericEntityServiceResourceSearchMethod("OozieResourceSensitivityService[@site=\"test\"]{*}",sites);
+        OozieSensitivityMetadataDAO oozieSensitivityMetadataDAO = new OozieSensitivityMetadataDAOImpl();
+        Map<String, String> oozieSensitivityMap = oozieSensitivityMetadataDAO.getOozieSensitivityMap("test");
+        Assert.assertEquals(2, oozieSensitivityMap.size());
+        Assert.assertTrue(oozieSensitivityMap.containsKey("0007197-160509174709457-oozie-oozi-C"));
+        Assert.assertTrue(oozieSensitivityMap.containsKey("0007189-160509174709457-oozie-oozi-C"));
+        Assert.assertEquals("pms job", oozieSensitivityMap.get("0007197-160509174709457-oozie-oozi-C"));
+        Assert.assertEquals("tandem job", oozieSensitivityMap.get("0007189-160509174709457-oozie-oozi-C"));
+
+    }
+
+    private void mockGenericEntityServiceResourceSearchMethod(String queryStr ,String[] sites)
throws Exception {
+        GenericEntityServiceResource genericEntityServiceResourceMock = createMock(GenericEntityServiceResource.class);
+        expectNew(GenericEntityServiceResource.class).andReturn(genericEntityServiceResourceMock);
+        GenericServiceAPIResponseEntity ret = new GenericServiceAPIResponseEntity();
+        List<OozieResourceSensitivityAPIEntity> entities = getOozieResourceSensitivityAPIEntities(sites);
+        ret.setObj(entities);
+        expect(genericEntityServiceResourceMock.search(queryStr, null, null, Integer.MAX_VALUE,
null, false, false, 0L, 0, false,
+                0, null, false)).andReturn(ret);
+
+        replay(genericEntityServiceResourceMock, GenericEntityServiceResource.class);
+    }
+
+    private List<OozieResourceSensitivityAPIEntity> getOozieResourceSensitivityAPIEntities(final
String[] sites) {
+        List<OozieResourceSensitivityAPIEntity> entities = new ArrayList<OozieResourceSensitivityAPIEntity>();
+        OozieResourceSensitivityAPIEntity entity1 = new OozieResourceSensitivityAPIEntity();
+        entity1.setTags(new HashMap<String, String>() {{
+            put("site", sites[0]);
+            put("oozieResource", "0007189-160509174709457-oozie-oozi-C");
+        }});
+        entity1.setSensitivityType("tandem job");
+        OozieResourceSensitivityAPIEntity entity2 = new OozieResourceSensitivityAPIEntity();
+        entity2.setTags(new HashMap<String, String>() {{
+            put("site", sites[1]);
+            put("oozieResource", "0007197-160509174709457-oozie-oozi-C");
+        }});
+        entity2.setSensitivityType("pms job");
+        entities.add(entity1);
+        entities.add(entity2);
+        return entities;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-security/eagle-security-oozie-web/src/test/resources/coordinatorJob.json
----------------------------------------------------------------------
diff --git a/eagle-security/eagle-security-oozie-web/src/test/resources/coordinatorJob.json
b/eagle-security/eagle-security-oozie-web/src/test/resources/coordinatorJob.json
new file mode 100644
index 0000000..f2e5d5c
--- /dev/null
+++ b/eagle-security/eagle-security-oozie-web/src/test/resources/coordinatorJob.json
@@ -0,0 +1,94 @@
+{
+  "total": 3,
+  "coordinatorjobs": [
+    {
+      "total": 0,
+      "pauseTime": null,
+      "coordJobName": "co_pms_ods_adv_click_log",
+      "coordJobPath": "\/user\/apps\/pms\/co_pms_cis_recommend_new_product",
+      "timeZone": "Asia\/Shanghai",
+      "frequency": "7",
+      "conf": null,
+      "endTime": "Tue, 17 May 2016 16:00:00 GMT",
+      "executionPolicy": "FIFO",
+      "startTime": "Tue, 17 May 2016 06:45:00 GMT",
+      "timeUnit": "DAY",
+      "concurrency": 1,
+      "coordJobId": "0007197-160509174709457-oozie-oozi-C",
+      "lastAction": "Tue, 24 May 2016 06:45:00 GMT",
+      "status": "RUNNING",
+      "acl": null,
+      "mat_throttling": 0,
+      "timeOut": 120,
+      "nextMaterializedTime": "Tue, 24 May 2016 06:45:00 GMT",
+      "bundleId": null,
+      "toString": "Coordinator application id[0007197-160509174709457-oozie-oozi-C] status[RUNNING]",
+      "coordExternalId": null,
+      "group": null,
+      "user": "pms",
+      "consoleUrl": null,
+      "actions": [
+      ]
+    },
+    {
+      "total": 0,
+      "pauseTime": null,
+      "coordJobName": "co_tandem_ods_adv_click_log",
+      "coordJobPath": "\/user\/apps\/cpc\/co_cpc_export_newcustomer",
+      "timeZone": "Asia\/Shanghai",
+      "frequency": "10",
+      "conf": null,
+      "endTime": "Mon, 23 Nov 2099 10:28:00 GMT",
+      "executionPolicy": "FIFO",
+      "startTime": "Mon, 16 May 2016 21:00:00 GMT",
+      "timeUnit": "DAY",
+      "concurrency": 1,
+      "coordJobId": "0007189-160509174709457-oozie-oozi-C",
+      "lastAction": "Thu, 26 May 2016 21:00:00 GMT",
+      "status": "RUNNING",
+      "acl": null,
+      "mat_throttling": 0,
+      "timeOut": 120,
+      "nextMaterializedTime": "Thu, 26 May 2016 21:00:00 GMT",
+      "bundleId": null,
+      "toString": "Coordinator application id[0007189-160509174709457-oozie-oozi-C] status[RUNNING]",
+      "coordExternalId": null,
+      "group": null,
+      "user": "tandem",
+      "consoleUrl": null,
+      "actions": [
+      ]
+    },
+    {
+      "total": 0,
+      "pauseTime": null,
+      "coordJobName": "co_cpc_new_custorm",
+      "coordJobPath": "\/user\/apps\/cpc\/co_cpc_new_custorm",
+      "timeZone": "Asia\/Shanghai",
+      "frequency": "1",
+      "conf": null,
+      "endTime": "Mon, 23 Nov 2099 10:28:00 GMT",
+      "executionPolicy": "FIFO",
+      "startTime": "Tue, 17 May 2016 23:40:00 GMT",
+      "timeUnit": "DAY",
+      "concurrency": 1,
+      "coordJobId": "0007188-160509174709457-oozie-oozi-C",
+      "lastAction": null,
+      "status": "PREP",
+      "acl": null,
+      "mat_throttling": 0,
+      "timeOut": 120,
+      "nextMaterializedTime": null,
+      "bundleId": null,
+      "toString": "Coordinator application id[0007188-160509174709457-oozie-oozi-C] status[PREP]",
+      "coordExternalId": null,
+      "group": null,
+      "user": "cpc",
+      "consoleUrl": null,
+      "actions": [
+      ]
+    }
+  ],
+  "len": 50,
+  "offset": 1
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-security/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-security/pom.xml b/eagle-security/pom.xml
index 93c5aa1..4735b69 100644
--- a/eagle-security/pom.xml
+++ b/eagle-security/pom.xml
@@ -18,31 +18,34 @@
   ~  */
   -->
 
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-  <parent>
-		<groupId>org.apache.eagle</groupId>
-		<artifactId>eagle-parent</artifactId>
-		<version>0.4.0-incubating-SNAPSHOT</version>
-      <relativePath>../pom.xml</relativePath>
-  </parent>
-  <artifactId>eagle-security-parent</artifactId>
-  <name>eagle-security-parent</name>
-  <description>eagle security data activity monitoring project</description>
-  <packaging>pom</packaging>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.eagle</groupId>
+        <artifactId>eagle-parent</artifactId>
+        <version>0.4.0-incubating-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>eagle-security-parent</artifactId>
+    <name>eagle-security-parent</name>
+    <description>eagle security data activity monitoring project</description>
+    <packaging>pom</packaging>
 
-  <modules>
-    <module>eagle-security-common</module>
-	<module>eagle-security-hdfs-auditlog</module>
-    <module>eagle-security-maprfs-auditlog</module>
-    <module>eagle-security-userprofile</module>
-    <module>eagle-security-hive</module>
-    <module>eagle-security-hive-web</module>
-    <module>eagle-security-hdfs-web</module>
-    <module>eagle-security-maprfs-web</module>
-    <module>eagle-security-hdfs-securitylog</module>
-    <module>eagle-security-hbase-securitylog</module>
-    <module>eagle-security-hbase-web</module>
-	<module>eagle-metric-collection</module>
-  </modules>
+    <modules>
+        <module>eagle-security-common</module>
+        <module>eagle-security-hdfs-auditlog</module>
+        <module>eagle-security-maprfs-auditlog</module>
+        <module>eagle-security-userprofile</module>
+        <module>eagle-security-hive</module>
+        <module>eagle-security-hive-web</module>
+        <module>eagle-security-hdfs-web</module>
+        <module>eagle-security-maprfs-web</module>
+        <module>eagle-security-hdfs-securitylog</module>
+        <module>eagle-security-hbase-securitylog</module>
+        <module>eagle-security-hbase-web</module>
+        <module>eagle-metric-collection</module>
+        <module>eagle-security-oozie-auditlog</module>
+        <module>eagle-security-oozie-web</module>
+    </modules>
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-topology-assembly/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-topology-assembly/pom.xml b/eagle-topology-assembly/pom.xml
index ced6d45..0ecd227 100644
--- a/eagle-topology-assembly/pom.xml
+++ b/eagle-topology-assembly/pom.xml
@@ -16,8 +16,9 @@
   ~ limitations under the License.
   -->
 
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <modelVersion>4.0.0</modelVersion>
     <parent>
         <groupId>org.apache.eagle</groupId>
@@ -29,26 +30,31 @@
     <url>http://maven.apache.org</url>
     <packaging>jar</packaging>
     <dependencies>
-      <dependency>
-          <groupId>org.apache.eagle</groupId>
-          <artifactId>eagle-security-hdfs-auditlog</artifactId>
-          <version>${project.version}</version>
-      </dependency>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-security-hdfs-auditlog</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.eagle</groupId>
             <artifactId>eagle-security-hdfs-securitylog</artifactId>
             <version>${project.version}</version>
         </dependency>
-      <dependency>
-          <groupId>org.apache.eagle</groupId>
-          <artifactId>eagle-security-hive</artifactId>
-          <version>${project.version}</version>
-      </dependency>
-      <dependency>
-          <groupId>org.apache.eagle</groupId>
-          <artifactId>eagle-security-userprofile-detection</artifactId>
-          <version>${project.version}</version>
-      </dependency>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-security-hive</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-security-userprofile-detection</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.eagle</groupId>
+            <artifactId>eagle-security-oozie-auditlog</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.apache.eagle</groupId>
             <artifactId>eagle-security-hbase-securitylog</artifactId>
@@ -87,7 +93,7 @@
             <artifactId>eagle-hadoop-metric</artifactId>
             <version>${project.version}</version>
         </dependency>
-	    <dependency>
+        <dependency>
             <groupId>org.apache.eagle</groupId>
             <artifactId>eagle-gc</artifactId>
             <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-webservice/pom.xml
----------------------------------------------------------------------
diff --git a/eagle-webservice/pom.xml b/eagle-webservice/pom.xml
index c316db2..9d379e7 100644
--- a/eagle-webservice/pom.xml
+++ b/eagle-webservice/pom.xml
@@ -12,7 +12,7 @@
 	under the License. -->
 
 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<groupId>org.apache.eagle</groupId>
@@ -65,11 +65,11 @@
 			</exclusions>
 		</dependency>
 
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-storage-jdbc</artifactId>
-            <version>${project.version}</version>
-        </dependency>
+		<dependency>
+			<groupId>org.apache.eagle</groupId>
+			<artifactId>eagle-storage-jdbc</artifactId>
+			<version>${project.version}</version>
+		</dependency>
 
 		<!-- jersey needs asm3, so use extcos 0.3b -->
 		<dependency>
@@ -142,6 +142,37 @@
 		</dependency>
 		<dependency>
 			<groupId>org.apache.eagle</groupId>
+			<artifactId>eagle-security-oozie-web</artifactId>
+			<version>${project.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>org.ow2.asm</groupId>
+					<artifactId>asm-all</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>asm</groupId>
+					<artifactId>asm</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>asm</groupId>
+					<artifactId>asm-all</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>asm</groupId>
+					<artifactId>asm-commons</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>asm</groupId>
+					<artifactId>asm-tree</artifactId>
+				</exclusion>
+				<exclusion>
+					<artifactId>servlet-api</artifactId>
+					<groupId>javax.servlet</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.eagle</groupId>
 			<artifactId>eagle-security-hdfs-web</artifactId>
 			<version>${project.version}</version>
 		</dependency>
@@ -156,17 +187,17 @@
 			<artifactId>eagle-stream-application-manager</artifactId>
 			<version>${project.version}</version>
 		</dependency> -->
-        <dependency>
-            <groupId>org.apache.eagle</groupId>
-            <artifactId>eagle-topology-assembly</artifactId>
-            <version>${project.version}</version>
+		<dependency>
+			<groupId>org.apache.eagle</groupId>
+			<artifactId>eagle-topology-assembly</artifactId>
+			<version>${project.version}</version>
 			<exclusions>
 				<exclusion>
 					<groupId>org.quartz-scheduler</groupId>
 					<artifactId>quartz</artifactId>
 				</exclusion>
 			</exclusions>
-        </dependency>
+		</dependency>
 
 		<!-- eagle user profile common dependency -->
 		<dependency>
@@ -288,10 +319,10 @@
 		</dependency>
 
 		<dependency>
-		    <groupId>javax.servlet</groupId>
-		    <artifactId>servlet-api</artifactId>
-		    <version>${servlet-api.version}</version>
-		    <scope>provided</scope>
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>${servlet-api.version}</version>
+			<scope>provided</scope>
 		</dependency>
 
 	</dependencies>

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-webservice/src/main/webapp/app/public/feature/classification/controller.js
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/classification/controller.js
b/eagle-webservice/src/main/webapp/app/public/feature/classification/controller.js
index b5d3e90..462b41b 100644
--- a/eagle-webservice/src/main/webapp/app/public/feature/classification/controller.js
+++ b/eagle-webservice/src/main/webapp/app/public/feature/classification/controller.js
@@ -85,7 +85,63 @@
 			});
 		};
 	});
-
+     // =============================================================
+    	// =                    Sensitivity - Job                   =
+    	// =============================================================
+    	feature.controller('sensitivityViewJob', function(Site, $scope, $wrapState, Entities)
{
+    		$scope.items = [];
+
+    		// Mark sensitivity
+    		$scope._oriItem = {};
+    		$scope._markItem = {};
+
+    		// ======================= View =======================
+    		// Item
+    		$scope.updateItems = function() {
+    			$scope.items = Entities.query($scope.viewConfig.api, {site: Site.current().tags.site});
+    		};
+
+
+    		$scope.updateItems();
+
+    		// =================== Sensitivity ===================
+    		$scope.markSensitivity = function(item) {
+    			$scope._oriItem = item;
+    			$scope._markItem = {
+    				prefix: $scope.viewConfig.prefix,
+    				tags: {
+    					site: Site.current().tags.site
+    				},
+    				sensitivityType: ""
+    			};
+
+    			$scope._markItem.tags[$scope.viewConfig.keys[0]] = item.jobId;
+    			$("#sensitivityMDL").modal();
+    		};
+    		$scope.confirmUpateSensitivity = function() {
+    			$scope._oriItem.sensitiveType = $scope._markItem.sensitivityType;
+    			Entities.updateEntity($scope.viewConfig.service, $scope._markItem, {timestamp: false})._promise.success(function(data)
{
+    				Entities.dialog(data);
+    			});
+    			$("#sensitivityMDL").modal('hide');
+    		};
+    		$scope.unmarkSensitivity = function(item) {
+    			$.dialog({
+    				title: "Unmark Confirm",
+    				content: "Do you want to remove the sensitivity mark on '" + item.jobId + "'?",
+    				confirm: true
+    			}, function(ret) {
+    				if(!ret) return;
+
+    				var _cond = {site: Site.current().tags.site};
+    				_cond[$scope.viewConfig.keys[0]] = item.jobId;
+    				Entities.deleteEntities($scope.viewConfig.service, _cond);
+
+    				item.sensitiveType = null;
+    				$scope.$apply();
+    			});
+    		};
+    	});
 	// =============================================================
 	// =                    Sensitivity - Folder                   =
 	// =============================================================

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/eagle-webservice/src/main/webapp/app/public/feature/classification/page/sensitivity/job.html
----------------------------------------------------------------------
diff --git a/eagle-webservice/src/main/webapp/app/public/feature/classification/page/sensitivity/job.html
b/eagle-webservice/src/main/webapp/app/public/feature/classification/page/sensitivity/job.html
new file mode 100644
index 0000000..05d70da
--- /dev/null
+++ b/eagle-webservice/src/main/webapp/app/public/feature/classification/page/sensitivity/job.html
@@ -0,0 +1,92 @@
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  -->
+<div ng-controller="classification_sensitivityViewJob">
+    <ul class="list-inline path">
+        <li>Oozie CoordinatorJob:</li>
+    </ul>
+
+    <table class="table table-bordered">
+        <thead>
+        <tr>
+            <th width="15%">JobId</th>
+            <th width="10%">AppName</th>
+            <th>Sensitivity Type</th>
+            <th width="10" ng-show="Auth.isRole('ROLE_ADMIN')"> </th>
+        </tr>
+        </thead>
+        <tbody>
+        <tr ng-show="items._promise.$$state.status !== 1">
+            <td colspan="5">
+                <span class="fa fa-refresh fa-spin"> </span>
+                Loading...
+            </td>
+        </tr>
+        <tr ng-show="items._promise.$$state.status === 1 && !items.length">
+            <td colspan="5">
+                <span class="fa fa-exclamation-triangle"> </span>
+                Empty
+            </td>
+        </tr>
+        <tr ng-repeat="item in items" ng-class="{warning : item.sensitiveType}">
+            <td>{{item.jobId}}</td>
+            <td>{{item.name}}</td>
+            <td>{{item.sensitiveType}}</td>
+            <td ng-show="Auth.isRole('ROLE_ADMIN')">
+                <button class="fa fa-eye btn btn-primary btn-xs" ng-click="markSensitivity(item)"
ng-show="!item.sensitiveType"
+                        uib-tooltip="Mark as sensitivity data" tooltip-animation="false"
tooltip-placement="left"> </button>
+                <button class="fa fa-eye-slash btn btn-warning btn-xs" ng-click="unmarkSensitivity(item)"
ng-show="item.sensitiveType"
+                        uib-tooltip="Remove the sensitivity mark" tooltip-animation="false"
tooltip-placement="left"> </button>
+            </td>
+        </tr>
+        </tbody>
+    </table>
+
+
+    <!-- Modal: Create / Edit site -->
+    <div class="modal fade" id="sensitivityMDL" tabindex="-1" role="dialog">
+        <div class="modal-dialog" role="document">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                        <span aria-hidden="true">&times;</span>
+                    </button>
+                    <h4 class="modal-title">Mark Sensitivity Data</h4>
+                </div>
+                <div class="modal-body">
+                    <div class="form-group">
+                        <label>Resource</label>
+                        <input type="text" readonly="readonly" class="form-control" ng-model="_markItem.tags.oozieResource"
/>
+                    </div>
+                    <div class="form-group">
+                        <label>* Sensitivity Type</label>
+                        <input type="text" class="form-control" ng-model="_markItem.sensitivityType"
id="sensitiveType" />
+                    </div>
+                </div>
+                <div class="modal-footer">
+                    <button type="button" class="btn btn-default" data-dismiss="modal">
+                        Close
+                    </button>
+                    <button type="button" class="btn btn-primary" ng-click="confirmUpateSensitivity()"
ng-disabled="!_markItem.sensitivityType">
+                        Update
+                    </button>
+                </div>
+            </div>
+        </div>
+    </div>
+
+</div>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/fd39e6e1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f17e082..49c2971 100755
--- a/pom.xml
+++ b/pom.xml
@@ -179,6 +179,7 @@
 
         <!-- Common Versions -->
         <commons-cli.version>1.2</commons-cli.version>
+        <commons-xml.version>1.4.01</commons-xml.version>
         <commons-lang.version>2.6</commons-lang.version>
         <commons-lang3.version>3.3.2</commons-lang3.version>
         <commons-math3.version>3.5</commons-math3.version>
@@ -287,6 +288,11 @@
                 <version>${commons-cli.version}</version>
             </dependency>
             <dependency>
+                <groupId>xml-apis</groupId>
+                <artifactId>xml-apis</artifactId>
+                <version>${commons-xml.version}</version>
+            </dependency>
+            <dependency>
                 <groupId>commons-lang</groupId>
                 <artifactId>commons-lang</artifactId>
                 <version>${commons-lang.version}</version>



Mime
View raw message