Skip to content

Commit 39f84e5

Browse files
committed
Update COSMOS-001 Effect to Modify in Cosmos DB policy definitions and tests
1 parent b3f42ed commit 39f84e5

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

  • tests/policy-integration-tests/cosmos-db

tests/policy-integration-tests/cosmos-db/tests.ps1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ $initiateTestScriptPath = (resolve-path -RelativeBasePath $PSScriptRoot -path '.
2222
#region defining tests
2323
<#
2424
The following policy definitions are tested:.
25-
- COSMOS-001: Azure Cosmos DB accounts should have local authentication disabled (Deny)
25+
- COSMOS-001: Azure Cosmos DB accounts should have local authentication disabled (Modify)
2626
- COSMOS-002: Azure Cosmos DB accounts should have firewall rules (Deny)
2727
- COSMOS-003: Azure Cosmos DB should disable public network access (Deny)
2828
- COSMOS-004: Azure Cosmos DB accounts should use customer-managed keys to encrypt data at rest (Audit)
@@ -42,10 +42,6 @@ $cosmosPolicyAssignmentId = $script:LocalConfig_policyAssignmentIds | Where-Obje
4242
$privateEndpointResourceId = $script:bicepDeploymentOutputs.privateEndpointResourceId.value
4343
$privateEndpointPrivateDNSZoneGroupId = '{0}{1}' -f $privateEndpointResourceId, $script:GlobalConfig_privateEndpointPrivateDNSZoneGroupIdSuffix
4444
$violatingPolicies = @(
45-
@{
46-
policyAssignmentId = $cosmosPolicyAssignmentId
47-
policyDefinitionReferenceId = 'COSMOS-001'
48-
}
4945
@{
5046
policyAssignmentId = $cosmosPolicyAssignmentId
5147
policyDefinitionReferenceId = 'COSMOS-002'
@@ -70,7 +66,10 @@ $violatingPolicies = @(
7066
#define tests
7167
$tests = @()
7268

73-
#region Audit Policies
69+
#Modify / Append Policies
70+
$tests += New-ARTPropertyCountTestConfig 'COSMOS-001: Local authentication should be disabled' $script:token $resourceId 'properties.disableLocalAuth' 'equals' true
71+
72+
# Audit Policies
7473
$tests += New-ARTPolicyStateTestConfig 'COSMOS-004: Azure Cosmos DB accounts should use customer-managed keys to encrypt data at rest' $script:token $resourceId $cosmosPolicyAssignmentId 'NonCompliant' 'COSMOS-004'
7574

7675
#DeployIfNotExists Policies

0 commit comments

Comments
 (0)