Родитель
bf3692a936
Коммит
2f265e2962
|
@ -1,70 +1,70 @@
|
|||
{
|
||||
"default": true,
|
||||
"header-increment": true,
|
||||
"first-header-h1": {
|
||||
"level": 1
|
||||
},
|
||||
"header-style": {
|
||||
"style": "atx"
|
||||
},
|
||||
"ul-style": {
|
||||
"style": "dash"
|
||||
},
|
||||
"list-indent": true,
|
||||
"ul-start-left": true,
|
||||
"ul-indent": {
|
||||
"indent": 2
|
||||
},
|
||||
"no-trailing-spaces": true,
|
||||
"no-hard-tabs": true,
|
||||
"no-reversed-links": true,
|
||||
"no-multiple-blanks": true,
|
||||
"line-length": {
|
||||
"line_length": 120,
|
||||
"code_blocks": false,
|
||||
"tables": false,
|
||||
"headers": true
|
||||
},
|
||||
"commands-show-output": true,
|
||||
"no-missing-space-atx": true,
|
||||
"no-multiple-space-atx": true,
|
||||
"no-missing-space-closed-atx": true,
|
||||
"no-multiple-space-closed-atx": true,
|
||||
"blanks-around-headers": true,
|
||||
"header-start-left": true,
|
||||
"no-duplicate-header": true,
|
||||
"single-h1": {
|
||||
"front_matter_title": ""
|
||||
},
|
||||
"no-trailing-punctuation": {
|
||||
"punctuation": ".,;:!"
|
||||
},
|
||||
"no-multiple-space-blockquote": true,
|
||||
"no-blanks-blockquote": true,
|
||||
"ol-prefix": {
|
||||
"style": "one_or_ordered"
|
||||
},
|
||||
"list-marker-space": true,
|
||||
"blanks-around-fences": true,
|
||||
"blanks-around-lists": true,
|
||||
"no-bare-urls": true,
|
||||
"hr-style": {
|
||||
"style": "---"
|
||||
},
|
||||
"no-emphasis-as-header": true,
|
||||
"no-space-in-emphasis": true,
|
||||
"no-space-in-code": true,
|
||||
"no-space-in-links": true,
|
||||
"fenced-code-language": true,
|
||||
"first-line-h1": false,
|
||||
"no-empty-links": true,
|
||||
"proper-names": {
|
||||
"names": [
|
||||
"PowerShell",
|
||||
"JavaScript"
|
||||
],
|
||||
"code_blocks": false
|
||||
},
|
||||
"no-alt-text": true,
|
||||
"code-block-style": false
|
||||
"default": true,
|
||||
"header-increment": true,
|
||||
"first-header-h1": {
|
||||
"level": 1
|
||||
},
|
||||
"header-style": {
|
||||
"style": "atx"
|
||||
},
|
||||
"ul-style": {
|
||||
"style": "dash"
|
||||
},
|
||||
"list-indent": true,
|
||||
"ul-start-left": true,
|
||||
"ul-indent": {
|
||||
"indent": 2
|
||||
},
|
||||
"no-trailing-spaces": true,
|
||||
"no-hard-tabs": true,
|
||||
"no-reversed-links": true,
|
||||
"no-multiple-blanks": true,
|
||||
"line-length": {
|
||||
"line_length": 120,
|
||||
"code_blocks": false,
|
||||
"tables": false,
|
||||
"headers": true
|
||||
},
|
||||
"commands-show-output": true,
|
||||
"no-missing-space-atx": true,
|
||||
"no-multiple-space-atx": true,
|
||||
"no-missing-space-closed-atx": true,
|
||||
"no-multiple-space-closed-atx": true,
|
||||
"blanks-around-headers": true,
|
||||
"header-start-left": true,
|
||||
"no-duplicate-header": true,
|
||||
"single-h1": {
|
||||
"front_matter_title": ""
|
||||
},
|
||||
"no-trailing-punctuation": {
|
||||
"punctuation": ".,;:!"
|
||||
},
|
||||
"no-multiple-space-blockquote": true,
|
||||
"no-blanks-blockquote": true,
|
||||
"ol-prefix": {
|
||||
"style": "one_or_ordered"
|
||||
},
|
||||
"list-marker-space": true,
|
||||
"blanks-around-fences": true,
|
||||
"blanks-around-lists": true,
|
||||
"no-bare-urls": true,
|
||||
"hr-style": {
|
||||
"style": "---"
|
||||
},
|
||||
"no-emphasis-as-header": true,
|
||||
"no-space-in-emphasis": true,
|
||||
"no-space-in-code": true,
|
||||
"no-space-in-links": true,
|
||||
"fenced-code-language": true,
|
||||
"first-line-h1": false,
|
||||
"no-empty-links": true,
|
||||
"proper-names": {
|
||||
"names": [
|
||||
"PowerShell",
|
||||
"JavaScript"
|
||||
],
|
||||
"code_blocks": false
|
||||
},
|
||||
"no-alt-text": true,
|
||||
"code-block-style": false
|
||||
}
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
"editor.detectIndentation": false,
|
||||
"files.insertFinalNewline": true,
|
||||
"yaml.format.singleQuote": true,
|
||||
"[markdown]": {
|
||||
"editor.formatOnSave": false
|
||||
},
|
||||
"[arm-template]": {
|
||||
"editor.tabSize": 4,
|
||||
"editor.defaultFormatter": "msazurermtools.azurerm-vscode-tools"
|
||||
|
|
|
@ -109,7 +109,7 @@ jobs:
|
|||
|
||||
# STEP 2: Run analysis against exported data
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure' # Analyze objects using the rules within the PSRule.Rules.Azure PowerShell module.
|
||||
```
|
||||
|
|
|
@ -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.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
```
|
||||
|
@ -83,12 +83,13 @@ For a full list of parameters see the readme for [GitHub Actions][6] or [Azure P
|
|||
### Limiting input to a specific path
|
||||
|
||||
By default, PSRule will scan all files and folders within the repository or current working path.
|
||||
You can use the `inputPath` parameter to limit the analysis to a specific path.
|
||||
You can use the `inputPath` parameter to limit the analysis to a specific file or directory path.
|
||||
|
||||
!!! Tip
|
||||
The `inputPath` parameter only accepts a relative path.
|
||||
Both file and directory paths are supported.
|
||||
For example: `azure/modules/` if you have a `azure/modules/` directory in the root of your repository.
|
||||
Becareful not to specify a leading `/` such as `/azure/modules/`.
|
||||
Be careful not to specify a leading `/` such as `/azure/modules/`.
|
||||
On Linux `/` is the root directory, which makes this a fully qualified path instead of a relative path.
|
||||
|
||||
=== "GitHub Actions"
|
||||
|
@ -96,7 +97,7 @@ You can use the `inputPath` parameter to limit the analysis to a specific path.
|
|||
```yaml hl_lines="6"
|
||||
# Analyze Azure resources using PSRule for Azure
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
inputPath: azure/modules/
|
||||
|
@ -136,7 +137,7 @@ See [working with baselines][8] for more information.
|
|||
```yaml hl_lines="6"
|
||||
# Analyze Azure resources using PSRule for Azure
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
baseline: Azure.GA_2022_12
|
||||
|
@ -176,7 +177,7 @@ To do this, configure the PSRule for Azure step to _continue on error_.
|
|||
```yaml hl_lines="4"
|
||||
# Analyze Azure resources using PSRule for Azure
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
continue-on-error: true
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
|
@ -215,7 +216,7 @@ You can add additional modules to the `modules` parameter by using comma (`,`) s
|
|||
```yaml hl_lines="5"
|
||||
# Analyze Azure resources using PSRule for Azure
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure,PSRule.Monitor'
|
||||
```
|
||||
|
@ -249,7 +250,7 @@ For details on the formats that are supported see [analysis output][9].
|
|||
```yaml hl_lines="6-7"
|
||||
# Analyze Azure resources using PSRule for Azure
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
outputFormat: Sarif
|
||||
|
|
|
@ -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.7.0
|
||||
uses: microsoft/ps-rule@v2.8.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.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
prerelease: true
|
||||
|
@ -232,8 +232,7 @@ If the `./build.ps1` script fails, you can start troubleshooting this by:
|
|||
- Checking the prerequisites are installed installed (and the specific versions)
|
||||
- Check the **PowerShell** version enter the following statement in the PowerShell terminal: `$PSVersionTable.PSVersion`
|
||||
- Check the installed **.NET** version by entering the `dotnet --list-sdks` command in your terminal.
|
||||
- Check if your .NET setup is connected to any Nuget repositories and if there's any
|
||||
connectivity or authentication issues.
|
||||
- Check if your .NET setup is connected to any Nuget repositories and if there's any connectivity or authentication issues.
|
||||
- Installation of some pre-reqs may require admin privileges.
|
||||
|
||||
### Limited access networks
|
||||
|
|
|
@ -70,7 +70,7 @@ Import analysis results into Azure Monitor with GitHub Actions by:
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: PSRule.Rules.Azure,PSRule.Monitor
|
||||
conventions: Monitor.LogAnalytics.Import
|
||||
|
@ -86,7 +86,7 @@ Import analysis results into Azure Monitor with GitHub Actions by:
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: PSRule.Rules.Azure,PSRule.Monitor
|
||||
conventions: Monitor.LogAnalytics.Import
|
||||
|
|
|
@ -200,5 +200,5 @@ For the PSRule GitHub Action, use **>=1.4.0**.
|
|||
|
||||
```yaml
|
||||
- name: Run PSRule analysis
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
```
|
||||
|
|
|
@ -188,17 +188,26 @@ Storing modules in a private registry gives you a central location to reference
|
|||
To test Bicep deployments which uses modules stored in a private registry, these modules must be restored.
|
||||
The restore process automatically occurs when PSRule is run, however some additional steps are required to authenticate.
|
||||
|
||||
To configure authentication to a private registry:
|
||||
To prepare your registry for storing Bicep modules see [Create private registry for Bicep modules][13].
|
||||
|
||||
To configure authentication for PSRule to a private registry:
|
||||
|
||||
- [Configure `bicepconfig.json`](#configure-bicepconfigjson)
|
||||
- [Granting access to a private registry](#granting-access-to-a-private-registry)
|
||||
- [Set pipeline environment variables](#set-pipeline-environment-variables)
|
||||
|
||||
!!! Note
|
||||
Currently it is not possible to connect to a private registry without any authentication.
|
||||
See issue [#2015][10] for details on annoymous access.
|
||||
Some organizations may want to expose Bicep modules publically.
|
||||
This can be configured by enabling anonymous pull access.
|
||||
To configure your registry see [Make your container registry content publicly available][14].
|
||||
|
||||
[10]: https://github.com/Azure/PSRule.Rules.Azure/issues/2015
|
||||
!!! Note
|
||||
To use anonymous pull access to a registry you must use a minimum of Bicep CLI version **0.15.31**.
|
||||
You can configure PSRule to check for the minimum Bicep version.
|
||||
See [configuring minimum version][10] for information on how to enable this check.
|
||||
|
||||
[13]: https://learn.microsoft.com/azure/azure-resource-manager/bicep/private-module-registry
|
||||
[14]: https://learn.microsoft.com/azure/container-registry/anonymous-pull-access
|
||||
[10]: setup/setup-bicep.md#configuring-minimum-version
|
||||
|
||||
### Configure `bicepconfig.json`
|
||||
|
||||
|
@ -261,7 +270,7 @@ Typically, the following three environment variables should be set:
|
|||
|
||||
```yaml
|
||||
- name: Analyze Azure template files
|
||||
uses: microsoft/ps-rule@v2.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: PSRule.Rules.Azure,PSRule.Monitor
|
||||
conventions: Monitor.LogAnalytics.Import
|
||||
|
|
|
@ -82,7 +82,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.7.0
|
||||
uses: microsoft/ps-rule@v2.8.0
|
||||
with:
|
||||
modules: 'PSRule.Rules.Azure'
|
||||
baseline: 'Azure.GA_2022_12'
|
||||
|
|
Загрузка…
Ссылка в новой задаче