Skip to content

Commit 3eddb4c

Browse files
committed
fix phishing protection url
1 parent 90f00c7 commit 3eddb4c

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-AddStandardsTemplate.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ function Invoke-AddStandardsTemplate {
3030
PartitionKey = 'StandardsTemplateV2'
3131
GUID = "$GUID"
3232
}
33+
34+
$AddObject = @{
35+
PartitionKey = 'InstanceProperties'
36+
RowKey = 'CIPPURL'
37+
Value = [string]([System.Uri]$Headers.'x-ms-original-url').Host
38+
}
39+
$ConfigTable = Get-CIPPTable -tablename 'Config'
40+
Add-AzDataTableEntity @ConfigTable -Entity $AddObject -Force
41+
3342
Write-LogMessage -headers $Request.Headers -API $APINAME -message "Standards Template $($Request.body.templateName) with GUID $GUID added/edited." -Sev 'Info'
3443
$body = [pscustomobject]@{'Results' = 'Successfully added template'; Metadata = @{id = $GUID } }
3544

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardPhishProtection.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,18 @@ function Invoke-CIPPStandardPhishProtection {
3535

3636
$TenantId = Get-Tenants | Where-Object -Property defaultDomainName -EQ $tenant
3737

38+
$Table = Get-CIPPTable -TableName Config
39+
$CippConfig = (Get-CIPPAzDataTableEntity @Table)
40+
$CIPPUrl = ($CippConfig | Where-Object { $_.RowKey -eq 'CIPPURL' }).Value
41+
3842
try {
3943
$currentBody = (New-GraphGetRequest -Uri "https://graph.microsoft.com/beta/organization/$($TenantId.customerId)/branding/localizations/0/customCSS" -tenantid $tenant)
4044
} catch {
4145
Write-LogMessage -API 'Standards' -tenant $tenant -message "Could not get the branding for $($Tenant). This tenant might not have premium licenses available: $($_.Exception.Message)" -sev Error
4246
}
4347
$CSS = @"
4448
.ext-sign-in-box {
45-
background-image: url(https://clone.cipp.app/api/PublicPhishingCheck?Tenantid=$($tenant)&URL=$($Settings.URL));
49+
background-image: url(https://clone.cipp.app/api/PublicPhishingCheck?Tenantid=$($tenant)&URL=https://$($CIPPUrl));
4650
}
4751
"@
4852
if ($Settings.remediate -eq $true) {

0 commit comments

Comments
 (0)