[Bug] New Terms Rule Import Failing (#3569)
* initial patch
* Update definitions to allow for brackets in name
* Update to prompt for required fields.
* Update detection_rules/cli_utils.py
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
---------
Co-authored-by: Mika Ayenson <Mikaayenson@users.noreply.github.com>
(cherry picked from commit fa75876322)
This commit is contained in:
committed by
github-actions[bot]
parent
5a28e1ecac
commit
645fa593a1
@@ -165,7 +165,20 @@ def rule_prompt(path=None, rule_type=None, required_only=True, save=True, verbos
|
||||
contents[name] = schema_prompt(name, value=kwargs.pop(name))
|
||||
continue
|
||||
|
||||
result = schema_prompt(name, is_required=name in required_fields, **options.copy())
|
||||
if name == "new_terms":
|
||||
# patch to allow new_term imports
|
||||
result = {"field": "new_terms_fields"}
|
||||
result["value"] = schema_prompt("new_terms_fields", value=kwargs.pop("new_terms_fields"))
|
||||
history_window_start_value = kwargs.pop("history_window_start", None)
|
||||
result["history_window_start"] = [
|
||||
{
|
||||
"field": "history_window_start",
|
||||
"value": schema_prompt("history_window_start", value=history_window_start_value),
|
||||
}
|
||||
]
|
||||
|
||||
else:
|
||||
result = schema_prompt(name, is_required=name in required_fields, **options.copy())
|
||||
|
||||
if result:
|
||||
if name not in required_fields and result == options.get('default', ''):
|
||||
|
||||
Reference in New Issue
Block a user