Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from the Nashorn engine to Graal.js for executing the the export-site-tree script #234

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions scanners/zap/zap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand All @@ -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",
},
Expand Down
2 changes: 1 addition & 1 deletion tests/scanners/zap/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
Loading