Skip to content

Commit

Permalink
Merge branch 'main' into users/alsehr/cmkUpdateMLWorkspace
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderSehr authored Nov 17, 2024
2 parents 89d5192 + f84c0ad commit 9a2f9fa
Show file tree
Hide file tree
Showing 89 changed files with 6,093 additions and 1,736 deletions.
29 changes: 29 additions & 0 deletions .github/actions/templates/avm-validateModulePSRule/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,35 @@ runs:
source: "${{ inputs.psrulePath}}/.ps-rule/" # Path to folder containing suppression rules to use for analysis.
summary: false # Disabling as taken care in customized task

- name: Run PSRule analysis - Security Pillar Only (Custom Security Pillar)
uses: microsoft/ps-rule@v2.9.0
if: ${{ inputs.psruleBaseline == 'CB.AVM.WAF.Security' }}
with:
modules: "PSRule.Rules.Azure"
prerelease: true
baseline: "${{ inputs.psruleBaseline }}"
inputPath: "${{ inputs.templateFilePath}}"
outputFormat: Csv
outputPath: "${{ inputs.templateFilePath}}-PSRule-output.csv"
option: "${{ github.workspace }}/${{ inputs.psrulePath}}/ps-rule.yaml" # Path to PSRule configuration options file
source: "${{ inputs.psrulePath}}/.ps-rule/" # Path to folder containing suppression rules to use for analysis.
summary: false # Disabling as taken care in customized task

- name: Run PSRule analysis - Security Pillar Only (Azure.Pillar.Security)
uses: microsoft/ps-rule@v2.9.0
if: ${{ inputs.psruleBaseline == 'Azure.Pillar.Security' }}
continue-on-error: true
with:
modules: "PSRule.Rules.Azure"
prerelease: true
baseline: "${{ inputs.psruleBaseline }}"
inputPath: "${{ inputs.templateFilePath}}"
outputFormat: Csv
outputPath: "${{ inputs.templateFilePath}}-PSRule-output.csv"
option: "${{ github.workspace }}/${{ inputs.psrulePath}}/ps-rule.yaml" # Path to PSRule configuration options file
source: "${{ inputs.psrulePath}}/.ps-rule/" # Path to folder containing suppression rules to use for analysis.
summary: false # Disabling as taken care in customized task

- name: "Parse CSV content"
if: always()
uses: azure/powershell@v2
Expand Down
48 changes: 47 additions & 1 deletion .github/workflows/avm.template.module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,50 @@ jobs:
psrulePath: "avm/utilities/pipelines/staticValidation/psrule" #'${{ github.workspace }}/avm'
psruleBaseline: "Azure.Pillar.Reliability"

job_psrule_test_waf_security_cb: # Note: Please don't change this job name. It is used by the setEnvironment action to define which PS modules to install on runners.
name: "PSRule - WAF Security - AVM Custom Baseline [${{ matrix.testCases.name }}]"
runs-on: ubuntu-latest
if: ${{ inputs.psRuleModuleTestFilePaths != '' && (fromJson(inputs.workflowInput)).staticValidation == 'true' }}
strategy:
fail-fast: false
matrix:
testCases: ${{ fromJson(inputs.psRuleModuleTestFilePaths) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set environment
uses: ./.github/actions/templates/avm-setEnvironment
- name: "Run PSRule validation with [${{ matrix.testCases.path }}]"
uses: ./.github/actions/templates/avm-validateModulePSRule
with:
templateFilePath: "${{ inputs.modulePath }}/${{ matrix.testCases.path }}"
subscriptionId: "${{ secrets.ARM_SUBSCRIPTION_ID }}"
managementGroupId: "${{ secrets.ARM_MGMTGROUP_ID }}"
psrulePath: "avm/utilities/pipelines/staticValidation/psrule" #'${{ github.workspace }}/avm'
psruleBaseline: "CB.AVM.WAF.Security"

job_psrule_test_waf_security: # Note: Please don't change this job name. It is used by the setEnvironment action to define which PS modules to install on runners.
name: "PSRule - WAF Security [${{ matrix.testCases.name }}]"
runs-on: ubuntu-latest
if: ${{ inputs.psRuleModuleTestFilePaths != '' && (fromJson(inputs.workflowInput)).staticValidation == 'true' }}
strategy:
fail-fast: false
matrix:
testCases: ${{ fromJson(inputs.psRuleModuleTestFilePaths) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set environment
uses: ./.github/actions/templates/avm-setEnvironment
- name: "Run PSRule validation with [${{ matrix.testCases.path }}]"
uses: ./.github/actions/templates/avm-validateModulePSRule
with:
templateFilePath: "${{ inputs.modulePath }}/${{ matrix.testCases.path }}"
subscriptionId: "${{ secrets.ARM_SUBSCRIPTION_ID }}"
managementGroupId: "${{ secrets.ARM_MGMTGROUP_ID }}"
psrulePath: "avm/utilities/pipelines/staticValidation/psrule" #'${{ github.workspace }}/avm'
psruleBaseline: "Azure.Pillar.Security"

#############################
# Deployment validation #
#############################
Expand All @@ -104,10 +148,12 @@ jobs:
!cancelled() &&
(fromJson(inputs.workflowInput)).deploymentValidation == 'true' &&
needs.job_module_static_validation.result != 'failure' &&
needs.job_psrule_test_waf_reliability.result != 'failure'
needs.job_psrule_test_waf_reliability.result != 'failure' &&
needs.job_psrule_test_waf_security_cb.result != 'failure'
needs:
- job_module_static_validation
- job_psrule_test_waf_reliability
- job_psrule_test_waf_security_cb
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platform.ossf-scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@662472033e021d55d94146f66f6058822b0b39fd # v3.27.0
uses: github/codeql-action/upload-sarif@396bb3e45325a47dd9ef434068033c6d5bb0d11a # v3.27.3
with:
sarif_file: results.sarif
22 changes: 19 additions & 3 deletions avm/ptn/lz/sub-vending/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ param virtualNetworkResourceGroupName = '<virtualNetworkResourceGroupName>'
| [`roleAssignments`](#parameter-roleassignments) | array | Supply an array of objects containing the details of the role assignments to create.<p><p>Each object must contain the following `keys`:<li>`principalId` = The Object ID of the User, Group, SPN, Managed Identity to assign the RBAC role too.<li>`definition` = The Name of one of the pre-defined built-In RBAC Roles or a Resource ID of a Built-in or custom RBAC Role Definition as follows:<p> - You can only provide the RBAC role name of the pre-defined roles (Contributor, Owner, Reader, Role Based Access Control Administrator (Preview), and User Access Administrator). We only provide those roles as they are the most common ones to assign to a new subscription, also to reduce the template size and complexity in case we define each and every Built-in RBAC role.<p> - You can provide the Resource ID of a Built-in or custom RBAC Role Definition<p> - e.g. `/providers/Microsoft.Authorization/roleDefinitions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`<li>`relativeScope` = 2 options can be provided for input value:<p> 1. `''` *(empty string)* = Make RBAC Role Assignment to Subscription scope<p> 2. `'/resourceGroups/<RESOURCE GROUP NAME>'` = Make RBAC Role Assignment to specified Resource Group.<p> |
| [`subscriptionAliasEnabled`](#parameter-subscriptionaliasenabled) | bool | Whether to create a new Subscription using the Subscription Alias resource. If `false`, supply an existing Subscription''s ID in the parameter named `existingSubscriptionId` instead to deploy resources to an existing Subscription. |
| [`subscriptionAliasName`](#parameter-subscriptionaliasname) | string | The name of the Subscription Alias, that will be created by this module.<p><p>The string must be comprised of `a-z`, `A-Z`, `0-9`, `-`, `_` and ` ` (space). The maximum length is 63 characters.<p><p>> **Not required when providing an existing Subscription ID via the parameter `existingSubscriptionId`**.<p> |
| [`subscriptionBillingScope`](#parameter-subscriptionbillingscope) | string | The Billing Scope for the new Subscription alias, that will be created by this module.<p><p>A valid Billing Scope starts with `/providers/Microsoft.Billing/billingAccounts/` and is case sensitive.<p><p>> **Not required when providing an existing Subscription ID via the parameter `existingSubscriptionId`**.<p> |
| [`subscriptionBillingScope`](#parameter-subscriptionbillingscope) | string | The Billing Scope for the new Subscription alias, that will be created by this module.<p><p>A valid Billing Scope looks like `/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}` and is case sensitive.<p><p>> **Not required when providing an existing Subscription ID via the parameter `existingSubscriptionId`**.<p> |
| [`subscriptionDisplayName`](#parameter-subscriptiondisplayname) | string | The name of the subscription alias. The string must be comprised of a-z, A-Z, 0-9, - and _. The maximum length is 63 characters.<p><p>The string must be comprised of `a-z`, `A-Z`, `0-9`, `-`, `_` and ` ` (space). The maximum length is 63 characters.<p><p>> The value for this parameter and the parameter named `subscriptionAliasName` are usually set to the same value for simplicity. But they can be different if required for a reason.<p><p>> **Not required when providing an existing Subscription ID via the parameter `existingSubscriptionId`**.<p> |
| [`subscriptionManagementGroupAssociationEnabled`](#parameter-subscriptionmanagementgroupassociationenabled) | bool | Whether to move the Subscription to the specified Management Group supplied in the parameter `subscriptionManagementGroupId`.<p> |
| [`subscriptionManagementGroupId`](#parameter-subscriptionmanagementgroupid) | string | The destination Management Group ID for the new Subscription that will be created by this module (or the existing one provided in the parameter `existingSubscriptionId`).<p><p>**IMPORTANT:** Do not supply the display name of the Management Group. The Management Group ID forms part of the Azure Resource ID. e.g., `/providers/Microsoft.Management/managementGroups/{managementGroupId}`.<p> |
Expand Down Expand Up @@ -983,7 +983,6 @@ An object of resource providers and resource providers features to register. If
'Microsoft.Sql': []
'Microsoft.Storage': []
'Microsoft.StreamAnalytics': []
'Microsoft.TimeSeriesInsights': []
'Microsoft.Web': []
}
```
Expand All @@ -1003,6 +1002,23 @@ Supply an array of objects containing the details of the role assignments to cre
- Required: No
- Type: array
- Default: `[]`
- Example:
```Bicep
[
{
// Contributor role assignment at subscription scope
principalId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
definition: '/Contributor'
relativeScope: ''
}
{
// Owner role assignment at resource group scope
principalId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
definition: '/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
relativeScope: '/resourceGroups/{resourceGroupName}'
}
]
```

**Required parameters**

Expand Down Expand Up @@ -1099,7 +1115,7 @@ The name of the Subscription Alias, that will be created by this module.<p><p>Th

### Parameter: `subscriptionBillingScope`

The Billing Scope for the new Subscription alias, that will be created by this module.<p><p>A valid Billing Scope starts with `/providers/Microsoft.Billing/billingAccounts/` and is case sensitive.<p><p>> **Not required when providing an existing Subscription ID via the parameter `existingSubscriptionId`**.<p>
The Billing Scope for the new Subscription alias, that will be created by this module.<p><p>A valid Billing Scope looks like `/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}` and is case sensitive.<p><p>> **Not required when providing an existing Subscription ID via the parameter `existingSubscriptionId`**.<p>

- Required: No
- Type: string
Expand Down
21 changes: 19 additions & 2 deletions avm/ptn/lz/sub-vending/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ param subscriptionAliasName string = ''

@description('''Optional. The Billing Scope for the new Subscription alias, that will be created by this module.
A valid Billing Scope starts with `/providers/Microsoft.Billing/billingAccounts/` and is case sensitive.
A valid Billing Scope looks like `/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}` and is case sensitive.
> **Not required when providing an existing Subscription ID via the parameter `existingSubscriptionId`**.
''')
Expand Down Expand Up @@ -200,6 +200,24 @@ Each object must contain the following `keys`:
1. `''` *(empty string)* = Make RBAC Role Assignment to Subscription scope
2. `'/resourceGroups/<RESOURCE GROUP NAME>'` = Make RBAC Role Assignment to specified Resource Group.
''')
@metadata({
example: '''
[
{
// Contributor role assignment at subscription scope
principalId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
definition: '/Contributor'
relativeScope: ''
}
{
// Owner role assignment at resource group scope
principalId: 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
definition: '/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
relativeScope: '/resourceGroups/{resourceGroupName}'
}
]
'''
})
param roleAssignments roleAssignmentType = []

@description('Optional. Enable/Disable usage telemetry for module.')
Expand Down Expand Up @@ -297,7 +315,6 @@ param resourceProviders object = {
'Microsoft.Sql': []
'Microsoft.Storage': []
'Microsoft.StreamAnalytics': []
'Microsoft.TimeSeriesInsights': []
'Microsoft.Web': []
}

Expand Down
Loading

0 comments on commit 9a2f9fa

Please sign in to comment.