Project

General

Profile

Actions

Bug #20083

closed

DSC policies are generated without the conditions

Added by Félix DALLIDET 9 months ago. Updated 8 months ago.

Status:
Released
Priority:
N/A
Category:
rudderc
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
First impressions of Rudder
Effort required:
Priority:
124

Description

See the tehcnique attached and its generated ps1 file:

function Dsc-Block-Test {
  [CmdletBinding()]
  param (
      [parameter(Mandatory=$true)]
      [string]$reportId,
      [parameter(Mandatory=$true)]
      [string]$techniqueName,
      [switch]$auditOnly
  )

  $local_classes = New-ClassContext
  $resources_dir = $PSScriptRoot + "\resources" 

  $class = "" 
  if (Evaluate-Class $class $local_classes $system_classes) {
    $local_classes = Merge-ClassContext $local_classes $(Service-Started -Name "sshd" -componentName "Service started" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly)
.get_item("classes")
  } else {
    _rudder_common_report_na -componentName "Service started" -componentKey "sshd" -message "Not applicable" -reportId $reportId -techniqueName $techniqueName -auditOnly:$auditOnly
  }

  $class = "" 
  if (Evaluate-Class $class $local_classes $system_classes) {
    $local_classes = Merge-ClassContext $local_classes $(Command-Execution -Command "write-output `"bob`"" -componentName "Command execution" -reportId $reportId -techniqueName $techniqueName
 -auditOnly:$auditOnly).get_item("classes")
  } else {
    _rudder_common_report_na -componentName "Command execution" -componentKey "write-output `"bob`"" -message "Not applicable" -reportId $reportId -techniqueName $techniqueName -auditOnly:$au
ditOnly
  }

}


Files

dsc_block_test.json (1.26 KB) dsc_block_test.json Félix DALLIDET, 2021-10-07 14:56

Subtasks 2 (0 open2 closed)

Bug #20109: String terminated by a double quote are not properly handles by ruddercReleasedAlexis MoussetActions
Bug #20110: rudderc translates kept into successReleasedAlexis MoussetActions
Actions

Also available in: Atom PDF