Parse DAST CWE active check YAML files

Purpose

Parse YAML active check definitions into Browserker active checks so that checks can be added and updated quickly by the vulnerability research team.

Implementation plan

  • Merge the MR https://gitlab.com/gitlab-org/security-products/dast-cwe-checks/-/merge_requests/109 into DAST CWE checks. It will likely need to be updated to reflect changes to the DAST CWE checks schema - https://gitlab.com/gitlab-org/security-products/dast-cwe-checks/-/merge_requests/175
  • Browserker should parse the YAML files, creating an active check for each. Attack types that are not defined by Browserker should result in the attack being "unsupported"
  • Follow similar patterns to the way passive checks are defined
  • Remove the vulnerability_definitions.FileBaseLoader hard-coded check 22.1. This should not fail integration tests or the end-to-end test (the check should be imported from YAML and parsed)
  • Ensure that errors are gracefully handled. Browserker should fail with a sensible message if the vulnerability definitions fail to parse.
  • No need to parse attacks of type callback_attack, these will likely change anyway
  • Parse timing_attack attacks
  • Parse match_response_attack attacks
  • Ensure that referenced affixes parse correctly, for example:
        affixes: &affixes-1
          - affix:
            prefix: "foo"
            suffix: "bar"
        injections:
          - injection:
            template: "{{prefix}}{{payload}}{{suffix}}"
            affixes: *affixes-1
  • Rename VulnerabilityDefinitionParser to PassiveCheckParser or create a passive_check package and move it there.
Edited by Craig Smith