Skip to content
This repository was archived by the owner on Sep 3, 2024. It is now read-only.
This repository was archived by the owner on Sep 3, 2024. It is now read-only.

Make remediation doc url a part of rule metadata #236

@darrendao

Description

@darrendao

Currently, it looks like the remediation doc URLs are stored in https://github.com/fugue/regula/blob/master/rego/remediation.yaml, and because of that, we cannot have remediation doc URL for CUSTOM rules. Would it make more sense to make remediation doc URL a part of a rule metadata? For example, something like this

__rego__metadoc__ := {
  "custom": {
    "controls": {
      "CIS-AWS_v1.3.0": [
        "CIS-AWS_v1.3.0_2.2.1"
      ]
    },
    "severity": "High"
  },
  "description": "My custom rule",
  "id": "CUSTOM_123",
  "title": "customer rule",
  "rule_remediation_doc": "https://example.com"
}

To be backward compatible, we can still have the remediation doc URLs defined in remediation.yaml. Just treat the value in the rule metadata with higher precedence and fall back to remediation.yaml if it's not there in the metadata. Thoughts on this? I can submit a PR if this sounds like a good idea.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions