Skip to content

Commit 8d993b4

Browse files
authored
Promote Azure.ACR.AnonymousAccess to GA Azure#3119 (Azure#3204)
1 parent faf7b2d commit 8d993b4

File tree

6 files changed

+38
-13
lines changed

6 files changed

+38
-13
lines changed

data/policy-ignore.json

+8
Original file line numberDiff line numberDiff line change
@@ -296,5 +296,13 @@
296296
],
297297
"reason": "Duplicate",
298298
"value": "Azure.AppConfig.DisableLocalAuth"
299+
},
300+
{
301+
"policyDefinitionIds": [
302+
"/providers/Microsoft.Authorization/policyDefinitions/9f2dea28-e834-476c-99c5-3507b4728395",
303+
"/providers/Microsoft.Authorization/policyDefinitions/cced2946-b08a-44fe-9fd9-e4ed8a779897"
304+
],
305+
"reason": "Duplicate",
306+
"value": "Azure.ACR.AnonymousAccess"
299307
}
300308
]

docs/CHANGELOG-v1.md

+8
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ See [upgrade notes][1] for helpful information when upgrading from previous vers
2929

3030
## Unreleased
3131

32+
What's changed since v1.40.0:
33+
34+
- Updated rules:
35+
- Container Registry:
36+
- Updated documentation and promoted `Azure.ACR.AnonymousAccess` to GA by @BernieWhite.
37+
[#3119](https://github.com/Azure/PSRule.Rules.Azure/issues/3119)
38+
- Bumped rule set to `2024_12`.
39+
3240
## v1.40.0
3341

3442
What's changed since v1.39.3:

docs/en/rules/Azure.ACR.AnonymousAccess.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
2+
reviewed: 2024-12-10
23
severity: Important
34
pillar: Security
45
category: SE:05 Identity and access management
@@ -37,7 +38,7 @@ For example:
3738
```json
3839
{
3940
"type": "Microsoft.ContainerRegistry/registries",
40-
"apiVersion": "2023-08-01-preview",
41+
"apiVersion": "2023-11-01-preview",
4142
"name": "[parameters('name')]",
4243
"location": "[parameters('location')]",
4344
"sku": {
@@ -79,7 +80,7 @@ To deploy registries that pass this rule:
7980
For example:
8081

8182
```bicep
82-
resource registry 'Microsoft.ContainerRegistry/registries@2023-08-01-preview' = {
83+
resource registry 'Microsoft.ContainerRegistry/registries@2023-11-01-preview' = {
8384
name: name
8485
location: location
8586
sku: {
@@ -112,7 +113,7 @@ resource registry 'Microsoft.ContainerRegistry/registries@2023-08-01-preview' =
112113
}
113114
```
114115

115-
<!-- external:avm avm/res/container-registry/registry:0.5.1 anonymousPullEnabled -->
116+
<!-- external:avm avm/res/container-registry/registry anonymousPullEnabled -->
116117

117118
### Configure with Azure CLI
118119

@@ -122,13 +123,21 @@ To configure registries that pass this rule:
122123
az acr update -n '<name>' -g '<resource_group>' --anonymous-pull-enabled false
123124
```
124125

126+
### Configure with Azure Policy
127+
128+
To address this issue at runtime use the following policies:
129+
130+
- [Container registries should have anonymous authentication disabled](https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/Container%20Registry/ACR_AnonymousPullDisabled_AuditDeny.json)
131+
`/providers/Microsoft.Authorization/policyDefinitions/9f2dea28-e834-476c-99c5-3507b4728395`.
132+
- [Configure container registries to disable anonymous authentication](https://github.com/Azure/azure-policy/blob/master/built-in-policies/policyDefinitions/Container%20Registry/ACR_AnonymousPullDisabled_Modify.json)
133+
`/providers/Microsoft.Authorization/policyDefinitions/cced2946-b08a-44fe-9fd9-e4ed8a779897`.
134+
125135
## NOTES
126136

127-
The anonymous pull access feature is currently in preview.
128137
Anonymous pull access is only available in the `Standard` and `Premium` service tiers.
129138

130-
This rule may generate false positives in specific scenarios where to intend to distribute OCI content to Internet users,
131-
for example: You are a software vendor and intend to distribute container images of your software to customers.
139+
This rule may generate false positives in specific scenarios where to intend to distribute OCI content to Internet users.
140+
For example: You are a software vendor and intend to distribute container images of your software to customers.
132141

133142
## LINKS
134143

docs/examples/avm/acr.bicep

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ param name string
1212
param location string = resourceGroup().location
1313

1414
// An example container registry deployed with Premium SKU.
15-
module registry 'br/public:avm/res/container-registry/registry:0.5.1' = {
15+
module registry 'br/public:avm/res/container-registry/registry:0.6.0' = {
1616
params: {
1717
name: name
1818
location: location

src/PSRule.Rules.Azure/rules/Azure.ACR.Rule.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ metadata:
143143
ref: AZR-000401
144144
tags:
145145
release: preview
146-
ruleSet: 2023_09
146+
ruleSet: 2024_12
147147
Azure.WAF/pillar: Security
148148
labels:
149149
Azure.MCSB.v1/control: 'IM-1'

tests/PSRule.Rules.Azure.Tests/Azure.Baseline.Tests.ps1

+5-5
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Describe 'Baselines' -Tag Baseline {
213213
$result = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.Preview_2023_09' -WarningAction Ignore);
214214
$filteredResult = @($result | Where-Object { $_.Tag.release -in 'preview'});
215215
$filteredResult | Should -Not -BeNullOrEmpty;
216-
$filteredResult.Length | Should -Be 8;
216+
$filteredResult.Length | Should -Be 7;
217217
}
218218

219219
It 'With Azure.GA_2023_12' {
@@ -227,7 +227,7 @@ Describe 'Baselines' -Tag Baseline {
227227
$result = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.Preview_2023_12' -WarningAction Ignore);
228228
$filteredResult = @($result | Where-Object { $_.Tag.release -in 'preview'});
229229
$filteredResult | Should -Not -BeNullOrEmpty;
230-
$filteredResult.Length | Should -Be 8;
230+
$filteredResult.Length | Should -Be 7;
231231
}
232232

233233
It 'With Azure.GA_2024_03' {
@@ -241,7 +241,7 @@ Describe 'Baselines' -Tag Baseline {
241241
$result = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.Preview_2024_03' -WarningAction Ignore);
242242
$filteredResult = @($result | Where-Object { $_.Tag.release -in 'preview'});
243243
$filteredResult | Should -Not -BeNullOrEmpty;
244-
$filteredResult.Length | Should -Be 8;
244+
$filteredResult.Length | Should -Be 7;
245245
}
246246

247247
It 'With Azure.GA_2024_06' {
@@ -255,7 +255,7 @@ Describe 'Baselines' -Tag Baseline {
255255
$result = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.Preview_2024_06' -WarningAction Ignore);
256256
$filteredResult = @($result | Where-Object { $_.Tag.release -in 'preview'});
257257
$filteredResult | Should -Not -BeNullOrEmpty;
258-
$filteredResult.Length | Should -Be 11;
258+
$filteredResult.Length | Should -Be 10;
259259
}
260260

261261
It 'With Azure.GA_2024_09' {
@@ -269,7 +269,7 @@ Describe 'Baselines' -Tag Baseline {
269269
$result = @(Get-PSRule -Module PSRule.Rules.Azure -Baseline 'Azure.Preview_2024_09' -WarningAction Ignore);
270270
$filteredResult = @($result | Where-Object { $_.Tag.release -in 'preview'});
271271
$filteredResult | Should -Not -BeNullOrEmpty;
272-
$filteredResult.Length | Should -Be 13;
272+
$filteredResult.Length | Should -Be 12;
273273
}
274274
}
275275
}

0 commit comments

Comments
 (0)