Framework/Models/SVT/SVTConfig.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Set-StrictMode -Version Latest 
class SVTConfig
{
    [string] $FeatureName = ""
    [string] $Reference = ""
    [bool] $IsMaintenanceMode 
    [ControlItem[]] $Controls = @();

    static [SVTConfig] LoadServerConfigFile([string] $fileName, [bool] $useOnlinePolicyStore, [string] $onlineStoreUri, [bool] $enableAADAuthForOnlinePolicyStore)
    {
        return [SVTConfig]([ConfigurationHelper]::LoadServerConfigFile($fileName, $useOnlinePolicyStore, $onlineStoreUri, $enableAADAuthForOnlinePolicyStore));
    }

    static [SVTConfig] LoadServerFileRaw([string] $fileName, [bool] $useOnlinePolicyStore, [string] $onlineStoreUri, [bool] $enableAADAuthForOnlinePolicyStore)
    {
        return [SVTConfig]([ConfigurationHelper]::LoadServerFileRaw($fileName, $useOnlinePolicyStore, $onlineStoreUri, $enableAADAuthForOnlinePolicyStore));
    }
}

class ControlItem
{
    #Fields from JSON
    [string] $ControlID = ""
    [string] $Id = ""
    [string] $ControlSeverity = [ControlSeverity]::High
    [string] $Description = ""
    [string] $Automated = ""
    [string[]] $Tags = @()
    [bool] $Enabled   
    hidden [string] $MethodName = ""   
    [string] $Recommendation = ""   
    [string] $Rationale = ""   
    hidden [string[]] $DataObjectProperties = @()
    hidden [string] $AttestComparisionType = ""
    hidden [FixControl] $FixControl = $null;
    [int] $AttestationExpiryPeriodInDays
    [bool] $IsBaselineControl
    #add PreviewBaselineFlag
    [bool] $IsPreviewBaselineControl;
    [DateTime] $GraceExpiryDate
    [int] $NewControlGracePeriodInDays
    [int] $AttestationPeriodInDays
    [string[]] $ValidAttestationStates
    [string] $PolicyDefinitionGuid 
    [string] $PolicyDefnResourceIdSuffix
    [string] $policyDefinitionId
}

class FixControl
{
    [string] $FixMethodName = ""
    [FixControlImpact] $FixControlImpact = [FixControlImpact]::High;
    [PSObject] $Parameters = $null;
}

enum FixControlImpact
{
    Critical
    High
    Medium
    Low
}