Skip to content

Commit 608c867

Browse files
added check page
1 parent 558a91c commit 608c867

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using namespace System.Net
2+
3+
function Invoke-ListCheckExtAlerts {
4+
<#
5+
.FUNCTIONALITY
6+
Entrypoint
7+
.ROLE
8+
CIPP.Core.Read
9+
#>
10+
[CmdletBinding()]
11+
param($Request, $TriggerMetadata)
12+
13+
$APIName = $Request.Params.CIPPEndpoint
14+
$Headers = $Request.Headers
15+
16+
$TenantFilter = $Request.Query.tenantFilter
17+
$Table = Get-CIPPTable -tablename CheckExtensionAlerts
18+
19+
if ($TenantFilter -and $TenantFilter -ne 'AllTenants') {
20+
$Filter = "PartitionKey eq '$TenantFilter'"
21+
} else {
22+
$Filter = $null
23+
}
24+
25+
try {
26+
$Alerts = Get-CIPPAzDataTableEntity @Table -Filter $Filter
27+
} catch {
28+
Write-LogMessage -headers $Headers -API $APIName -message "Failed to retrieve check extension alerts: $($_.Exception.Message)" -Sev 'Error'
29+
$Alerts = @()
30+
}
31+
32+
# Associate values to output bindings by calling 'Push-OutputBinding'.
33+
Push-OutputBinding -Name Response -Value ([HttpResponseContext]@{
34+
StatusCode = [HttpStatusCode]::OK
35+
Body = @($Alerts | Sort-Object -Property Timestamp -Descending)
36+
})
37+
}

Modules/CIPPCore/Public/Entrypoints/Invoke-PublicPhishingCheck.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function Invoke-PublicPhishingCheck {
2323
$TableBody = @{
2424
RowKey = "$ID"
2525
PartitionKey = [string]$Tenant.defaultDomainName
26+
tenantFilter = [string]$Tenant.defaultDomainName
2627
message = [string]$Message
2728
type = [string]$request.body.type
2829
url = [string]$request.body.url

0 commit comments

Comments
 (0)