-
Notifications
You must be signed in to change notification settings - Fork 31
71 lines (61 loc) · 2.04 KB
/
azure-analyze.yaml
File metadata and controls
71 lines (61 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#
# Analyze repository with PSRule for Azure
#
# Note:
# This workflow is designed to run in templated repositories to check Azure Infrastructure as Code.
# For PSRule for Azure documentation see:
# https://aka.ms/ps-rule-azure
# For action details see:
# https://aka.ms/ps-rule-action
name: Analyze Azure resources
# Run for main or PRs against main
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
permissions: {}
jobs:
analyze:
name: Analyze repository
runs-on: ubuntu-latest
permissions:
# actions: read
contents: read
# security-events: write
if: github.repository != 'Azure/PSRule.Rules.Azure-quickstart'
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
# Install a specific version of Bicep for consistency across CI runs.
# - name: Install Bicep
# run: az bicep install --version v0.39.26
# Run analysis by using the PSRule GitHub action.
- name: Run PSRule analysis
uses: microsoft/ps-rule@46451b8f5258c41beb5ae69ed7190ccbba84112c # v2.9.0
with:
modules: PSRule.Rules.Azure
outputFormat: Sarif
outputPath: reports/ps-rule-results.sarif
summary: true
# env:
# # Use Bicep from Azure CLI.
# PSRULE_AZURE_BICEP_USE_AZURE_CLI: true
# If you have GitHub Advanced Security you can upload PSRule scan results.
# Uncomment the next step to use this feature.
# - name: Upload results to security tab
# uses: github/codeql-action/upload-sarif@dd746615b3b9d728a6a37ca2045b68ca76d4841a # v3.28.8
# if: always()
# with:
# sarif_file: reports/ps-rule-results.sarif
- name: Upload results
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
if: always()
with:
name: PSRule-Sarif
path: reports/ps-rule-results.sarif
retention-days: 1
if-no-files-found: error