PowerStig icon indicating copy to clipboard operation
PowerStig copied to clipboard

Sql server 2016 Instance STIG - V-79141 Issue

Open pursca opened this issue 6 years ago • 0 comments

Describe the bug After start DSCConfiguration the very first rule cannot be successfully applied

To Reproduce

  1. Install SQL 2016 on a domain join machine
  2. apply SQL 2016 Instance STIG
configuration SqlS2016STIG
{
    param
    (
        [Parameter(Mandatory=$true)]
        [ValidateNotNullorEmpty()]
        [PSCredential]
        $Credential,
        
        [parameter()]
        [string]
        $NodeName = 'SQL2016STIG'
    )

    Import-DscResource -ModuleName PowerStig

    Node $NodeName
    {
        SqlServer BaseLine
        {
            SqlVersion   = '2016'
            SqlRole      = 'Instance'
            StigVersion = '1.3'
            ServerInstance = 'SQL2016STIG'
            PsDscRunAsCredential = $Credential
        }
    }
}

$cd = @{
    AllNodes = @(
        @{
            NodeName = 'SQL2016STIG'
            PSDscAllowDomainUser = $true
            PSDscAllowPlainTextPassword = $true
        }
    )
}

$cred = Get-Credential -userName litware\dscRunAs -Message "Password please"
SqlS2016STIG -NodeName SQL2016STIG -credential $cred -ConfigurationData $cd -OutputPath C:\STIG\SQLConfig

Notes: the document should also be updated to specify that a domain account is needed because the default DSC account might not have all permissions to apply all STIGs ... also need to make sure this domain account has enough permission

Expected behavior Expected Test-DscConfiguration return true

Screenshots

Additional context There are 2 issues:

  1. looking into the mof file, it seems require that C:\Audits folder exists ... without this folder, the set operation cannot be successful - workaround, add File resource to create that folder and make that as dependency of SqlServer STIG resource
  2. the Get and Test operation has the following SQL statement which will not work: - there is no values provided in the insert statement.

CREATE TABLE #AuditEvents (AuditEvent varchar(100)) INSERT INTO #AuditEvents (AuditEvent) VALUES ()

pursca avatar Aug 12 '19 18:08 pursca