-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(custom-checks-metadata): add new fields #3976
Changes from 1 commit
f37b9d2
80b856c
d114d1b
ed473fd
4e9fa6e
0bb9eca
3d94d2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,71 @@ | |
"Severity": { | ||
"type": "string", | ||
"enum": valid_severities, | ||
} | ||
}, | ||
"CheckTitle": { | ||
"type": "string", | ||
}, | ||
"Description": { | ||
"type": "string", | ||
}, | ||
"Risk": { | ||
"type": "string", | ||
}, | ||
"RelatedUrl": { | ||
"type": "string", | ||
}, | ||
"Remediation": { | ||
"type": "object", | ||
"properties": { | ||
"Code": { | ||
"type": "object", | ||
"properties": { | ||
"CLI": { | ||
"type": "string", | ||
}, | ||
"NativeIaC": { | ||
"type": "string", | ||
}, | ||
"Other": { | ||
"type": "string", | ||
}, | ||
"Terraform": { | ||
"type": "string", | ||
}, | ||
}, | ||
"required": [ | ||
"CLI", | ||
"NativeIaC", | ||
"Other", | ||
"Terraform", | ||
], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure of this? I think we want just to override the fields present in the custom metadata file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are true, I think no field should be required. |
||
}, | ||
"Recommendation": { | ||
"type": "object", | ||
"properties": { | ||
"Text": { | ||
"type": "string", | ||
}, | ||
"Url": { | ||
"type": "string", | ||
}, | ||
}, | ||
"required": ["Text", "Url"], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we sure of this? I think we want just to override the fields present in the custom metadata file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You are true, I think no field should be required. |
||
"additionalProperties": False, | ||
}, | ||
}, | ||
"required": ["Code", "Recommendation"], | ||
"additionalProperties": False, | ||
}, | ||
}, | ||
"required": ["Severity"], | ||
"required": [ | ||
"Severity", | ||
"CheckTitle", | ||
"Description", | ||
"Risk", | ||
"RelatedUrl", | ||
"Remediation", | ||
], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to mark all as required? I think it should be optional. What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think they should be required. If missing, then the values from the check's json should be used There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I totally agree with that. |
||
"additionalProperties": False, | ||
} | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some tests to modify for example the
Remediation.Code.CLI
and check that the rest of the original check's metadata is kept.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, also I've modified the
update_check_metadata
method since It wasn't working fine for sub-fields.