Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calec/new api version #24542

Merged
merged 25 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9158a69
Baseline current api version
calecarter Mar 15, 2023
11333f5
Add new version properties/apis
calecarter Jun 17, 2023
da0f647
Add new list apis
calecarter Jun 17, 2023
bbdc4f5
Sync with main
calecarter Jun 21, 2023
947a691
Update readme files
calecarter Jun 21, 2023
72c7354
Updated python readme
calecarter Jun 21, 2023
5573006
reverting to sync with main
calecarter Jun 21, 2023
e8c2284
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
calecarter Jun 21, 2023
a9de5d2
updating python and main readme
calecarter Jun 21, 2023
a0728ec
Fixing some automation failures
calecarter Jun 21, 2023
5d6d779
add examples for all policyDefinitionVersion apis
calecarter Jul 10, 2023
a7c8c75
Add examples for policy set versions
calecarter Jul 11, 2023
e70ac8c
Updated readme to remove tangling tag
calecarter Jul 26, 2023
55f5d9e
Fix linter issues and and suppression where applicable
calecarter Jul 27, 2023
d402c62
Fix linter errors for assignmenets swagger
calecarter Aug 3, 2023
71cdd1a
Fix more linter errors
calecarter Aug 3, 2023
a5de781
fix more linter errors
calecarter Aug 4, 2023
481d27b
Add schema property to definition parameters to reflect reality
calecarter Aug 4, 2023
06ab504
Fix prettier check issues
calecarter Aug 4, 2023
72a863b
Updated based on feedback
calecarter Aug 8, 2023
c8259da
Fixing linter errors
calecarter Aug 8, 2023
9cd8c50
Fixed more linter errors
calecarter Aug 8, 2023
73781bb
Fix JSON syntax error
calecarter Aug 8, 2023
83ecba7
updated based on feedback to remove RepeatedPathInfo subpression for …
calecarter Aug 9, 2023
5a7178b
Updated subid and api version to use common types
calecarter Sep 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
}
}
}
}
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"
}
}
}
}
}
}
}
}
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"
}
}
}
}
}
Loading