Skip to content
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

AAD module generates an error at launch #903

Closed
houstek opened this issue Feb 10, 2024 · 7 comments · Fixed by #908
Closed

AAD module generates an error at launch #903

houstek opened this issue Feb 10, 2024 · 7 comments · Fixed by #908
Labels
public-reported This issue is reported by the public users of the tool.

Comments

@houstek
Copy link

houstek commented Feb 10, 2024

🐛 Summary

The AAD module generates an error at launch. All prerequisites are correct.

To reproduce

Steps to reproduce the behavior:

Invoke-SCuBA -ProductNames aad -Verbose

Any helpful log output or screenshots

PS C:\temp\ScubaGear-1.1.0> Invoke-SCuBA -ProductNames aad -Verbose
COMMENTAIRES : Suppression de la fonction importée « Select-DohServer ».
COMMENTAIRES : Suppression de la fonction importée « Get-ScubaDmarcRecord ».
COMMENTAIRES : Suppression de la fonction importée « Invoke-RobustDnsTxt ».
COMMENTAIRES : Suppression de la fonction importée « Get-ScubaSpfRecord ».
COMMENTAIRES : Suppression de la fonction importée « Get-ScubaDkimRecord ».
COMMENTAIRES : Suppression de la fonction importée « Get-EXOTenantDetail ».
COMMENTAIRES : Suppression de la fonction importée « Export-EXOProvider ».
COMMENTAIRES : Suppression de la fonction importée « Get-PrivilegedUser ».
COMMENTAIRES : Suppression de la fonction importée « Get-PrivilegedRole ».
COMMENTAIRES : Suppression de la fonction importée « Get-AADTenantDetail ».
COMMENTAIRES : Suppression de la fonction importée « Export-AADProvider ».
COMMENTAIRES : Suppression de la fonction importée « Export-DefenderProvider ».
COMMENTAIRES : Suppression de la fonction importée « Get-TeamsTenantDetail ».
COMMENTAIRES : Suppression de la fonction importée « Export-TeamsProvider ».
COMMENTAIRES : Suppression de la fonction importée « Export-SharePointProvider ».
COMMENTAIRES : Suppression de la fonction importée « Invoke-Rego ».
COMMENTAIRES : Suppression de la fonction importée « New-Report ».
COMMENTAIRES : Suppression de la fonction importée « Import-SecureBaseline ».
COMMENTAIRES : Suppression de la fonction importée « Disconnect-SCuBATenant ».
COMMENTAIRES : Suppression de la fonction importée « Connect-Tenant ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportAADProvider.psm1 ».
COMMENTAIRES : Exportation de la fonction « Export-AADProvider ».
COMMENTAIRES : Exportation de la fonction « Get-AADTenantDetail ».
COMMENTAIRES : Exportation de la fonction « Get-PrivilegedUser ».
COMMENTAIRES : Exportation de la fonction « Get-PrivilegedRole ».
COMMENTAIRES : Importation de la fonction « Export-AADProvider ».
COMMENTAIRES : Importation de la fonction « Get-AADTenantDetail ».
COMMENTAIRES : Importation de la fonction « Get-PrivilegedRole ».
COMMENTAIRES : Importation de la fonction « Get-PrivilegedUser ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportDefenderProvider.psm1 ».
COMMENTAIRES : Exportation de la fonction « Export-DefenderProvider ».
COMMENTAIRES : Importation de la fonction « Export-DefenderProvider ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportEXOProvider.psm1 ».
COMMENTAIRES : Exportation de la fonction « Export-EXOProvider ».
COMMENTAIRES : Exportation de la fonction « Get-EXOTenantDetail ».
COMMENTAIRES : Exportation de la fonction « Select-DohServer ».
COMMENTAIRES : Exportation de la fonction « Invoke-RobustDnsTxt ».
COMMENTAIRES : Exportation de la fonction « Get-ScubaSpfRecord ».
COMMENTAIRES : Exportation de la fonction « Get-ScubaDkimRecord ».
COMMENTAIRES : Exportation de la fonction « Get-ScubaDmarcRecord ».
COMMENTAIRES : Importation de la fonction « Export-EXOProvider ».
COMMENTAIRES : Importation de la fonction « Get-EXOTenantDetail ».
COMMENTAIRES : Importation de la fonction « Get-ScubaDkimRecord ».
COMMENTAIRES : Importation de la fonction « Get-ScubaDmarcRecord ».
COMMENTAIRES : Importation de la fonction « Get-ScubaSpfRecord ».
COMMENTAIRES : Importation de la fonction « Invoke-RobustDnsTxt ».
COMMENTAIRES : Importation de la fonction « Select-DohServer ». COMMENTAIRES : Importation de la fonction « Export-PowerPlatformProvider ». COMMENTAIRES : Importation de la fonction « Get-PowerPlatformTenantDetail ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportSharePointProvider.psm1 ». COMMENTAIRES : Exportation de la fonction « Export-SharePointProvider ».
COMMENTAIRES : Importation de la fonction « Export-SharePointProvider ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportTeamsProvider.psm1 ».
COMMENTAIRES : Exportation de la fonction « Export-TeamsProvider ».
COMMENTAIRES : Exportation de la fonction « Get-TeamsTenantDetail ».
COMMENTAIRES : Importation de la fonction « Export-TeamsProvider ».
COMMENTAIRES : Importation de la fonction « Get-TeamsTenantDetail ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Connection\Connection.psm1 ».
COMMENTAIRES : Importation de la fonction « Connect-Tenant ».
COMMENTAIRES : Importation de la fonction « Disconnect-SCuBATenant ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\RunRego\RunRego.psm1 ».
COMMENTAIRES : Importation de la fonction « Invoke-Rego ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\CreateReport\CreateReport.psm1 ».
COMMENTAIRES : Importation de la fonction « Import-SecureBaseline ».
COMMENTAIRES : Importation de la fonction « New-Report ».
COMMENTAIRES : Chargement du module à partir du chemin
« C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\ScubaConfig\ScubaConfig.psm1 ».
COMMENTAIRES : Importation de la fonction « Copy-ScubaBaselineDocument ».
Fatal Error involving the Report Creation.
Ending ScubaGear execution. See the exception message for more details: Objet non valide passé, ':' ou '}'
attendu. (677065): {
"baseline_version": "1",
"module_version": "1.1.0",
"date": "02/10/2024 05:38:58 Paris, Madrid",
"tenant_details": [
{
"AADAdditionalData": {
"AssignedPlans": [
{
"AssignedDateTime": "Date(1707461129000)",
"CapabilityStatus": "Suspended",
"Service": "MicrosoftCommunicationsOnline",
2024-02-10_05-49

Add any screenshots of the problem here.

@fariaz
Copy link

fariaz commented Feb 11, 2024

Hi,

Same issue for me i tried with powershell 5.1 and 7.

Br

@schrolla
Copy link
Collaborator

🐛 Summary

The AAD module generates an error at launch. All prerequisites are correct.

To reproduce

Steps to reproduce the behavior:

Invoke-SCuBA -ProductNames aad -Verbose

Any helpful log output or screenshots

PS C:\temp\ScubaGear-1.1.0> Invoke-SCuBA -ProductNames aad -Verbose COMMENTAIRES : Suppression de la fonction importée « Select-DohServer ». COMMENTAIRES : Suppression de la fonction importée « Get-ScubaDmarcRecord ». COMMENTAIRES : Suppression de la fonction importée « Invoke-RobustDnsTxt ». COMMENTAIRES : Suppression de la fonction importée « Get-ScubaSpfRecord ». COMMENTAIRES : Suppression de la fonction importée « Get-ScubaDkimRecord ». COMMENTAIRES : Suppression de la fonction importée « Get-EXOTenantDetail ». COMMENTAIRES : Suppression de la fonction importée « Export-EXOProvider ». COMMENTAIRES : Suppression de la fonction importée « Get-PrivilegedUser ». COMMENTAIRES : Suppression de la fonction importée « Get-PrivilegedRole ». COMMENTAIRES : Suppression de la fonction importée « Get-AADTenantDetail ». COMMENTAIRES : Suppression de la fonction importée « Export-AADProvider ». COMMENTAIRES : Suppression de la fonction importée « Export-DefenderProvider ». COMMENTAIRES : Suppression de la fonction importée « Get-TeamsTenantDetail ». COMMENTAIRES : Suppression de la fonction importée « Export-TeamsProvider ». COMMENTAIRES : Suppression de la fonction importée « Export-SharePointProvider ». COMMENTAIRES : Suppression de la fonction importée « Invoke-Rego ». COMMENTAIRES : Suppression de la fonction importée « New-Report ». COMMENTAIRES : Suppression de la fonction importée « Import-SecureBaseline ». COMMENTAIRES : Suppression de la fonction importée « Disconnect-SCuBATenant ». COMMENTAIRES : Suppression de la fonction importée « Connect-Tenant ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportAADProvider.psm1 ». COMMENTAIRES : Exportation de la fonction « Export-AADProvider ». COMMENTAIRES : Exportation de la fonction « Get-AADTenantDetail ». COMMENTAIRES : Exportation de la fonction « Get-PrivilegedUser ». COMMENTAIRES : Exportation de la fonction « Get-PrivilegedRole ». COMMENTAIRES : Importation de la fonction « Export-AADProvider ». COMMENTAIRES : Importation de la fonction « Get-AADTenantDetail ». COMMENTAIRES : Importation de la fonction « Get-PrivilegedRole ». COMMENTAIRES : Importation de la fonction « Get-PrivilegedUser ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportDefenderProvider.psm1 ». COMMENTAIRES : Exportation de la fonction « Export-DefenderProvider ». COMMENTAIRES : Importation de la fonction « Export-DefenderProvider ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportEXOProvider.psm1 ». COMMENTAIRES : Exportation de la fonction « Export-EXOProvider ». COMMENTAIRES : Exportation de la fonction « Get-EXOTenantDetail ». COMMENTAIRES : Exportation de la fonction « Select-DohServer ». COMMENTAIRES : Exportation de la fonction « Invoke-RobustDnsTxt ». COMMENTAIRES : Exportation de la fonction « Get-ScubaSpfRecord ». COMMENTAIRES : Exportation de la fonction « Get-ScubaDkimRecord ». COMMENTAIRES : Exportation de la fonction « Get-ScubaDmarcRecord ». COMMENTAIRES : Importation de la fonction « Export-EXOProvider ». COMMENTAIRES : Importation de la fonction « Get-EXOTenantDetail ». COMMENTAIRES : Importation de la fonction « Get-ScubaDkimRecord ». COMMENTAIRES : Importation de la fonction « Get-ScubaDmarcRecord ». COMMENTAIRES : Importation de la fonction « Get-ScubaSpfRecord ». COMMENTAIRES : Importation de la fonction « Invoke-RobustDnsTxt ». COMMENTAIRES : Importation de la fonction « Select-DohServer ». COMMENTAIRES : Importation de la fonction « Export-PowerPlatformProvider ». COMMENTAIRES : Importation de la fonction « Get-PowerPlatformTenantDetail ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportSharePointProvider.psm1 ». COMMENTAIRES : Exportation de la fonction « Export-SharePointProvider ». COMMENTAIRES : Importation de la fonction « Export-SharePointProvider ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Providers\ExportTeamsProvider.psm1 ». COMMENTAIRES : Exportation de la fonction « Export-TeamsProvider ». COMMENTAIRES : Exportation de la fonction « Get-TeamsTenantDetail ». COMMENTAIRES : Importation de la fonction « Export-TeamsProvider ». COMMENTAIRES : Importation de la fonction « Get-TeamsTenantDetail ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\Connection\Connection.psm1 ». COMMENTAIRES : Importation de la fonction « Connect-Tenant ». COMMENTAIRES : Importation de la fonction « Disconnect-SCuBATenant ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\RunRego\RunRego.psm1 ». COMMENTAIRES : Importation de la fonction « Invoke-Rego ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\CreateReport\CreateReport.psm1 ». COMMENTAIRES : Importation de la fonction « Import-SecureBaseline ». COMMENTAIRES : Importation de la fonction « New-Report ». COMMENTAIRES : Chargement du module à partir du chemin « C:\temp\ScubaGear-1.1.0\PowerShell\ScubaGear\Modules\ScubaConfig\ScubaConfig.psm1 ». COMMENTAIRES : Importation de la fonction « Copy-ScubaBaselineDocument ». Fatal Error involving the Report Creation. Ending ScubaGear execution. See the exception message for more details: Objet non valide passé, ':' ou '}' attendu. (677065): { "baseline_version": "1", "module_version": "1.1.0", "date": "02/10/2024 05:38:58 Paris, Madrid", "tenant_details": [ { "AADAdditionalData": { "AssignedPlans": [ { "AssignedDateTime": "Date(1707461129000)", "CapabilityStatus": "Suspended", "Service": "MicrosoftCommunicationsOnline", 2024-02-10_05-49

Add any screenshots of the problem here.

From the screenshot, it appears like there is a parsing/format error in the ProviderExportSettings.json file being produced. Would it be possible to share the next couple lines of that file beyond what is indicated in the screenshot? It may help isolate the issue.

Thank you.

@schrolla schrolla added the public-reported This issue is reported by the public users of the tool. label Feb 12, 2024
@houstek
Copy link
Author

houstek commented Feb 12, 2024

Is that enough for you?

Fatal Error involving the Report Creation.
Ending ScubaGear execution. See the exception message for more details: Objet non valide passé, ':' ou '}' attendu. (677065): {
"baseline_version": "1",
"module_version": "1.1.0",
"date": "02/12/2024 20:53:11 Paris, Madrid",
"tenant_details": [
{
"AADAdditionalData": {
"AssignedPlans": [
{
"AssignedDateTime": "Date(1707461129000)",
"CapabilityStatus": "Suspended",
"Service": "MicrosoftCommunicationsOnline",
"ServicePlanId": "42a3ec34-28ba-46b6-992f-db53a675ac5b"
},
{
"AssignedDateTime": "Date(1705477222000)",
"CapabilityStatus": "Enabled",
"Service": "TeamspaceAPI",
"ServicePlanId": "ec17f317-f4bc-451e-b2da-0167e5c260f9"
},
{
"AssignedDateTime": "Date(1705477222000)",
"CapabilityStatus": "Enabled",
"Service": "TeamspaceAPI",
"ServicePlanId": "0374d34c-6be4-4dbb-b3f0-26105db0b28a"
},

@schrolla
Copy link
Collaborator

Yes, that helps.
I wasn't sure before, but does the JSON file that is being produced actually start with (677065): in your output or is that part of the error message? The file is, by default, named ProviderSettingsExport.json and located in a newly created M365BaselineConformance_ folder. I think it's part of the error message, but I want to be sure before further evaluating.

The file should start with the { "baseline_version": "1" string without the number in front. If the number is present, that is likely the issue, but I will have to look into what is causing it.

Other question, would you perhaps have any Azure AD conditional access policies with names using Unicode characters or special characters (accents, backslashes, etc)? It's possible some of these are being filtered out and causing the resulting JSON to be malformed. May be able to see it in the actual JSON file, but I understand it often contains sensitive information you wouldn't want to post fully on a public Github issue.

Is that enough for you?

Fatal Error involving the Report Creation. Ending ScubaGear execution. See the exception message for more details: Objet non valide passé, ':' ou '}' attendu. (677065): { "baseline_version": "1", "module_version": "1.1.0", "date": "02/12/2024 20:53:11 Paris, Madrid", "tenant_details": [ { "AADAdditionalData": { "AssignedPlans": [ { "AssignedDateTime": "Date(1707461129000)", "CapabilityStatus": "Suspended", "Service": "MicrosoftCommunicationsOnline", "ServicePlanId": "42a3ec34-28ba-46b6-992f-db53a675ac5b" }, { "AssignedDateTime": "Date(1705477222000)", "CapabilityStatus": "Enabled", "Service": "TeamspaceAPI", "ServicePlanId": "ec17f317-f4bc-451e-b2da-0167e5c260f9" }, { "AssignedDateTime": "Date(1705477222000)", "CapabilityStatus": "Enabled", "Service": "TeamspaceAPI", "ServicePlanId": "0374d34c-6be4-4dbb-b3f0-26105db0b28a" },

@houstek
Copy link
Author

houstek commented Feb 12, 2024

I attach an overview of the file ProviderSettingsExport.json
I do indeed have non-alphanumeric characters in the names of the conditional access policies. I have: "é" "=" ">" "," "_" "(" ")"

2024-02-12_22-10

@schrolla
Copy link
Collaborator

schrolla commented Feb 12, 2024

Thank you for the additional details. The header of the file is correct, but after some research the issue is likely due to a bug in the latest version of the MS Graph SDK modules used by ScubaGear. To resolve the issue as a workaround and confirm that this is the issue, could you downgrade those libraries? Here are the steps to do so:

  1. Close any PowerShell sessions and open a new PowerShell window so no modules are in use. Change to the folder where you extracted ScubaGear.
  2. Run .\utils\UninstallModules.ps1. This will remove the PowerShell modules installed by the ScubaGear Setup.ps1 script.
  3. Replace the current .\PowerShell\Modules\ScubaGear\RequiredVersons.ps1 script with the one in the attached zip file. The only difference is the max version for Microsoft.Graph.* modules is set to 2.12.0
    RequiredVersions.zip
  4. Re-run Setup.ps1 after the new file is in place. This will reinstall the v2.12.0 version of the MSGraph modules that do not have the bug.

After that is done, try re-running ScubaGear and see if it resolves your issue.

@houstek
Copy link
Author

houstek commented Feb 13, 2024

With the Graph module in version 2.12, the script works perfectly :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
public-reported This issue is reported by the public users of the tool.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants