Skip to content

DefenderRoleDefinition

Parameters

Parameter Attribute DataType Description Allowed Values
DisplayName Key String The display name for the role definition.
Id Write String The id of the role definition.
Description Write String The description of the role definition.
RolePermissions Write MSFT_DefenderRoleDefinitionRolePermissions[] List of permissions included in the role.
Ensure Write String Present ensures the instance exists, absent ensures it is removed. Absent, Present
Credential Write PSCredential Credentials of the workload's Admin
ApplicationId Write String Id of the Azure Active Directory application to authenticate with.
TenantId Write String Id of the Azure Active Directory tenant used for authentication.
CertificateThumbprint Write String Thumbprint of the Azure Active Directory application's authentication certificate to use for authentication.
ManagedIdentity Write Boolean Managed ID being used for authentication.
AccessTokens Write StringArray[] Access token used for authentication.

Embedded Instances

MSFT_DefenderRoleDefinitionRolePermissions

Parameters

Parameter Attribute DataType Description Allowed Values
allowedResourceActions Write StringArray[] Set of tasks that can be performed on a resource.

Description

Managed custom roles in Defender

Permissions

Microsoft Graph

To authenticate with the Microsoft Graph API, this resource requires the following permissions:

Delegated permissions

  • Read
  • None

  • Update

  • None

Application permissions

  • Read
  • RoleManagement.Read.Defender

  • Update

  • RoleManagement.ReadWrite.Defender

Examples

Example 1

This example creates a new Defender Role Definition.

Configuration Example
{
    param(
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )
    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        DefenderRoleDefinition "DefenderRoleDefinitionExample"
        {
            Description           = "Test Definition";
            DisplayName           = "MyNewDefinition";
            Ensure                = "Present";
            RolePermissions       = @(
                MSFT_DefenderRoleDefinitionRolePermissions
                {
                    allowedResourceActions = @(
                        "microsoft.xdr/secops/*/manage"
                        "microsoft.xdr/securityposture/*/manage"
                        "microsoft.xdr/configuration/*/manage"
                    )
                }
            )
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}

Example 2

This example updates a new Defender Role Definition.

Configuration Example
{
    param(
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )
    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        DefenderRoleDefinition "DefenderRoleDefinitionExample"
        {
            Description           = "Test Definition - Updated";
            DisplayName           = "MyNewDefinition";
            Ensure                = "Present";
            RolePermissions       = @(
                MSFT_DefenderRoleDefinitionRolePermissions
                {
                    allowedResourceActions = @(
                        "microsoft.xdr/secops/*/manage"
                        "microsoft.xdr/securityposture/*/manage"
                        "microsoft.xdr/configuration/*/manage"
                    )
                }
            )
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}

Example 3

This example removes a new Defender Role Definition.

Configuration Example
{
    param(
        [Parameter()]
        [System.String]
        $ApplicationId,

        [Parameter()]
        [System.String]
        $TenantId,

        [Parameter()]
        [System.String]
        $CertificateThumbprint
    )
    Import-DscResource -ModuleName Microsoft365DSC

    node localhost
    {
        DefenderRoleDefinition "DefenderRoleDefinitionExample"
        {
            DisplayName           = "MyNewDefinition";
            Ensure                = "Absent";
            ApplicationId         = $ApplicationId;
            TenantId              = $TenantId;
            CertificateThumbprint = $CertificateThumbprint;
        }
    }
}