Skip to content

Commit

Permalink
Stig class rename (#143)
Browse files Browse the repository at this point in the history
* renamed STIG base class

* renamed Convert.Stig module

* renamed Convert.STIG

* renamed Convert.Rule

* updated base class name

* renamed constructor

* renamed rule test

* renamed rule class
  • Loading branch information
athaynes authored Sep 25, 2018
1 parent 0af3503 commit e60a0da
Show file tree
Hide file tree
Showing 54 changed files with 112 additions and 112 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Module/Convert.AuditPolicyRule/Convert.AuditPolicyRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Module/Convert.DocumentRule/Convert.DocumentRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Module/Convert.FileContentRule/Convert.FileContentRule.psm1
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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
Expand Down Expand Up @@ -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 )
}

Expand All @@ -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)))
}
}
12 changes: 6 additions & 6 deletions Module/Convert.FileContentType/Convert.FileContentType.psm1
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# 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

<#
.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
Expand All @@ -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()
Expand All @@ -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
#>
Expand Down
4 changes: 2 additions & 2 deletions Module/Convert.GroupRule/Convert.GroupRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Module/Convert.IISLoggingRule/Convert.IISLoggingRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -32,7 +32,7 @@ Foreach ($supportFile in $supportFileList)
.PARAMETER LogTargetW3C
#>
Class IisLoggingRule : STIG
Class IisLoggingRule : Rule
{
[object[]] $LogCustomFieldEntry
[string] $LogFlags
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion Module/Convert.Main/Convert.Main.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Module/Convert.Main/Functions.XccdfXml.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions Module/Convert.ManualRule/Convert.ManualRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Module/Convert.MimeTypeRule/Convert.MimeTypeRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 ) )
}

<#
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Module/Convert.PermissionRule/Convert.PermissionRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 )
}

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions Module/Convert.RegistryRule/Convert.RegistryRule.psm1
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 ) )
}

<#
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit e60a0da

Please sign in to comment.