8000 [pull] master from KelvinTegelaar:master by pull[bot] · Pull Request #70 · gocovi/CIPP-API · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[pull] master from KelvinTegelaar:master #70

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clic 8000 king “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
May 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
158a175
chore: Update comments
kris6673 May 28, 2025
323e64d
feat: Add Invoke-CIPPStandardEXODirectSend function to manage Direct …
kris6673 May 28, 2025
1c82501
chore: Simplify documentation link generation in Update-StandardsComm…
kris6673 May 28, 2025
0eb798d
better error handling and logging
kris6673 May 28, 2025
e3ad53e
casing
kris6673 May 28, 2025
bd14e9b
chore: update licenses data to newest from MS
kris6673 May 28, 2025
d0f585e
fix email check
JohnDuprey May 28, 2025
8326331
Update Invoke-CIPPStandardUserSubmissions.ps1
JohnDuprey May 28, 2025
579e129
feat: Add mailbox recipient limits standardization script
Jr7468 May 28, 2025
800d924
feat: Add mail contact deployment standard script
Jr7468 May 28, 2025
0dddb94
Created a function to remove proxy addresses, and set primary smtp ad…
Jr7468 May 29, 2025
bad2418
typo
JohnDuprey May 29, 2025
5b29480
add Terrl word
kris6673 May 29, 2025
5fc9a6d
Feat: Add TERRL status scripted alert
kris6673 May 29, 2025
11dca75
Add functionality to add proxy addresses
Jr7468 May 29, 2025
4ae5cd9
Make it possible to ignore disabled apps, backwards compatible
Zacgoose May 30, 2025
f1f6860
Update sherweb license management
JohnDuprey May 30, 2025
6cbbd8d
Chore: Update license files to newest from MS
kris6673 May 30, 2025
2a07d7f
Merge pull request #1463 from Zacgoose/huntress-app-alert
KelvinTegelaar May 30, 2025
a602353
Merge pull request #1460 from kris6673/issue4166
KelvinTegelaar May 30, 2025
8ea4175
Merge pull request #1458 from Jr7468/RecipientLimitStandard
KelvinTegelaar May 30, 2025
10a23c7
Merge pull request #14 8000 54 from kris6673/add-team-modernize
KelvinTegelaar May 30, 2025
55853ad
Merge pull request #1453 from kris6673/feat-EXODirectSend
KelvinTegelaar May 30, 2025
65ac022
Merge pull request #1456 from kris6673/license-updates
KelvinTegelaar May 30, 2025
64e9922
Merge pull request #1459 from Jr7468/ProxyAddresses
KelvinTegelaar May 30, 2025
5481e11
incorrect alias
KelvinTegelaar May 30, 2025
2dec5a3
Update Invoke-ListDomainHealth.ps1
JohnDuprey May 30, 2025
34a7089
directory object lookup function
JohnDuprey May 30, 2025
ac16961
improve ca policy list
JohnDuprey May 30, 2025
3ec1ead
up version
JohnDuprey May 30, 2025
3e93d5d
Merge pull request #1465 from KelvinTegelaar/dev
JohnDuprey May 30, 2025
3bc409d
Update Invoke-ExecCreateSAMApp.ps1
JohnDuprey May 30, 2025
b8ffaad
Merge pull request #1466 from KelvinTegelaar/dev
JohnDuprey May 30, 2025
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
123 changes: 122 additions & 1 deletion ConversionTable.csv

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ function Get-CIPPAlertHuntressRogueApps {
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
$TenantFilter,
[Parameter(Mandatory = $false)]
[bool]$IgnoreDisabledApps = $false
)

try {
$RogueApps = Invoke-RestMethod -Uri 'https://raw.githubusercontent.com/huntresslabs/rogueapps/main/public/rogueapps.json'
$RogueAppFilter = $RogueApps.appId -join "','"
$ServicePrincipals = New-GraphGetRequest -uri "https://graph.microsoft.com/beta/servicePrincipals?`$filter=appId in ('$RogueAppFilter')" -tenantid $TenantFilter
# If IgnoreDisabledApps is true, filter out disabled service principals
if ($IgnoreDisabledApps) {
$ServicePrincipals = $ServicePrincipals | Where-Object { $_.accountEnabled -eq $true }
}

if (($ServicePrincipals | Measure-Object).Count -gt 0) {
$AlertData = foreach ($ServicePrincipal in $ServicePrincipals) {
Expand Down
39 changes: 39 additions & 0 deletions Modules/CIPPCore/Public/Alerts/Get-CIPPAlertTERRL.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
function Get-CIPPAlertTERRL {
<#
.FUNCTIONALITY
Entrypoint
#>
[CmdletBinding()]
Param (
[Parameter(Mandatory = $false)]
[Alias('input')]
$InputValue,
$TenantFilter
)

try {
# Set threshold with fallback to 80%
$Threshold = if ([string]::IsNullOrWhiteSpace($InputValue)) { 80 } else { [int]$InputValue }

# Get TERRL status
$TerrlStatus = New-ExoRequest -tenantid $TenantFilter -cmdlet 'Get-LimitsEnforcementStatus'

if ($TerrlStatus) {
$UsagePercentage = [math]::Round(($TerrlStatus.ObservedValue / $TerrlStatus.Threshold) * 100, 2)

if ($UsagePercentage -gt $Threshold) {
$AlertData = [PSCustomObject]@{
UsagePercentage = $UsagePercentage
CurrentVolume = $TerrlStatus.ObservedValue
ThresholdLimit = $TerrlStatus.Threshold
EnforcementEnabled = $TerrlStatus.EnforcementEnabled
Verdict = $TerrlStatus.Verdict
Message = 'Tenant is at {0}% of their TERRL limit (using {1} of {2} messages). Tenant Enforcement Status: {3}' -f $UsagePercentage, $TerrlStatus.ObservedValue, $TerrlStatus.Threshold, $TerrlStatus.Verdict
}
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
}
}
} catch {
Write-AlertMessage -tenant $($TenantFilter) -message "Could not get TERRL status for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
}
}
30 changes: 20 additions & 10 deletions Modules/CIPPCore/Public/Authentication/Get-CIPPAccessRole.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,34 @@ function Get-CIPPAccessRole {
Internal
#>
[CmdletBinding()]
param($Request)
param($Request, $Headers)

$CacheAccessUserRoleTable = Get-CIPPTable -tablename 'cacheAccessUserRole'
$CachedRoles = Get-CIPPAzDataTableEntity @CacheAccessUserRoleTable -Filter "PartitionKey eq 'AccessUser' and RowKey eq '$($Request.Headers.'x-ms-client-principal-name')'" | Select-Object -ExpandProperty Role | ConvertFrom-Json
$Headers = $Request.Headers ?? $Headers

$SwaCreds = ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($request.headers.'x-ms-client-principal')) | ConvertFrom-Json)
$CacheAccessUserRoleTable = Get-CIPPTable -tablename 'cacheAccessUserRoles'

$SwaCreds = ([System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($Headers.'x-ms-client-principal')) | ConvertFrom-Json)
$SwaRoles = $SwaCreds.userRoles
$Username = $SwaCreds.userDetails

$CachedRoles = Get-CIPPAzDataTableEntity @CacheAccessUserRoleTable -Filter "PartitionKey eq 'AccessUser' and RowKey eq '$Username'" | Select-Object -ExpandProperty Role | ConvertFrom-Json

Write-Information "SWA Roles: $($SwaRoles -join ', ')"
Write-Information "Cached Roles: $($CachedRoles -join ', ')"

# Combine SWA roles and cached roles into a single deduplicated list
$AllRoles = [System.Collections.Generic.List[string]]::new()
if ($null -ne $SwaRoles) {
$AllRoles.AddRange($SwaRoles)

foreach ($Role in $SwaRoles) {
if (-not $AllRoles.Contains($Role)) {
$AllRoles.Add($Role)
}
}
if ($null -ne $CachedRoles) {
$AllRoles.AddRange($CachedRoles)
foreach ($Role in $CachedRoles) {
if (-not $AllRoles.Contains($Role)) {
$AllRoles.Add($Role)
}
}

# Remove duplicates and ensure we have a clean array
$CombinedRoles = $AllRoles | Select-Object -Unique

# For debugging
Expand Down
Loading
0