-
Notifications
You must be signed in to change notification settings - Fork 284
gcchigh get-dlp compliancePolicy and Error running Get-PrivilegedUser: #1654
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 clicking “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
Comments
@homebrewjc For GCCHigh tenants specifically, ensure your Service Principal Application has the The resulting API permissions for your App Registration should have the Image of an example App Registration with the permissions below. |
@homebrewjc Glad that the permissions fixed the EXO related issue. To follow up, the 14th permission As for the |
Awesome i was able to get all working on except one the azure report for this instance. there are no other errors just this. at New-Report,
|
Glad to hear the tool is working better for you now. That particular error usually indicates that there was some sort of processing error such that when the configuration settings were extracted from Azure AD/Entra, one of the values was unexpectedly null or empty which resulted in the ScubaResults JSON file being malformed. Which is what the "Invalid JSON primitive" error means. It has also come up with certain escape sequences or special characters in setting values such as '' or unicode characters. Although we've closed out the known bugs. Usually, the best way to isolate the issue is to inspect the produced ScubaResults JSON file to find the malformed line and associated JSON key. This points to which setting or value might be causing the issue. Often, it's a line where there is a key defined, but no value. It often looks something like this. Some editors (like VSCode) will also parse and highlight areas that are malformed to make it easier to find the malformed area.
If you could find that key and share it, we might be able to figure out if it is a known issue and if there is a workaround or file a bug report to fix if it is new. |
Yes, that definitely looks like the culprit and gives us a better idea of where to investigate the issue. I've created #1658 to track the bug. For the time being, if you want a full report from that tenant, you can set the value in the JSON to an empty list The full command would be as follows where
That should give you a report manually until we can isolate and resolve the bug. |
@homebrewjc If you'd like to test it out, you can download this feature branch with a fix for the risky service principals issue: https://github.com/cisagov/ScubaGear/archive/refs/heads/1607-risky-sps-invalid-json.zip Let us know if you have any other questions. |
Prerequisites
ScubaGear Version
Loop through each tenant and run ScubaGear
foreach ($tenant in $tenants) {
Write-Host "Running ScubaGear for $($tenant.Organization)..." -ForegroundColor Cyan
}
Write-Host "All tenant scans completed!" -ForegroundColor Green
Operating System
Windows Server 2019 windows 10
PowerShell Version
7.0+
M365 Environment and License(s)
We are using comm and Gcchigh
🐛 Summary
we are running scuba perfectly against our commercial account but get a dlp issue for all gov accounts and get this error for only 2 of our gov accounts. Get-PrivilegedUser: Response status code does not indicate success: Forbidden (Forbidden).
Steps to reproduce
we set this up with a thumbprint and used this script to invoke scuba on each and every account
Function to clean up old report folders
function Clean-OldReports {
param (
[string]$FolderPath
)
}
Function to convert JSON files to OEM encoding
function Convert-JsonFilesToOEM {
param (
[string]$FolderPath
)
}
Loop through each tenant and run ScubaGear
foreach ($tenant in $tenants) {
Write-Host "Running ScubaGear for $($tenant.Organization)..." -ForegroundColor Cyan
}
Write-Host "All tenant scans completed!" -ForegroundColor Green
Expected behavior
We expected the normal output with out omitting commands
Output from Initialize-SCuBA (optional)
WARNING: Invalid Teams Environment name for Migration API
WARNING: Error running Get-PrivilegedUser: Response status code does not indicate success: Forbidden (Forbidden).
at Invoke-GraphDirectly,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ExportAADProvid
er.psm1: line 54
at Get-PrivilegedUser,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ExportAADProvid
er.psm1: line 336
at TryCommand,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ProviderHelpers
\CommandTracker.psm1: line 23
at Export-AADProvider,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ExportAADProvid
er.psm1: line 117
at Invoke-ProviderList,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Orchestrator.psm1: line
617
at Invoke-SCuBA,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Orchestrator.psm1: line
403
at , C:\Users\Administrator\Documents\scubaCommerical.ps1: line 262
at , : line 1
WARNING: Error running Get-PrivilegedRole: Response status code does not indicate success: Forbidden (Forbidden).
at Invoke-GraphDirectly,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ExportAADProvid
er.psm1: line 54
at Get-PrivilegedRole,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ExportAADProvid
er.psm1: line 688
at TryCommand,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ProviderHelpers
\CommandTracker.psm1: line 23
at Export-AADProvider,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ExportAADProvid
er.psm1: line 152
at Invoke-ProviderList,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Orchestrator.psm1: line
617
at Invoke-SCuBA,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Orchestrator.psm1: line
403
at , C:\Users\Administrator\Documents\scubaCommerical.ps1: line 262
at , : line 1
WARNING: Error running Connect-IPPSSession: UnAuthorized
at Connect-ExchangeOnline,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.4.0\netFramework\ExchangeOnlineMa
nagement.psm1: line 766
at Connect-IPPSSession,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ExchangeOnlineManagement\3.4.0\netFramework\ExchangeOnlineMa
nagement.psm1: line 904
at Connect-DefenderHelper,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Connection\ConnectHelpers
.psm1: line 126
at Export-DefenderProvider,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Providers\ExportDefenderP
rovider.psm1: line 93
at Invoke-ProviderList,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Orchestrator.psm1: line
623
at Invoke-SCuBA,
C:\Users\Administrator\Documents\WindowsPowerShell\Modules\ScubaGear\1.5.0.1741012484\Modules\Orchestrator.psm1: line
403
at , C:\Users\Administrator\Documents\scubaCommerical.ps1: line 262
at , : line 1
WARNING: Omitting the following commands: Get-DlpCompliancePolicy, Get-DlpComplianceRule, and Get-ProtectionAlert.
The text was updated successfully, but these errors were encountered: