Framework/Models/SubscriptionSecurity/SubscriptionRBAC.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Set-StrictMode -Version Latest 

# Defines data structure for subscription RBAC json
class SubscriptionRBAC
{
    [string] $ActiveCentralAccountsVersion;
    [string] $DeprecatedAccountsVersion;
    [ActiveRBACAccount[]] $ValidActiveAccounts = @();
    [RBACAccount[]] $DeprecatedAccounts = @();
}

class RBACAccount
{
     #Fields from JSON
    [string] $Name = "";
    [string] $Description = "";
    [bool] $Enabled = $false;
    [string] $ObjectId = "";
    [string] $ObjectType = "";
    [RBACAccountType] $Type = [RBACAccountType]::Validate;
}

class ActiveRBACAccount: RBACAccount
{
    [string[]] $Tags = @();
    [string] $RoleDefinitionName = "";
    [string] $Scope = "";
}
class TelemetryRBAC
{
    [string] $SubscriptionId="";
    [string] $Scope="";
    [string] $DisplayName="";
    [string] $ObjectId="";
    [string] $ObjectType="";
    [string] $RoleAssignmentId="";
    [string] $RoleDefinitionId="";
    [string] $RoleDefinitionName="";
}
enum RBACAccountType
{
    # AzSK should not Add/Delete the account
    Validate
    # The account can be fully managed (Add/Delete) from AzSK
    Provision
}