Skip to content

Commit 02a9454

Browse files
authored
Merge pull request #78 from KelvinTegelaar/master
[pull] master from KelvinTegelaar:master
2 parents 8c3bc6b + c89c54a commit 02a9454

File tree

317 files changed

+239221
-1948
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

317 files changed

+239221
-1948
lines changed

.github/workflows/upload_dev.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Upload Dev zip
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
release:
10+
if: github.event.repository.fork == false && github.event_name == 'push'
11+
name: Upload to Azure
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
# Checkout the repository
16+
- name: Checkout Code
17+
uses: actions/checkout@v3
18+
19+
# Create ZIP File in a New Source Directory
20+
- name: Prepare and Zip Release Files
21+
run: |
22+
mkdir -p src/releases
23+
zip -r src/releases/dev.zip . \
24+
--exclude "./src/releases/*" \
25+
--exclude ".*" \
26+
--exclude ".*/**"
27+
28+
# Upload to Azure Blob Storage
29+
- name: Azure Blob Upload with Destination folder defined
30+
uses: LanceMcCarthy/[email protected]
31+
with:
32+
connection_string: ${{ secrets.AZURE_CONNECTION_STRING }}
33+
container_name: cipp-api
34+
source_folder: src/releases/
35+
destination_folder: /
36+
delete_if_exists: true

Config/CyberEssentials.BPATemplate.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@
9292
"isMFARegistered",
9393
"defaultMFAMethod"
9494
],
95-
"URL": "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails"
95+
"URL": "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails",
96+
"Parameters": {
97+
"asApp": "True"
98+
}
9699
}
97100
]
98101
}

Config/cipp-roles.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"readonly": {
3+
"include": ["*.Read"],
4+
"exclude": ["CIPP.SuperAdmin.*"]
5+
},
6+
"editor": {
7+
"include": ["*.Read", "*.ReadWrite"],
8+
"exclude": [
9+
"CIPP.SuperAdmin.*",
10+
"CIPP.Admin.*",
11+
"CIPP.AppSettings.*",
12+
"Tenant.Standards.ReadWrite"
13+
]
14+
},
15+
"admin": {
16+
"include": ["*"],
17+
"exclude": ["CIPP.SuperAdmin.*"]
18+
},
19+
"superadmin": {
20+
"include": ["*"],
21+
"exclude": []
22+
}
23+
}

Config/schemaDefinitions.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[
2+
{
3+
"id": "cippUser",
4+
"description": "CIPP User Schema",
5+
"targetTypes": ["User"],
6+
"properties": [
7+
{ "name": "jitAdminEnabled", "type": "Boolean" },
8+
{ "name": "jitAdminExpiration", "type": "DateTime" },
9+
{ "name": "mailboxType", "type": "String" },
10+
{ "name": "archiveEnabled", "type": "Boolean" },
11+
{ "name": "autoExpandingArchiveEnabled", "type": "Boolean" },
12+
{ "name": "perUserMfaState", "type": "String" }
13+
],
14+
"status": "Available"
15+
}
16+
]

ConversionTable.csv

Lines changed: 222 additions & 0 deletions
Large diffs are not rendered by default.

Modules/CIPPCore/Public/Add-CIPPScheduledTask.ps1

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,15 @@ function Add-CIPPScheduledTask {
6464
if ([int64]$task.ScheduledTime -eq 0 -or [string]::IsNullOrEmpty($task.ScheduledTime)) {
6565
$task.ScheduledTime = [int64](([datetime]::UtcNow) - (Get-Date '1/1/1970')).TotalSeconds
6666
}
67-
67+
$excludedTenants = if ($task.excludedTenants.value) {
68+
$task.excludedTenants.value -join ','
69+
}
6870
$entity = @{
6971
PartitionKey = [string]'ScheduledTask'
7072
TaskState = [string]'Planned'
7173
RowKey = [string]$RowKey
7274
Tenant = $task.TenantFilter.value ? "$($task.TenantFilter.value)" : "$($task.TenantFilter)"
75+
excludedTenants = [string]$excludedTenants
7376
Name = [string]$task.Name
7477
Command = [string]$task.Command.value
7578
Parameters = [string]$Parameters
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
2+
function Get-CIPPAlertDefenderIncidents {
3+
<#
4+
.FUNCTIONALITY
5+
Entrypoint
6+
#>
7+
[CmdletBinding()]
8+
param(
9+
[Parameter(Mandatory = $false)]
10+
[Alias('input')]
11+
$InputValue,
12+
$TenantFilter
13+
)
14+
try {
15+
$AlertData = New-GraphGetRequest -uri "https://graph.microsoft.com/v1.0/security/incidents?`$top=50&`$filter=status eq 'active'" -tenantid $TenantFilter | ForEach-Object {
16+
"Incident ID $($_.id): Created at $($_.createdDateTime). Severity: $($_.severity). `nIncident name: $($_.displayName). Incident URL: $($_.incidentWebUrl)."
17+
}
18+
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData
19+
20+
} catch {
21+
# Pretty sure this one is gonna be spammy cause of licensing issues, so it's commented out -Bobby
22+
# Write-AlertMessage -tenant $($TenantFilter) -message "Could not get Defender incident data for $($TenantFilter): $(Get-NormalizedError -message $_.Exception.message)"
23+
}
24+
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ function Get-CIPPAlertEntraLicenseUtilization {
1818
$Alerts = [System.Collections.Generic.List[string]]::new()
1919

2020
# Check P1 License utilization
21-
if ($LicenseData.entitledP1LicenseCount -gt 0) {
21+
if ($LicenseData.entitledP1LicenseCount -gt 0 -or $LicenseData.entitledP2LicenseCount -gt 0) {
2222
$P1Used = $LicenseData.p1FeatureUtilizations.conditionalAccess.userCount
23-
$P1Entitled = $LicenseData.entitledP1LicenseCount
23+
$P1Entitled = $LicenseData.entitledP1LicenseCount + $LicenseData.entitledP2LicenseCount
2424
$P1Usage = ($P1Used / $P1Entitled) * 100
2525
$P1Overage = $P1Used - $P1Entitled
2626

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function Get-CIPPAlertMFAAdmins {
1818
}
1919
}
2020
if (!$DuoActive) {
21-
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq true and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
21+
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq true and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
2222
if ($users.UserPrincipalName) {
2323
$AlertData = "The following admins do not have MFA registered: $($users.UserPrincipalName -join ', ')"
2424
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function Get-CIPPAlertMFAAlertUsers {
1212
)
1313
try {
1414

15-
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq false and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
15+
$users = New-GraphGETRequest -uri "https://graph.microsoft.com/beta/reports/authenticationMethods/userRegistrationDetails?`$top=999&filter=IsAdmin eq false and isMfaRegistered eq false and userType eq 'member'&`$select=userPrincipalName,lastUpdatedDateTime,isMfaRegistered,IsAdmin" -tenantid $($TenantFilter) -AsApp $true | Where-Object { $_.userDisplayName -ne 'On-Premises Directory Synchronization Service Account' }
1616
if ($users.UserPrincipalName) {
1717
$AlertData = "The following $($users.Count) users do not have MFA registered: $($users.UserPrincipalName -join ', ')"
1818
Write-AlertTrace -cmdletName $MyInvocation.MyCommand -tenantFilter $TenantFilter -data $AlertData

0 commit comments

Comments
 (0)