Skip to content

Commit

Permalink
Remove duplicate TTPs
Browse files Browse the repository at this point in the history
  • Loading branch information
f-bader committed Nov 17, 2023
1 parent 637d0d7 commit 2139367
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/public/Convert-SentinelARYamlToArm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,21 @@ function Convert-SentinelARYamlToArm {
$ARMTemplate.techniques = $ARMTemplate.techniques | Where-Object { Test-MITRETechnique $_ }
}

# Remove duplicate techniques
if ($ARMTemplate.techniques) {
$ARMTemplate.techniques = $ARMTemplate.techniques | Sort-Object -Unique
}

# Remove any invalid or non-existent tactics from the tactics array
if ($ARMTemplate.tactics) {
$ARMTemplate.tactics = $ARMTemplate.tactics | Where-Object { Test-MITRETactic $_ }
}

# Remove duplicate tactics
if ($ARMTemplate.tactics) {
$ARMTemplate.tactics = $ARMTemplate.tactics | Sort-Object -Unique
}

# Convert hashtable to JSON
$JSON = $ARMTemplate | ConvertTo-Json -Depth 99
# Use ISO8601 format for timespan values
Expand Down

0 comments on commit 2139367

Please sign in to comment.