Skip to content
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

Fixed minor issues #371

Merged
merged 3 commits into from
Apr 27, 2022
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
13 changes: 7 additions & 6 deletions msticpy/datamodel/entities/alert.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ def __init__(
self.ProviderName: Optional[str] = None
self.Entities: Optional[List] = None
super().__init__(src_entity=src_entity, **kwargs)
if src_entity:
if src_entity is not None:
self._create_from_ent(src_entity)

if isinstance(src_event, pd.Series) and not src_event.empty:
self._create_from_event(src_event)

def _create_from_ent(self, src_entity): # noqa: MC0001
if "StartTime" in src_entity or "TimeGenerated" in src_entity:
self.TimeGeneratedUtc = (
src_entity["StartTime"] or src_entity["TimeGenerated"]
)
if "StartTime" in src_entity:
self.TimeGeneratedUtc = src_entity["StartTime"]
if "TimeGenerated" in src_entity:
self.TimeGeneratedUtc = src_entity["TimeGenerated"]
if "EndTime" in src_entity:
self.EndTimeUtc = src_entity["EndTime"]
if "StartTime" in src_entity:
Expand Down Expand Up @@ -137,7 +137,8 @@ def description_str(self) -> str:
@property
def name_str(self) -> str:
"""Return Entity Name."""
return f"Alert: {self.DisplayName}" or self.__class__.__name__
alert_name = self.AlertDisplayName or self.DisplayName or None
return f"Alert: {alert_name}" or self.__class__.__name__

def _add_additional_data(self, src_entity: Mapping[str, Any]):
"""Populate additional alert properties."""
Expand Down
6 changes: 3 additions & 3 deletions msticpy/sectools/base64unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ def _decode_b64_string_recursive(
item_prefix,
fragment_index,
)
df_results = df_results.append(
new_records, ignore_index=True, sort=False
df_results = pd.concat(
[df_results, pd.DataFrame(new_records)], ignore_index=True
)
# replace the decoded fragment in our current results string
# (decode_string)
Expand Down Expand Up @@ -426,7 +426,7 @@ def _decode_b64_string_recursive(
)
return (
next_level_string,
df_results.append(child_records, ignore_index=True, sort=False),
pd.concat([df_results, child_records], ignore_index=True),
)

_debug_print_trace("Nothing left to decode")
Expand Down