Skip to content

Commit

Permalink
Prepare for 3.50.0 (#1217)
Browse files Browse the repository at this point in the history
* Deprecate GreyNoise detections (#1205)

* Deprecate GreyNoise detections

* Update rules/aws_cloudtrail_rules/aws_s3_activity_greynoise.yml

* Update rules/cloudflare_rules/cloudflare_firewall_suspicious_event_greynoise.yml

* Update cloudflare_httpreq_bot_high_volume_greynoise.yml

---------

Co-authored-by: Ariel Ropek <[email protected]>

* fix - Notion Login From New Location - NoneType error (#1206)

* fix - Notion Login From New Location - NoneType error

* fix - Notion Login From New Location - NoneType error - linter fix

* remove codeowners (#1208)

* fix - GCP rules - AttributeError (#1210)

* fix - GCP rules - AttributeError

* fix - GCP rules - AttributeError - linter fix

* MITRE ATT&CK Mappings for MS Rules (#1209)

* added MITRE mappings for microsoft rules

* fixed formatting on some helper files

---------

Co-authored-by: Ariel Ropek <[email protected]>

* traildiscover enrichment with managed schema (#1177)

* traildiscover enrichment with managed schema

* Add npm install in dockerfile (#1172)

* add npm install in dockerfile

* Remove Python optimizations; add prettier to PATH

---------

Co-authored-by: egibs <[email protected]>

* schema name: TrailDiscover.CloudTrail

* Fix Dockerfile; add Workflow to test image

* updated data set

* Add MongoDB.2FA.Disabled rule (#1190)

Co-authored-by: Ariel Ropek <[email protected]>

* lint and fmt

* fmt

* add OCSF selector

* additional OCSF mappings

* Fix Pipfile

* Rebase changes

---------

Co-authored-by: Panos Sakkos <[email protected]>
Co-authored-by: egibs <[email protected]>
Co-authored-by: Oleh Melenevskyi <[email protected]>

* Update PAT to 0.46.0 (#1216)

---------

Co-authored-by: Oleh Melenevskyi <[email protected]>
Co-authored-by: Ariel Ropek <[email protected]>
Co-authored-by: akozlovets098 <[email protected]>
Co-authored-by: Panos Sakkos <[email protected]>
Co-authored-by: ben-githubs <[email protected]>
  • Loading branch information
6 people authored Apr 23, 2024
1 parent 538c5db commit ecf74bf
Show file tree
Hide file tree
Showing 21 changed files with 583 additions and 268 deletions.
6 changes: 0 additions & 6 deletions .github/CODEOWNERS

This file was deleted.

2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ wrapt = "~=1.15"
[packages]
policyuniverse = "==1.5.1.20230817"
requests = "==2.31.0"
panther-analysis-tool = "~=0.45"
panther-analysis-tool = "~=0.46"
panther-detection-helpers = "==0.3.0"

[requires]
Expand Down
436 changes: 218 additions & 218 deletions Pipfile.lock

Large diffs are not rendered by default.

257 changes: 257 additions & 0 deletions lookup_tables/traildiscover/traildiscover_data.jsonl

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions lookup_tables/traildiscover/traildiscover_lut.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
AnalysisType: lookup_table
LookupName: TrailDiscover
Enabled: true
Description: An evolving repository of CloudTrail events with detailed descriptions, MITRE ATT&CK insights, real-world incidents references, other research references and security implications.
Filename: traildiscover_data.jsonl
Reference: https://github.com/adanalvarez/TrailDiscover
Schema: TrailDiscover.CloudTrail
LogTypeMap:
PrimaryKey: eventName
AssociatedLogTypes:
- LogType: AWS.CloudTrail
Selectors:
- "eventName"
- LogType: OCSF.AccountChange
Selectors:
- "$.api.operation"
- LogType: OCSF.ApiActivity
Selectors:
- "$.api.operation"
- LogType: OCSF.Authentication
Selectors:
- "$.api.operation"
- LogType: OCSF.UserAccess
Selectors:
- "$.api.operation"
2 changes: 0 additions & 2 deletions packs/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ PackDefinition:
- AWS.S3.Bucket.NameDNSCompliance
- AWS.S3.BucketDeleted
- AWS.S3.BucketPolicyModified
- AWS.S3.GreyNoiseActivity
- AWS.S3.ServerAccess.Error
- AWS.SecurityHub.Finding.Evasion
- AWS.VPC.FlowLogs
Expand Down Expand Up @@ -175,7 +174,6 @@ PackDefinition:
- panther_config_overrides
- panther_default
- panther_event_type_helpers
- panther_greynoise_helpers
- panther_iocs
- panther_lookuptable_helpers
- panther_oss_helpers
3 changes: 0 additions & 3 deletions packs/cloudflare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ Description: Group of all Cloudflare detections
PackDefinition:
IDs:
- Cloudflare.Firewall.L7DDoS
- Cloudflare.Firewall.SuspiciousEventGreyNoise
- Cloudflare.HttpRequest.BotHighVolume
- Cloudflare.HttpRequest.BotHighVolumeGreyNoise
# Globals used in these rules/policies
- panther_base_helpers
- panther_cloudflare_helpers
- panther_greynoise_helpers
- panther_lookuptable_helpers
- global_filter_cloudflare
- panther_config
Expand Down
14 changes: 0 additions & 14 deletions packs/greynoise_advanced.yml

This file was deleted.

14 changes: 0 additions & 14 deletions packs/greynoise_basic.yml

This file was deleted.

5 changes: 3 additions & 2 deletions rules/aws_cloudtrail_rules/aws_s3_activity_greynoise.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AnalysisType: rule
Description: S3 operations from known malicious GreyNoise classifications. Note that this rule will only work with S3 object-level logging enabled for a given bucket.
DisplayName: "GreyNoise Malicious AWS S3 Get/List Object"
Enabled: true
DisplayName: "--DEPRECATED-- GreyNoise Malicious AWS S3 Get/List Object"
Enabled: false
Filename: aws_s3_activity_greynoise.py
Reference: https://attack.mitre.org/techniques/T1530/
Reports:
Expand All @@ -25,6 +25,7 @@ Tags:
- AWS
- GreyNoise
- Collection:Data From Cloud Storage Object
- Deprecated
Tests:
- ExpectedResult: true
Name: GetObject from Malicious GreyNoise finding
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ LogTypes:
Tags:
- Cloudflare
- GreyNoise
- Deprecated
Severity: Info
Description: Monitors high volume events blocked from the same IP enriched with GreyNoise
Runbook: Inspect and monitor internet-facing services for potential outages
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
AnalysisType: rule
Filename: cloudflare_firewall_suspicious_event_greynoise.py
RuleID: "Cloudflare.Firewall.SuspiciousEventGreyNoise"
DisplayName: "Cloudflare Suspicious Event - GreyNoise"
Enabled: true
DisplayName: "--DEPRECATED-- Cloudflare Suspicious Event - GreyNoise"
Enabled: false
LogTypes:
- Cloudflare.Firewall
Tags:
- Cloudflare
- GreyNoise
- Deprecated
Severity: Medium
Description: Monitors for non-blocked requests from Greynoise identified malicious IP Addresses
Runbook: Inspect resources accessed for malicious behavior
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
AnalysisType: rule
Filename: cloudflare_httpreq_bot_high_volume_greynoise.py
RuleID: "Cloudflare.HttpRequest.BotHighVolumeGreyNoise"
DisplayName: "Cloudflare Bot High Volume GreyNoise"
DisplayName: "--DEPRECATED-- Cloudflare Bot High Volume GreyNoise"
Enabled: false
LogTypes:
- Cloudflare.HttpRequest
Tags:
- Cloudflare
- GreyNoise
- Deprecated
Severity: Low
Description: Monitors for high volume of likely automated HTTP Requests with GreyNoise enrichment
Runbook: Inspect and monitor internet-facing services for potential outages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@


def rule(event):
if not deep_get(event, "protoPayload", "methodName").endswith("CloudBuild.CreateBuild"):
if not deep_get(event, "protoPayload", "methodName", default="METHOD_NOT_FOUND").endswith(
"CloudBuild.CreateBuild"
):
return False

authorization_info = deep_walk(event, "protoPayload", "authorizationInfo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@


def rule(event):
if not deep_get(event, "protoPayload", "methodName").endswith("ApiKeys.CreateKey"):
if not deep_get(event, "protoPayload", "methodName", default="METHOD_NOT_FOUND").endswith(
"ApiKeys.CreateKey"
):
return False

authorization_info = deep_walk(event, "protoPayload", "authorizationInfo")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Description: A Microsoft365 user was denied login access several times
DisplayName: "Microsoft365 Brute Force Login by User"
Enabled: true
Filename: microsoft365_brute_force_login_by_user.py
Reports:
MITRE ATT&CK:
- TA0006:T1110 # Credential Access - Brute Force
Runbook: Analyze the IP they came from and actions taken before/after.
Reference: https://learn.microsoft.com/en-us/microsoft-365/troubleshoot/authentication/access-denied-when-connect-to-office-365
Severity: Medium
Expand Down
3 changes: 3 additions & 0 deletions rules/microsoft_rules/microsoft365_external_sharing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Description: Document shared externally
DisplayName: "Microsoft365 External Document Sharing"
Enabled: true
Filename: microsoft365_external_sharing.py
Reports:
MITRE ATT&CK:
- TA0009:T1039 # Collection - Data from Network Shared Drive
Runbook: Check the document metadata to ensure it is not a sensitive document.
Reference: https://support.microsoft.com/en-us/topic/manage-sharing-with-external-users-in-microsoft-365-small-business-2951a85f-c970-4375-aa4f-6b0d7035fe35#:~:text=Top%20of%20Page-,Turn%20external%20sharing%20on%20or%20off,-The%20ability%20to
Severity: Low
Expand Down
5 changes: 5 additions & 0 deletions rules/microsoft_rules/microsoft365_mfa_disabled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Description: A user's MFA has been removed
DisplayName: "Microsoft365 MFA Disabled"
Enabled: true
Filename: microsoft365_mfa_disabled.py
Reports:
MITRE ATT&CK:
- TA003:T1556 # Persistence - Modify Authentication Process
- TA005:T1556 # Defense Evansion - Modify Authentication Process
- TA006:T1556 # Credential Access - Modify Authentication Process
Runbook: Depending on company policy, either suggest or require the user re-enable two step verification.
Reference: https://learn.microsoft.com/en-us/microsoft-365/admin/security-and-compliance/set-up-multi-factor-authentication?view=o365-worldwide
Severity: Low
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ Description: Detects creation of forwarding rule to external domains
DisplayName: "Microsoft Exchange External Forwarding"
Enabled: true
Filename: microsoft_exchange_external_forwarding.py
Reports:
MITRE ATT&CK:
- TA0009:T1114 # Collection - Email Collection
Reference: https://learn.microsoft.com/en-us/microsoft-365/security/office-365-security/outbound-spam-policies-external-email-forwarding?view=o365-worldwide
Severity: High
Tests:
Expand Down
6 changes: 3 additions & 3 deletions rules/notion_rules/notion_login_from_new_location.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ def rule(event):
global IPINFO_LOC
IPINFO_LOC = IPInfoLocation(event)
path_to_ip = "event.ip_address"
city = IPINFO_LOC.city(path_to_ip)
region = IPINFO_LOC.region(path_to_ip)
country = IPINFO_LOC.country(path_to_ip)
city = IPINFO_LOC.city(path_to_ip) or ""
region = IPINFO_LOC.region(path_to_ip) or ""
country = IPINFO_LOC.country(path_to_ip) or ""
loc_string = "_".join((city, region, country))

# Store the login location. The premise is to create a new entry for each combimation of user
Expand Down
50 changes: 50 additions & 0 deletions rules/notion_rules/notion_login_from_new_location.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,53 @@ Tests:
"p_source_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"p_source_label": "Notion Logs",
}
- Name: Login from different location - no region
ExpectedResult: true
Mocks:
- objectName: get_dictionary
returnValue: '{ "Minas Tirith_Pellenor_Gondor": 1686542031 }'
- objectName: put_dictionary
returnValue: False
Log:
{
"event":
{
"actor":
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"object": "user",
"person": { "email": "[email protected]" },
"type": "person",
},
"details": { "authType": "email" },
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"ip_address": "192.168.100.100",
"platform": "web",
"timestamp": "2023-06-12 21:40:28.690000000",
"type": "user.login",
"workspace_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
},
"p_enrichment":
{
"ipinfo_location":
{
"event.ip_address":
{
"city": "Barad-Dur",
"lat": "0.00000",
"lng": "0.00000",
"country": "Mordor",
"postal_code": "55555",
"region_code": "MD",
"timezone": "Middle Earth/Mordor",
},
},
},
"p_event_time": "2023-06-12 21:40:28.690000000",
"p_log_type": "Notion.AuditLogs",
"p_parse_time": "2023-06-12 22:53:51.602223297",
"p_row_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"p_schema_version": 0,
"p_source_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"p_source_label": "Notion Logs",
}

0 comments on commit ecf74bf

Please sign in to comment.