Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
187 changes: 185 additions & 2 deletions Solutions/QualysVM/Analytic Rules/HighNumberofVulnDetectedV2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,189 @@ tactics:
relevantTechniques:
- T1190
query: |
let QualysHostDetection = view () {
let QualysHostDetection_view = view () {
QualysHostDetection_CL
| mv-expand todynamic(Detections_s)
| extend
Severity_s = tostring(Detections_s.Severity),
Status_s = tostring(Detections_s.Status),
QID_s = tostring(Detections_s.Results)
| extend
TenantId = column_ifexists('TenantId', ''),
SourceSystem = column_ifexists('SourceSystem', ''),
MG = column_ifexists('MG', ''),
ManagementGroupName = column_ifexists('ManagementGroupName', ''),
TimeGenerated = column_ifexists('TimeGenerated', ''),
Computer = column_ifexists('Computer', ''),
RawData = column_ifexists('RawData', ''),
Id = column_ifexists('Id_s', ''),
HostId = column_ifexists('HostId_s', ''),
HostTags = column_ifexists('HostTags_s', ''),
IPAddress = column_ifexists('IPAddress', ''),
TrackingMethod = column_ifexists('TrackingMethod_s', ''),
OperatingSystem = column_ifexists('OperatingSystem_s', ''),
DnsName = column_ifexists('DnsName_s', ''),
NetBios = column_ifexists('NetBios_s', ''),
QGHostId = column_ifexists('QGHostId_g', ''),
LastScanDateTime = column_ifexists('LastScanDateTime_t', ''),
LastVMScannedDateTime = column_ifexists('LastVMScannedDateTime_t', ''),
LastVMAuthScannedDateTime = column_ifexists('LastVMAuthScannedDateTime_t', ''),
QID = column_ifexists('QID_s', ''),
SSL = column_ifexists('SSL_s', ''),
Status = column_ifexists('Status_s', ''),
Ignored = column_ifexists('Ignored_s', ''),
Severity = column_ifexists('Severity_s', ''),
Disabled = column_ifexists('Disabled_s', ''),
LastFixed = column_ifexists('LastFixed_t', ''),
LastFound = column_ifexists('LastFound_t', ''),
TimesFound = column_ifexists('TimesFound_s', ''),
FirstFound = column_ifexists('FirstFound_t', ''),
LastUpdate = column_ifexists('LastUpdate_t', datetime(null)),
LastProcessedDateTime = column_ifexists('LastProcessed_t', datetime(null)),
Result_column_count = tostring(column_ifexists('Result_column_count_d', '')),
Results_0 = column_ifexists('Results_0_s', ''),
Type = column_ifexists('Type', ''),
_ResourceId = column_ifexists('_ResourceId', '')
};
let QualysHostDetectionV2_view = view () {
QualysHostDetectionV2_CL
| extend
TenantId = column_ifexists('TenantId', ''),
SourceSystem = column_ifexists('SourceSystem', ''),
MG = column_ifexists('MG', ''),
ManagementGroupName = column_ifexists('ManagementGroupName', ''),
TimeGenerated = column_ifexists('TimeGenerated', ''),
Computer = column_ifexists('Computer', ''),
RawData = column_ifexists('RawData', ''),
Id = column_ifexists('Id_s', ''),
HostId = column_ifexists('HostId_s', ''),
IPAddress = column_ifexists('IPAddress', ''),
TrackingMethod = column_ifexists('TrackingMethod_s', ''),
OperatingSystem = column_ifexists('OperatingSystem_s', ''),
DnsName = column_ifexists('DnsName_s', ''),
NetBios = column_ifexists('NetBios_s', ''),
QGHostId = column_ifexists('QGHostId_g', ''),
LastScanDateTime = column_ifexists('LastScanDateTime_t', ''),
LastVMScannedDateTime = column_ifexists('LastVMScannedDateTime_t', ''),
LastVMAuthScannedDateTime = column_ifexists('LastVMAuthScannedDateTime_t', ''),
QID = column_ifexists('QID_s', ''),
SSL = column_ifexists('SSL_s', ''),
Status = column_ifexists('Status_s', ''),
Ignored = column_ifexists('Ignored_s', ''),
Severity = column_ifexists('Severity_s', ''),
Disabled = column_ifexists('Disabled_s', ''),
LastFixed = column_ifexists('LastFixed_t', ''),
LastFound = column_ifexists('LastFound_t', ''),
TimesFound = column_ifexists('TimesFound_s', ''),
FirstFound = column_ifexists('FirstFound_t', ''),
LastUpdate = column_ifexists('LastUpdate_t', datetime(null)),
LastProcessedDateTime = column_ifexists('LastProcessed_t', datetime(null)),
Result_column_count = tostring(column_ifexists('Result_column_count_d', '')),
Results_0 = column_ifexists('Results_0_s', ''),
Type = column_ifexists('Type', ''),
_ResourceId = column_ifexists('_ResourceId', '')
};
let QualysHostDetectionV3_view = view () {
QualysHostDetectionV3_CL
| extend DetectionList = todynamic(DetectionList)
| extend DetectionItems = iff(
gettype(DetectionList.DETECTION) == "array",
DetectionList.DETECTION,
pack_array(DetectionList.DETECTION)
)
| mv-expand Detections = DetectionItems to typeof(dynamic)
| extend
TenantId = column_ifexists('TenantId', ''),
SourceSystem = column_ifexists('SourceSystem', ''),
MG = column_ifexists('MG', ''),
ManagementGroupName = column_ifexists('ManagementGroupName', ''),
TimeGenerated = column_ifexists('TimeGenerated', ''),
Computer = column_ifexists('Computer', ''),
RawData = column_ifexists('RawData', ''),
Id = column_ifexists('Id', ''),
HostId = column_ifexists('HostId', ''),
HostTags = column_ifexists('HostTags', ''),
IPAddress = column_ifexists('IPAddress', ''),
TrackingMethod = column_ifexists('TrackingMethod', ''),
OperatingSystem = column_ifexists('OperatingSystem', ''),
DnsName = column_ifexists('DnsName', ''),
NetBios = column_ifexists('NetBios', ''),
QGHostId = column_ifexists('QGHostId', ''),
LastScanDateTime = column_ifexists('LastScanDateTime', ''),
LastVMScannedDateTime = column_ifexists('LastVMScannedDateTime', ''),
LastVMAuthScannedDateTime = column_ifexists('LastVMAuthScannedDateTime', ''),
QID = tostring(Detections.QID),
SSL = tostring(Detections.SSL),
Status = tostring(Detections.STATUS),
Ignored = tostring(Detections.IS_IGNORED),
Severity = tostring(Detections.SEVERITY),
Disabled = tostring(Detections.IS_DISABLED),
LastFixed = todatetime(Detections.LAST_FIXED_DATETIME),
LastFound = todatetime(Detections.LAST_FOUND_DATETIME),
TimesFound = tostring(Detections.TIMES_FOUND),
FirstFound = todatetime(Detections.FIRST_FOUND_DATETIME),
LastUpdate = todatetime(Detections.LAST_UPDATE_DATETIME),
LastProcessedDateTime = coalesce(
todatetime(Detections.LAST_PROCESSED_DATETIME),
todatetime(Detections.LAST_PROCESSED_DATE)),
Results_0 = tostring(coalesce(Detections.RESULTS['#cdata-section'], Detections.RESULTS)),
Result_column_count = "1",
Type = tostring(Detections.TYPE),
_ResourceId = column_ifexists('_ResourceId', '')
| extend _IngestionTime = todatetime(TimeGenerated)
| summarize arg_max(_IngestionTime, *) by HostId, QID, Status, SSL, Ignored, Severity, Disabled, LastFixed, LastFound, TimesFound, FirstFound, Result_column_count, Results_0, Type
| project-away _IngestionTime
};
union isfuzzy=true
(QualysHostDetection_view),
(QualysHostDetectionV2_view),
(QualysHostDetectionV3_view)
| project
TenantId,
SourceSystem,
MG,
ManagementGroupName,
TimeGenerated,
Computer,
RawData,
Id,
HostId,
HostTags,
IPAddress,
TrackingMethod,
OperatingSystem,
DnsName,
NetBios,
QGHostId,
LastScanDateTime,
LastVMScannedDateTime,
LastVMAuthScannedDateTime,
QID,
SSL,
Type,
Status,
Ignored,
Severity,
Disabled,
LastFixed,
LastFound,
TimesFound,
FirstFound,
LastUpdate,
LastProcessedDateTime,
Result_column_count,
Results_0,
_ResourceId
| extend
HostId = tostring(HostId),
QID = tostring(QID),
Status = tostring(Status),
LastProcessedDateTime = todatetime(LastProcessedDateTime),
LastUpdate = todatetime(LastUpdate),
LastFound = todatetime(LastFound)
| extend DetectionTime = coalesce(LastProcessedDateTime, LastUpdate, LastFound, todatetime(TimeGenerated))
};
let threshold = 10;
QualysHostDetection
| where Severity == "5"
Expand All @@ -25,11 +208,11 @@ query: |
entityMappings:
- entityType: Host
fieldMappings:
- identifier: FullName
- identifier: NetBiosName
columnName: NetBios
- entityType: IP
fieldMappings:
- identifier: Address
columnName: IPAddress
version: 1.0.4
version: 3.2.1
kind: Scheduled
Loading