diff --git a/internal/scanners/synw/rules.go b/internal/scanners/synw/rules.go index 835765b0..7537d07f 100644 --- a/internal/scanners/synw/rules.go +++ b/internal/scanners/synw/rules.go @@ -87,7 +87,7 @@ func (a *SynapseWorkspaceScanner) getWorkspaceRules() map[string]scanners.AzureR Impact: scanners.ImpactHigh, Eval: func(target interface{}, scanContext *scanners.ScanContext) (bool, string) { c := target.(*armsynapse.Workspace) - return *c.Properties.ManagedVirtualNetwork != "default", "" + return c.Properties.ManagedVirtualNetwork == nil || strings.ToLower(*c.Properties.ManagedVirtualNetwork) != "default", "" }, Url: "https://learn.microsoft.com/en-us/security/benchmark/azure/baselines/azure-synapse-analytics-security-baseline?toc=%2Fazure%2Fsynapse-analytics%2Ftoc.json", }, diff --git a/internal/scanners/synw/rules_test.go b/internal/scanners/synw/rules_test.go index a7b38e28..4f9664d9 100644 --- a/internal/scanners/synw/rules_test.go +++ b/internal/scanners/synw/rules_test.go @@ -92,7 +92,7 @@ func TestSynapseWorkspaceScanner_WorkspaceRules(t *testing.T) { }, }, { - name: "SynapseWorkspaceScanner Security Profile", + name: "SynapseWorkspaceScanner ManagedVirtualNetwork default", fields: fields{ rule: "synw-006", target: &armsynapse.Workspace{ @@ -108,6 +108,23 @@ func TestSynapseWorkspaceScanner_WorkspaceRules(t *testing.T) { result: "", }, }, + { + name: "SynapseWorkspaceScanner ManagedVirtualNetwork null", + fields: fields{ + rule: "synw-006", + target: &armsynapse.Workspace{ + Name: to.Ptr("synw-test"), + Properties: &armsynapse.WorkspaceProperties{ + ManagedVirtualNetwork: nil, + }, + }, + scanContext: &scanners.ScanContext{}, + }, + want: want{ + broken: true, + result: "", + }, + }, { name: "SynapseWorkspaceScanner Security Profile", fields: fields{