From 3a5206c36a694ccf80d44d2b95c59fba103b6006 Mon Sep 17 00:00:00 2001 From: Camilo Cota <1499184+ccronca@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:06:06 +0100 Subject: [PATCH] Switch from the Nashorn engine to Graal.js for executing the the export-site-tree script (#234) Switch from the Nashorn engine to Graal.js for executing the export-site-tree script --- scanners/zap/zap.py | 4 +--- tests/scanners/zap/test_setup.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/scanners/zap/zap.py b/scanners/zap/zap.py index b03afc4e..41eb0a69 100644 --- a/scanners/zap/zap.py +++ b/scanners/zap/zap.py @@ -393,8 +393,6 @@ def _setup_export_site_tree(self): "action": "add", "type": "standalone", "name": "export-site-tree-filename-global-var", - # Setting the engine to Oracle Nashorn causes the script to fail because - # the engine can't be found when using inline scripts. Not sure why this happens "engine": "ECMAScript : Graal.js", "inline": f""" org.zaproxy.zap.extension.script.ScriptVars.setGlobalVar('siteTreeFileName','{self.SITE_TREE_FILENAME}') @@ -414,7 +412,7 @@ def _setup_export_site_tree(self): "parameters": { "action": "add", "type": "standalone", - "engine": "ECMAScript : Oracle Nashorn", + "engine": "ECMAScript : Graal.js", "name": "export-site-tree", "file": f"{scripts_dir}/export-site-tree.js", }, diff --git a/tests/scanners/zap/test_setup.py b/tests/scanners/zap/test_setup.py index a9054ed0..7da36c62 100644 --- a/tests/scanners/zap/test_setup.py +++ b/tests/scanners/zap/test_setup.py @@ -433,7 +433,7 @@ def test_setup_export_site_tree(test_config, pytestconfig): assert add_script["parameters"]["name"] == run_script["parameters"]["name"] assert add_script["parameters"]["file"] == f"{pytestconfig.rootpath}/scanners/zap/scripts/export-site-tree.js" - assert add_script["parameters"]["engine"] == "ECMAScript : Oracle Nashorn" + assert add_script["parameters"]["engine"] == "ECMAScript : Graal.js" assert add_variable_script["parameters"]["name"] == run_variable_script["parameters"]["name"] assert add_variable_script["parameters"]["inline"]