Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix empty index field in elastic rule#149

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nazargesyk merged 2 commits intomainfromgis-7581
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
4 changes: 4 additions & 0 deletionsuncoder-core/app/translator/core/mapping.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,6 +20,10 @@ def is_suitable(self, *args, **kwargs) -> bool:
def __str__(self) -> str:
raise NotImplementedError("Abstract method")

@property
def default_source(self) -> dict:
return self._default_source


class FieldMapping:
def __init__(self, generic_field_name: str, platform_field_name: str):
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -10,8 +10,8 @@ class AQLEscapeManager(EscapeManager):
ValueType.value: [EscapeDetails(pattern=r"(')", escape_symbols=r"'\1")],
ValueType.regex_value: [
EscapeDetails(pattern=r"([$^*+()\[\]{}|.?\-\\])", escape_symbols=r"\\\1"),
EscapeDetails(pattern=r"(')", escape_symbols=r"'\1")
]
EscapeDetails(pattern=r"(')", escape_symbols=r"'\1"),
],
}


Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -85,13 +85,14 @@ def finalize_query(
query: str,
functions: str,
meta_info: Optional[MetaInfoContainer] = None,
source_mapping: Optional[SourceMapping] = None, # noqa: ARG002
source_mapping: Optional[SourceMapping] = None,
not_supported_functions: Optional[list] = None,
*args, # noqa: ARG002
**kwargs, # noqa: ARG002
) -> str:
query = super().finalize_query(prefix=prefix, query=query, functions=functions)
rule = copy.deepcopy(ELASTICSEARCH_DETECTION_RULE)
index = source_mapping.log_source_signature.default_source.get("index") if source_mapping else None
rule.update(
{
"query": query,
Expand All@@ -105,6 +106,7 @@ def finalize_query(
"tags": meta_info.tags,
"threat": self.__create_mitre_threat(meta_info.mitre_attack),
"false_positives": meta_info.false_positives,
"index": [index] if index else [],
}
)
rule_str = json.dumps(rule, indent=4, sort_keys=False, ensure_ascii=False)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp