Skip to content

Instantly share code, notes, and snippets.

@sjwaight
Created September 5, 2023 08:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjwaight/c6eb473837ff026829e9addb934a19d6 to your computer and use it in GitHub Desktop.
Save sjwaight/c6eb473837ff026829e9addb934a19d6 to your computer and use it in GitHub Desktop.
A good default PSRule configuration
#
# PSRule for Azure configuration
#
# 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:
module:
- "PSRule.Rules.Azure"
# Require a minimum version of modules that include referenced baseline.
requires:
PSRule: "@pre >=2.3.2"
PSRule.Rules.Azure: "@pre >=1.18.1"
# Reference the repository in output.
#repository:
# url: <<full repo url>>
execution:
# Ignore warnings for resources and objects that don't have any rules.
unprocessedObject: Ignore
configuration:
# Enable expansion for Bicep source files.
AZURE_BICEP_FILE_EXPANSION: true
# Expand Bicep module from Bicep parameter files.
AZURE_BICEP_PARAMS_FILE_EXPANSION: true
# Set timeout for expanding Bicep source files.
AZURE_BICEP_FILE_EXPANSION_TIMEOUT: 45
output:
culture: [ 'en-AU', 'en-US' ]
input:
pathIgnore:
# Ignore common files that don't need analysis.
- "**/bicepconfig.json"
- "*.md"
- "*.png"
- ".github/"
- ".vscode/"
- ".devcontainer/"
binding:
preferTargetInfo: true
targetType:
- resourceType
- type
rule:
exclude:
# Ignore these recommendations for this repo.
# - Azure.Resource.UseTags # False positive for Management Groups.
# Currently a bug as of v1.15.2. Review in the next release.
# - Azure.PublicIP.Name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment