-
Notifications
You must be signed in to change notification settings - Fork 1
Atlassian conversion #6
base: main
Are you sure you want to change the base?
Conversation
…nversion' into nkulig-atlassian-conversion Syncing updates from main into branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!!!! Thanks for doing this. Just a few minor comments
from typing import Literal | ||
|
||
from . import queries, rules, sample_logs | ||
from ._shared import * |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this from here as the _ prefix implies it should not be exported
return { | ||
"Timestamp": event.deep_get("attributes", "time", default="<unknown-time>"), | ||
"Actor": event.deep_get("attributes", "actor", "email", default="<unknown-actor-email>"), | ||
"Impersonated user": event.deep_get("attributes", "context", default=[{}])[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does deep get not work with list indexes?
overrides=detection.RuleOverrides(name=name_override) | ||
) | ||
|
||
self.assertIsInstance(rule, detection.Rule) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test will fail won't it?
It would also be good to add a test for the title function 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! I think this looks good once Max's comments are addressed
overrides=overrides, | ||
name="Atlassian user logged in as user", | ||
rule_id="Atlassian.User.LoggedInAsUser", | ||
log_types=[SYSTEM_LOG_TYPE], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with the latest version of SDK, we can now use schema.LogTypeAtlassianAudit
instead.
There have been some updates to the standard of how to write detections in this repo. Mainly 2:
Please make sure to pull in Thanks again for all your work on this!!! |
Background
This branch contains the changes necessary to bring the Atlassian rules from panther-analysis over to panther-detections.
Changes
An Atlassian folder was added under the Providers folder that contains the folder structure necessary to move forward with additional rules in the future. For now, there is only one rule to convert, and that has been added.
Testing
Tests are included under tests/providers/atlassian and I verified that the rule works correctly by running:
pipenv run panther_analysis_tool --debug sdk test