class Chef::Resource::WindowsAuditPolicy

Constants

WIN_AUDIT_SUBCATEGORIES

Public Instance Methods

option_configured?(option_name, option_setting) click to toggle source
# File lib/chef/resource/windows_audit_policy.rb, line 220
        def option_configured?(option_name, option_setting)
          setting = option_setting ? "Enabled$" : "Disabled$"
          powershell_exec!(<<-CODE).result
            $auditpol_config = auditpol /get /option:#{option_name}
            if ($auditpol_config | Select-String "#{setting}") { return $true } else { return $false }
          CODE
        end
subcategory_configured?(sub_cat, success_value, failure_value) click to toggle source
# File lib/chef/resource/windows_audit_policy.rb, line 204
        def subcategory_configured?(sub_cat, success_value, failure_value)
          setting = if success_value && failure_value
                      "Success and Failure$"
                    elsif success_value && !failure_value
                      "Success$"
                    elsif !success_value && failure_value
                      "#{sub_cat}\\s+Failure$"
                    else
                      "No Auditing"
                    end
          powershell_exec!(<<-CODE).result
            $auditpol_config = auditpol /get /subcategory:"#{sub_cat}"
            if ($auditpol_config | Select-String "#{setting}") { return $true } else { return $false }
          CODE
        end