Improvements to documentation (#1556)
This commit is contained in:
Родитель
6726036171
Коммит
2961c309d2
|
@ -97,7 +97,7 @@ jobs:
|
|||
|
||||
# STEP 2: Run analysis against exported data
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure' # Analyze objects using the rules within the PSRule.Rules.Azure PowerShell module.
|
||||
```
|
||||
|
|
|
@ -6,6 +6,7 @@ Document 'index' {
|
|||
|
||||
Metadata @{
|
||||
generated = $True
|
||||
title = 'Reference'
|
||||
}
|
||||
|
||||
Import-Module ./out/modules/PSRule.Rules.Azure
|
||||
|
|
|
@ -26,7 +26,7 @@ The following configurations options are available for use:
|
|||
- [AZURE_RESOURCE_GROUP](#azure_resource_group)
|
||||
- [AZURE_SUBSCRIPTION](#azure_subscription)
|
||||
|
||||
[1]: https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Options.html
|
||||
[1]: https://aka.ms/ps-rule/options
|
||||
|
||||
### Azure_AKSMinimumVersion
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ Within the root directory of your infrastructure as code repository:
|
|||
|
||||
# Analyze Azure resources using PSRule for Azure
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
```
|
||||
|
@ -71,7 +71,7 @@ When enabled, PSRule for Azure automatically resolves parameter and template fil
|
|||
To enabled this feature, set the `Configuration.AZURE_PARAMETER_FILE_EXPANSION` option to `true`.
|
||||
This option can be set within the `ps-rule.yaml` file.
|
||||
|
||||
```yaml
|
||||
```yaml title="ps-rule.yaml"
|
||||
configuration:
|
||||
# Enable automatic expansion of Azure parameter files
|
||||
AZURE_PARAMETER_FILE_EXPANSION: true
|
||||
|
@ -89,7 +89,7 @@ When enabled, PSRule for Azure automatically expands and analyzes Azure resource
|
|||
To enabled this feature, set the `Configuration.AZURE_BICEP_FILE_EXPANSION` option to `true`.
|
||||
This option can be set within the `ps-rule.yaml` file.
|
||||
|
||||
```yaml
|
||||
```yaml title="ps-rule.yaml"
|
||||
configuration:
|
||||
# Enable automatic expansion of bicep source files
|
||||
AZURE_BICEP_FILE_EXPANSION: true
|
||||
|
@ -108,7 +108,7 @@ To exclude a rule, set `Rule.Exclude` option within the `ps-rule.yaml` file.
|
|||
|
||||
[:octicons-book-24: Docs][3]
|
||||
|
||||
```yaml
|
||||
```yaml title="ps-rule.yaml"
|
||||
rule:
|
||||
exclude:
|
||||
# Ignore the following rules for all resources
|
||||
|
@ -120,7 +120,7 @@ To suppress a rule, set `Suppression` option within the `ps-rule.yaml` file.
|
|||
|
||||
[:octicons-book-24: Docs][4]
|
||||
|
||||
```yaml
|
||||
```yaml title="ps-rule.yaml"
|
||||
suppression:
|
||||
Azure.AKS.AuthorizedIPs:
|
||||
# Exclude the following externally managed AKS clusters
|
||||
|
|
|
@ -181,5 +181,5 @@ Grab the full sample code for each of these files from:
|
|||
- [Org.Azure.Rule.ps1](https://github.com/Azure/PSRule.Rules.Azure/blob/main/docs/customization/enforce-custom-tags/.ps-rule/Org.Azure.Rule.ps1)
|
||||
- [ps-rule.yaml](https://github.com/Azure/PSRule.Rules.Azure/blob/main/docs/customization/enforce-custom-tags/ps-rule.yaml)
|
||||
|
||||
[AWAF]: https://docs.microsoft.com/en-gb/azure/architecture/framework/
|
||||
[assertions]: https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Assert.html
|
||||
[AWAF]: https://docs.microsoft.com/azure/architecture/framework/
|
||||
[assertions]: https://microsoft.github.io/PSRule/v2/commands/PSRule/en-US/Assert-PSRule/
|
||||
|
|
|
@ -39,8 +39,10 @@ As new built-in rules are added and improved, download the latest version to sta
|
|||
For detailed information on building custom rules see:
|
||||
|
||||
- [Enforcing custom tags][3].
|
||||
- [Enforcing code ownership][3].
|
||||
|
||||
[3]: customization/enforce-custom-tags.md
|
||||
[4]: customization/enforce-codeowners.md
|
||||
|
||||
## DevOps integrated
|
||||
|
||||
|
@ -50,7 +52,7 @@ From as early as authoring an ARM template, resources can be validated offline b
|
|||
Pre-flight validation can be integrated into a continuous integration (CI) pipeline as unit tests to:
|
||||
|
||||
- **Shift-left** — Identify configuration issues and provide fast feedback in PRs.
|
||||
- **Quality gates** — Implement quality gates between environments such as development, test, and production.
|
||||
- **Quality gates** — Implement quality gates between environments such as dev, test, and production.
|
||||
- **Monitor continuously** — Perform ongoing checks for configuration optimization opportunities.
|
||||
|
||||
## Cross-platform
|
||||
|
@ -63,25 +65,20 @@ PowerShell makes it easy to integrate PSRule into popular CI systems.
|
|||
Run natively or in a container depending on your platform.
|
||||
PSRule has native extensions for:
|
||||
|
||||
- [Azure Pipelines (Azure DevOps)][4]
|
||||
- [GitHub Actions][5]
|
||||
- [Visual Studio Code][6]
|
||||
- [Azure Pipelines (Azure DevOps)][5]
|
||||
- [GitHub Actions][6]
|
||||
- [Visual Studio Code][7]
|
||||
|
||||
Additionally, PSRule for Azure can be installed locally or within Azure Cloud Shell.
|
||||
For installation options see [installation][7].
|
||||
For installation options see [installation][8].
|
||||
|
||||
[4]: https://marketplace.visualstudio.com/items?itemName=bewhite.ps-rule
|
||||
[5]: https://github.com/marketplace/actions/psrule
|
||||
[6]: https://marketplace.visualstudio.com/items?itemName=bewhite.psrule-vscode
|
||||
[7]: install-instructions.md
|
||||
[5]: https://marketplace.visualstudio.com/items?itemName=bewhite.ps-rule
|
||||
[6]: https://github.com/marketplace/actions/psrule
|
||||
[7]: https://marketplace.visualstudio.com/items?itemName=bewhite.psrule-vscode
|
||||
[8]: install-instructions.md
|
||||
|
||||
*[ARM]: Azure Resource Manager
|
||||
*[WAF]: Well-Architected Framework
|
||||
*[IaC]: Infrastructure as Code
|
||||
*[CI]: Continuous Integration
|
||||
*[PRs]: Pull Requests
|
||||
|
||||
[ignore-rule]: https://github.com/microsoft/PSRule/blob/main/docs/features.md#how-do-i-ignore-a-rule
|
||||
[ps-rule-configure]: https://github.com/microsoft/PSRule/blob/main/docs/features.md#how-do-i-configure-psrule
|
||||
[ps-rule-faq]: https://github.com/microsoft/PSRule/blob/main/docs/features.md#frequently-asked-questions-faq
|
||||
[add-custom-rule]: https://github.com/microsoft/PSRule/blob/main/docs/features.md#how-do-i-layer-on-custom-rules-on-top-of-an-existing-module
|
||||
|
|
|
@ -24,7 +24,7 @@ Install and use PSRule for Azure with GitHub Actions by referencing the `microso
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
```
|
||||
|
@ -35,7 +35,7 @@ Install and use PSRule for Azure with GitHub Actions by referencing the `microso
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
prerelease: true
|
||||
|
@ -113,7 +113,7 @@ Additionally, exporting data from an subscription requires:
|
|||
### Installing PowerShell
|
||||
|
||||
PowerShell 7.x can be installed on MacOS, Linux, and Windows but is not installed by default.
|
||||
For a list of platforms that PowerShell 7.1 is supported on and install instructions see [Get PowerShell][4].
|
||||
For a list of platforms that PowerShell 7.2 is supported on and install instructions see [Get PowerShell][4].
|
||||
|
||||
[4]: https://github.com/PowerShell/PowerShell#get-powershell
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ Import analysis results into Azure Monitor with GitHub Actions by:
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: PSRule.Rules.Azure,PSRule.Monitor
|
||||
conventions: Monitor.LogAnalytics.Import
|
||||
|
@ -84,7 +84,7 @@ Import analysis results into Azure Monitor with GitHub Actions by:
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: PSRule.Rules.Azure,PSRule.Monitor
|
||||
conventions: Monitor.LogAnalytics.Import
|
||||
|
|
|
@ -78,5 +78,5 @@ For the PSRule GitHub Action, use **>=1.4.0**.
|
|||
|
||||
```yaml
|
||||
- name: Run PSRule analysis
|
||||
uses: Microsoft/ps-rule@v1.4.0
|
||||
uses: Microsoft/ps-rule@v2.2.0
|
||||
```
|
||||
|
|
|
@ -20,7 +20,7 @@ To enable this feature, you need to:
|
|||
|
||||
To expand Bicep deployments configure `ps-rule.yaml` with the `AZURE_BICEP_FILE_EXPANSION` option.
|
||||
|
||||
```yaml
|
||||
```yaml title="ps-rule.yaml"
|
||||
# YAML: Enable expansion for Bicep source files.
|
||||
configuration:
|
||||
AZURE_BICEP_FILE_EXPANSION: true
|
||||
|
@ -144,7 +144,7 @@ You may need to [configure credentials][4] to access the private registry from a
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: PSRule.Rules.Azure,PSRule.Monitor
|
||||
conventions: Monitor.LogAnalytics.Import
|
||||
|
|
|
@ -18,7 +18,7 @@ To enable this feature, you need to:
|
|||
|
||||
To expand parameter files configure `ps-rule.yaml` with the `AZURE_PARAMETER_FILE_EXPANSION` option.
|
||||
|
||||
```yaml
|
||||
```yaml title="ps-rule.yaml"
|
||||
# YAML: Enable expansion for template expansion.
|
||||
configuration:
|
||||
AZURE_PARAMETER_FILE_EXPANSION: true
|
||||
|
|
|
@ -77,7 +77,7 @@ See [reference][1] for a list baselines shipped with PSRule for Azure.
|
|||
```yaml
|
||||
# Analyze Azure resources using PSRule for Azure
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.1.0
|
||||
uses: microsoft/ps-rule@v2.2.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
baseline: 'Azure.GA_2022_06'
|
||||
|
@ -96,13 +96,25 @@ See [reference][1] for a list baselines shipped with PSRule for Azure.
|
|||
baseline: 'Azure.GA_2022_06'
|
||||
```
|
||||
|
||||
=== "PowerShell"
|
||||
|
||||
Update your PowerShell command-line with `-Baseline <name_of_baseline>`.
|
||||
|
||||
```powershell title="With Assert-PSRule"
|
||||
Assert-PSRule -Format File -InputPath '.' -Module 'PSRule.Rules.Azure' -Baseline 'Azure.GA_2022_06'
|
||||
```
|
||||
|
||||
```powershell title="With Invoke-PSRule"
|
||||
Invoke-PSRule -Format File -InputPath '.' -Module 'PSRule.Rules.Azure' -Baseline 'Azure.GA_2022_06'
|
||||
```
|
||||
|
||||
[1]: en/baselines/Azure.All.md
|
||||
|
||||
## Creating baselines
|
||||
|
||||
To create your own baselines see the PSRule help topic [about_PSRule_Baseline][2].
|
||||
|
||||
[2]: https://microsoft.github.io/PSRule/concepts/PSRule/en-US/about_PSRule_Baseline.html
|
||||
[2]: https://microsoft.github.io/PSRule/v2/concepts/PSRule/en-US/about_PSRule_Baseline/
|
||||
|
||||
## Including custom rules
|
||||
|
||||
|
@ -114,7 +126,7 @@ When you specify a baseline, custom rules you create and store in `.ps-rule/` wi
|
|||
To change this behavior, set the `Rule.IncludeLocal` option to `true`.
|
||||
This option can be set in `ps-rule.yaml`.
|
||||
|
||||
```yaml
|
||||
```yaml title="ps-rule.yaml"
|
||||
# YAML: Enable custom rules that don't exist in the baseline
|
||||
rule:
|
||||
includeLocal: true
|
||||
|
|
|
@ -131,10 +131,3 @@ extra:
|
|||
|
||||
local:
|
||||
social_preview: https://repository-images.githubusercontent.com/184154668/58818c00-d496-11eb-9b77-016145022654
|
||||
|
||||
# alternate:
|
||||
|
||||
# # Switch to English
|
||||
# - name: English
|
||||
# link: /en/
|
||||
# lang: en
|
||||
|
|
Загрузка…
Ссылка в новой задаче