Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final updates for merge #252

Merged
merged 6 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions .github/workflows/bicep-build-to-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
pull_request:
branches:
- main

# TODO: Branch for integration testing, to be removed before integration into main.
- ps-rule
paths:
- "**.bicep"
- "ps-rule.yaml"
Expand All @@ -20,7 +17,7 @@ jobs:

steps:
- name: Checkout Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand Down Expand Up @@ -51,10 +48,11 @@ jobs:
with:
fetch-depth: 0

# Add pipeline tests for Azure Well-Architected Framework
# Add pipeline tests for Azure Well-Architected Framework.
# See https://aka.ms/ps-rule-action for configuration options.
- name: Run PSRule analysis
uses: Microsoft/ps-rule@v2.1.0
uses: Microsoft/ps-rule@v2.3.2
with:
modules: PSRule.Rules.Azure
baseline: Azure.GA_2022_03
baseline: Azure.GA_2022_06
continue-on-error: true
11 changes: 11 additions & 0 deletions .ps-rule/Minimum.Rule.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#
# Suppression and rules for the minimum sample configuration.
#

# NOTE:
# For details on authoring suppression groups see:
# https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_SuppressionGroups/
# https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/

---
# Synopsis: Ignore the minimum sample configuration.
Expand All @@ -12,12 +20,15 @@ spec:
- Azure.PublicIP.AvailabilityZone
- Azure.VNG.VPNActiveActive
- Azure.PublicIP.StandardSKU
- Azure.VNET.UseNSGs
if:
allOf:
- type: '.'
in:
- Microsoft.Network/azureFirewalls
- Microsoft.Network/publicIPAddresses
- Microsoft.Network/virtualNetworks
- Microsoft.Network/virtualNetworkGateways
- source: 'Template'
endsWith:
- 'minimum.sample.bicep'
25 changes: 25 additions & 0 deletions .ps-rule/Unsupported.Rule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#
# Suppression and rules for unsupported scenarios.
#

# NOTE:
# For details on authoring suppression groups see:
# https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_SuppressionGroups/
# https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Expressions/

---
# Synopsis: Ignore availability zones for Azure Bastion public IP which is not supported. https://github.com/Azure/PSRule.Rules.Azure/issues/1442
apiVersion: github.com/microsoft/PSRule/v1
kind: SuppressionGroup
metadata:
name: ALZ.PublicIPForBastion
spec:
rule:
- Azure.PublicIP.AvailabilityZone
if:
allOf:
- name: '.'
contains: bastion
- type: '.'
in:
- Microsoft.Network/publicIPAddresses
7 changes: 5 additions & 2 deletions ps-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

# Please see the documentation for all configuration options:
# https://aka.ms/ps-rule-azure
# https://aka.ms/ps-rule-azure/options
# https://aka.ms/ps-rule/options
# https://aka.ms/ps-rule-azure/bicep

# Use rules from the following modules/
include:
Expand All @@ -12,8 +15,8 @@ include:

# Require a minimum version of modules that include referenced baseline.
requires:
PSRule: '@pre >=2.1.0'
PSRule.Rules.Azure: '@pre >=1.15.2'
PSRule: '@pre >=2.3.2'
PSRule.Rules.Azure: '@pre >=1.18.1'

# Reference the repository in output.
repository:
Expand Down