Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sql server 2016 Instance STIG - V-79141 Issue #467

Open
pursca opened this issue Aug 12, 2019 · 0 comments
Open

Sql server 2016 Instance STIG - V-79141 Issue #467

pursca opened this issue Aug 12, 2019 · 0 comments
Assignees
Labels
bug Something isn't working In Progress

Comments

@pursca
Copy link

pursca commented Aug 12, 2019

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 ()

@stevehose stevehose self-assigned this Nov 7, 2019
@stevehose stevehose added bug Something isn't working In Progress labels Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working In Progress
Projects
None yet
Development

No branches or pull requests

2 participants