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

Link to all possible alerts raised #166

Open
3 of 6 tasks
psiinon opened this issue Jul 23, 2020 · 20 comments
Open
3 of 6 tasks

Link to all possible alerts raised #166

psiinon opened this issue Jul 23, 2020 · 20 comments
Assignees
Labels
enhancement New feature or request

Comments

@psiinon
Copy link
Member

psiinon commented Jul 23, 2020

On https://www.zaproxy.org/docs/alerts

  • Pscan add-on rules
  • Ascan add-on rules
  • Pscan script rules
  • Ascan script rules
  • Pscan websocket rules
  • Improve content - ensure all details included (will require ZAP code changes)
@psiinon psiinon added the enhancement New feature or request label Jul 23, 2020
@psiinon psiinon self-assigned this Jul 23, 2020
@rezen
Copy link
Contributor

rezen commented Aug 13, 2020

I'd love to spruce up the template for individual alerts if that would be interesting?
https://www.zaproxy.org/docs/alerts/42/

@psiinon
Copy link
Member Author

psiinon commented Aug 14, 2020

@rezen yes please! As you know we're not graphic designers :P
FYI theres an open PR which will slightly change the format, but not that significantly: zaproxy/zap-admin#398

@kingthorin
Copy link
Member

kingthorin commented Aug 14, 2020

I don't want to derail what you've been building but would it be better if the script built json or yaml (vs html) and then the site just had a template or include to display the details.

That'd probably be less finicky and easier to maintain/tweak style-wise in the future.

@psiinon
Copy link
Member Author

psiinon commented Aug 14, 2020

Completely agree, but I dont think it derails anything. The changes I've made should make that easier to do.
@rezen can you convert the website to use json or yaml as part of your sprucing up? I can easily change the script to generate the structured data...

@rezen
Copy link
Contributor

rezen commented Aug 14, 2020

So I can think of two paths around the data.

  • Option 1 All the data gets placed into site/data/alerts.yaml and each alert still has a generated markdown file but simply with the title, and a reference to the id of the alert.
    • The template would load the data from the data file and inject into the template
    • There could also be a shortcode which renders the alert, with which we could embed alert details other places if it was useful
    • Requires generating an additional file that has all the alerts
    • Using a shortcode for rendering alerts gives more flexibility
    • Having all alerts in one data file enables other people to consume it for other purposes
  • Option 2 Instead of having the alert details in each post's body, the details would be in yaml format in the header
    • The template would get the data out of the header
    • No additional files needed
    • Easy to modify current setup

@psiinon
Copy link
Member Author

psiinon commented Aug 17, 2020

For me a key requirement is that alert details are always available via a predictable URL based on the alert id - eg https://www.zaproxy.org/docs/alerts/0/
If only one of those options supports this then that the one I think we should use :)
Other than that, the second easier option sounds good to me - theres always plenty of other things we can spend our time on ;)

@rezen
Copy link
Contributor

rezen commented Aug 17, 2020

Both will achieve that option, but Option 2 will have more minimal changes 👍

@rezen
Copy link
Contributor

rezen commented Aug 19, 2020

Okay so I will create a PR with a template. I will adjust the content with the yaml header but omit that from the PR and include a screenshot - that sound good?

@psiinon
Copy link
Member Author

psiinon commented Aug 20, 2020

Sounds good to me 👍 If you can give an example of the yaml header you require then I can update the script to generate it.

@rezen
Copy link
Contributor

rezen commented Sep 6, 2020

Screen Shot 2020-09-05 at 9 33 16 PM

Here is what it looks like. If this looks ok I'll make the PR

@kingthorin
Copy link
Member

Looks good to me, how’s it look on mobile?

@rezen
Copy link
Contributor

rezen commented Sep 6, 2020

Thank you for reminding me!
Screen Shot 2020-09-06 at 9 37 16 AM

@rezen
Copy link
Contributor

rezen commented Sep 7, 2020

Okay, about to send the PR, I can also do a PR for the script that generates the new format?

---
title: "Directory Browsing"
name: Directory Browsing
alertid: 0
alert_type: "Active Scan Rule"
alertcount: 1
status: release
type: alert
alert_type: Active Scan Rule
risk: Medium
solution: |
    Disable directory browsing.  If this is required, make sure the listed files does not induce risks.
references:
    - http://httpd.apache.org/docs/mod/core.html#options
    - http://alamo.satlug.org/pipermail/satlug/2002-February/000053.html
cwe: 548
wasc: 48
code:  https://github.com/zaproxy/zap-extensions/blob/master/addOns/ascanrulesBeta/src/main/java/org/zaproxy/zap/extension/ascanrulesBeta/SourceCodeDisclosureGitScanRule.java
date: 2020-08-14 11:48:43.628Z
lastmod: 2020-08-14 11:48:43.628Z
---
<!-- Summary lives down here -->
It is possible to view the directory listing.  Directory listing may reveal hidden scripts, include files, backup source files, etc. which can be accessed to read sensitive information.

@thc202
Copy link
Member

thc202 commented Sep 7, 2020

How are multiple alerts handled/shown?

@kingthorin
Copy link
Member

Questions on the header block:

  • Is count really needed?
  • Was the duplicate type just a copy/paste issue?
  • Title vs. name?
  • Do any of the values actually need to be quoted strings?

@rezen
Copy link
Contributor

rezen commented Sep 8, 2020

  • @thc202 not sure I understand about multiple alerts - do you mean the alerts list page?
  • @kingthorin anything that seems unneeded/duplicate is very likely that. Also I don't think anything needs to actually be quoted.

@psiinon
Copy link
Member Author

psiinon commented Sep 8, 2020

@rezen some alerts can raise multiple alerts, and we recently changes the scripting to cope with that = an example is https://www.zaproxy.org/docs/alerts/10020/

@rezen
Copy link
Contributor

rezen commented Sep 16, 2020

To verify, the fields for alerts should be:

  • name
  • risk
  • description
  • solution
  • references
  • cwe
  • wasc

so then the schema should be like

---
title: Directory Browsing
alertid: 0
alert_type: Active Scan Rule
status: release
type: alert
alerts:
    - name: Directory Browsing
      risk: Medium
      description: Incomplete ....
      solution: |
        Disable directory browsing.  If this is required, make sure the listed files does not induce risks.
      references:
        - http://httpd.apache.org/docs/mod/core.html#options
        - http://alamo.satlug.org/pipermail/satlug/2002-February/000053.html
      cwe: 548
      wasc: 48
code:  https://github.com/zaproxy/zap-extensions/blob/master/addOns/ascanrulesBeta/src/main/java/org/zaproxy/zap/extension/ascanrulesBeta/SourceCodeDisclosureGitScanRule.java
date: 2020-08-14 11:48:43.628Z
lastmod: 2020-08-14 11:48:43.628Z
---

@thc202
Copy link
Member

thc202 commented Sep 16, 2020

Yes. What does the summary map to?

@rezen
Copy link
Contributor

rezen commented Sep 16, 2020

Good question 🤔 I think that mapped to description before I understood the model accurately - ignore then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

4 participants