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

Assert-M365DSCBlueprint: Severity level when a resource is missing #4638

Open
YenNantes opened this issue May 6, 2024 · 0 comments
Open

Comments

@YenNantes
Copy link

Description of the issue

Is there a way to have a severity level added when a resource is missing with Assert-M365DSCBlueprint.
I am able to get the severity level metadata added when a property of a resource is not configured but I have not found how to do it when the whole resource is missing.

Microsoft 365 DSC Version

1.24.424.1

Which workloads are affected

other

The DSC configuration

# Generated with Microsoft365DSC version 1.23.1220.1orig
# For additional information on how to use Microsoft365DSC, please visit https://aka.ms/M365DSC
param (
)

Configuration M365TenantConfig
{
    param (
    )

    $OrganizationName = $ConfigurationData.NonNodeData.OrganizationName

    Import-DscResource -ModuleName 'Microsoft365DSC' -ModuleVersion '1.23.1220.1'

    Node localhost
    {
        AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Require Trusted Endpoint"
        {
            DisplayName           = "Require Trusted"; ###L3|Mandatory requirement for FAMS
            Ensure                = "Present"; ###L3|Mandatory requirement for FAMS
            Id                    = "c1"; ###L3|Mandatory requirement for FAMS
            IsAvailable           = $True;
        }
        AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Require MFA"
        {
            DisplayName           = "Require MFA"; ###L3|Mandatory requirement for FAMS
            Ensure                = "Present"; ###L3|Mandatory requirement for FAMS
            Id                    = "c2"; ###L3|Mandatory requirement for FAMS
            IsAvailable           = $True;
        }
        AADAuthenticationContextClassReference "AADAuthenticationContextClassReference-Require re-authenticate every one hour"
        {
            DisplayName           = "Require re-authenticate every one hour"; ###L3|Mandatory requirement for FAMS
            Ensure                = "Present"; ###L3|Mandatory requirement for FAMS
            Id                    = "c3"; ###L3|Mandatory requirement for FAMS
            IsAvailable           = $True;
        }
    }

}

M365TenantConfig -ConfigurationData .\ConfigurationData.psd1

Verbose logs showing the problem

Here is the json outcome. The "C1" auth context exit but name is not correct. The sensitivity is correctly added.
The second one is missing, no severity is added despite the fact that I added on on the base line for the "Ensure" = "present" property.
[
    {
        "ResourceName":  "AADAuthenticationContextClassReference",
        "Key":  "Id",
        "KeyValue":  "c1",
        "Properties":  [
                           {
                               "_Metadata_Level":  "###L3",
                               "ValueInDestination":  "Require Trusted",
                               "ParameterName":  "DisplayName",
                               "ValueInSource":  "Require Trusted Endpoint",
                               "_Metadata_Info":  "Mandatory requirement for FAMS"
                           }
                       ],
        "ResourceInstanceName":  "AADAuthenticationContextClassReference-Require Trusted Endpoint"
    },
    {
        "ResourceName":  "AADAuthenticationContextClassReference",
        "Key":  [
                    "Id"
                ],
        "KeyValue":  "c3",
        "Properties":  [
                           {
                               "ValueInDestination":  "Present",
                               "ParameterName":  "_IsInConfiguration_",
                               "ValueInSource":  "Absent"
                           }
                       ],
        "ResourceInstanceName":  "AADAuthenticationContextClassReference-Require re-authenticate every one hour"
    }
]

Environment Information + PowerShell Version

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant