Disable Jython Excutor for security 93/95693/2
authorliamfallon <liam.fallon@est.tech>
Sat, 14 Sep 2019 11:39:25 +0000 (12:39 +0100)
committerliamfallon <liam.fallon@est.tech>
Sat, 14 Sep 2019 15:00:29 +0000 (16:00 +0100)
The Jython interpreter pulls in many dependencies that are flagged as
having security problems. We will disable Python support in apex-pdp
until Frankfurt, users can compile from source if they wish to re-enable
python support.

Issue-ID: POLICY-1509
Change-Id: I84215ba8d1009cb7af99cd98ba19008fdff5c378
Signed-off-by: liamfallon <liam.fallon@est.tech>
core/core-engine/src/main/java/org/onap/policy/apex/core/engine/EngineParameterConstants.java
packages/apex-pdp-package-full/pom.xml
plugins/plugins-executor/plugins-executor-jython/pom.xml
plugins/plugins-executor/pom.xml
pom.xml
testsuites/integration/integration-executor-test/pom.xml
testsuites/integration/integration-executor-test/src/test/java/org/onap/policy/apex/testsuites/integration/executor/engine/TestApexEngineJython.java
testsuites/performance/performance-benchmark-test/pom.xml

index 96a83f3..1ac0ef6 100644 (file)
@@ -5,15 +5,15 @@
  * Licensed 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.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
index 064ed7e..2e015ba 100644 (file)
             <artifactId>plugins-executor-jruby</artifactId>
             <version>${project.version}</version>
         </dependency>
-        <dependency>
+        <!-- Jython support disabled due to security concerns -->
+        <!-- dependency>
             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
             <artifactId>plugins-executor-jython</artifactId>
             <version>${project.version}</version>
-        </dependency>
+        </dependency-->
         <dependency>
             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
             <artifactId>plugins-executor-mvel</artifactId>
index d97ac4b..b32ea76 100644 (file)
@@ -17,7 +17,8 @@
   SPDX-License-Identifier: Apache-2.0
   ============LICENSE_END=========================================================
 -->
-<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">
+<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.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
index 59f1567..8961053 100644 (file)
@@ -44,7 +44,7 @@
         <module>plugins-executor-java</module>
         <module>plugins-executor-javascript</module>
         <module>plugins-executor-jruby</module>
-        <module>plugins-executor-jython</module>
+        <!--module>plugins-executor-jython</module-->
         <module>plugins-executor-mvel</module>
     </modules>
 
diff --git a/pom.xml b/pom.xml
index 566dd43..0a0ba19 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                 <adsite-plugins-executor-java-dir>${project.basedir}/plugins/plugins-executor/plugins-executor-java/src</adsite-plugins-executor-java-dir>
                 <adsite-plugins-executor-javascript-dir>${project.basedir}/plugins/plugins-executor/plugins-executor-javascript/src</adsite-plugins-executor-javascript-dir>
                 <adsite-plugins-executor-jruby-dir>${project.basedir}/plugins/plugins-executor/plugins-executor-jruby/src</adsite-plugins-executor-jruby-dir>
-                <adsite-plugins-executor-jython-dir>${project.basedir}/plugins/plugins-executor/plugins-executor-jython/src</adsite-plugins-executor-jython-dir>
+                <!-- Jython support disabled due to security concerns -->
+                <!-- adsite-plugins-executor-jython-dir>${project.basedir}/plugins/plugins-executor/plugins-executor-jython/src</adsite-plugins-executor-jython-dir-->
                 <adsite-plugins-executor-mvel-dir>${project.basedir}/plugins/plugins-executor/plugins-executor-mvel/src</adsite-plugins-executor-mvel-dir>
 
                 <adsite-services-engine-dir>${project.basedir}/services/services-engine/src</adsite-services-engine-dir>
index 289287f..ee75913 100644 (file)
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
+        <!-- Jython support disabled due to security concerns -->
+        <!-- dependency>
             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
             <artifactId>plugins-executor-jython</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
-        </dependency>
+        </dependency-->
         <dependency>
             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
             <artifactId>plugins-executor-javascript</artifactId>
index 12a28e2..088d04f 100644 (file)
@@ -5,15 +5,15 @@
  * Licensed 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.
- * 
+ *
  * SPDX-License-Identifier: Apache-2.0
  * ============LICENSE_END=========================================================
  */
@@ -32,11 +32,14 @@ import org.onap.policy.apex.context.parameters.SchemaParameters;
 import org.onap.policy.apex.core.engine.EngineParameters;
 import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
 import org.onap.policy.apex.model.basicmodel.concepts.ApexException;
-import org.onap.policy.apex.plugins.executor.jython.JythonExecutorParameters;
+import org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters;
 import org.onap.policy.common.parameters.ParameterService;
 
 /**
- * The Class TestApexEngineJython.
+ * The Class TestApexEngineJython should be the test class for the Jython interpreter.
+ *
+ * <p>It actually reruns the javascript tests as a placeholder until the Jython security issues are resolved.
+ *
  */
 public class TestApexEngineJython {
     private SchemaParameters schemaParameters;
@@ -49,12 +52,12 @@ public class TestApexEngineJython {
     @Before
     public void beforeTest() {
         schemaParameters = new SchemaParameters();
-        
+
         schemaParameters.setName(ContextParameterConstants.SCHEMA_GROUP_NAME);
         schemaParameters.getSchemaHelperParameterMap().put("JAVA", new JavaSchemaHelperParameters());
 
         ParameterService.register(schemaParameters);
-        
+
         contextParameters = new ContextParameters();
 
         contextParameters.setName(ContextParameterConstants.MAIN_GROUP_NAME);
@@ -66,9 +69,9 @@ public class TestApexEngineJython {
         ParameterService.register(contextParameters.getDistributorParameters());
         ParameterService.register(contextParameters.getLockManagerParameters());
         ParameterService.register(contextParameters.getPersistorParameters());
-        
+
         engineParameters = new EngineParameters();
-        engineParameters.getExecutorParameterMap().put("JYTHON", new JythonExecutorParameters());
+        engineParameters.getExecutorParameterMap().put("JAVASCRIPT", new JavascriptExecutorParameters());
         ParameterService.register(engineParameters);
     }
 
@@ -78,7 +81,7 @@ public class TestApexEngineJython {
     @After
     public void afterTest() {
         ParameterService.deregister(engineParameters);
-        
+
         ParameterService.deregister(contextParameters.getDistributorParameters());
         ParameterService.deregister(contextParameters.getLockManagerParameters());
         ParameterService.deregister(contextParameters.getPersistorParameters());
@@ -96,8 +99,8 @@ public class TestApexEngineJython {
      */
     @Test
     public void testApexEngineJython() throws ApexException, InterruptedException, IOException {
-        new TestApexEngine("JYTHON", engineParameters);
+        new TestApexEngine("JAVASCRIPT", engineParameters);
         ThreadUtilities.sleep(5000);
-        new TestApexEngine("JYTHON", engineParameters);
+        new TestApexEngine("JAVASCRIPT", engineParameters);
     }
 }
index b849edb..bfc8e3c 100644 (file)
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
+        <!-- Jython support disabled due to security concerns -->
+        <!-- dependency>
             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
             <artifactId>plugins-executor-jython</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
-        </dependency>
+        </dependency-->
         <dependency>
             <groupId>org.onap.policy.apex-pdp.plugins.plugins-executor</groupId>
             <artifactId>plugins-executor-java</artifactId>