Giter Club home page Giter Club logo

Comments (4)

jmetzger-novetta avatar jmetzger-novetta commented on June 2, 2024 1

@erjenkin -- thanks so much for testing that out. I think I figured out what the problem is.

The only other PS module I'd installed aside from PowerSTIG was SqlServer, which I needed it to run another piece of software that assesses STIG compliance. It looks like the presence of the SqlServer module was causing the behavior I documented.

To test:

  • I compiled your example config.
  • I deleted the SqlServer module from my PS modules folder, then applied the example config. The DSC configuration was applied successfully.
  • I copied the SqlServer module back into my PS modules folder, removed the config and stopped the DSC process using the snippet below, then re-applied your example config. It generated the exception I logged in my previous post (screenshot below).
Remove-DscConfigurationDocument -Stage Current,Pending,Previous -Verbose -Force
###
### Find the process that is hosting the DSC engine
###
$CimParameters = @{
    ClassName = 'Msft_Providers'
    Filter    = "provider='dsctimer' OR provider='dsccore'"
}
$dscProcessID = Get-CimInstance @CimParameters |
    Select-Object -ExpandProperty HostProcessIdentifier
###
### Stop the process
###
Get-Process -Id $dscProcessID | Stop-Process

image

  • I removed the config and stopped the DSC process once again using the snippet, deleted the SqlServer module from my PS modules folder, then re-applied your example config. The DSC configuration was applied successfully once again.

I'm not sure why the presence of the SqlServer module is causing this behavior, but it seems to be responsible.

from powerstig.

erjenkin avatar erjenkin commented on June 2, 2024

I would assume you are missing the audit directory based on that rule. Can you try to use the whole dsc config from that example? The path needs to be "'C:\Audits'

configuration Example
{
    param
    (
        [parameter()]
        [string]
        $NodeName = 'localhost'
    )

    Import-DscResource -ModuleName PowerStig

    Node localhost
    {

        File SqlAudit
        {
            Ensure = "Present"
            Type   = "Directory"
            DestinationPath = "C:\Audits"
        }

        SqlServer BaseLine
        {
            SqlVersion     = '2016'
            SqlRole        = 'Instance'
            ServerInstance = 'SQL2019onServer'
        }
    }
}

Example

from powerstig.

jmetzger-novetta avatar jmetzger-novetta commented on June 2, 2024

I'm not sure that's it -- I had manually created the C:\Audits directory previously.

I also deleted the directory and then ran the example config with the additional File block to ensure the C:\Audits dir is present. After starting this configuration, I see that C:\Audits has been created, but I still see the aforementioned exception for each of the SqlScriptQueryRule entities.

Is there anything else I might be missing?

from powerstig.

erjenkin avatar erjenkin commented on June 2, 2024

Just deployed SQL2019 on Server 2019 and the configuration passes - with the exception of one rule - V-213975 - guessing because this option does not exist on SQL2019
image
After skipping that single rule, the configuration applies.
image

from powerstig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.