michelin/ChopChop

Query String attribute for checks

bentasker opened this issue · 1 comments

It'd be useful to be able to specify a querystring as part of a check rather than having to include it in the URI.

I've been playing around with ChopChop by creating unit tests for some WAF rules, one set of which is QS arg type enforcement, so I end up with something like

  • uri: "/?id=FOO-chopchoptest"
    checks:

    • name: ID type enforcement
      match:
      • "Homepage"
        remediation: "Check the WAF dynamic rules are active"
        description: "Verifies the WAF is enforcing type for QS arg 'id'"
        status_code: 200
        severity: "Medium"
  • uri: "/?catid=FOO-chopchoptest"
    checks:

    • name: catid type enforcement
      match:
      • "Homepage"
        remediation: "Check the WAF dynamic rules are active"
        description: "Verifies the WAF is enforcing type for QS arg 'catid'"
        status_code: 200
        severity: "Medium"

Which is fine, but it's be awesome to be able to do something like

  • uri: "/"
    checks:
    • name: ID type enforcement
      qs: "id=FOO-chopchoptest"
      match:

      • "Homepage"
        remediation: "Check the WAF dynamic rules are active"
        description: "Verifies the WAF is enforcing type for QS arg 'id'"
        status_code: 200
        severity: "Medium"
    • name: catid type enforcement
      qs: "catid=FOO-chopchoptest"
      match:

      • "Homepage"
        remediation: "Check the WAF dynamic rules are active"
        description: "Verifies the WAF is enforcing type for QS arg 'catid'"
        status_code: 200
        severity: "Medium"

So that if the path needs to be updated for some reason, it only needs doing in one place

Thanks a lot for your issue, I added another parameter query_string and you can find the underlying documentation here: https://github.com/michelin/ChopChop

Have a great day and thanks a lot for your contributions :)