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

Making RG optional in check policy gate, and task friendly name changed. #10116

Merged
merged 2 commits into from
Apr 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
@@ -1,8 +1,8 @@
{
"loc.friendlyName": "Azure Policy Check Gate",
"loc.friendlyName": "Check Azure Policy Compliance",
"loc.helpMarkDown": "",
"loc.description": "Security and compliance assessment with Azure policies on resources that belong to the resource group and Azure subscription.",
"loc.instanceNameFormat": "Azure Policy compliance assessment for $(ResourceGroupName)",
"loc.instanceNameFormat": "Azure Policy compliance assessment for $(ConnectedServiceName):$(ResourceGroupName)",
"loc.input.label.ConnectedServiceName": "Azure subscription",
"loc.input.help.ConnectedServiceName": "Select the Azure Resource Manager subscription to enforce the policies.",
"loc.input.label.ResourceGroupName": "Resource group",
Expand Down
11 changes: 5 additions & 6 deletions Tasks/AzurePolicyV0/task.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "8BA74703-E94F-4A35-814E-FC21F44578A2",
"name": "AzurePolicyCheckGate",
"friendlyName": "Azure Policy Check Gate",
"friendlyName": "Check Azure Policy Compliance",
"description": "Security and compliance assessment with Azure policies on resources that belong to the resource group and Azure subscription.",
"helpUrl": "",
"helpMarkDown": "",
Expand All @@ -16,7 +16,7 @@
"version": {
"Major": 0,
"Minor": 0,
"Patch": 1
divman25 marked this conversation as resolved.
Show resolved Hide resolved
"Patch": 3
},
"preview": "true",
"inputs": [
Expand All @@ -34,7 +34,6 @@
"name": "ResourceGroupName",
"type": "pickList",
"label": "Resource group",
"required": true,
"helpMarkDown": "Provide name of a resource group.",
"properties": {
"EditableOptions": "True"
Expand Down Expand Up @@ -69,14 +68,14 @@
"resultTemplate": "{ \"Value\" : \"{{{id}}}\", \"DisplayValue\" : \"{{{name}}}\" }"
}
],
"instanceNameFormat": "Azure Policy compliance assessment for $(ResourceGroupName)",
"instanceNameFormat": "Azure Policy compliance assessment for $(ConnectedServiceName):$(ResourceGroupName)",
divman25 marked this conversation as resolved.
Show resolved Hide resolved
"execution": {
"HttpRequestChain": {
"Execute": [
{
"RequestInputs": {
"EndpointId": "$(connectedServiceName)",
"EndpointUrl": "$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2018-07-01-preview",
"EndpointUrl": "{{#if ResourceGroupName}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2018-07-01-preview{{else}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2018-07-01-preview{{/if}}",
"Method": "POST"
},
"ExecutionOptions": {
Expand All @@ -95,7 +94,7 @@
{
"RequestInputs": {
"EndpointId": "$(connectedServiceName)",
"EndpointUrl": "$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-04-04&$filter=IsCompliant eq false",
"EndpointUrl": "{{#if ResourceGroupName}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-04-04&$filter=IsCompliant eq false{{else}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-04-04&$filter=IsCompliant eq false{{/if}}",
"Method": "POST",
"Expression": "or(and(eq(isNullOrEmpty(taskInputs['resources']), true), eq(count(jsonpath('value[*].resourceId')), 0)), and(eq(isNullOrEmpty(taskInputs['resources']), false), eq(count(intersect(split(taskInputs['resources'], ','), jsonpath('value[*].resourceId'))) ,0)))"
}
Expand Down
7 changes: 3 additions & 4 deletions Tasks/AzurePolicyV0/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"version": {
"Major": 0,
"Minor": 0,
"Patch": 1
"Patch": 3
},
"preview": "true",
"inputs": [
Expand All @@ -34,7 +34,6 @@
"name": "ResourceGroupName",
"type": "pickList",
"label": "ms-resource:loc.input.label.ResourceGroupName",
"required": true,
"helpMarkDown": "ms-resource:loc.input.help.ResourceGroupName",
"properties": {
"EditableOptions": "True"
Expand Down Expand Up @@ -76,7 +75,7 @@
{
"RequestInputs": {
"EndpointId": "$(connectedServiceName)",
"EndpointUrl": "$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2018-07-01-preview",
"EndpointUrl": "{{#if ResourceGroupName}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2018-07-01-preview{{else}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/providers/Microsoft.PolicyInsights/policyStates/latest/triggerEvaluation?api-version=2018-07-01-preview{{/if}}",
"Method": "POST"
},
"ExecutionOptions": {
Expand All @@ -97,7 +96,7 @@
{
"RequestInputs": {
"EndpointId": "$(connectedServiceName)",
"EndpointUrl": "$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-04-04&$filter=IsCompliant eq false",
"EndpointUrl": "{{#if ResourceGroupName}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/resourceGroups/$(ResourceGroupName)/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-04-04&$filter=IsCompliant eq false{{else}}$(endpoint.url)subscriptions/$(endpoint.subscriptionId)/providers/Microsoft.PolicyInsights/policyStates/latest/queryResults?api-version=2018-04-04&$filter=IsCompliant eq false{{/if}}",
"Method": "POST",
"Expression": "or(and(eq(isNullOrEmpty(taskInputs['resources']), true), eq(count(jsonpath('value[*].resourceId')), 0)), and(eq(isNullOrEmpty(taskInputs['resources']), false), eq(count(intersect(split(taskInputs['resources'], ','), jsonpath('value[*].resourceId'))) ,0)))"
}
Expand Down