Repository navigation
Rubrik: Updated data connector and added playbooks, analytic rules for DSPM & IR violation usecase #14788
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
Open
Nirali Shah (niralishah-crest)
wants to merge
7
commits into
Azure:master
Choose a base branch
from
niralishah-crest:Rubrik-DSPM-IR-violation-update
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rubrik: Updated data connector and added playbooks, analytic rules for DSPM & IR violation usecase #14788
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3b01f6b
Updated data connector and added playbooks, analytic rules for DSPM &…
687f15a
Updated QuarantineFiles playbook and mainTemplate
3b855c6
Merge branch 'master' into Rubrik-DSPM-IR-violation-update
52f3073
Updated playbook templates and analytic rules as per feedback received
7e59a4a
Updated data connector templates
acdd0a8
Fixed validation errors
cc9d1f2
Updated the data connector files
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
Solutions/RubrikSecurityCloud/Analytic Rules/RubrikClassificationEvents.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| id: 9563dc15-ea0a-438a-9d50-7ab243378241 | ||
| name: Create Incident for Classification events for non DSPM license users | ||
| version: 1.0.0 | ||
| kind: Scheduled | ||
| description: | | ||
| 'Creates an incident for Classification events (ClassficationResultsAvailable) for non DSPM license users.' | ||
| severity: Medium | ||
| status: Available | ||
| requiredDataConnectors: | ||
| - connectorId: RubrikSecurityCloudAzureFunctions | ||
| dataTypes: | ||
| - RubrikViolationData | ||
| queryFrequency: 5m | ||
| queryPeriod: 5m | ||
| triggerOperator: gt | ||
| triggerThreshold: 0 | ||
| tactics: | ||
| - Collection | ||
| relevantTechniques: | ||
| - T1213 | ||
| query: | | ||
| Rubrik_Violation_Data_CL | ||
| | where class_s == "Classification" and custom_details_eventName_s in ("ClassficationResultsAvailable", "ClassificationResultsAvailable") | ||
| | extend NewSeverity = case(severity_s=="info", "Low", | ||
| severity_s=="warning", "Medium", | ||
| severity_s=="critical", "High", | ||
| "Informational"), | ||
| ObjectId = iff(isnotempty(custom_details_objectId_s), custom_details_objectId_s, tostring(custom_details_objectId_g)), | ||
| SnapshotId = custom_details_snapshotId_s | ||
| incidentConfiguration: | ||
| createIncident: true | ||
| groupingConfiguration: | ||
| enabled: true | ||
| reopenClosedIncident: false | ||
| lookbackDuration: P7D | ||
| matchingMethod: Selected | ||
| groupByCustomDetails: | ||
| - ObjectId | ||
| eventGroupingSettings: | ||
| aggregationKind: AlertPerResult | ||
| alertDetailsOverride: | ||
| alertDisplayNameFormat: '{{class_s}} event occurred for object {{custom_details_objectName_s}} with type {{custom_details_objectType_s}}' | ||
| alertDescriptionFormat: '{{summary_s}}' | ||
| alertSeverityColumnName: NewSeverity | ||
| customDetails: | ||
| ObjectId: ObjectId | ||
| ObjectName: custom_details_objectName_s | ||
| ObjectType: custom_details_objectType_s | ||
| EventType: class_s | ||
| EventName: custom_details_eventName_s | ||
| Summary: summary_s | ||
| EventTimestamp: timestamp_t | ||
| Severity: severity_s | ||
| SnapshotId: custom_details_snapshotId_s | ||
59 changes: 59 additions & 0 deletions
59
Solutions/RubrikSecurityCloud/Analytic Rules/RubrikDataSecurityViolation.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| id: 5b70b78e-397c-474c-a556-f6c37fccbb18 | ||
| name: Create Incident for Data Security Violation events for DSPM license users | ||
| version: 1.0.0 | ||
| kind: Scheduled | ||
| description: | | ||
| 'Creates an incident for Data Security Violation events for DSPM license users.' | ||
| severity: Medium | ||
| status: Available | ||
| requiredDataConnectors: | ||
| - connectorId: RubrikSecurityCloudAzureFunctions | ||
| dataTypes: | ||
| - RubrikViolationData | ||
| queryFrequency: 5m | ||
| queryPeriod: 5m | ||
| triggerOperator: gt | ||
| triggerThreshold: 0 | ||
| tactics: | ||
| - Exfiltration | ||
| relevantTechniques: | ||
| - T1567 | ||
| query: | | ||
| Rubrik_Violation_Data_CL | ||
| | where class_s == "SecurityViolation" and custom_details_eventName_s in ("CriticalSeverityDataViolationDetected", | ||
| "CriticalSeverityDataViolationReOpen", | ||
| "HighSeverityDataViolationDetected", | ||
| "HighSeverityDataViolationReOpen", | ||
| "LowOrMediumSeverityDataViolationDetected", | ||
| "LowOrMediumSeverityDataViolationReOpen") | ||
| | extend NewSeverity = case(severity_s=="info", "Low", | ||
| severity_s=="warning", "Medium", | ||
| severity_s=="critical", "High", | ||
| "Informational"), | ||
| ObjectId = iff(isnotempty(custom_details_objectId_s), custom_details_objectId_s, tostring(custom_details_objectId_g)), | ||
| ViolationId = iff(isnotempty(custom_details_seriesId_s), custom_details_seriesId_s, tostring(custom_details_seriesId_g)) | ||
| incidentConfiguration: | ||
| createIncident: true | ||
| groupingConfiguration: | ||
| enabled: true | ||
| reopenClosedIncident: false | ||
| lookbackDuration: P7D | ||
| matchingMethod: Selected | ||
| groupByCustomDetails: | ||
| - ViolationId | ||
| eventGroupingSettings: | ||
| aggregationKind: AlertPerResult | ||
| alertDetailsOverride: | ||
| alertDisplayNameFormat: '{{class_s}} event occurred for object {{custom_details_objectName_s}} with type {{custom_details_objectType_s}}' | ||
| alertDescriptionFormat: '{{summary_s}}' | ||
| alertSeverityColumnName: NewSeverity | ||
| customDetails: | ||
| ObjectId: ObjectId | ||
| ObjectName: custom_details_objectName_s | ||
| ObjectType: custom_details_objectType_s | ||
| EventType: class_s | ||
| EventName: custom_details_eventName_s | ||
| ViolationId: ViolationId | ||
| Summary: summary_s | ||
| EventTimestamp: timestamp_t | ||
| Severity: severity_s |
62 changes: 62 additions & 0 deletions
62
Solutions/RubrikSecurityCloud/Analytic Rules/RubrikIdentitySecurityViolation.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| id: 77e7519f-be7e-41fc-8f02-76bb0a7d5496 | ||
| name: Create Incident for Identity Security Violation and Identity Alerts events for IR violations | ||
| version: 1.0.0 | ||
| kind: Scheduled | ||
| description: | | ||
| 'Creates an incident for Identity Security Violation and Identity Alerts events for IR violations.' | ||
| severity: Medium | ||
| status: Available | ||
| requiredDataConnectors: | ||
| - connectorId: RubrikSecurityCloudAzureFunctions | ||
| dataTypes: | ||
| - RubrikViolationData | ||
| queryFrequency: 5m | ||
| queryPeriod: 5m | ||
| triggerOperator: gt | ||
| triggerThreshold: 0 | ||
| tactics: | ||
| - InitialAccess | ||
| relevantTechniques: | ||
| - T1078 | ||
| query: | | ||
| Rubrik_Violation_Data_CL | ||
| | where (class_s == "IdentityViolation" and custom_details_eventName_s in ("CriticalSeverityDataViolationDetected", | ||
| "CriticalSeverityDataViolationReOpen", "HighSeverityDataViolationDetected", | ||
| "HighSeverityDataViolationReOpen", "LowOrMediumSeverityDataViolationDetected", | ||
| "LowOrMediumSeverityDataViolationReOpen")) or | ||
| (class_s == "IdentityAlerts" and custom_details_eventName_s in ("CriticalSeverityIdentityAlertDetected", | ||
| "CriticalSeverityIdentityAlertReOpened", "HighSeverityIdentityAlertDetected", | ||
| "HighSeverityIdentityAlertReOpened", "LowOrMediumSeverityIdentityAlertDetected", | ||
| "LowOrMediumSeverityIdentityAlertReOpened" | ||
| )) | ||
| | extend NewSeverity = case(severity_s=="info", "Low", | ||
| severity_s=="warning", "Medium", | ||
| severity_s=="critical", "High", | ||
| "Informational"), | ||
| ObjectId = iff(isnotempty(custom_details_objectId_s), custom_details_objectId_s, tostring(custom_details_objectId_g)), | ||
| ViolationId = iff(isnotempty(custom_details_seriesId_s), custom_details_seriesId_s, tostring(custom_details_seriesId_g)) | ||
| incidentConfiguration: | ||
| createIncident: true | ||
| groupingConfiguration: | ||
| enabled: true | ||
| reopenClosedIncident: false | ||
| lookbackDuration: P7D | ||
| matchingMethod: Selected | ||
| groupByCustomDetails: | ||
| - ViolationId | ||
| eventGroupingSettings: | ||
| aggregationKind: AlertPerResult | ||
| alertDetailsOverride: | ||
| alertDisplayNameFormat: '{{class_s}} event occurred for object {{custom_details_objectName_s}} with type {{custom_details_objectType_s}}' | ||
| alertDescriptionFormat: '{{summary_s}}' | ||
| alertSeverityColumnName: NewSeverity | ||
| customDetails: | ||
| ObjectId: ObjectId | ||
| ObjectName: custom_details_objectName_s | ||
| ObjectType: custom_details_objectType_s | ||
| EventType: class_s | ||
| EventName: custom_details_eventName_s | ||
| ViolationId: ViolationId | ||
| Summary: summary_s | ||
| EventTimestamp: timestamp_t | ||
| Severity: severity_s |
57 changes: 35 additions & 22 deletions
57
Solutions/RubrikSecurityCloud/Data Connectors/RubrikWebhookEvents/RubrikActivity/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,45 +1,58 @@ | ||
| """This __init__ file will be called by Orchastrator function to ingest data in Sentinel.""" | ||
| """This __init__ file is called by the Orchestrator to ingest data into Sentinel.""" | ||
| import inspect | ||
| import time | ||
| from shared_code.logger import applogger | ||
| from shared_code.consts import LOGS_STARTS_WITH | ||
| from shared_code.consts import LOGS_STARTS_WITH, LOG_FORMAT | ||
| from shared_code.rubrik_exception import RubrikException | ||
| from .rubrik import Rubrik | ||
|
|
||
| FUNCTION_NAME = "RubrikActivity" | ||
|
|
||
|
|
||
| def main(name) -> str: | ||
| """Start Execution of Activity Function. | ||
| """Start execution of the Activity function. | ||
|
|
||
| Args: | ||
| name (dict): data received via Rubrik Webhook. | ||
| name (dict): payload with keys data, log_type, stream_name, rule_id. | ||
|
|
||
| Returns: | ||
| str: status message of activity function. | ||
| str: status message of the activity function. | ||
| """ | ||
| __method_name = inspect.currentframe().f_code.co_name | ||
| try: | ||
| applogger.info( | ||
| "{}(method={}) Activity function called!".format( | ||
| LOGS_STARTS_WITH, __method_name | ||
| ) | ||
| log_type = name.get("log_type") | ||
| applogger.info( | ||
| LOG_FORMAT.format( | ||
| LOGS_STARTS_WITH, | ||
| FUNCTION_NAME, | ||
| __method_name, | ||
| "Activity function started for log_type={}.".format( | ||
| log_type | ||
| ), | ||
| ) | ||
| ) | ||
| try: | ||
| start = time.time() | ||
| rubrik_obj = Rubrik() | ||
| rubrik_obj.post_data_to_sentinel(name) | ||
| end = time.time() | ||
| elapsed = int(time.time() - start) | ||
| applogger.info( | ||
| "{}(method={}) time taken for data ingestion is {} sec".format( | ||
| LOGS_STARTS_WITH, __method_name, int(end - start) | ||
| ) | ||
| ) | ||
| applogger.info( | ||
| "{}(method={}) Activity function Completed!".format( | ||
| LOGS_STARTS_WITH, __method_name | ||
| LOG_FORMAT.format( | ||
| LOGS_STARTS_WITH, | ||
| FUNCTION_NAME, | ||
| __method_name, | ||
| "Data ingestion completed for {} in {} sec.".format(log_type, elapsed), | ||
| ) | ||
| ) | ||
| return "Data Posted successfully to {}".format(log_type) | ||
| except RubrikException as err: | ||
| return err | ||
| applogger.error( | ||
| LOG_FORMAT.format(LOGS_STARTS_WITH, FUNCTION_NAME, __method_name, err) | ||
| ) | ||
| return "Error while posting data to {}: {}".format(log_type, err) | ||
| except Exception as err: | ||
| applogger.error("{}(method={}) {}".format(LOGS_STARTS_WITH, __method_name, err)) | ||
| return err | ||
| return "Data Posted successfully to {}".format(name.get("log_type")) | ||
| applogger.error( | ||
| LOG_FORMAT.format(LOGS_STARTS_WITH, FUNCTION_NAME, __method_name, err) | ||
| ) | ||
| return "Unexpected error while posting data to {}: {}".format( | ||
| log_type, err | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The actual event name has typo so we have to match accordingly