CAUtils.psm1

# Requires -Module @{ ModuleName = 'MSAL.PS'; RequiredVersion = '4.7.1.2' }
$global:MSGraphAppName = "Azure Active Directory Configuration Assessment"
$global:authHeader = $null

Function New-MSCloudIdGraphApp
{
    $msGraphAppId="00000003-0000-0000-c000-000000000000"
    $msGraphApp = Get-AzureADServicePrincipal -Filter "appId eq '$msGraphAppId'"          

    $scopesRequired = @("Policy.Read.All","User.Read.All","Group.Read.All","Application.Read.All")
    $msGraphPerm = New-Object -TypeName "Microsoft.Open.AzureAD.Model.RequiredResourceAccess"
    $msGraphPerm.ResourceAppId = $msGraphAppId
    $msGraphPermResourceAccess = @()

    foreach($scopeRequired in $scopesRequired)
    {
        $scopeId = $msGraphApp.Oauth2Permissions | where {$_.Value -eq $scopeRequired} | Select-Object -ExpandProperty Id    
        $msGraphPermResourceAccess += New-Object -TypeName "microsoft.open.azuread.model.resourceAccess" -ArgumentList $scopeId, "Scope"
    }

    $msGraphPerm.ResourceAccess = $msGraphPermResourceAccess
    $app = New-AzureADApplication -DisplayName $global:MSGraphAppName  -ReplyUrls "http://localhost" -RequiredResourceAccess $msGraphPerm -PublicClient $true

    Write-Output $app
}



Function Get-MSCloudIdGraphApp
{
    $app = Get-AzureADApplication -Filter "DisplayName eq '$global:MSGraphAppName'"
    Write-Output $app
}

Function Remove-MSCloudIdGraphApp
{
    Get-AzureADApplication -Filter "DisplayName eq '$global:MSGraphAppName'" | Remove-AzureADApplication
}

function Connect-MSGraphAPI {
    [CmdletBinding()]
    param (
        [string]
        $TenantId,
        [string]
        $ClientID = "92cd380b-4edf-4457-946e-25b4a665cd6a",
        [string]
        $RedirectUri = "http://localhost",
        [string]
        $Scopes = "Policy.Read.All User.Read.All Group.Read.All Application.Read.All",
        [switch]
        $Interactive = $True
    )
    
    begin {
    }
    
    process {


        $msalToken = $null
        if ($Interactive)
        {
            $msalToken = get-msaltoken -ClientId $ClientID -TenantId $TenantId -RedirectUri $RedirectUri -Scopes $Scopes -LoginHint $Credential.UserName                 
        }
        else
        {

            try {
                $msalToken = get-msaltoken -ClientId $ClientID -TenantId $TenantId -RedirectUri $RedirectUri -Scopes $Scopes -Silent -LoginHint $Credential.UserName     
            }
            catch [Microsoft.Identity.Client.MsalUiRequiredException] 
            {
                $MsalToken = get-msaltoken -ClientId $ClientID -TenantId $TenantId -RedirectUri $RedirectUri -Scopes $Scopes -UserCredential $Credential                
            }
        }

        $token = $MsalToken.accesstoken
        $Header = @{ }
        $Header.Authorization = "Bearer {0}" -f $token
        $Header.'Content-type' = "application/json"
        $global:authHeader = $Header
    }
    end {
        Write-Output $result
    }
}


function New-MSGraphQueryToBatch
{
    [CmdletBinding()]
    param (
        # endpoint
        [string]
        $endpoint,
        [string]
        $QueryParameters,
        # HTTP Method
        [Parameter(Mandatory = $true)]
        [ValidateSet("GET", "POST", "PUT", "DELETE")]
        [string]
        $Method,
        [string]
        $Body
    )

    if ($null -notlike $QueryParameters) {
        $URI = ("/{0}?{1}" -f $endpoint, $QueryParameters)
        
    }
    else {
        $URI = ("/{0}" -f $endpoint)
    }

    $result = New-Object PSObject -Property @{
        id = [Guid]::NewGuid()
        method=$Method
        url=$URI
        body=$Body
    }

    Write-Output $result
}

function Invoke-MSGraphBatch
{
    param (
        # Base URI
        [string]
        $BaseURI = "https://graph.microsoft.com/",
        # endpoint
        [ValidateSet("1.0", "beta")]
        [string]
        $APIVersion = "beta",
        [object[]]
        $requests
    )

    $requestsJson = New-Object psobject -Property @{requests=$requests} | ConvertTo-Json -Depth 100

    Invoke-MSGraphQuery -BaseURI $BaseURI -endpoint "`$batch" -Method "POST" -Body $requestsJson

}

$global:tokenRequestedTime = [DateTime]::MinValue

function Invoke-MSGraphQuery {
    [CmdletBinding()]
    param (
        # Base URI
        [string]
        $BaseURI = "https://graph.microsoft.com/",
        # endpoint
        [string]
        $endpoint,
        [ValidateSet("1.0", "beta")]
        [string]
        $APIVersion = "beta",
        [string]
        $QueryParameters,
        # HTTP Method
        [Parameter(Mandatory = $true)]
        [ValidateSet("GET", "POST", "PUT", "DELETE")]
        [string]
        $Method,
        [string]
        $Body

    )
    
    begin {
        # Header
        $CurrentDate = [DateTime](Get-Date)
        $Delta= ($CurrentDate - $global:tokenRequestedTime).TotalMinutes
        
        if ($Delta -gt 55)
        {
            Connect-MSGraphAPI
            $global:tokenRequestedTime = $CurrentDate
        }
        $Headers = $global:authHeader        
    }
    
    process {

        if ($null -notlike $QueryParameters) {
            $URI = ("{0}{1}/{2}?{3}" -f $BaseURI, $APIVersion, $endpoint, $QueryParameters)
            
        }
        else {
            $URI = ("{0}{1}/{2}" -f $BaseURI, $APIVersion, $endpoint)
        }
        
        try {

            switch ($Method) {
                "GET" {

                    $queryUrl = $URI
                    Write-Verbose ("Invoking $Method request on $queryUrl...")
                    while (-not [String]::IsNullOrEmpty($queryUrl)) {
                       
                        try {                            
                            $pagedResults = Invoke-RestMethod -Method $Method -Uri $queryUrl -Headers $Headers -ErrorAction Stop
                        
                        }
                        catch {
                        
                            $StatusCode = [int]$_.Exception.Response.StatusCode
                            $message = $_.Exception.Message
                            Write-Error "ERROR During Request - $StatusCode $message"

                        }

                    
                        if ($pagedResults.value -ne $null) {
                            $queryResults += $pagedResults.value
                        }
                        else {
                            $queryResults += $pagedResults
                        }
                        $queryCount = $queryResults.Count
                        Write-Progress -Id 1 -Activity "Querying directory" -CurrentOperation "Retrieving results ($queryCount found so far)" 
                        $queryUrl = ""

                        $odataNextLink = $pagedResults | Select-Object -ExpandProperty "@odata.nextLink" -ErrorAction SilentlyContinue

                        if ($null -ne $odataNextLink) {
                            $queryUrl = $odataNextLink
                        }
                        else {
                            $odataNextLink = $pagedResults | Select-Object -ExpandProperty "odata.nextLink" -ErrorAction SilentlyContinue
                            if ($null -ne $odataNextLink) {
                                $absoluteUri = [Uri]"https://bogus/$odataNextLink"
                                $skipToken = $absoluteUri.Query.TrimStart("?")
                                
                            }
                        }
                    }

                    Write-Verbose ("Returning {0} total results" -f $queryResults.count)
                    Write-Output $queryResults

                }

                "POST" {
                    $queryUrl = $URI
                    Write-Verbose ("Invoking $Method request on $queryUrl using $Headers with Body $body...")
                    #Connect-MSGraphAPI

                    $qErr = $Null
                    try {                    
                        $queryResults = Invoke-RestMethod -Method $Method -Uri $queryUrl -Headers $Headers -Body $Body -UseBasicParsing -ErrorVariable qErr -ErrorAction Stop
                        Write-Output $queryResults
                    }
                    catch {
                        $StatusCode = [int]$_.Exception.Response.StatusCode
                        $message = $_.Exception.Message
                        Write-Error "ERROR During Request - $StatusCode $message"


                    }
                   

                   
                   
                }

                "PUT" {
                    $queryUrl = $URI
                    Write-Verbose ("Invoking $Method request on $queryUrl...")
                    $pagedResults = Invoke-RestMethod -Method $Method -Uri $queryUrl -Headers $Headers -Body $Body
                }
                "DELETE" {
                    $queryUrl = $URI
                    Write-Verbose ("Invoking $Method request on $queryUrl...")
                    $pagedResults = Invoke-RestMethod -Method $Method -Uri $queryUrl -Headers $Headers
                }
            }
            
            
        }
        catch {
            
        }
    }
    
    end {
        
    }
}

function Add-MSGraphObjectIdCondition
{
    [CmdletBinding()]
    param (
        [Parameter()]
        [string]
        $InitialFilter,
        [Parameter()]
        [string]
        $PropertyName="id",
        [string]
        $ObjectId,
        [Parameter()]
        $Operator = "or"
    )

    $oid = [Guid]::NewGuid()

    if ([String]::IsNullOrWhiteSpace($oid) -or -not [Guid]::TryParse($ObjectId, [ref]$oid))
    {
        Write-Output $InitialFilter
        return
    }

    $Condition = "$PropertyName+eq+'$ObjectId'"

    if ([string]::IsNullOrWhiteSpace($InitialFilter))
    {
        Write-Output $Condition
    }
    else {
        Write-Output "$InitialFilter+$Operator+$Condition"
    }
}

function Expand-AzureADCAPolicyReferencedUsers()
{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [PSObject]
        $Policy
    )

    $msGraphFilter = ""

    $policy.conditions.users.includeUsers | %{ $msGraphFilter = Add-MSGraphObjectIdCondition -InitialFilter $msGraphFilter -ObjectId $_ }
    $policy.conditions.users.excludeUsers | %{ $msGraphFilter = Add-MSGraphObjectIdCondition -InitialFilter $msGraphFilter -ObjectId $_ }

    if ($msGraphFilter -ne "")
    {
        $batchQuery = New-MSGraphQueryToBatch -Method GET -endpoint "users" -QueryParameters "`$select=id,userprincipalName&filter=$msGraphFilter"
        Write-Output $batchQuery
    }

}

function Expand-AzureADCAPolicyReferencedGroups()
{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [PSObject]
        $Policy
    )

    $msGraphFilter = ""

    $policy.conditions.users.includeGroups | %{ $msGraphFilter = Add-MSGraphObjectIdCondition -InitialFilter $msGraphFilter -ObjectId $_ }
    $policy.conditions.users.excludeGroups | %{ $msGraphFilter = Add-MSGraphObjectIdCondition -InitialFilter $msGraphFilter -ObjectId $_ }

    if ($msGraphFilter -ne "")
    {
        $batchQuery = New-MSGraphQueryToBatch -Method GET -endpoint "groups" -QueryParameters "`$select=id,displayName&filter=$msGraphFilter"
        Write-Output $batchQuery
    }
}

function Expand-AzureADCAPolicyReferencedApplications()
{
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [PSObject]
        $Policy
    )


    $appMSGraphFilter = ""
    $policy.conditions.applications.includeApplications | % { $appMSGraphFilter = Add-MSGraphObjectIdCondition -InitialFilter $appMSGraphFilter -ObjectId $_ -PropertyName "appId" }
    $policy.conditions.applications.excludeApplications | % { $appMSGraphFilter = Add-MSGraphObjectIdCondition -InitialFilter $appMSGraphFilter -ObjectId $_ -PropertyName "appId" }

    if ($appMSGraphFilter -ne "")
    {
        #we have to find the app in the local tenant and in the service principals, in case they come
        #from other tenants such as first party services (e.g. Exchange Online)
        $batchAppQuery = New-MSGraphQueryToBatch -Method GET -endpoint "applications" -QueryParameters "`$select=appId,displayName&filter=$appMSGraphFilter"
        Write-Output $batchAppQuery        
        $batchSPQuery = New-MSGraphQueryToBatch -Method GET -endpoint "servicePrincipals" -QueryParameters "`$select=appId,displayName&filter=$appMSGraphFilter"
        Write-Output $batchSPQuery
    }

}

function Export-AzureADCAPolicy {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [string]
        $OutputFilesPath 
    )    
    
    begin {
        
    }
    process {
        $policies = Invoke-MSGraphQuery -Method GET -endpoint "identity/conditionalAccess/policies"
        $namedLocations = Invoke-MSGraphQuery -Method GET -endpoint "identity/conditionalAccess/namedLocations"      

        $usersBatch = @()
        $groupsBatch = @()
        $appsBatch = @()

        foreach($policy in $policies)
        {
            if ($policy -ne $null)
            {
                $usersBatch += Expand-AzureADCAPolicyReferencedUsers -Policy $policy
                $groupsBatch += Expand-AzureADCAPolicyReferencedGroups -Policy $policy
                $appsPolicyBatch = Expand-AzureADCAPolicyReferencedApplications -Policy $policy            
                $appsPolicyBatch | % { $appsBatch += $_}
            }
        }

        $referencedUsers = Invoke-MSGraphBatch -requests $usersBatch 
        $referencedGroups = Invoke-MSGraphBatch -requests $groupsBatch 
        $referencedApps = Invoke-MSGraphBatch -requests $appsBatch 
        
        $policies | ConvertTo-Json -Depth 100 | Out-File "$OutputFilesPath\CAPolicies.json" -Force
        $namedLocations | ConvertTo-Json -Depth 100 | Out-File "$OutputFilesPath\NamedLocations.json" -Force
        
        $referencedUsers.responses | select-object -ExpandProperty body | select-object -ExpandProperty value  | select-object -Unique  id,userPrincipalName | ConvertTo-Json -Depth 100| Out-File "$OutputFilesPath\CARefUsers.json" -Force
        $referencedGroups.responses | select-object -ExpandProperty body | select-object -ExpandProperty value | select-object -Unique id,displayName | ConvertTo-Json -Depth 100| Out-File "$OutputFilesPath\CARefGroups.json" -Force
        $referencedApps.responses | select-object -ExpandProperty body | select-object -ExpandProperty value | select-object -Unique appId,displayName | ConvertTo-Json -Depth 100| Out-File "$OutputFilesPath\CARefApps.json" -Force

    }
    end {
    }
}
# SIG # Begin signature block
# MIIjhgYJKoZIhvcNAQcCoIIjdzCCI3MCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNL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