Skip to content

Fix schema error in rules folder

Hua Yan requested to merge huayan-fix-schema-error into main

What does this MR do?

This MR fixes schema errors in the rules folder, which were included in rule_schema.sh before. Around 40+ existing rules are impacted.

  • enable rule_schema.sh to examine the rules folder
  • adjust the owasp field for rules with unqualified owasp
  • add security-severity for rules without it
  • fix shortDescription for rules without a too short shortDescription

What are the relevant issue numbers?

gitlab-org/gitlab#457624

Does this MR meet the acceptance criteria?

  • The test cases cover both positive and negative cases and are also annotated with appropriate semgrep annotations:
    • For positive cases: // ruleid: ...
    • For negative cases: // ok: ....
  • Following metadata fields exist for the rule(s) added/updated in this MR:
    • owasp with both 2017 and 2021 mappings.
    • category: "security"
    • cwe
    • shortDescription
    • security-severity
  • The message field is valid and contains a secure code example.
  • Applicable license is mentioned in the rule if embedded/taken from external source.
  • Relevant labels including workflow labels are appropriately selected.
Edited by Hua Yan

Merge request reports