Skip to content

Commit

Permalink
CM-34678 - Add Remediation Guidelines and Description to JSON output (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshalX authored Apr 5, 2024
1 parent ee6d006 commit e1e159c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cycode/cli/commands/scan/code_scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ def _enrich_scan_result_with_data_from_detection_rules(

# detection_details never was typed properly. so not a problem for now
detection.detection_details['custom_remediation_guidelines'] = detection_rule.custom_remediation_guidelines
detection.detection_details['remediation_guidelines'] = detection_rule.remediation_guidelines
detection.detection_details['description'] = detection_rule.description


def _get_scan_documents_thread_func(
Expand Down
4 changes: 4 additions & 0 deletions cycode/cyclient/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,8 @@ class DetectionRule:
classification_data: List[ClassificationData]
detection_rule_id: str
custom_remediation_guidelines: Optional[str] = None
remediation_guidelines: Optional[str] = None
description: Optional[str] = None


class DetectionRuleSchema(Schema):
Expand All @@ -449,6 +451,8 @@ class Meta:
classification_data = fields.Nested(ClassificationDataSchema, many=True)
detection_rule_id = fields.String()
custom_remediation_guidelines = fields.String(allow_none=True)
remediation_guidelines = fields.String(allow_none=True)
description = fields.String(allow_none=True)

@post_load
def build_dto(self, data: Dict[str, Any], **_) -> DetectionRule:
Expand Down

0 comments on commit e1e159c

Please sign in to comment.