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

Docker ZAP integrated with OWASP Glue #152

Open
plech opened this issue Mar 20, 2019 · 22 comments
Open

Docker ZAP integrated with OWASP Glue #152

plech opened this issue Mar 20, 2019 · 22 comments
Labels

Comments

@plech
Copy link

plech commented Mar 20, 2019

Hi Omer, I've done all the steps from https://github.com/OWASP/glue/blob/master/docs/dynamic_task.md#zaproxy.

I have a report in txt format, but I have a question on how to remove false-positives from this report ? Can I create a glue.json file with false-positives ?

My idea is ts to do something like this :

  1. modify ZAP Docker image (adding bash script with curl command - request for ZAP API, response with report in json format, save report on local disk)
  2. step by step : https://github.com/OWASP/glue/blob/master/docs/dynamic_task.md#zaproxy.
  3. create glue.json file with false-positives
  4. run command : ruby /bin/glue --finding-file-path <path_glue.json>

What do you think about this solution ?

output.txt

@omerlh
Copy link
Collaborator

omerlh commented Mar 20, 2019

Yep, using the glue json you can either ignore or postpone findings.

@plech
Copy link
Author

plech commented Mar 20, 2019

OK, the solution works, but how to generate a report in json / text / csv format after filtering false-positves from the glue.json file?
Now, the output is on the console, and I would like a report in json format.
Is it possible ?

@omerlh
Copy link
Collaborator

omerlh commented Mar 21, 2019

There is a JSON reporter, but it will print all the finding to the console - currently, there is no reporter that generates a file with the finding. Maybe open a PR and add a decorator reporter that wrap any existing reporter and put the output in a file?
The reporter will report the finding after filtering - so it will ignore all the finding that are marked as false-positive.

@plech
Copy link
Author

plech commented Mar 25, 2019

I am trying to use the owasp/glue docker image and analyze the .json report (filter out false-positives).
I'm using the command

docker run -it owasp/glue sh ruby​/bin/glue -t Dynamic -T output.json --mapping-file zaproxy --finding-file-path glue.json

but I get output

/home/glue/glue/lib/glue/options.rb:41:in `block (2 levels) in get_options': undefined local variable or method `path' for Glue::Options:Module (NameError)
	from /home/glue/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/optparse.rb:1571:in `block in parse_in_order'
	from /home/glue/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/optparse.rb:1527:in `catch'
	from /home/glue/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/optparse.rb:1527:in `parse_in_order'
	from /home/glue/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/optparse.rb:1521:in `order!'
	from /home/glue/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/optparse.rb:1613:in `permute!'
	from /home/glue/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/optparse.rb:1635:in `parse!'
	from /home/glue/glue/lib/glue/options.rb:356:in `get_options'
	from /home/glue/glue/lib/glue/options.rb:16:in `parse!'
	from /home/glue/glue/bin/glue:11:in `<top (required)>'
	from /home/glue/.rvm/rubies/ruby-2.3.1/bin/glue:23:in `load'
	from /home/glue/.rvm/rubies/ruby-2.3.1/bin/glue:23:in `<main>'
	from /home/glue/.rvm/rubies/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
	from /home/glue/.rvm/rubies/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'


What is wrong ?

@omerlh
Copy link
Collaborator

omerlh commented Mar 25, 2019

Yep, try the raw-latest tag - currently, the regular latest tag is not pushed automatically and is outdated. This should solve it.

@ghost
Copy link

ghost commented Mar 27, 2019

Hi Omer, thank you very much for the tips.
I'm trying to execute the jq statement on a json report, but I get an error
jq: error (at data.json:0): Cannot index array with string "@name"
What is wrong ? Is the statement incorrect? Has the ZAP report changed?
ZAP report in json format is attached.

zap_report.json.txt

@omerlh
Copy link
Collaborator

omerlh commented Mar 27, 2019

Sorry, there was a bug in the pattern - just fixed it in #153 :)
Test the new pattern, please?

@ghost
Copy link

ghost commented Mar 27, 2019

It's OK, I would suggest updating the documentation.
https://github.com/OWASP/glue/blob/master/docs/dynamic_task.md

Thank you very much.

@omerlh
Copy link
Collaborator

omerlh commented Mar 27, 2019

I did - take a look at the PR :)

@ghost
Copy link

ghost commented Mar 27, 2019

I would like to report results to JIRA.
JIRA works locally (localhost:8080).
How should be the value of the --jira-api-url parameter ?

@omerlh
Copy link
Collaborator

omerlh commented Mar 27, 2019

Actually - I'm not sure. Try just localhost:8080?

@ghost
Copy link

ghost commented Mar 28, 2019

When trying to connect to the JIRA server (https) - I get an error

SSL_connect returned = 1 errno = 0 state = error: certificate verify failed
Results are in JIRA

How to fix it ?

@omerlh
Copy link
Collaborator

omerlh commented Mar 28, 2019

Look like a TLS issue, does your Jira server has a valid TLS certificate?

@ghost
Copy link

ghost commented Mar 28, 2019

The certificate is good.
I made the test using openssl

Verify return code: 0 (ok)

@omerlh
Copy link
Collaborator

omerlh commented Mar 31, 2019

That's weird because the error:

SSL_connect returned = 1 errno = 0 state = error: certificate verify failed

Look like a TLS issue... Do you run glue inside docker?

@ghost
Copy link

ghost commented Mar 31, 2019

Yes.
I have no idea what is wrong, I tried this https://bundler.io/v2.0/guides/rubygems_tls_ssl_troubleshooting_guide.html
but it doesn't work.
Is there any other active integration? Maybe Slack or something else?

@omerlh
Copy link
Collaborator

omerlh commented Apr 1, 2019

Can you try that outside the docker container? And can you test your website using tools like SSLLabs?

@ghost
Copy link

ghost commented Apr 2, 2019

OK, it works.
Tasks are created in the JIRA system, but the filter that eliminates duplication does not work. Duplicates are created because the jql query is incorrect and incorrectly verified by the "fingerprint". I think so :-)

I found a working solution.
https://community.atlassian.com/t5/Jira-questions/CONTAINS-does-not-seem-to-work-when-searching-description/qaq-p/408602

I tested this solution on local machine and it's working.

@omerlh
Copy link
Collaborator

omerlh commented Apr 2, 2019

Sounds like a PR?

@ghost
Copy link

ghost commented Apr 2, 2019

I would like :-)
but I'm not a developer, especially in Ruby.

@omerlh
Copy link
Collaborator

omerlh commented Apr 2, 2019

So file an issue please?

@stale
Copy link

stale bot commented Jun 1, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants