diff --git a/Module/Convert.AccountPolicyRule/Convert.AccountPolicyRule.psm1 b/Module/Convert.AccountPolicyRule/Convert.AccountPolicyRule.psm1 index 31a28bc76..be50c66e1 100644 --- a/Module/Convert.AccountPolicyRule/Convert.AccountPolicyRule.psm1 +++ b/Module/Convert.AccountPolicyRule/Convert.AccountPolicyRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -25,7 +25,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER PolicyValue The value the account policy should be set to. #> -Class AccountPolicyRule : STIG +Class AccountPolicyRule : Rule { [string] $PolicyName [string] $PolicyValue diff --git a/Module/Convert.AuditPolicyRule/Convert.AuditPolicyRule.psm1 b/Module/Convert.AuditPolicyRule/Convert.AuditPolicyRule.psm1 index e8220db54..1b2a2ac7d 100644 --- a/Module/Convert.AuditPolicyRule/Convert.AuditPolicyRule.psm1 +++ b/Module/Convert.AuditPolicyRule/Convert.AuditPolicyRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -27,7 +27,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Ensure A present or absent flag #> -Class AuditPolicyRule : STIG +Class AuditPolicyRule : Rule { [string] $Subcategory [string] $AuditFlag diff --git a/Module/Convert.DnsServerRootHintRule/Convert.DnsServerRootHintRule.psm1 b/Module/Convert.DnsServerRootHintRule/Convert.DnsServerRootHintRule.psm1 index 9cad06776..efdac83f3 100644 --- a/Module/Convert.DnsServerRootHintRule/Convert.DnsServerRootHintRule.psm1 +++ b/Module/Convert.DnsServerRootHintRule/Convert.DnsServerRootHintRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -26,7 +26,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER IpAddress The ip address of the root hint server #> -Class DnsServerRootHintRule : STIG +Class DnsServerRootHintRule : Rule { [string] $HostName [string] $IpAddress diff --git a/Module/Convert.DnsServerSettingRule/Convert.DnsServerSettingRule.psm1 b/Module/Convert.DnsServerSettingRule/Convert.DnsServerSettingRule.psm1 index 20c3fb37a..71467eaa4 100644 --- a/Module/Convert.DnsServerSettingRule/Convert.DnsServerSettingRule.psm1 +++ b/Module/Convert.DnsServerSettingRule/Convert.DnsServerSettingRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -26,7 +26,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER PropertyValue The value to set the proerty to #> -Class DnsServerSettingRule : STIG +Class DnsServerSettingRule : Rule { [string] $PropertyName [string] $PropertyValue diff --git a/Module/Convert.DocumentRule/Convert.DocumentRule.psm1 b/Module/Convert.DocumentRule/Convert.DocumentRule.psm1 index 5a18c1334..063877f0d 100644 --- a/Module/Convert.DocumentRule/Convert.DocumentRule.psm1 +++ b/Module/Convert.DocumentRule/Convert.DocumentRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -21,7 +21,7 @@ Foreach ($supportFile in $supportFileList) document rule, it is passed to the DocumentRule class for parsing and validation. #> -Class DocumentRule : STIG +Class DocumentRule : Rule { <# .SYNOPSIS diff --git a/Module/Convert.FileContentRule/Convert.FileContentRule.psm1 b/Module/Convert.FileContentRule/Convert.FileContentRule.psm1 index 16a6d39c6..32fd83349 100644 --- a/Module/Convert.FileContentRule/Convert.FileContentRule.psm1 +++ b/Module/Convert.FileContentRule/Convert.FileContentRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 using module .\..\Convert.FileContentType\Convert.FileContentType.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') @@ -24,7 +24,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Value Specifies the value of the configuration setting #> -Class FileContentRule : STIG +Class FileContentRule : Rule { [string] $Key [string] $Value @@ -91,7 +91,7 @@ Class FileContentRule : STIG #> static [bool] HasMultipleRules ( [string] $CheckContent ) { - $keyValuePairs = Get-KeyValuePair -CheckContent ([STIG]::SplitCheckContent( $CheckContent ) ) + $keyValuePairs = Get-KeyValuePair -CheckContent ([Rule]::SplitCheckContent( $CheckContent ) ) return ( Test-MultipleFileContentRule -KeyValuePair $keyValuePairs ) } @@ -107,6 +107,6 @@ Class FileContentRule : STIG #> static [string[]] SplitMultipleRules ( [string] $CheckContent ) { - return (Get-KeyValuePair -SplitCheckContent -CheckContent ([STIG]::SplitCheckContent($CheckContent))) + return (Get-KeyValuePair -SplitCheckContent -CheckContent ([Rule]::SplitCheckContent($CheckContent))) } } diff --git a/Module/Convert.FileContentType/Convert.FileContentType.psm1 b/Module/Convert.FileContentType/Convert.FileContentType.psm1 index 2e9e38b7d..b141850bd 100644 --- a/Module/Convert.FileContentType/Convert.FileContentType.psm1 +++ b/Module/Convert.FileContentType/Convert.FileContentType.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 # Header @@ -9,7 +9,7 @@ using module .\..\Convert.Stig\Convert.Stig.psm1 .SYNOPSIS Singleton class to support variable filter and parse methods in FileContentRule .DESCRIPTION - The FileContentType is used to extend filter and parse logic for diiferent + The FileContentType is used to extend filter and parse logic for diiferent FileContentRules without modifing existing filtering and parsing logic .PARAMETER Instance Maintains a single instance of the class object @@ -30,7 +30,7 @@ Class FileContentType Returns an instance of the class .DESCRIPTION Gets or sets a single instance of the FileContentType - for use in the FileContentRule + for use in the FileContentRule #> static [FileContentType] GetInstance() @@ -41,14 +41,14 @@ Class FileContentType } return [FileContentType]::Instance } - + <# .SYNOPSIS Loads and applies specific filtering and parsing rules .DESCRIPTION When Key-Value settings are located in a rule, the format - of Key-Value pairs differ between technologies, this method - supports a unique filter and parsing strategy for the rule + of Key-Value pairs differ between technologies, this method + supports a unique filter and parsing strategy for the rule .PARAMETER matchResult The key-value settings from the check-content element in the xccdf #> diff --git a/Module/Convert.GroupRule/Convert.GroupRule.psm1 b/Module/Convert.GroupRule/Convert.GroupRule.psm1 index e87a39752..aa524c8c3 100644 --- a/Module/Convert.GroupRule/Convert.GroupRule.psm1 +++ b/Module/Convert.GroupRule/Convert.GroupRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -25,7 +25,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER MembersToExclude The list of memmbers that are not allowed to be in the group #> -Class GroupRule : STIG +Class GroupRule : Rule { [string] $GroupName [string[]] $MembersToExclude diff --git a/Module/Convert.IISLoggingRule/Convert.IISLoggingRule.psm1 b/Module/Convert.IISLoggingRule/Convert.IISLoggingRule.psm1 index 01db3769a..9e7847c33 100644 --- a/Module/Convert.IISLoggingRule/Convert.IISLoggingRule.psm1 +++ b/Module/Convert.IISLoggingRule/Convert.IISLoggingRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -32,7 +32,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER LogTargetW3C #> -Class IisLoggingRule : STIG +Class IisLoggingRule : Rule { [object[]] $LogCustomFieldEntry [string] $LogFlags @@ -149,8 +149,8 @@ Class IisLoggingRule : STIG #> [void] SetStatus () { - $baseStig = [Stig]::New() - $referenceProperties = ( $baseStig | Get-Member -MemberType Property ).Name + $baseRule = [Rule]::New() + $referenceProperties = ( $baseRule | Get-Member -MemberType Property ).Name $differenceProperties = ( $this | Get-Member -MemberType Property ).Name $propertyList = (Compare-Object -ReferenceObject $referenceProperties -DifferenceObject $differenceProperties).InputObject diff --git a/Module/Convert.Main/Convert.Main.psm1 b/Module/Convert.Main/Convert.Main.psm1 index ac4d750c7..fdb526b05 100644 --- a/Module/Convert.Main/Convert.Main.psm1 +++ b/Module/Convert.Main/Convert.Main.psm1 @@ -2,7 +2,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude diff --git a/Module/Convert.Main/Functions.XccdfXml.ps1 b/Module/Convert.Main/Functions.XccdfXml.ps1 index 25d7d90a8..fc9a95a9a 100644 --- a/Module/Convert.Main/Functions.XccdfXml.ps1 +++ b/Module/Convert.Main/Functions.XccdfXml.ps1 @@ -231,7 +231,7 @@ function Get-StigRuleList Write-Verbose -Message "[$stigProcessedCounter of $stigGroupCount] $($stigRule.id)" - $ruleTypes = [STIG]::GetRuleTypeMatchList( $stigRule.rule.Check.('check-content') ) + $ruleTypes = [Rule]::GetRuleTypeMatchList( $stigRule.rule.Check.('check-content') ) foreach ( $ruleType in $ruleTypes ) { $rules = & "ConvertTo-$ruleType" -StigRule $stigRule diff --git a/Module/Convert.ManualRule/Convert.ManualRule.psm1 b/Module/Convert.ManualRule/Convert.ManualRule.psm1 index 38309ab4d..521044da1 100644 --- a/Module/Convert.ManualRule/Convert.ManualRule.psm1 +++ b/Module/Convert.ManualRule/Convert.ManualRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -20,7 +20,7 @@ Foreach ($supportFile in $supportFileList) check-content of the xccdf. Once a STIG rule is identifed as a manual rule, it is passed to the ManualRule class for parsing and validation. #> -Class ManualRule : STIG +Class ManualRule : Rule { <# .SYNOPSIS diff --git a/Module/Convert.MimeTypeRule/Convert.MimeTypeRule.psm1 b/Module/Convert.MimeTypeRule/Convert.MimeTypeRule.psm1 index 9f978c32c..e9297c1ba 100644 --- a/Module/Convert.MimeTypeRule/Convert.MimeTypeRule.psm1 +++ b/Module/Convert.MimeTypeRule/Convert.MimeTypeRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -27,7 +27,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Ensure A present or absent flag #> -Class MimeTypeRule : STIG +Class MimeTypeRule : Rule { [string] $Extension [string] $MimeType @@ -110,7 +110,7 @@ Class MimeTypeRule : STIG #> static [bool] HasMultipleRules ( [string] $CheckContent ) { - return Test-MultipleMimeTypeRule -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) + return Test-MultipleMimeTypeRule -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) } <# @@ -129,7 +129,7 @@ Class MimeTypeRule : STIG static [string[]] SplitMultipleRules ( [string] $CheckContent ) { - return ( Split-MultipleMimeTypeRule -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) ) + return ( Split-MultipleMimeTypeRule -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) ) } #endregion diff --git a/Module/Convert.PermissionRule/Convert.PermissionRule.psm1 b/Module/Convert.PermissionRule/Convert.PermissionRule.psm1 index 04c139c13..afeb1661a 100644 --- a/Module/Convert.PermissionRule/Convert.PermissionRule.psm1 +++ b/Module/Convert.PermissionRule/Convert.PermissionRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -27,7 +27,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Force A flag that will overwrite the current ACE in the ACL instead of merge #> -Class PermissionRule : STIG +Class PermissionRule : Rule { [string] $Path [object[]] $AccessControlEntry @@ -121,7 +121,7 @@ Class PermissionRule : STIG #> static [bool] HasMultipleRules ( [string] $CheckContent ) { - $permissionPaths = Get-PermissionTargetPath -StigString ([STIG]::SplitCheckContent( $CheckContent ) ) + $permissionPaths = Get-PermissionTargetPath -StigString ([Rule]::SplitCheckContent( $CheckContent ) ) return ( Test-MultiplePermissionRule -PermissionPath $permissionPaths ) } @@ -140,7 +140,7 @@ Class PermissionRule : STIG #> static [string[]] SplitMultipleRules ( [string] $CheckContent ) { - return ( Split-MultiplePermissionRule -CheckContent ([STIG]::SplitCheckContent( $CheckContent ) ) ) + return ( Split-MultiplePermissionRule -CheckContent ([Rule]::SplitCheckContent( $CheckContent ) ) ) } #endregion diff --git a/Module/Convert.ProcessMitigationRule/Convert.ProcessMitigationRule.psm1 b/Module/Convert.ProcessMitigationRule/Convert.ProcessMitigationRule.psm1 index 78b21a083..7f1186862 100644 --- a/Module/Convert.ProcessMitigationRule/Convert.ProcessMitigationRule.psm1 +++ b/Module/Convert.ProcessMitigationRule/Convert.ProcessMitigationRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -28,7 +28,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Disable A flag to disable the mitigation rule #> -Class ProcessMitigationRule : STIG +Class ProcessMitigationRule : Rule { [string] $MitigationTarget [string] $Enable diff --git a/Module/Convert.RegistryRule/Convert.RegistryRule.psm1 b/Module/Convert.RegistryRule/Convert.RegistryRule.psm1 index 1b6670258..0fd6650a5 100644 --- a/Module/Convert.RegistryRule/Convert.RegistryRule.psm1 +++ b/Module/Convert.RegistryRule/Convert.RegistryRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -31,7 +31,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Ensure A present or absent flag #> -Class RegistryRule : STIG +Class RegistryRule : Rule { [string] $Key [string] $ValueName @@ -295,7 +295,7 @@ Class RegistryRule : STIG #> static [bool] HasMultipleRules ( [string] $CheckContent ) { - return Test-MultipleRegistryEntries -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) + return Test-MultipleRegistryEntries -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) } <# @@ -313,7 +313,7 @@ Class RegistryRule : STIG #> static [string[]] SplitMultipleRules ( [string] $CheckContent ) { - return ( Split-MultipleRegistryEntries -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) ) + return ( Split-MultipleRegistryEntries -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) ) } #endregion diff --git a/Module/Convert.SecurityOptionRule/Convert.SecurityOptionRule.psm1 b/Module/Convert.SecurityOptionRule/Convert.SecurityOptionRule.psm1 index 2b8cff1d6..8c9dd748d 100644 --- a/Module/Convert.SecurityOptionRule/Convert.SecurityOptionRule.psm1 +++ b/Module/Convert.SecurityOptionRule/Convert.SecurityOptionRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -24,7 +24,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER OptionValue The security option value #> -Class SecurityOptionRule : STIG +Class SecurityOptionRule : Rule { [ValidateNotNullOrEmpty()] [string] $OptionName [ValidateNotNullOrEmpty()] [string] $OptionValue diff --git a/Module/Convert.ServiceRule/Convert.ServiceRule.psm1 b/Module/Convert.ServiceRule/Convert.ServiceRule.psm1 index 727a3b219..abb52884f 100644 --- a/Module/Convert.ServiceRule/Convert.ServiceRule.psm1 +++ b/Module/Convert.ServiceRule/Convert.ServiceRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -28,7 +28,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Ensure A present or absent flag #> -Class ServiceRule : STIG +Class ServiceRule : Rule { [string] $ServiceName [string] $ServiceState diff --git a/Module/Convert.SqlScriptQueryRule/Convert.SqlScriptQueryRule.psm1 b/Module/Convert.SqlScriptQueryRule/Convert.SqlScriptQueryRule.psm1 index 12dfd2f77..e92c84b6c 100644 --- a/Module/Convert.SqlScriptQueryRule/Convert.SqlScriptQueryRule.psm1 +++ b/Module/Convert.SqlScriptQueryRule/Convert.SqlScriptQueryRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -28,7 +28,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER SetScript The set script content #> -Class SqlScriptQueryRule : STIG +Class SqlScriptQueryRule : Rule { [string] $GetScript [string] $TestScript diff --git a/Module/Convert.Template/Convert.Template.psm1 b/Module/Convert.Template/Convert.Template.psm1 index f400bfbb2..9a1ede731 100644 --- a/Module/Convert.Template/Convert.Template.psm1 +++ b/Module/Convert.Template/Convert.Template.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude diff --git a/Module/Convert.UserRightsAssignmentRule/Convert.UserRightsAssignmentRule.psm1 b/Module/Convert.UserRightsAssignmentRule/Convert.UserRightsAssignmentRule.psm1 index e1879beec..d368f20db 100644 --- a/Module/Convert.UserRightsAssignmentRule/Convert.UserRightsAssignmentRule.psm1 +++ b/Module/Convert.UserRightsAssignmentRule/Convert.UserRightsAssignmentRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -29,7 +29,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Force A flag that replaces the identities vs append #> -Class UserRightRule : STIG +Class UserRightRule : Rule { [ValidateNotNullOrEmpty()] [string] $DisplayName [ValidateNotNullOrEmpty()] [string] $Constant @@ -147,7 +147,7 @@ Class UserRightRule : STIG static [bool] HasMultipleRules ( [string] $CheckContent ) { - if ( Test-MultipleUserRightsAssignment -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) ) + if ( Test-MultipleUserRightsAssignment -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) ) { return $true } @@ -170,7 +170,7 @@ Class UserRightRule : STIG #> static [string[]] SplitMultipleRules ( [string] $CheckContent ) { - return ( Split-MultipleUserRightsAssignment -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) ) + return ( Split-MultipleUserRightsAssignment -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) ) } #endregion diff --git a/Module/Convert.WebAppPoolRule/Convert.WebAppPoolRule.psm1 b/Module/Convert.WebAppPoolRule/Convert.WebAppPoolRule.psm1 index f60952a71..b54f19721 100644 --- a/Module/Convert.WebAppPoolRule/Convert.WebAppPoolRule.psm1 +++ b/Module/Convert.WebAppPoolRule/Convert.WebAppPoolRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -25,7 +25,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Value The value the web.config key should be set to #> -Class WebAppPoolRule : STIG +Class WebAppPoolRule : Rule { [string] $Key [string] $Value diff --git a/Module/Convert.WebConfigurationPropertyRule/Convert.WebConfigurationPropertyRule.psm1 b/Module/Convert.WebConfigurationPropertyRule/Convert.WebConfigurationPropertyRule.psm1 index 906a617fc..1f336311e 100644 --- a/Module/Convert.WebConfigurationPropertyRule/Convert.WebConfigurationPropertyRule.psm1 +++ b/Module/Convert.WebConfigurationPropertyRule/Convert.WebConfigurationPropertyRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -28,7 +28,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Value The value the web.config key should be set to #> -Class WebConfigurationPropertyRule : STIG +Class WebConfigurationPropertyRule : Rule { [string] $ConfigSection [string] $Key @@ -131,7 +131,7 @@ Class WebConfigurationPropertyRule : STIG #> static [bool] HasMultipleRules ( [string] $CheckContent ) { - return Test-MultipleWebConfigurationPropertyRule -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) + return Test-MultipleWebConfigurationPropertyRule -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) } <# @@ -149,7 +149,7 @@ Class WebConfigurationPropertyRule : STIG #> static [string[]] SplitMultipleRules ( [string] $CheckContent ) { - return ( Split-MultipleWebConfigurationPropertyRule -CheckContent ( [STIG]::SplitCheckContent( $CheckContent ) ) ) + return ( Split-MultipleWebConfigurationPropertyRule -CheckContent ( [Rule]::SplitCheckContent( $CheckContent ) ) ) } #endregion diff --git a/Module/Convert.WinEventLogRule/Convert.WinEventLogRule.psm1 b/Module/Convert.WinEventLogRule/Convert.WinEventLogRule.psm1 index 4056d60d8..11e8846ed 100644 --- a/Module/Convert.WinEventLogRule/Convert.WinEventLogRule.psm1 +++ b/Module/Convert.WinEventLogRule/Convert.WinEventLogRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -26,7 +26,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER IsEnabled The enabled status of the log #> -Class WinEventLogRule : STIG +Class WinEventLogRule : Rule { [string] $LogName [bool] $IsEnabled diff --git a/Module/Convert.WindowsFeatureRule/Convert.WindowsFeatureRule.psm1 b/Module/Convert.WindowsFeatureRule/Convert.WindowsFeatureRule.psm1 index f93ad7894..8254114a3 100644 --- a/Module/Convert.WindowsFeatureRule/Convert.WindowsFeatureRule.psm1 +++ b/Module/Convert.WindowsFeatureRule/Convert.WindowsFeatureRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -26,7 +26,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER InstallState The state the windows feature should be in #> -Class WindowsFeatureRule : STIG +Class WindowsFeatureRule : Rule { [string] $FeatureName [string] $InstallState diff --git a/Module/Convert.WmiRule/Convert.WmiRule.psm1 b/Module/Convert.WmiRule/Convert.WmiRule.psm1 index 5eda71495..106c95a12 100644 --- a/Module/Convert.WmiRule/Convert.WmiRule.psm1 +++ b/Module/Convert.WmiRule/Convert.WmiRule.psm1 @@ -1,7 +1,7 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. using module .\..\Common\Common.psm1 -using module .\..\Convert.Stig\Convert.Stig.psm1 +using module .\..\Rule\Rule.psm1 $exclude = @($MyInvocation.MyCommand.Name,'Template.*.txt') $supportFileList = Get-ChildItem -Path $PSScriptRoot -Exclude $exclude @@ -29,7 +29,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER Operator The PowerShell equivalent operator #> -Class WmiRule : STIG +Class WmiRule : Rule { [string] $Query [string] $Property diff --git a/Module/Convert.Stig/Data.ps1 b/Module/Rule/Data.ps1 similarity index 100% rename from Module/Convert.Stig/Data.ps1 rename to Module/Rule/Data.ps1 diff --git a/Module/Convert.Stig/Functions.ps1 b/Module/Rule/Functions.ps1 similarity index 100% rename from Module/Convert.Stig/Functions.ps1 rename to Module/Rule/Functions.ps1 diff --git a/Module/Convert.Stig/Methods.ps1 b/Module/Rule/Methods.ps1 similarity index 99% rename from Module/Convert.Stig/Methods.ps1 rename to Module/Rule/Methods.ps1 index 974efc079..da39cef6a 100644 --- a/Module/Convert.Stig/Methods.ps1 +++ b/Module/Rule/Methods.ps1 @@ -453,7 +453,7 @@ function Get-FileContentRuleDscResource $Key ) - switch ($Key) + switch ($Key) { {$PSItem -match 'deployment.'} { @@ -463,7 +463,7 @@ function Get-FileContentRuleDscResource { return 'cJsonFile' } - default + default { 'ReplaceText' } @@ -549,9 +549,9 @@ function Test-DuplicateRule ) $ruleType = $DifferenceObject.GetType().Name - $baseStig = [Stig]::New() + $baseRule = [Rule]::New() - $referenceProperties = ( $baseStig | Get-Member -MemberType Property ).Name + $referenceProperties = ( $baseRule | Get-Member -MemberType Property ).Name $differenceProperties = ( $DifferenceObject | Get-Member -MemberType Property ).Name $propertyList = (Compare-Object -ReferenceObject $referenceProperties -DifferenceObject $differenceProperties).InputObject diff --git a/Module/Convert.Stig/Convert.Stig.psm1 b/Module/Rule/Rule.psm1 similarity index 99% rename from Module/Convert.Stig/Convert.Stig.psm1 rename to Module/Rule/Rule.psm1 index 0a6de7eb0..ebe23ef0a 100644 --- a/Module/Convert.Stig/Convert.Stig.psm1 +++ b/Module/Rule/Rule.psm1 @@ -40,7 +40,7 @@ Foreach ($supportFile in $supportFileList) .PARAMETER DscResource Defines the DSC resource used to configure the rule #> -Class STIG : ICloneable +Class Rule : ICloneable { [String] $Id [String] $Title @@ -59,7 +59,7 @@ Class STIG : ICloneable .DESCRIPTION This is the base class constructor #> - STIG () + Rule () { } @@ -97,7 +97,7 @@ Class STIG : ICloneable that the Mandatory parameter validation does not fail and to prevent the need for a work around by allowing empty strings in mandatory parameters. #> - $this.SplitCheckContent = [STIG]::SplitCheckContent( $this.rawString ) + $this.SplitCheckContent = [Rule]::SplitCheckContent( $this.rawString ) # Default Flags $this.IsNullOrEmpty = $false diff --git a/PowerStig.Convert.psm1 b/PowerStig.Convert.psm1 index 48e9798f0..a8e0e72bf 100644 --- a/PowerStig.Convert.psm1 +++ b/PowerStig.Convert.psm1 @@ -26,7 +26,7 @@ using module .\Module\Convert.RegistryRule\Convert.RegistryRule.psm1 using module .\Module\Convert.SecurityOptionRule\Convert.SecurityOptionRule.psm1 using module .\Module\Convert.ServiceRule\Convert.ServiceRule.psm1 using module .\Module\Convert.SqlScriptQueryRule\Convert.SqlScriptQueryRule.psm1 -using module .\Module\Convert.Stig\Convert.Stig.psm1 +using module .\Module\Rule\Rule.psm1 using module .\Module\Convert.UserRightsAssignmentRule\Convert.UserRightsAssignmentRule.psm1 using module .\Module\Convert.WebAppPoolRule\Convert.WebAppPoolRule.psm1 using module .\Module\Convert.WebConfigurationPropertyRule\Convert.WebConfigurationPropertyRule.psm1 diff --git a/Tests/Unit/Module/Convert.AccountPolicyRule.tests.ps1 b/Tests/Unit/Module/Convert.AccountPolicyRule.tests.ps1 index c17ab772c..f4aee3004 100644 --- a/Tests/Unit/Module/Convert.AccountPolicyRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.AccountPolicyRule.tests.ps1 @@ -20,7 +20,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.AuditPolicyRule.tests.ps1 b/Tests/Unit/Module/Convert.AuditPolicyRule.tests.ps1 index c9aa08dee..27b5b2672 100644 --- a/Tests/Unit/Module/Convert.AuditPolicyRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.AuditPolicyRule.tests.ps1 @@ -23,7 +23,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.DnsServerRootHintRule.tests.ps1 b/Tests/Unit/Module/Convert.DnsServerRootHintRule.tests.ps1 index 7cf5a8ac1..0cca9fe2b 100644 --- a/Tests/Unit/Module/Convert.DnsServerRootHintRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.DnsServerRootHintRule.tests.ps1 @@ -14,7 +14,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.DnsServerSettingRule.tests.ps1 b/Tests/Unit/Module/Convert.DnsServerSettingRule.tests.ps1 index 4949f2e63..6d2efd47e 100644 --- a/Tests/Unit/Module/Convert.DnsServerSettingRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.DnsServerSettingRule.tests.ps1 @@ -31,7 +31,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.DocumentRule.tests.ps1 b/Tests/Unit/Module/Convert.DocumentRule.tests.ps1 index 9579f44d4..e0ddcf5bc 100644 --- a/Tests/Unit/Module/Convert.DocumentRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.DocumentRule.tests.ps1 @@ -14,7 +14,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.FileContentRule.tests.ps1 b/Tests/Unit/Module/Convert.FileContentRule.tests.ps1 index 2bf68fac2..a53c15100 100644 --- a/Tests/Unit/Module/Convert.FileContentRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.FileContentRule.tests.ps1 @@ -19,7 +19,7 @@ try Verify Preference Name "security.tls.version.min" is set to the value "2" and locked. Verify Preference Name "security.tls.version.max" is set to the value "3" and locked. - Criteria: If the parameters are set incorrectly, then this is a finding. + Criteria: If the parameters are set incorrectly, then this is a finding. If the settings are not locked, then this is a finding.' } @@ -45,7 +45,7 @@ try Key = 'deployment.security.revocation.check*' Value = 'MultipleRule' ArchiveFile = 'OracleJRE' - CheckContent = 'If the system is on the SIPRNet, this requirement is NA. + CheckContent = 'If the system is on the SIPRNet, this requirement is NA. Navigate to the system-level "deployment.properties" file for JRE. @@ -64,7 +64,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.GroupRule.tests.ps1 b/Tests/Unit/Module/Convert.GroupRule.tests.ps1 index 7f6f3dd29..ff6179d90 100644 --- a/Tests/Unit/Module/Convert.GroupRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.GroupRule.tests.ps1 @@ -56,7 +56,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.IISLoggingRule.tests.ps1 b/Tests/Unit/Module/Convert.IISLoggingRule.tests.ps1 index fa0b30dcf..c6e047822 100644 --- a/Tests/Unit/Module/Convert.IISLoggingRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.IISLoggingRule.tests.ps1 @@ -149,7 +149,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.ManualRule.tests.ps1 b/Tests/Unit/Module/Convert.ManualRule.tests.ps1 index e973d55ed..d2ffa0079 100644 --- a/Tests/Unit/Module/Convert.ManualRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.ManualRule.tests.ps1 @@ -15,7 +15,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.MimeTypeRule.tests.ps1 b/Tests/Unit/Module/Convert.MimeTypeRule.tests.ps1 index 8dd35c3a8..7b9e4905a 100644 --- a/Tests/Unit/Module/Convert.MimeTypeRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.MimeTypeRule.tests.ps1 @@ -65,7 +65,7 @@ try Context 'Base Class'{ It "Shoud have a BaseType of STIG"{ - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.PermissionRule.tests.ps1 b/Tests/Unit/Module/Convert.PermissionRule.tests.ps1 index 993b2c2a8..70bbe1fd2 100644 --- a/Tests/Unit/Module/Convert.PermissionRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.PermissionRule.tests.ps1 @@ -166,7 +166,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.ProcessMitigationRule.tests.ps1 b/Tests/Unit/Module/Convert.ProcessMitigationRule.tests.ps1 index c185cf2d4..3f8f9d1e9 100644 --- a/Tests/Unit/Module/Convert.ProcessMitigationRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.ProcessMitigationRule.tests.ps1 @@ -97,7 +97,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.RegistryRule.tests.ps1 b/Tests/Unit/Module/Convert.RegistryRule.tests.ps1 index 6957385b1..2af1cf089 100644 --- a/Tests/Unit/Module/Convert.RegistryRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.RegistryRule.tests.ps1 @@ -178,11 +178,11 @@ try ValueType = 'Dword' CheckContent = 'If the following registry value does not exist or is not configured as specified, this is a finding. - Registry Hive: HKEY_LOCAL_MACHINE + Registry Hive: HKEY_LOCAL_MACHINE Registry Path: \SOFTWARE\ Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging\ - + Value Name: EnableScriptBlockLogging - + Value Type: REG_DWORD Value: 1' }, @@ -195,11 +195,11 @@ try ValueType = 'Dword' CheckContent = 'If the following registry value does not exist or is not configured as specified, this is a finding: - Registry Hive: HKEY_LOCAL_MACHINE + Registry Hive: HKEY_LOCAL_MACHINE Registry Path: \System\CurrentControlSet\Control\Print\Providers\LanMan Print Services\Servers\ - + Value Name: AddPrinterDrivers - + Value Type: REG_DWORD Value: 1' } @@ -211,7 +211,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } @@ -741,7 +741,7 @@ try } } } - + Describe "Get-RegistryValueTypeFromWindowsStig" { $checkContent = "Type: REG_SZ" @@ -1358,7 +1358,7 @@ try $checkContent = "Criteria: If the value ""ValueName"" is REG_Type = $valueData, this is not a finding." It "Should return '$valueData' from '$checkContent'" { - $result = Get-RegistryValueDataFromSingleStig -CheckContent $checkContent + $result = Get-RegistryValueDataFromSingleStig -CheckContent $checkContent $result | Should Be $valueData } } diff --git a/Tests/Unit/Module/Convert.SecurityOptionRule.tests.ps1 b/Tests/Unit/Module/Convert.SecurityOptionRule.tests.ps1 index aacd7a0b6..268fb6c4c 100644 --- a/Tests/Unit/Module/Convert.SecurityOptionRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.SecurityOptionRule.tests.ps1 @@ -53,7 +53,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.ServiceRule.tests.ps1 b/Tests/Unit/Module/Convert.ServiceRule.tests.ps1 index 724051f2c..ced92430f 100644 --- a/Tests/Unit/Module/Convert.ServiceRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.ServiceRule.tests.ps1 @@ -70,7 +70,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.SqlScriptQueryRule.tests.ps1 b/Tests/Unit/Module/Convert.SqlScriptQueryRule.tests.ps1 index 6517b06ca..ba1387ffb 100644 --- a/Tests/Unit/Module/Convert.SqlScriptQueryRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.SqlScriptQueryRule.tests.ps1 @@ -136,7 +136,7 @@ try Context "Base Class" { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be "STIG" + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.UserRightsAssignmentRule.tests.ps1 b/Tests/Unit/Module/Convert.UserRightsAssignmentRule.tests.ps1 index bdf07cc00..1cb04827c 100644 --- a/Tests/Unit/Module/Convert.UserRightsAssignmentRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.UserRightsAssignmentRule.tests.ps1 @@ -192,7 +192,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.WebAppPoolRule.tests.ps1 b/Tests/Unit/Module/Convert.WebAppPoolRule.tests.ps1 index 9f741a6e1..b84d49492 100644 --- a/Tests/Unit/Module/Convert.WebAppPoolRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.WebAppPoolRule.tests.ps1 @@ -51,7 +51,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.WebConfigurationPropertyRule.tests.ps1 b/Tests/Unit/Module/Convert.WebConfigurationPropertyRule.tests.ps1 index 3dd29d191..e10151d55 100644 --- a/Tests/Unit/Module/Convert.WebConfigurationPropertyRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.WebConfigurationPropertyRule.tests.ps1 @@ -83,7 +83,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.WinEventLogRule.tests.ps1 b/Tests/Unit/Module/Convert.WinEventLogRule.tests.ps1 index 236682ba2..919949d25 100644 --- a/Tests/Unit/Module/Convert.WinEventLogRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.WinEventLogRule.tests.ps1 @@ -54,7 +54,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.WmiRule.tests.ps1 b/Tests/Unit/Module/Convert.WmiRule.tests.ps1 index 0bda91c0f..3e3cd3d2c 100644 --- a/Tests/Unit/Module/Convert.WmiRule.tests.ps1 +++ b/Tests/Unit/Module/Convert.WmiRule.tests.ps1 @@ -23,7 +23,7 @@ try Context 'Base Class' { It "Shoud have a BaseType of STIG" { - $rule.GetType().BaseType.ToString() | Should Be 'STIG' + $rule.GetType().BaseType.ToString() | Should Be 'Rule' } } diff --git a/Tests/Unit/Module/Convert.Stig.tests.ps1 b/Tests/Unit/Module/Rule.tests.ps1 similarity index 98% rename from Tests/Unit/Module/Convert.Stig.tests.ps1 rename to Tests/Unit/Module/Rule.tests.ps1 index 8d5fdd8ff..81ecdd37a 100644 --- a/Tests/Unit/Module/Convert.Stig.tests.ps1 +++ b/Tests/Unit/Module/Rule.tests.ps1 @@ -1,12 +1,12 @@ #region Header -using module .\..\..\..\Module\Convert.Stig\Convert.Stig.psm1 +using module .\..\..\..\Module\Rule\Rule.psm1 . $PSScriptRoot\.tests.header.ps1 #endregion try { InModuleScope -ModuleName $script:moduleName { #region Test Setup - $stig = [STIG]::new() + $stig = [Rule]::new() $stig.InvokeClass( (Get-TestStigRule -ReturnGroupOnly) ) #endregion #region Class Tests @@ -75,13 +75,13 @@ try foreach ( $method in $staticMethods ) { It "Should have a method named '$method'" { - ( [STIG] | Get-Member -Static -Name $method ).Name | Should Be $method + ( [Rule] | Get-Member -Static -Name $method ).Name | Should Be $method } } # If new methods are added this will catch them so test coverage can be added It "Should not have more static methods than are tested" { $memberPlanned = $staticMethods + @('Equals', 'new', 'ReferenceEquals') - $memberActual = ( [STIG] | Get-Member -Static -MemberType Method ).Name + $memberActual = ( [Rule] | Get-Member -Static -MemberType Method ).Name $compare = Compare-Object -ReferenceObject $memberActual -DifferenceObject $memberPlanned $compare.Count | Should Be 0 } @@ -97,7 +97,7 @@ try Line 2 ' - [string[]] $splitCheckContent = [STIG]::SplitCheckContent( $CheckContent ) + [string[]] $splitCheckContent = [Rule]::SplitCheckContent( $CheckContent ) It 'Should trim strings and remove empty lines' { $splitCheckContent[0] | Should Be 'Line 1' diff --git a/Tools/TestHelper/TestHelper.psm1 b/Tools/TestHelper/TestHelper.psm1 index af0cd6d6a..38303c79e 100644 --- a/Tools/TestHelper/TestHelper.psm1 +++ b/Tools/TestHelper/TestHelper.psm1 @@ -211,7 +211,7 @@ Function Get-StigBaseMethods else { $objectClassMethodNames = @('Equals', 'GetHashCode', 'GetType', 'ToString') - $stigClassMethodNames = @('Clone', 'IsDuplicateRule', 'SetDuplicateTitle', , 'SetStatus', + $stigClassMethodNames = @('Clone', 'IsDuplicateRule', 'SetDuplicateTitle', 'SetStatus', 'SetIsNullOrEmpty', 'SetOrganizationValueRequired', 'GetOrganizationValueTestString', 'ConvertToHashTable', 'SetStigRuleResource', 'IsHardCoded', 'GetHardCodedString', 'IsHardCodedOrganizationValueTestString', 'GetHardCodedOrganizationValueTestString',