Skip to content

Commit c5cab14

Browse files
committed
fix breach alert
track differences across days by using a single partition key
1 parent 435440a commit c5cab14

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Modules/CIPPCore/Public/Alerts/Get-CippAlertBreachAlert.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Get-CippAlertBreachAlert {
1212
)
1313
try {
1414
$Search = New-BreachTenantSearch -TenantFilter $TenantFilter
15-
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $Search
15+
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $Search -PartitionKey BreachAlert
1616
} catch {
1717
Write-AlertMessage -tenant $($TenantFilter) -message "Could not get New Breaches for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
1818
}

Modules/CIPPCore/Public/GraphHelper/Write-AlertTrace.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ function Write-AlertTrace {
66
param(
77
$cmdletName,
88
$data,
9-
$tenantFilter
9+
$tenantFilter,
10+
[string]$PartitionKey = (Get-Date -UFormat '%Y%m%d').ToString()
1011
)
1112
$Table = Get-CIPPTable -tablename AlertLastRun
12-
$PartitionKey = (Get-Date -UFormat '%Y%m%d').ToString()
1313
#Get current row and compare the $logData object. If it's the same, don't write it.
1414
$Row = Get-CIPPAzDataTableEntity @table -Filter "RowKey eq '$($tenantFilter)-$($cmdletName)' and PartitionKey eq '$PartitionKey'"
1515
try {

0 commit comments

Comments
 (0)