Skip to content

Commit

Permalink
generated report and risky applications/SPs successfully with RiskyPe…
Browse files Browse the repository at this point in the history
…rmissions.json loaded from ScubaConfig.psm1
  • Loading branch information
mitchelbaker-cisa committed Jan 6, 2025
1 parent f3d89d8 commit 987cfd5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using module 'ScubaConfig\ScubaConfig.psm1'
using module "..\..\ScubaConfig\ScubaConfig.psm1"
#$PermissionsPath = Join-Path -Path ((Get-Item -Path $PSScriptRoot).Parent.Parent.FullName) -ChildPath "Permissions"
#$PermissionsJson = Get-Content -Path (Join-Path -Path $PermissionsPath -ChildPath "RiskyPermissions.json") | ConvertFrom-Json

Expand Down Expand Up @@ -379,8 +379,9 @@ function Get-ThirdPartyRiskyServicePrincipals {
}

Export-ModuleMember -Function @(
'Get-ApplicationsWithRiskyPermissions',
'Get-ServicePrincipalsWithRiskyPermissions',
'Get-FirstPartyRiskyApplications',
'Get-ThirdPartyRiskyServicePrincipals'
)
"Get-ApplicationsWithRiskyPermissions",
"Get-ServicePrincipalsWithRiskyPermissions",
"Get-FirstPartyRiskyApplications",
"Get-ThirdPartyRiskyServicePrincipals"
)

11 changes: 5 additions & 6 deletions PowerShell/ScubaGear/Modules/ScubaConfig/ScubaConfig.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ class ScubaConfig {
"Application Administrator",
"Cloud Application Administrator")
DefaultOPAVersion = '0.70.0'
}
hidden static [PSCustomObject]$RiskyPermissions
}

hidden [PSCustomObject]$RiskyPermissions = (Get-Content -Path (
Join-Path -Path (Get-Item -Path $PSScriptRoot).Parent.FullName -ChildPath "Permissions/RiskyPermissions.json"
) | ConvertFrom-Json)

static [object]ScubaDefault ([string]$Name){
return [ScubaConfig]::ScubaDefaults[$Name]
Expand All @@ -60,10 +63,6 @@ class ScubaConfig {
$this.SetParameterDefaults()
[ScubaConfig]::_IsLoaded = $true

[Scubaconfig]::RiskyPermissions = Get-Content -Path (
Join-Path -Path (Get-Item -Path $PSScriptRoot).Parent.Parent.FullName -ChildPath "Permissions/RiskyPermissions.json"
) | ConvertFrom-Json

# If OmitPolicy was included in the config file, validate the policy IDs included there.
if ($this.Configuration.ContainsKey("OmitPolicy")) {
foreach ($Policy in $this.Configuration.OmitPolicy.Keys) {
Expand Down

0 comments on commit 987cfd5

Please sign in to comment.