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

Aws mitre t1606 #646

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Aws mitre t1606 #646

wants to merge 29 commits into from

Conversation

hbenac10
Copy link
Contributor

Background

Adding aws mitre t1606 to Odin detections.

@hbenac10 hbenac10 requested review from a team January 20, 2023 20:48
@@ -0,0 +1,117 @@
from datetime import datetime, timedelta
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should implement this as more portable vs re-implementing/copying the evaluation used in the okta improbable login.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nate and I had this conversation and think we should have an anomalous helper.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @edyesed I totally agree. I would like to update our global helpers to include:

  • DynamoDB - put_dictionary() and get_dictionary(), that would handle serializing and de-serializing dictionaries and putting/getting them from DynamoDB. These would alleviate the string set-to-dict conversions that are implemented in several detections that use DynamoDB stateful caching
  • Distance calculation with Lat/Long values - haversine_distance()

Would that be something I could work up in its own PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

absolutely something that you can work up into its own PR 👍

Also agree that the distance calculation belongs out in the helpers. This is a valuable technique we can apply to lots of different logtypes 💯

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just notating this as completed.


PANTHER_TIME_FORMAT = "%Y-%m-%d %H:%M:%S"

AUTH_EVENTS = [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably increase scope to ConsoleLogin, though unlike the other eventNames it is not in sso.amazonaws.com eventSource

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -0,0 +1,382 @@
AnalysisType: rule
Description: Monitor for creation of access tokens
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This detection is computing improbable travel and description mentions creating access tokens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


def title(event):
return (
f"User [{deep_get(event, 'userIdentity', 'principalId')}] "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this title should say something about impossible travel

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


def rule(event):
# Filter: Non-S3 events
if event.get("eventSource") != "s3.amazonaws.com":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the eventNames from lines 26-44 always return False from line 51

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


def title(event):
return (
f"User [{deep_get(event, 'userIdentity', 'principalId')}] "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use userIdentity.arn

def title(event):
return (
f"User [{deep_get(event, 'userIdentity', 'principalId')}] "
f"performed a [{event.get('eventName')}] "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know we haven't historically included the Threshold in the title, and I'm wondering if it makes sense to say that the actor has already done N number of these items.

Reference: https://attack.mitre.org/techniques/T1518/001/
Reports:
MITRE ATT&CK:
- T1518:T1518.001
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my understanding is that the web UI doesn't handle subtechniques.
I think this will need to be TAxxxx:Txxxx

Reference: https://attack.mitre.org/techniques/T1213/003/
Reports:
MITRE ATT&CK:
- T1213
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be format TAxxxx:Txxxx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Reference: https://attack.mitre.org/tactics/TA0009/
Reports:
MITRE ATT&CK:
- TA0009
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TAxxxx:Txxxx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@zacbrown zacbrown removed the request for review from a team May 31, 2023 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants