@@ -116,6 +116,7 @@ Each rule **must** meet the following requirements:
116
116
- The rule name must not be longer than 35 characters.
117
117
- Use a unique ` Ref ` following the format ` AZR-nnnnnnn ` .
118
118
Where ` nnnnnn ` is a sequential number from ` 000001 ` .
119
+ See [ how to get the next unique rule ref] ( #how-to-get-the-next-unique-rule-ref ) .
119
120
- Have documentation and unit tests.
120
121
- Have a ` release ` tag either ` GA ` or ` preview ` . e.g. ` -Tag @{ release = 'GA' } `
121
122
- Rules are marked as ` GA ` if they relate to generally available Azure features.
@@ -125,13 +126,16 @@ Each rule **must** meet the following requirements:
125
126
- The rule set tag identifies the quarter that the rule was first released.
126
127
- This is used to include rules in quarterly baselines.
127
128
- New rules are included in the next quarterly baseline. i.e. (YYYY_03, YYYY_06, YYYY_09, YYYY_12)
129
+ - Have a ` Azure.WAF/pillar ` tag identifying the primary WAF pillar the rule aligns to.
130
+ e.g. ` -Tag @{ release = 'GA'; ruleSet = '2020_09'; 'Azure.WAF/pillar' = 'Reliability' } `
131
+ - If more then one pillar is applicable, the ` Azure.WAF/additionalPillars ` label can be added on rules.
128
132
- Include an inline ` Synopsis: ` comment above each rule.
129
133
130
134
For example:
131
135
132
136
``` powershell
133
137
# Synopsis: Consider configuring a managed identity for each API Management instance.
134
- Rule 'Azure.APIM.ManagedIdentity' -Type 'Microsoft.ApiManagement/service' -Tag @{ release = 'GA'; ruleSet = '2020_06' } {
138
+ Rule 'Azure.APIM.ManagedIdentity' -Type 'Microsoft.ApiManagement/service' -Tag @{ release = 'GA'; ruleSet = '2020_06'; 'Azure.WAF/pillar' = 'Security' } {
135
139
$Assert.In($TargetObject, 'Identity.Type', @('SystemAssigned', 'UserAssigned'))
136
140
}
137
141
```
@@ -146,6 +150,7 @@ metadata:
146
150
tags :
147
151
release : ' GA'
148
152
ruleSet : ' 2020_06'
153
+ Azure.WAF/pillar : Security
149
154
spec :
150
155
type :
151
156
- Microsoft.ApiManagement/service
@@ -164,6 +169,15 @@ spec:
164
169
- Use ` -Type` over `-If` pre-conditions when possible.
165
170
Both may be required in some cases.
166
171
172
+ # ## How to get the next unique rule ref?
173
+
174
+ To get the next unique rule ref :
175
+
176
+ 1. Scroll to the bottom of this [reference](https://azure.github.io/PSRule.Rules.Azure/en/rules/) page.
177
+ 2. Choose the next available ref number sequence.
178
+ 3. Be aware of any existing open PRs that add rules, and choose the next available ref number sequence.
179
+ If both PRs choose the same rule ref the CI build will fail after one is merged.
180
+
167
181
# ## Adding rule configuration options
168
182
169
183
For some rules, adding configuration options to allow customization may be helpful.
0 commit comments