Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/Conventional_Commits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const title = context.payload.pull_request.title || '';
const pattern = /^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\(.+\))?!?: .+/;
const pattern = /^(feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert)(\(.+\))?!?: .+/i;

if (pattern.test(title)) {
console.log(`✓ PR title follows Conventional Commits format: "${title}"`);
Expand Down
2 changes: 1 addition & 1 deletion Modules/CIPPCore/Public/Add-CIPPApplicationPermission.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function Add-CIPPApplicationPermission {
if (!$svcPrincipalId) { continue }

foreach ($SingleResource in $App.ResourceAccess | Where-Object -Property Type -EQ 'Role') {
if ($SingleResource.id -in $CurrentRoles.appRoleId) { continue }
if ($CurrentRoles | Where-Object { $_.appRoleId -eq $SingleResource.id -and $_.resourceId -eq $svcPrincipalId.id }) { continue }
[pscustomobject]@{
principalId = $($ourSVCPrincipal.id)
resourceId = $($svcPrincipalId.id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ function Get-CIPPRolePermissions {
try {
$ValidPermissions = Get-CippHttpPermissions
if (@($ValidPermissions).Count -gt 0) {
$Permissions = @($Permissions | Where-Object { $ValidPermissions -contains $_ })
$ValidBases = [System.Collections.Generic.HashSet[string]]::new([System.StringComparer]::OrdinalIgnoreCase)
foreach ($ValidPermission in $ValidPermissions) {
$null = $ValidBases.Add(($ValidPermission -replace '\.(ReadWrite|Read)$', ''))
}
$Permissions = @($Permissions | Where-Object {
$ValidBases.Contains(($_ -replace '\.(ReadWrite|Read)$', ''))
})
}
} catch {
Write-Warning "Unable to resolve valid permissions to filter role '$RoleName': $($_.Exception.Message)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function Invoke-ExecCompareIntunePolicy {
'windowsQualityUpdatePolicies' = 'windowsQualityUpdatePolicies'
'windowsQualityUpdateProfiles' = 'windowsQualityUpdateProfiles'
'Intents' = 'Intents'
'ManagedAppPolicies' = 'AppProtection'
}

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ function Invoke-ListIntunePolicy {
method = 'GET'
url = "/deviceManagement/intents?`$top=1000"
}
@{
id = 'ManagedAppPolicies'
method = 'GET'
url = '/deviceAppManagement/managedAppPolicies?$orderby=displayName'
}
)

$BulkResults = New-GraphBulkRequest -Requests $BulkRequests -tenantid $TenantFilter
Expand All @@ -236,6 +241,7 @@ function Invoke-ListIntunePolicy {
$URLName = $_.Id
$_.body.Value | ForEach-Object {
$AssignmentContext = $_.'assignments@odata.context'
$PolicyODataType = $_.'@odata.type'
$policyTypeName = switch -Wildcard ($AssignmentContext) {
'*microsoft.graph.windowsIdentityProtectionConfiguration*' { 'Identity Protection' }
'*microsoft.graph.windows10EndpointProtectionConfiguration*' { 'Endpoint Protection' }
Expand Down Expand Up @@ -264,6 +270,14 @@ function Invoke-ListIntunePolicy {
$policyTypeName = switch ($URLName) {
'deviceCompliancePolicies' { 'Compliance Policy' }
'Intents' { 'Endpoint Security' }
'ManagedAppPolicies' {
switch -Wildcard ($PolicyODataType) {
'*iosManagedAppProtection*' { 'iOS App Protection' }
'*androidManagedAppProtection*' { 'Android App Protection' }
'*windowsManagedAppProtection*' { 'Windows App Protection' }
default { 'App Protection' }
}
}
default { $AssignmentContext }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1552,6 +1552,16 @@ function Invoke-NinjaOneTenantSync {

### M365 Links Section
if ($MappedFields.TenantLinks) {
try {
$SharePointAdminUrl = (Get-SharePointAdminLink -TenantFilter $TenantFilter).AdminUrl
} catch {
$SharePointTenantName = ($Customer.initialDomainName -split '\.')[0]
if ($SharePointTenantName) {
Write-Information "NinjaOneSync: Get-SharePointAdminLink failed for $($Customer.defaultDomainName), using fallback SharePoint admin URL '$SharePointAdminUrl'. Error: $($_.Exception.Message)"
$SharePointAdminUrl = "https://$SharePointTenantName-admin.sharepoint.com"
}
}

$ManagementLinksData = @(
@{
Name = 'M365 Admin Portal'
Expand All @@ -1575,7 +1585,7 @@ function Invoke-NinjaOneTenantSync {
},
@{
Name = 'SharePoint Admin'
Link = "https://admin.microsoft.com/Partner/beginclientsession.aspx?CTID=$($Customer.customerId)&CSDEST=SharePoint"
Link = $SharePointAdminUrl ?? "https://$($Customer.defaultDomainName)-admin.sharepoint.com"
Icon = 'fas fa-shapes'
},
@{
Expand Down Expand Up @@ -2241,7 +2251,7 @@ function Invoke-NinjaOneTenantSync {
Write-LogMessage -API 'NinjaOneSync' -tenant $TenantFilter -message "CVE sync — skipped $SkippedCount rows (missing deviceName or cveId)" -sev 'Warning'
}
}
$CsvBytes = New-VulnCsvBytes -TenantFilter $TenantFilter -Rows $CsvRows -Headers @($DeviceIdHeader, $CveIdHeader)
$CsvBytes = New-VulnCsvBytes -Rows $CsvRows -Headers @($DeviceIdHeader, $CveIdHeader)

if ($CsvBytes -and $CsvBytes.Length -gt 0) {
$UploadUri = "$NinjaBaseUrl/vulnerability/scan-groups/$ResolvedScanGroupId/upload"
Expand Down
Loading