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

Add an "Enable all scripts" option to Options->Scripts screen #7575

Closed
1 task done
vx-sec opened this issue Nov 4, 2022 · 5 comments · Fixed by #7623
Closed
1 task done

Add an "Enable all scripts" option to Options->Scripts screen #7575

vx-sec opened this issue Nov 4, 2022 · 5 comments · Fixed by #7623

Comments

@vx-sec
Copy link
Contributor

vx-sec commented Nov 4, 2022

Is your feature request related to a problem? Please describe.

Currently all scripts imported from a specified directory are disabled by default, which can be an issue when working with containerized ZAP by preventing the usage of the scripts imported during the scan.

Describe the solution you'd like

Add an option/checkbox to enable/disable scripts imported from the specified directories.

Describe alternatives you've considered

The alternative now is to manually enable all scripts one by one either programmatically or manually through the UI.

Screenshots

No response

Additional context

No response

Would you like to help fix this issue?

  • Yes
@psiinon
Copy link
Member

psiinon commented Nov 4, 2022

Thanks @vx-sec - I've assigned this issue to you 😁
Just ask here if you have any questions!

@thc202 thc202 added the add-on label Nov 4, 2022
@vx-sec
Copy link
Contributor Author

vx-sec commented Nov 7, 2022

So I've been trying to understand how ZAP's workflow goes and found that the core of interacting with scripts is in org/zaproxy/zap/extension/script/ExtensionScript.java.

So I've added a boolean field to it, as well as modifier for that field. Then in addScriptsFromDir() the value for that field is checked and the loaded scripts are enabled accordingly. I'd like to ask someone from the team to review the changes so far and say if it is at all following the ZAP's workflow or not.

I figure the next thing would be to add the appropriate checkbox in org/zaproxy/zap/extension/script/OptionsScriptPanel.java and call the modifier in ExtensionScript.java on saveParam() according to it. But I'm very inexperienced in java GUIs so any help would be great.

@vx-sec
Copy link
Contributor Author

vx-sec commented Nov 23, 2022

@psiinon Any feedback on this?

@thc202 thc202 removed the add-on label Nov 23, 2022
@thc202
Copy link
Member

thc202 commented Nov 23, 2022

The flag/option should be added to ScriptParam not the extension itself. This should only apply to the dirs added through the options too.

@psiinon
Copy link
Member

psiinon commented Nov 23, 2022

Thanks @thc202
Sorry @vx-sec - I've been doing a lot of traveling recently and am still catching up...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants