Skip to content

Commit 38e77ec

Browse files
authored
Merge pull request #39 from f-bader/Fix-RelevantTechniques
🐛 Rename techniques to relevantTechniques
2 parents d84db20 + d8f13f5 commit 38e77ec

5 files changed

+11
-8
lines changed

README.md

+3
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ This way the following KQL query will be converted...
174174

175175
## Changelog
176176

177+
### 2.4.2
178+
* FIX: Arm to YAML used `techniques` instead of `relevantTechniques`
179+
177180
### 2.4.1
178181
* FIX: Handle error if `incidentConfiguration` section is missing from source YAML in `Convert-SentinelARYamlToArm` when using `-DisableIncidentCreation`
179182

src/SentinelARConverter.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'SentinelARConverter.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.4.1'
15+
ModuleVersion = '2.4.2'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

src/public/Convert-SentinelARArmToYaml.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ function Convert-SentinelARArmToYaml {
347347
# We must merge all techniques since (relevant)techniques could contain values not preset in subTechniques
348348
if ($PropertyName -like "*techniques") {
349349
foreach ($value in $AnalyticsRule.$PropertyName) {
350-
$KeyName = "techniques"
350+
$KeyName = "relevantTechniques"
351351
$technique = $value -replace "(T\d{4})\.\d{3}", '$1'
352352
# Create an empty key
353353
if ( -not $AnalyticsRuleCleaned.Contains($KeyName) ) {

tests/Convert-SentinelARArmToYaml.tests.ps1

+2-3
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,7 @@ Describe "Convert-SentinelARArmToYaml" {
133133
}
134134

135135
BeforeEach {
136-
$ARMTemplateContent = Get-Content -Path "TestDrive:/$ExampleFileName" -Raw
137-
$ARMTemplateContent | Convert-SentinelARArmToYaml -OutFile $convertedExampleFilePath
136+
Convert-SentinelARArmToYaml -Filename "TestDrive:/$ExampleFileName" -OutFile $convertedExampleFilePath
138137
}
139138

140139
It "Properly converts the propertynames" {
@@ -589,7 +588,7 @@ Describe "Simple example tests" {
589588
It "Merged RelevantTechniques, SubTechniques and Techniques into single property" {
590589
$converted = Convert-SentinelARArmToYaml -Filename "TestDrive:/Content/TTPWithTacticsNTechniques.json" | ConvertFrom-Yaml
591590
$converted.subTechniques | Should -Be $null
592-
$converted.Techniques -join ", " | Should -Be "T1078.003, T1078.004"
591+
$converted.RelevantTechniques -join ", " | Should -Be "T1078.003, T1078.004"
593592
}
594593
}
595594
}

tests/examples/Scheduled.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
{
32
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
43
"contentVersion": "1.0.0.0",
@@ -30,7 +29,9 @@
3029
"tactics": [
3130
"InitialAccess"
3231
],
33-
"techniques": [],
32+
"techniques": [
33+
"T1078"
34+
],
3435
"alertRuleTemplateName": "2de8abd6-a613-450e-95ed-08e503369fb3",
3536
"incidentConfiguration": {
3637
"createIncident": true,
@@ -71,4 +72,4 @@
7172
}
7273
}
7374
]
74-
}
75+
}

0 commit comments

Comments
 (0)