VaronisDataSecurityPlatform
Streamline alerts and related forensic information from Varonis DSP.
Analytics & SIEM · Varonis Data Security Platform
Details
| ID | VaronisDataSecurityPlatform |
|---|---|
| Provider | Varonis |
| Category | Analytics & SIEM |
| From Version | 6.0.0 |
| Docker Image | demisto/ntlm:1.0.0.9067966 |
| Supported Modules | Agentix XSIAM |
README
Streamline alerts and related forensic information from Varonis DSP
This integration was integrated and tested with version 1.0 of VaronisDataSecurityPlatform
Configure Varonis Data Security Platform in Cortex
| Parameter | Description | Required |
|---|---|---|
| Fetch incidents | False | |
| Incident type | False | |
| The FQDN/IP the integration should connect to | True | |
| Name of Varonis user | True | |
| Password | True | |
| Use system proxy settings | False | |
| Trust any certificate (not secure) | False | |
| Maximum number of incidents per fetch | Maximum value is 100 | False |
| First fetch time | False | |
| Minimum severity of alerts to fetch | False | |
| Varonis threat model name | Comma-separated list of threat model names of alerts to fetch | False |
| Varonis alert status | False |
Commands
You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
varonis-get-alerts
Get alerts from Varonis DA
Base Command
varonis-get-alerts
Input
| Argument Name | Description | Required |
|---|---|---|
| threat_model_name | List of requested threat models to retrieve. | Optional |
| max_results | The max number of alerts to retrieve (up to 50). Default is 50. | Optional |
| start_time | Start time of alert range. | Optional |
| end_time | End time of alert range. | Optional |
| alert_status | List of required alerts status. | Optional |
| alert_severity | List of required alerts severity. | Optional |
| device_name | List of required alerts device name. | Optional |
| user_name | List of users (up to 5). | Optional |
| user_domain_name | User domain name (cannot be provided without user_name). | Optional |
| sam_account_name | List of sam account names (up to 5). | Optional |
| List of emails (up to 5). | Optional | |
| last_days | Number of days you want the search to go back to. | Optional |
| descending_order | Indicates whether alerts should be ordered in newest to oldest order. | Optional |
| page | Page number. Default is 1. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Varonis.Alert.ID | Number | Varonis ID for alert |
| Varonis.Alert.Name | String | Name of retrieved alert |
| Varonis.Alert.Time | Date | When was the alert triggered |
| Varonis.Alert.Severity | String | Alert severity |
| Varonis.Alert.Category | String | Alert category. Options are: - Reconnaissance - Intrusion - Exploitation - Privilege Escalation - Lateral Movement |
| Varonis.Alert.Country | String | Name of the country from which the event occurred |
| Varonis.Alert.State | String | Name of the state or regional subdivision from which the event occurred |
| Varonis.Alert.Status | String | Alert state. Options are: - Open - Under investigation - Closed |
| Varonis.Alert.CloseReason | String | Reason the alert was closed. Options are: - Resolved - Misconfiguration - Threat model disabled or deleted - Account misclassification - Legitimate activity - Other |
| Varonis.Alert.BlacklistLocation | Boolean | Whether any of the geographical locations from which an alerted activity originated was on the blacklist at the time the activity occurred |
| Varonis.Alert.AbnormalLocation | Boolean | Whether any of the geographical locations from which an alerted activity originated is new or abnormal to the organization, the user and peers, or only the user |
| Varonis.Alert.NumOfAlertedEvents | Number | Number of events with alerts |
| Varonis.Alert.UserName | String | Name of the users triggered alerts |
| Varonis.Alert.By.SamAccountName | String | Logon name used to support clients and servers running earlier versions of Windows operating system, such as Windows NT 4.0. In the dashboards (other than the Alert dashboard), this is the SAM account name of the user or group |
| Varonis.Alert.By.PrivilegedAccountType | String | Privileged account. Options are: - Service accounts - Admin accounts - Executive accounts |
| Varonis.Alert.By.Department | String | User`s department |
| Varonis.Alert.On.ContainsFlaggedData | Boolean | Whether the data affected by the alerted events has global flags |
| Varonis.Alert.On.ContainsSensitiveData | Boolean | Filters according to whether the resource on which the event was performed is sensitive (including subfolders) |
| Varonis.Alert.On.Platform | String | Type of platform on which the server resides. For example, Windows, Exchange, or SharePoint |
| Varonis.Alert.On.Asset | String | Path of the alerted asset |
| Varonis.Alert.On.FileServerOrDomain | String | Associated file server/domain |
| Varonis.Alert.Device.Name | String | Name of the device from which the user generated the event |
| Varonis.Alert.Device.ContainMaliciousExternalIP | Boolean | Whether the alert contains IPs known to be malicious |
| Varonis.Alert.Device.IPThreatTypes | String | Whether the alert contains IPs known to be malicious |
| Varonis.Pagination.Page | Number | Current page number requested by user |
| Varonis.Pagination.PageSize | Number | Number of records on the page |
Command example
!varonis-get-alerts page=1 alert_status=Open max_results=1 start_time=2022-02-16T13:00:00+02:00
Context Example
{
"Varonis": {
"Alert": [
{
"AbnormalLocation": "",
"BlacklistLocation": "",
"By": {
"Department": "",
"PrivilegedAccountType": "",
"SamAccountName": ""
},
"Category": "Privilege Escalation",
"CloseReason": "",
"Country": "",
"Device": {
"ContainMaliciousExternalIP": "No",
"IPThreatTypes": "",
"Name": "l1839-zkpr1"
},
"ID": "D366A9C5-EF82-413D-BABB-7F04AB358D11",
"Name": "dns aaaaaalert",
"NumOfAlertedEvents": "1",
"On": {
"Asset": "",
"ContainsFlaggedData": "",
"ContainsSensitiveData": "",
"FileServerOrDomain": "DNS",
"Platform": "DNS"
},
"Severity": "Medium",
"State": "",
"Status": "Open",
"Time": "2022-02-15T16:02:00",
"UserName": ""
}
],
"Pagination": {
"Page": 1,
"PageSize": 1
}
}
}
Human Readable Output
Varonis Alerts
Name Severity Time Category UserName Status dns aaaaaalert Medium 2022-02-15T16:02:00 Privilege Escalation Open
varonis-update-alert-status
Update alert status
Base Command
varonis-update-alert-status
Input
| Argument Name | Description | Required |
|---|---|---|
| alert_id | Requested alerts. | Required |
| status | Alert new status. Possible values are: Open, Under Investigation. | Required |
Context Output
There is no context output for this command.
Command example
!varonis-update-alert-status alert_id=72D0D925-0937-4111-AB4A-FFFD4A529A3C status="Under Investigation"
Human Readable Output
True
varonis-close-alert
Close the alert
Base Command
varonis-close-alert
Input
| Argument Name | Description | Required |
|---|---|---|
| alert_id | Requested alerts. | Required |
| close_reason | The reason the alert was closed. Possible values are: Resolved, Misconfiguration, Threat model disabled or deleted, Account misclassification, Legitimate activity, Other. | Required |
Context Output
There is no context output for this command.
Command example
!varonis-close-alert alert_id=72D0D925-0937-4111-AB4A-FFFD4A529A3C,0D9D657A-A51F-4674-B49A-FFB1EDD35D51 close_reason=Resolved
Human Readable Output
True
varonis-get-alerted-events
Get events applied to specific alerts
Base Command
varonis-get-alerted-events
Input
| Argument Name | Description | Required |
|---|---|---|
| alert_id | List of alert IDs. | Required |
| max_results | Maximum number of alerts to retrieve (up to 5k). | Optional |
| page | Page number. Default is 1. | Optional |
| descending_order | Indicates whether events should be ordered in newest to oldest order. | Optional |
Context Output
| Path | Type | Description |
|---|---|---|
| Varonis.Event.Type | String | Event type |
| Varonis.Event.UTCTime | Date | Event time UTC format |
| Varonis.Event.Status | String | Filters according to the status of the event. Options are: - Fail - Success |
| Varonis.Event.Description | String | Description of the activity |
| Varonis.Event.Country | String | Name of the country from which the event occurred |
| Varonis.Event.State | String | Name of the state or regional subdivision from which the event occurred |
| Varonis.Event.ExternalIP | String | Device external IP |
| Varonis.Event.Details.IsBlacklist | Boolean | Whether any of the geographical locations from which an alerted activity originated was on the blacklist at the time the activity occurred |
| Varonis.Event.Details.Operation | String | Type of operation that occurred during the event. Options are: - Accessed - Added - Changed - Removed - Sent - Received - Requested |
| Varonis.Event.ByUser.Name | String | Name of the user that triggered the event |
| Varonis.Event.ByUser.UserType | String | Type of account, i.e., user or computer |
| Varonis.Event.ByUser.UserAccountType | String | Logon name used to support clients and servers running earlier versions of the Windows operating system, such as Windows NT 4.0. In the dashboards (other than the Alert dashboard), this is the SAM account name of the user or group |
| Varonis.Event.ByUser.Domain | String | Domain of the user that triggered the event |
| Varonis.Event. ByUser.DisabledAccount | Boolean | Whether the account is disabled |
| Varonis.Event.ByUser.StaleAccount | Boolean | Whether the account is stale |
| Varonis.Event.ByUser.LockoutAccounts | Boolean | Whether the account is lockout |
| Varonis.Event.SourceIP | String | Source IP of the device triggered the event |
| Varonis.Event. IsMaliciousIP | Boolean | Whether the IP is known to be malicious |
| Varonis.Event. IPReputation | Number | Reputation score of the IP. The score is a numeric value from 1-100 |
| Varonis.Event.IPThreatType | String | List of threat types associated with the IP |
| Varonis.Event.OnObject.Name | String | Name of object on which the event was performed |
| Varonis.Event.OnObject.ObjectType | String | Type of object on which the event was performed |
| Varonis.Event.OnObject.Platform | String | Type of platform on which the server resides. For example, Windows, Exchange, or SharePoint |
| Varonis.Event.OnObject.IsSensitive | Boolean | Indicates whether the resource on which the event was performed is sensitive |
| Varonis.Event.OnObject.FileServerOrDomain | String | File server of object on which the event was performed |
| Varonis.Event.OnObject.IsDisabledAccount | Boolean | Whether the account is disabled |
| Varonis.Event.OnObject.IsLockOutAccount | Boolean | Whether the account is lockout |
| Varonis.Event.OnObject.SAMAccountName | String | Logon name used to support clients and servers running earlier versions of the Windows operating system, such as Windows NT 4.0. In the dashboards (other than the Alert dashboard), this is the SAM account name of the user or group |
| Varonis.Event.OnObject.UserAccountType | String | Specified type of privileged account. Options are: - Service accounts - Admin accounts - Executive accounts - Test accounts |
| Varonis.Event.OnObject.DestinationIP | String | Destination IP address within the organization |
| Varonis.Event.OnObject.DestinationDevice | String | Destination host name for relevant services |
| Varonis.Event.OnObject.Path | String | Path of asset |
| Varonis.Pagination.Page | Number | Current page number requested by user |
| Varonis.Pagination.PageSize | Number | Number of records on the page |
Command example
!varonis-get-alerted-events page=1 alert_id=72D0D925-0937-4111-AB4A-FFFD4A529A3C max_results=1
Context Example
{
"Varonis": {
"Event": [
{
"ByUser": {
"DisabledAccount": "",
"Domain": "",
"LockoutAccounts": "",
"Name": "",
"SAMAccountName": "",
"StaleAccount": "",
"UserAccountType": "",
"UserType": ""
},
"Country": "",
"Description": "The DNS Server has resolved successfully ",
"Details": {
"IsBlacklist": "",
"Operation": "Request"
},
"ID": "22D3EFC0-E758-4BA0-92C4-EB9566C830AD",
"IPReputation": "",
"IPThreatType": "",
"IsMaliciousIP": "",
"OnObject": {
"DestinationDevice": "",
"DestinationIP": "",
"FileServerOrDomain": "DNS",
"IsDisabledAccount": "",
"IsLockOutAccount": "",
"IsSensitive": "",
"Name": "dns.msftncsi.com",
"ObjectType": "Dns",
"Platform": "DNS",
"SAMAccountName": "",
"UserAccountType": ""
},
"SourceIP": "10.10.10.10",
"State": "",
"Status": "Success",
"Type": "Client DNS request",
"UTCTime": "2022-03-17T17:52:14Z"
}
],
"Pagination": {
"Page": 1,
"PageSize": 1
}
}
}
Human Readable Output
Varonis Alerted Events
ByUser Country Description Details ID IPReputation IPThreatType IsMaliciousIP OnObject SourceIP State Status Type UTCTime Name:
UserType:
UserAccountType:
SAMAccountName:
Domain:
DisabledAccount:
StaleAccount:
LockoutAccounts:The DNS Server has resolved successfully IsBlacklist:
Operation: Request22D3EFC0-E758-4BA0-92C4-EB9566C830AD Name: dns.msftncsi.com
ObjectType: Dns
Platform: DNS
IsSensitive:
FileServerOrDomain: DNS
IsDisabledAccount:
IsLockOutAccount:
SAMAccountName:
UserAccountType:
DestinationIP:
DestinationDevice:10.10.10.10 Success Client DNS request 2022-03-17T17:52:14Z
Configuration parameters
isFetch— Fetch incidentsincidentType— Incident typeincidentFetchInterval— Incidents Fetch Intervalurl— The FQDN/IP the integration should connect to (required)credentials— Name of Varonis user (required)proxy— Use system proxy settingsinsecure— Trust any certificate (not secure)max_fetch— Maximum number of incidents per fetchfirst_fetch— First fetch timeseverity— Minimum severity of alerts to fetchthreat_model— Varonis threat model namestatus— Varonis alert status
Commands (4)
-
varonis-close-alertClose the alert.
-
varonis-get-alerted-eventsGet events applied to specific alerts.
-
varonis-get-alertsGet alerts from Varonis DA.
-
varonis-update-alert-statusUpdate alert status.
import json import demistomock as demisto from pytest_mock import MockerFixture from VaronisDataSecurityPlatform import Client def util_load_json(path): with open(path, encoding="utf-8") as f: return json.loads(f.read()) """ COMMAND UNIT TESTS """ def test_varonis_get_alerts_command(mocker: MockerFixture): """ When: - Get alerts from Varonis api Then - Assert output prefix data is as expected - Assert mapping works as expected """ from VaronisDataSecurityPlatform import varonis_get_alerts_command client = Client(base_url="https://test.com", verify=False, proxy=False) mocker.patch.object( client, "varonis_get_alerts", return_value=util_load_json("test_data/varonis_get_alerts_api_response.json") ) mocker.patch.object(client, "varonis_get_enum", return_value=util_load_json("test_data/varonis_get_enum_response.json")) mocker.patch.object(client, "varonis_get_users", return_value=util_load_json("test_data/varonis_get_users_api_response.json")) args = util_load_json("test_data/demisto_search_alerts_args.json") expected_outputs = util_load_json("test_data/varonis_get_alerts_command_output.json") result = varonis_get_alerts_command(client, args) assert result.outputs_prefix == "Varonis" assert result.outputs == expected_outputs def test_varonis_update_alert_status_command(requests_mock): from VaronisDataSecurityPlatform import varonis_update_alert_status_command requests_mock.post("https://test.com/api/alert/alert/SetStatusToAlerts", json=True) client = Client(base_url="https://test.com", verify=False, proxy=False) args = { "status": "Under Investigation", "alert_id": "C8CF4194-133F-4F5A-ACB1-FFFB00573468, F8F608A7-0256-42E0-A527-FFF4749C1A8B", } resp = varonis_update_alert_status_command(client, args) assert resp is True def test_varonis_close_alert_command(requests_mock): from VaronisDataSecurityPlatform import varonis_close_alert_command requests_mock.post("https://test.com/api/alert/alert/SetStatusToAlerts", json=True) client = Client(base_url="https://test.com", verify=False, proxy=False) args = { "close_reason": "Account misclassification", "alert_id": "C8CF4194-133F-4F5A-ACB1-FFFB00573468, F8F608A7-0256-42E0-A527-FFF4749C1A8B", } resp = varonis_close_alert_command(client, args) assert resp is True def test_varonis_get_alerted_events_command(mocker: MockerFixture): """ When: - Get alerted events from Varonis api Then - Assert output prefix data is as expected - Assert mapping works as expected """ from VaronisDataSecurityPlatform import varonis_get_alerted_events_command client = Client(base_url="https://test.com", verify=False, proxy=False) mocker.patch.object( client, "varonis_get_alerted_events", return_value=util_load_json("test_data/varonis_get_alerted_events_response.json") ) args = util_load_json("test_data/demisto_alerted_events_args.json") expected_outputs = util_load_json("test_data/varonis_get_alerted_events_command_output.json") result = varonis_get_alerted_events_command(client, args) assert result.outputs_prefix == "Varonis" assert result.outputs == expected_outputs def test_fetch_incidents(mocker: MockerFixture, requests_mock: MockerFixture): from VaronisDataSecurityPlatform import fetch_incidents fetch_output = util_load_json("test_data/varonis_fetch_incidents_response.json") requests_mock.get( "https://test.com/api/alert/alert/GetAlerts" "?ruleName=Suspicious&fromAlertSeqId=150&status=Open&severity=high&severity=medium&descendingOrder=True" "&aggregate=True&offset=0&maxResult=50", json=fetch_output, ) client = Client(base_url="https://test.com", verify=False, proxy=False) mocker.patch.object(client, "varonis_get_enum", return_value=util_load_json("test_data/varonis_get_enum_response.json")) mocker.patch.object(demisto, "debug", return_value=None) last_run = {"last_fetched_id": 150} next_run, incidents = fetch_incidents( client=client, max_results=50, alert_status="Open", severity="Medium", threat_model="Suspicious", last_run=last_run, first_fetch_time="3 days", ) expected_outputs = util_load_json("test_data/varonis_fetch_incidents_output.json") assert next_run == {"last_fetched_id": 152} assert incidents == [ { "name": "Varonis alert DNS CUSTOM - Copy(2)", "occurred": "2022-04-13T10:01:35Z", "rawJSON": json.dumps(expected_outputs[0]), "type": "Varonis DSP Incident", "severity": 3, }, { "name": "Varonis alert DNS CUSTOM", "occurred": "2022-04-13T10:01:33Z", "rawJSON": json.dumps(expected_outputs[1]), "type": "Varonis DSP Incident", "severity": 3, }, ] def test_enrich_with_url(): from VaronisDataSecurityPlatform import enrich_with_url obj = {} baseUrl = "http://test.com" id = "1" expectedUrl = f"{baseUrl}/#/app/analytics/entity/Alert/{id}" enrich_with_url(obj, baseUrl, id) assert obj["Url"] == expectedUrl baseUrl = "http://test.com/" enrich_with_url(obj, baseUrl, id) assert obj["Url"] == expectedUrl def test_case_insensitive(): from VaronisDataSecurityPlatform import strEqual assert strEqual(None, None) assert not strEqual(None, "None") assert not strEqual("None", None) assert not strEqual("None", "None1") assert strEqual("", None) assert strEqual(None, "") assert strEqual("None", "None") assert strEqual("None", "none") assert strEqual("none", "None") def test_get_sids_user(mocker: MockerFixture): from VaronisDataSecurityPlatform import DISPLAY_NAME_KEY, NON_EXISTENT_SID, get_sids client = Client(base_url="https://test.com", verify=False, proxy=False) mocker.patch.object(client, "varonis_get_users", return_value=util_load_json("test_data/varonis_get_users_api_response.json")) result = get_sids(client, ["not_exist"], None, DISPLAY_NAME_KEY) assert result[0] == NON_EXISTENT_SID result = get_sids(client, [], None, DISPLAY_NAME_KEY) assert len(result) == 0 result = get_sids(client, ["Administrator"], None, DISPLAY_NAME_KEY) assert result[0] == 509 def test_convert_to_demisto_severity(): from VaronisDataSecurityPlatform import IncidentSeverity, convert_to_demisto_severity assert convert_to_demisto_severity(None) == IncidentSeverity.LOW assert convert_to_demisto_severity("Low") == IncidentSeverity.LOW assert convert_to_demisto_severity("Medium") == IncidentSeverity.MEDIUM assert convert_to_demisto_severity("High") == IncidentSeverity.HIGH def test_get_excluded_severitires(): from VaronisDataSecurityPlatform import get_included_severitires assert get_included_severitires(None) == [] assert get_included_severitires("Low") == ["high", "medium", "low"] assert get_included_severitires("Medium") == ["high", "medium"] assert get_included_severitires("High") == ["high"] def test_varonis_get_auth_url(requests_mock: MockerFixture): client = Client(base_url="https://test.com", verify=False, proxy=False) fetch_output = util_load_json("test_data/demisto_auth_configuration_response.json") requests_mock.get("https://test.com/auth/configuration", json=fetch_output) assert client.varonis_get_auth_url() == "https://test.com/DatAdvantage/api/authentication/win" def test_varonis_authenticate(requests_mock: MockerFixture): client = Client(base_url="https://test.com", verify=False, proxy=False) fetch_output = util_load_json("test_data/demisto_auth_response.json") auth_url = "https://test.com/DatAdvantage/api/authentication/win" requests_mock.post(auth_url, json=fetch_output) client.varonis_authenticate("user", "password", auth_url) assert client._headers["Authorization"] == "bearer token_here"