cisagov / ScubaGear

Automation to assess the state of your M365 tenant against CISA's baselines
https://www.cisa.gov/resources-tools/services/secure-cloud-business-applications-scuba-project
Creative Commons Zero v1.0 Universal
1.44k stars 203 forks source link

Modify MS.AAD.6.1 to account for federated domains #1185

Open mitchelbaker-cisa opened 5 days ago

mitchelbaker-cisa commented 5 days ago

๐Ÿ—ฃ Description

Modified the rule for MS.AAD.6.1 such that federated domains are excluded from the check. Only domains with AuthenticationType = "Managed" will be considered.

That being said, detailed reporting is expanded to indicate to the user if federated domains are present. Users should refer to their identity provider on how to configure these domains in a federated context.

Screenshot (115)

๐Ÿ’ญ Motivation and context

Resolves #1080

๐Ÿงช Testing

From .\Testing run

.\RunUnitTests.ps1 -p aad -c 6

To run functional tests copy/paste into a PS script:

$TestContainers = @() 
$TestContainers += New-PesterContainer -Path "Testing/Functional/Products" `
-Data @{ 
    Thumbprint = "<thumbprint>"; 
    TenantDomain = "<domain>"; 
    TenantDisplayName = "<display-name>"; 
    AppId = "<app-id>"; 
    ProductName = "aad"; 
    M365Environment = "gcc"
} 
$PesterConfig = @{
        Run = @{Container = $TestContainers}
        Filter = @{Tag = @("MS.AAD.6.1v1")}
        Output = @{Verbosity = 'Detailed'}
    }

$Config = New-PesterConfiguration -Hashtable $PesterConfig 
Invoke-Pester -Configuration $Config

โœ… Pre-approval checklist

โœ… Pre-merge checklist

โœ… Post-merge checklist

tkol2022 commented 4 days ago

@mitchelbaker-cisa your unit test for AAD policy 3.2 was failing the unit test so I looked into it. I compared your AAD Rego code to main and you are out of synch. Need to rebase maybe.

image

mitchelbaker-cisa commented 4 days ago

@tkol2022 Thanks for catching that, must have slipped through when rebasing. Reverted so it matches main.