Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,13 @@ def validate_presence_of_filter_macro(cls, value:str, info:ValidationInfo)->str:


Args:
value (Union[str, dict[str,Any]]): The search. It can either be a string (and should be
SPL or a dict, in which case it is Sigma-formatted.
value (str): The SPL search. It must be an SPL-formatted string.
info (ValidationInfo): The validation info can contain a number of different objects.
Today it only contains the director.

Returns:
Union[str, dict[str,Any]]: The search, either in sigma or SPL format.
"""

str: The search, as an SPL formatted string.
"""

# Otherwise, the search is SPL.

Expand Down
5 changes: 4 additions & 1 deletion contentctl/output/conf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ def escapeNewlines(obj:Any):
# Failing to do so will result in an improperly formatted conf files that
# cannot be parsed
if isinstance(obj,str):
return obj.replace(f"\n"," \\\n")
# Remove leading and trailing characters. Conf parsers may erroneously
# Parse fields if they have leading or trailing newlines/whitespace and we
# probably don't want that anyway as it doesn't look good in output
return obj.strip().replace(f"\n"," \\\n")
else:
return obj

Expand Down
Loading