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

Allow to differentiate scripts' output #5113

Open
thc202 opened this issue Nov 12, 2018 · 3 comments · May be fixed by zaproxy/zap-extensions#6044
Open

Allow to differentiate scripts' output #5113

thc202 opened this issue Nov 12, 2018 · 3 comments · May be fixed by zaproxy/zap-extensions#6044

Comments

@thc202
Copy link
Member

thc202 commented Nov 12, 2018

From zaproxy/community-scripts#127, e.g.:

// Logging with the script name is super helpful!
function logger() {
  print('[' + this['zap.script.name'] + '] ' + arguments[0]);
}

ZAP should allow to differentiate the scripts' output instead of requiring the users to do that manually, currently ZAP outputs to the same UI component without any distinction.

Add-on:
Script Console
It also requires core changes to let the Script Console know which script is writing to the output.

thc202 added a commit to thc202/zap-extensions that referenced this issue Nov 14, 2018
Change ZestZapRunner to not set the script console writer as output
writer if the script context writer is already set, while both end up in
the script console the latter allows the core to intercept the writes.
For the cases the context writer is not set the writes are not
intercepted.
Update changes in ZapAddOn.xml file.

Related to zaproxy/zaproxy#5113 - Allow to differentiate scripts' output
psiinon pushed a commit to zaproxy/zap-extensions that referenced this issue Nov 15, 2018
Change ZestZapRunner to not set the script console writer as output
writer if the script context writer is already set, while both end up in
the script console the latter allows the core to intercept the writes.
For the cases the context writer is not set the writes are not
intercepted.
Update changes in ZapAddOn.xml file.

Related to zaproxy/zaproxy#5113 - Allow to differentiate scripts' output
thc202 added a commit to thc202/zaproxy that referenced this issue Dec 27, 2018
Add a listener for script output, which provides the script and the
output being written.

Part of zaproxy#5113 - Allow to differentiate scripts' output
thc202 added a commit to thc202/zaproxy that referenced this issue Dec 27, 2018
Add a listener for script output, which provides the script and the
output being written.

Part of zaproxy#5113 - Allow to differentiate scripts' output
@thc202 thc202 added the in:scripts Issues pertaining to Script Console add-on. label Apr 14, 2023
@ricekot
Copy link
Member

ricekot commented Nov 11, 2023

Along with this change, what do you think about using the main Output panel for script outputs, and removing the existing output panel within the Script console?

@kingthorin
Copy link
Member

I'm torn about it.

Part of me says we should differentiate more (tabs for scripts and their output).

On the flip side reducing components is also good (it's 2023 if we can differentiate output then people can process externally if needed or we add some sort of optional/on-the-fly filtering functionality).

@psiinon
Copy link
Member

psiinon commented Nov 13, 2023

Along with this change, what do you think about using the main Output panel for script outputs, and removing the existing output panel within the Script console?

That wouldnt work for people using ZAP in "Full Layout" mode.
I'm not so keen on this idea right now .. but could be persuaded.
Where would the script specific outout tab buttons go? e.g. "Clear on run"

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.

4 participants