Skip to content

Commit 6e96eae

Browse files
taoyangcloudCopilot
andauthored
Add ai foundry policies, various bug fixes (#20)
* udpate category and add cognitive service policy * Add new policies for Cognitive Services and update existing diagnostic settings Co-authored-by: Copilot <copilot@github.com> * Refactor workflow configuration for clarity and consistency in policy initiatives Co-authored-by: Copilot <copilot@github.com> * Add Azure Cosmos DB policies and assignments for security compliance Co-authored-by: Copilot <copilot@github.com> * Refactor diagnostic settings policies to use parameterized log and metric enabling - Updated multiple diagnostic settings JSON files to replace hardcoded values for logs and metrics enabling with parameters. - Introduced a new parameter `DS-008_LogsToEnable` to specify which logs should be enabled. - Modified existence conditions to check for the count of enabled logs under the category group "allLogs". - Ensured consistency across various resource types in the policy definitions for better maintainability and flexibility. Co-authored-by: Copilot <copilot@github.com> * Fix policy name and update display name for AppInsights diagnostic settings deployment * Refactor Cosmos DB diagnostic settings to consolidate log categories under 'allLogs' * Fix profileName value in diagnostic settings policies for consistency * Update AzPolicyTest module version to 3.0.0 and improve action.yml formatting * Update AzPolicyTest module version to 3.1.0 in pipeline templates * Update policy assignment and definition resources to use 2026-01-01-preview API version * Update policy assignment, definition, exemption, and set definition resources to use 2025-12-01-preview API version * Update policy module versions to 3.1.0 and set action group policy versions to 1.0.0 * Remove version property from multiple policy definition files * Update AzPolicyTest module version to 3.1.1 in pipeline templates * Add PEDNS-016 effect for Cognitive Service Accounts to policy initiative * Update policy definitions and assignments to use 2026-01-01-preview API version * Update policy assignments and definitions to use 2025-12-01-preview API version * Update policy definition references for Cosmos DB initiative and remove deprecated source built-in name * Update policy definition reference for COSMOS-007 to use new policy ID * Add allowed locations for COSMOS-007 and update integration test templates for Cosmos DB policies * Add PEDNS-017 effect and update integration tests for Azure Cosmos DB policies * Update minimalTlsVersion formatting in Cosmos DB policy templates for consistency * Update policy definition groups and clean up deprecated entries in Cosmos DB policy initiative * Refactor policy definitions for Cognitive Services: update field references and add new policy initiative * Add new policy definitions and assignments for Cognitive Services: restrict model formats and names * Update Azure Cognitive Services policy assignments: modify effects and add allowed formats and names * Update modelFormat structure in policy definitions for Cognitive Services * Rename allowedFormats and allowedNames parameters to listOfAllowedFormats and listOfAllowedNames in policy assignments and initiatives for consistency * Add integration tests and configuration for Cognitive Services policies * Update resource identifiers in Azure Private Endpoint DNS Records policy initiative * Update storage account API version to 2025-08-01 in integration test templates * Remove unused variable resourceSubnetName from cognitive service test template * Enhance Cosmos DB policy to include capability checks and update policy definition reference * Refactor Cognitive Services policy assignments to update allowed model names and enhance test templates * Refactor policy rule in Cosmos DB audit policy to check for capabilities count instead of existence * Add unique suffix to Cognitive Service account names in test templates * Update Cognitive Services and Cosmos DB resource definitions to use latest API versions and remove unnecessary parameters * Update COSMOS-001 Effect to Modify in Cosmos DB policy assignments and initiative * Update identity to SystemAssigned and modify roleDefinitionIds in Cosmos DB policy assignments * Update COSMOS-001 Effect to Modify in Cosmos DB policy definitions and tests * Update identity to SystemAssigned and add roleDefinitionIds in Cognitive Services and Cosmos DB policy assignments; modify policy initiative effects and test templates * Update COG-001 Effect to Modify in both dev and prod Cognitive Services policy assignments * Update allowed names and resource references in Cognitive Services policy assignments and tests * Update COG-004 Effect to Audit and modify allowed names in Cognitive Services policy assignments and tests * Update workflow triggers and format in policy-initiatives.yml; modify defaultValue in polset-diag-settings.json --------- Co-authored-by: Copilot <copilot@github.com>
1 parent 911a62d commit 6e96eae

218 files changed

Lines changed: 3048 additions & 491 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.azuredevops/templates/template-stage-policy-tests.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ stages:
6262
- template: ./template-task-install-ps-modules.yml
6363
parameters:
6464
displayName: "Install AzPolicyTest Module"
65-
moduleNames: "AzPolicyTest`@2.8.2"
65+
moduleNames: "AzPolicyTest`@3.1.1"
6666
shouldInstall: ${{ or(eq(parameters.runPolicyJsonPesterTests, true), eq(parameters.runPolicyInitiativePesterTests, true), eq(parameters.runPolicyDefinitionPesterTests, true)) }}
6767

6868
- pwsh: |

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Documentation
4-
url: https://github.com/AzPolicyFactory/AzPolicyFactory/tree/main/docs
4+
url: https://github.com/Azure/AzPolicyFactory/tree/main/docs
55
about: Check the documentation before opening an issue

‎.github/actions/templates/test-policy-def/action.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: "Policy Definition Pester Tests"
2-
description: "Runs Pester tests for Azure Policy Definitions, Initiatives, and JSON content using the AzPolicyTest module"
2+
description: "Runs Pester tests for Azure Policy Definitions, Initiatives, and
3+
JSON content using the AzPolicyTest module"
34
author: "Tao Yang"
45

56
inputs:
@@ -41,7 +42,9 @@ runs:
4142
using: "composite"
4243
steps:
4344
- name: Install AzPolicyTest Module
44-
if: inputs.run-policy-json-pester-tests == 'true' || inputs.run-policy-initiative-pester-tests == 'true' || inputs.run-policy-definition-pester-tests == 'true'
45+
if: inputs.run-policy-json-pester-tests == 'true' ||
46+
inputs.run-policy-initiative-pester-tests == 'true' ||
47+
inputs.run-policy-definition-pester-tests == 'true'
4548
shell: pwsh
4649
env:
4750
INPUT_WORKSPACE_DIRECTORY: ${{ github.workspace }}
@@ -50,7 +53,7 @@ runs:
5053
Write-Output '::group::Install AzPolicyTest Module'
5154
$scriptPath = "$env:INPUT_WORKSPACE_DIRECTORY/scripts/pipelines/pipeline-install-moduleFromRepo.ps1"
5255
& $scriptPath `
53-
-modules 'AzPolicyTest@2.8.2' `
56+
-modules 'AzPolicyTest@3.1.1' `
5457
-repoName 'PSGallery' `
5558
-maxRetry 3 `
5659
-allowPrerelease 'false'

‎.github/workflows/policy-initiatives.yml‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
name: policy-initiatives
22

33
on:
4-
workflow_dispatch: # allows a manual run from the UI
4+
workflow_dispatch:
5+
# allows a manual run from the UI
56
inputs:
67
debug:
78
description: "Enable debug logging"
@@ -28,7 +29,9 @@ jobs:
2829
job_call_initiation:
2930
name: Initiation
3031
runs-on: ubuntu-latest
31-
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch' }}
32+
if:
33+
${{ github.event.workflow_run.conclusion == 'success' || github.event_name
34+
== 'workflow_dispatch' }}
3235
steps:
3336
- name: "Checkout"
3437
uses: actions/checkout@v6
@@ -79,7 +82,7 @@ jobs:
7982
definition-file-path: "${{env.definitionFileDirectory}}"
8083
template-file-directory: "${{env.templateFileDirectory}}"
8184
bicep-file-path: "${{env.templateFileDirectory}}/${{env.templateFileName}}"
82-
bicep-variable-name: "policyInitiatives"
85+
bicep-variable-name: "policySetDefinitions"
8386
build-artifact-name: "policy_set_bicep_dev"
8487

8588
job_build_prod:
@@ -100,7 +103,7 @@ jobs:
100103
definition-file-path: "${{env.definitionFileDirectory}}"
101104
template-file-directory: "${{env.templateFileDirectory}}"
102105
bicep-file-path: "${{env.templateFileDirectory}}/${{env.templateFileName}}"
103-
bicep-variable-name: "policyInitiatives"
106+
bicep-variable-name: "policySetDefinitions"
104107
build-artifact-name: "policy_set_bicep_prod"
105108

106109
job_test_dev:

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,4 +418,6 @@ FodyWeavers.xsd
418418
*.msp
419419

420420
#Mac
421-
.DS_Store
421+
.DS_Store
422+
.github/workflows/package.json
423+
.github/workflows/package-lock.json

‎.vscode/settings.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,6 @@
5454
"unauthorized",
5555
"vnet",
5656
"whatif"
57-
]
57+
],
58+
"sarif-viewer.connectToGithubCodeScanning": "off"
5859
}

‎bicep/modules/authorization/policy-assignment/management-group/main.bicep‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var identityVar = policyAssignment.?identity == 'SystemAssigned'
3232
}
3333
: null
3434

35-
resource assignment 'Microsoft.Authorization/policyAssignments@2025-03-01' = {
35+
resource assignment 'Microsoft.Authorization/policyAssignments@2025-12-01-preview' = {
3636
name: policyAssignment.name
3737
location: location
3838
properties: {

‎bicep/modules/authorization/policy-assignment/management-group/version.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
3-
"version": "3.0.0",
3+
"version": "3.1.0",
44
"pathFilters": [
55
"./main.json"
66
]

‎bicep/modules/authorization/policy-assignment/resource-group/main.bicep‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var identityVar = policyAssignment.?identity == 'SystemAssigned'
3535
}
3636
: null
3737

38-
resource assignment 'Microsoft.Authorization/policyAssignments@2025-03-01' = {
38+
resource assignment 'Microsoft.Authorization/policyAssignments@2025-12-01-preview' = {
3939
name: policyAssignment.name
4040
location: location
4141
properties: {

‎bicep/modules/authorization/policy-assignment/resource-group/version.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://aka.ms/bicep-registry-module-version-file-schema#",
3-
"version": "3.0.0",
3+
"version": "3.1.0",
44
"pathFilters": [
55
"./main.json"
66
]

0 commit comments

Comments
 (0)