Skip to content

Commit 48aead2

Browse files
authored
Update readme and add custom baseline (#48)
1 parent abc1d99 commit 48aead2

4 files changed

Lines changed: 31 additions & 4 deletions

File tree

.ps-rule/Baseline.Rule.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
# IMPORTANT:
5+
# This file demonstrates defining YAML-based custom baselines.
6+
# To correctly find resources set binding configuration within ps-rule.yaml.
7+
# See: https://azure.github.io/PSRule.Rules.Azure/customization/using-custom-rules/#set-binding-configuration
8+
9+
---
10+
# Synopsis: This is an example of a custom baseline that only includes GA rules in the Security and Reliability pillars.
11+
apiVersion: github.com/microsoft/PSRule/v1
12+
kind: Baseline
13+
metadata:
14+
name: Org.Custom.Baseline
15+
spec:
16+
rule:
17+
tag:
18+
release: GA
19+
Azure.WAF/pillar:
20+
- Security
21+
- Reliability
22+
23+
exclude:
24+
- Azure.Deployment.Name

.ps-rule/Org.Rule.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the MIT License.
33

44
# Note:
5-
# This files demonstrates using YAML-based rules.
5+
# This file demonstrates defining YAML-based custom rules.
66

77
---
88
# Synopsis: Azure resource must have an valid env tag set.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ This repository includes:
2222
- The `ms-analyze.yaml` file can be ignore or removed as this will not execute outside this repository.
2323
- **Azure Pipelines** — Starter pipeline for checking Azure Infrastructure as Code (IaC).
2424
- Use the files in the `.pipelines/` to check your Azure IaC with Azure Pipelines.
25-
- **Custom rules** — Example custom rules that enforce organization specific requirements.
26-
- Use the files in the `.ps-rule/` folder to configure custom rules.
25+
- **Custom rules and baselines** — Example custom rules and baselines.
26+
- These rules and baselines can be used to enforce organization specific requirements.
27+
- Use the files in the `.ps-rule/` folder to configure custom rules and baselines.
2728
- **PSRule options** — Example options for using PSRule for Azure.
2829
- PSRule options are configures within `ps-rule.yaml`.
2930
- Options include suppressing rules, configuring input/ output, and any rules modules.
3031

31-
> **ARM templates**
32+
> [!NOTE]
3233
> PSRule for Azure supports ARM templates in addition to Bicep code.
3334
> However going forward this repository will focus on Bicep deployments and modules.
3435
> Existing ARM templates samples are no longer maintained and have been archived.

ps-rule.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ binding:
1313
- type
1414
- resourceType
1515

16+
# Do not warn if an Azure resource or related object has no rules.
1617
execution:
1718
unprocessedObject: Ignore
1819

@@ -26,6 +27,7 @@ include:
2627
module:
2728
- PSRule.Rules.Azure
2829

30+
# Configure the output culture for recommendations.
2931
output:
3032
culture:
3133
- 'en-US'

0 commit comments

Comments
 (0)