Skip to content

Gis fix gen all bug #75

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

Merged
merged 2 commits into from
Mar 12, 2024
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 @@ -16,7 +16,6 @@
limitations under the License.
-----------------------------------------------------------------
"""

import copy
import json
from typing import Optional
Expand Down Expand Up @@ -50,21 +49,6 @@ class LogRhythmAxonRuleRender(LogRhythmAxonQueryRender):
or_token = "or"
field_value_map = LogRhythmAxonRuleFieldValue(or_token=or_token)

def __create_mitre_threat(self, meta_info: MetaInfoContainer) -> tuple[list, list]:
tactics = set()
techniques = []

for tactic in meta_info.mitre_attack.get("tactics"):
tactics.add(tactic["tactic"])

for technique in meta_info.mitre_attack.get("techniques"):
if technique.get("tactic"):
for tactic in technique["tactic"]:
tactics.add(tactic)
techniques.append(technique["technique_id"])

return sorted(tactics), sorted(techniques)

def finalize_query(
self,
prefix: str,
Expand All @@ -91,11 +75,11 @@ def finalize_query(
)
if tactics := meta_info.mitre_attack.get("tactics"):
rule["observationPipeline"]["metadataFields"]["threat.mitre_tactic"] = ", ".join(
f"{i['external_id']}:{i['tactic']}" for i in tactics
f"{i['external_id']}:{i['tactic']}" for i in sorted(tactics, key=lambda x: x["external_id"])
)
if techniques := meta_info.mitre_attack.get("techniques"):
rule["observationPipeline"]["metadataFields"]["threat.mitre_technique"] = ", ".join(
f"{i['technique_id']}:{i['technique']}" for i in techniques
f"{i['technique_id']}:{i['technique']}" for i in sorted(techniques, key=lambda x: x["technique_id"])
)
if meta_info.fields:
rule["observationPipeline"]["pattern"]["operations"][0]["logObserved"]["groupByFields"] = [
Expand Down
2 changes: 1 addition & 1 deletion translator/app/translator/translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def __generate_all(self, text: str, source: str) -> list[dict]:
status, data = self.__render_translation(query_container=raw_query_container, target=target)
else:
status, data = self.__render_translation(query_container=tokenized_query_container, target=target)
result.append({"status": status, "result": parsed_data, "siem_type": target})
result.append({"status": status, "result": data, "siem_type": target})

return result

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy