-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Baseline current api version * Add new version properties/apis * Add new list apis * Sync with main * Update readme files * Updated python readme * reverting to sync with main * updating python and main readme * Fixing some automation failures * add examples for all policyDefinitionVersion apis * Add examples for policy set versions * Updated readme to remove tangling tag * Fix linter issues and and suppression where applicable * Fix linter errors for assignmenets swagger * Fix more linter errors * fix more linter errors * Add schema property to definition parameters to reflect reality * Fix prettier check issues * Updated based on feedback * Fixing linter errors * Fixed more linter errors * Fix JSON syntax error * updated based on feedback to remove RepeatedPathInfo subpression for new apis * Updated subid and api version to use common types
- Loading branch information
1 parent
32c0cdc
commit db5d7dc
Showing
85 changed files
with
9,785 additions
and
2 deletions.
There are no files selected for viewing
95 changes: 95 additions & 0 deletions
95
...er/Microsoft.Authorization/stable/2023-04-01/examples/createOrUpdatePolicyDefinition.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", | ||
"policyDefinitionName": "ResourceNaming", | ||
"api-version": "2023-04-01", | ||
"parameters": { | ||
"properties": { | ||
"mode": "All", | ||
"displayName": "Enforce resource naming convention", | ||
"description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", | ||
"metadata": { | ||
"category": "Naming" | ||
}, | ||
"policyRule": { | ||
"if": { | ||
"not": { | ||
"field": "name", | ||
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" | ||
} | ||
}, | ||
"then": { | ||
"effect": "deny" | ||
} | ||
}, | ||
"parameters": { | ||
"prefix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Prefix", | ||
"description": "Resource name prefix" | ||
} | ||
}, | ||
"suffix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Suffix", | ||
"description": "Resource name suffix" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", | ||
"type": "Microsoft.Authorization/policyDefinitions", | ||
"name": "ResourceNaming", | ||
"properties": { | ||
"mode": "All", | ||
"displayName": "Naming Convention", | ||
"description": "Force resource names to begin with 'prefix' and end with 'suffix'", | ||
"metadata": { | ||
"category": "Naming" | ||
}, | ||
"version": "1.2.1", | ||
"versions": [ | ||
"1.2.1", | ||
"1.0.0" | ||
], | ||
"policyRule": { | ||
"if": { | ||
"not": { | ||
"field": "name", | ||
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" | ||
} | ||
}, | ||
"then": { | ||
"effect": "deny" | ||
} | ||
}, | ||
"parameters": { | ||
"prefix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Prefix", | ||
"description": "Resource name prefix" | ||
} | ||
}, | ||
"suffix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Suffix", | ||
"description": "Resource name suffix" | ||
} | ||
} | ||
}, | ||
"policyType": "Custom" | ||
} | ||
} | ||
} | ||
} | ||
} |
122 changes: 122 additions & 0 deletions
122
...uthorization/stable/2023-04-01/examples/createOrUpdatePolicyDefinitionAdvancedParams.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
{ | ||
"parameters": { | ||
"subscriptionId": "ae640e6b-ba3e-4256-9d62-2993eecfa6f2", | ||
"policyDefinitionName": "EventHubDiagnosticLogs", | ||
"api-version": "2023-04-01", | ||
"parameters": { | ||
"properties": { | ||
"mode": "Indexed", | ||
"displayName": "Event Hubs should have diagnostic logging enabled", | ||
"description": "Audit enabling of logs and retain them up to a year. This enables recreation of activity trails for investigation purposes when a security incident occurs or your network is compromised", | ||
"metadata": { | ||
"category": "Event Hub" | ||
}, | ||
"policyRule": { | ||
"if": { | ||
"field": "type", | ||
"equals": "Microsoft.EventHub/namespaces" | ||
}, | ||
"then": { | ||
"effect": "AuditIfNotExists", | ||
"details": { | ||
"type": "Microsoft.Insights/diagnosticSettings", | ||
"existenceCondition": { | ||
"allOf": [ | ||
{ | ||
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled", | ||
"equals": "true" | ||
}, | ||
{ | ||
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days", | ||
"equals": "[parameters('requiredRetentionDays')]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"requiredRetentionDays": { | ||
"type": "Integer", | ||
"defaultValue": 365, | ||
"allowedValues": [ | ||
0, | ||
30, | ||
90, | ||
180, | ||
365 | ||
], | ||
"metadata": { | ||
"displayName": "Required retention (days)", | ||
"description": "The required diagnostic logs retention in days" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/subscriptions/ae640e6b-ba3e-4256-9d62-2993eecfa6f2/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", | ||
"type": "Microsoft.Authorization/policyDefinitions", | ||
"name": "ResourceNaming", | ||
"properties": { | ||
"mode": "Indexed", | ||
"displayName": "Event Hubs should have diagnostic logging enabled", | ||
"description": "Audit enabling of logs and retain them up to a year. This enables recreation of activity trails for investigation purposes when a security incident occurs or your network is compromised", | ||
"metadata": { | ||
"category": "Event Hub" | ||
}, | ||
"version": "1.2.1", | ||
"versions": [ | ||
"1.2.1", | ||
"1.0.0" | ||
], | ||
"policyRule": { | ||
"if": { | ||
"field": "type", | ||
"equals": "Microsoft.EventHub/namespaces" | ||
}, | ||
"then": { | ||
"effect": "AuditIfNotExists", | ||
"details": { | ||
"type": "Microsoft.Insights/diagnosticSettings", | ||
"existenceCondition": { | ||
"allOf": [ | ||
{ | ||
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.enabled", | ||
"equals": "true" | ||
}, | ||
{ | ||
"field": "Microsoft.Insights/diagnosticSettings/logs[*].retentionPolicy.days", | ||
"equals": "[parameters('requiredRetentionDays')]" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
"parameters": { | ||
"requiredRetentionDays": { | ||
"type": "Integer", | ||
"defaultValue": 365, | ||
"allowedValues": [ | ||
0, | ||
30, | ||
90, | ||
180, | ||
365 | ||
], | ||
"metadata": { | ||
"displayName": "Required retention (days)", | ||
"description": "The required diagnostic logs retention in days" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
95 changes: 95 additions & 0 deletions
95
...orization/stable/2023-04-01/examples/createOrUpdatePolicyDefinitionAtManagementGroup.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
{ | ||
"parameters": { | ||
"managementGroupId": "MyManagementGroup", | ||
"policyDefinitionName": "ResourceNaming", | ||
"api-version": "2023-04-01", | ||
"parameters": { | ||
"properties": { | ||
"mode": "All", | ||
"displayName": "Enforce resource naming convention", | ||
"description": "Force resource names to begin with given 'prefix' and/or end with given 'suffix'", | ||
"metadata": { | ||
"category": "Naming" | ||
}, | ||
"policyRule": { | ||
"if": { | ||
"not": { | ||
"field": "name", | ||
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" | ||
} | ||
}, | ||
"then": { | ||
"effect": "deny" | ||
} | ||
}, | ||
"parameters": { | ||
"prefix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Prefix", | ||
"description": "Resource name prefix" | ||
} | ||
}, | ||
"suffix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Suffix", | ||
"description": "Resource name suffix" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"headers": {}, | ||
"body": { | ||
"id": "/providers/Microsoft.Management/managementgroups/MyManagementGroup/providers/Microsoft.Authorization/policyDefinitions/ResourceNaming", | ||
"type": "Microsoft.Authorization/policyDefinitions", | ||
"name": "ResourceNaming", | ||
"properties": { | ||
"mode": "All", | ||
"displayName": "Naming Convention", | ||
"description": "Force resource names to begin with 'prefix' and end with 'suffix'", | ||
"metadata": { | ||
"category": "Naming" | ||
}, | ||
"version": "1.2.1", | ||
"versions": [ | ||
"1.2.1", | ||
"1.0.0" | ||
], | ||
"policyRule": { | ||
"if": { | ||
"not": { | ||
"field": "name", | ||
"like": "[concat(parameters('prefix'), '*', parameters('suffix'))]" | ||
} | ||
}, | ||
"then": { | ||
"effect": "deny" | ||
} | ||
}, | ||
"parameters": { | ||
"prefix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Prefix", | ||
"description": "Resource name prefix" | ||
} | ||
}, | ||
"suffix": { | ||
"type": "String", | ||
"metadata": { | ||
"displayName": "Suffix", | ||
"description": "Resource name suffix" | ||
} | ||
} | ||
}, | ||
"policyType": "Custom" | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.