Skip to main content

governance_rules

Creates, updates, deletes, gets or lists a governance_rules resource.

Overview

Namegovernance_rules
TypeResource
Idazure.security.governance_rules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringFully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.
namestringThe name of the resource.
conditionSetsarrayThe governance rule conditionSets - see examples. Required.
descriptionstringDescription of the governance rule.
displayNamestringDisplay name of the governance rule. Required.
excludedScopesarrayExcluded scopes, filter out the descendants of the scope (on management scopes).
governanceEmailNotificationobjectThe email notifications settings for the governance rule, states whether to disable notifications for mangers and owners.
includeMemberScopesbooleanDefines whether the rule is management scope rule (master connector as a single scope or management scope).
isDisabledbooleanDefines whether the rule is active/inactive.
isGracePeriodbooleanDefines whether there is a grace period on the governance rule.
metadataobjectThe governance rule metadata.
ownerSourceobjectThe owner source for the governance rule - e.g. Manually by user@contoso.com _ - see example. Required.
remediationTimeframestringGovernance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days.
rulePriorityintegerThe governance rule priority, priority to the lower number. Rules with the same priority on the same scope will not be allowed. Required.
ruleTypestringThe rule type of the governance rule, defines the source of the rule e.g. Integrated. Required. Known values are: "Integrated" and "ServiceNow". (Integrated, ServiceNow)
sourceResourceTypestringThe governance rule source, what the rule affects, e.g. Assessments. Required. "Assessments" (Assessments)
systemDataobjectAzure Resource Manager metadata containing createdBy and modifiedBy information.
tenantIdstringThe tenantId (GUID).
typestringThe type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectscope, rule_idGet a specific governance rule for the requested scope by ruleId.
listselectscopeGet a list of all relevant governance rules over a scope.
create_or_updateinsertscope, rule_idCreates or updates a governance rule over a given scope.
create_or_updatereplacescope, rule_idCreates or updates a governance rule over a given scope.
deletedeletescope, rule_idDelete a Governance rule over a given scope.
executeexecscope, rule_idExecute a governance rule.
operation_resultsexecscope, rule_id, operation_idGet governance rules long run operation result for the requested scope by ruleId and operationId.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
operation_idstringThe governance rule long running operation unique key. Required.
rule_idstringThe governance rule key. Required.
scopestringThe scope of the governance rule. Required.

SELECT examples

Get a specific governance rule for the requested scope by ruleId.

SELECT
id,
name,
conditionSets,
description,
displayName,
excludedScopes,
governanceEmailNotification,
includeMemberScopes,
isDisabled,
isGracePeriod,
metadata,
ownerSource,
remediationTimeframe,
rulePriority,
ruleType,
sourceResourceType,
systemData,
tenantId,
type
FROM azure.security.governance_rules
WHERE scope = '{{ scope }}' -- required
AND rule_id = '{{ rule_id }}' -- required
;

INSERT examples

Creates or updates a governance rule over a given scope.

INSERT INTO azure.security.governance_rules (
properties,
scope,
rule_id
)
SELECT
'{{ properties }}',
'{{ scope }}',
'{{ rule_id }}'
RETURNING
id,
name,
properties,
systemData,
type
;

REPLACE examples

Creates or updates a governance rule over a given scope.

REPLACE azure.security.governance_rules
SET
properties = '{{ properties }}'
WHERE
scope = '{{ scope }}' --required
AND rule_id = '{{ rule_id }}' --required
RETURNING
id,
name,
properties,
systemData,
type;

DELETE examples

Delete a Governance rule over a given scope.

DELETE FROM azure.security.governance_rules
WHERE scope = '{{ scope }}' --required
AND rule_id = '{{ rule_id }}' --required
;

Lifecycle Methods

Execute a governance rule.

EXEC azure.security.governance_rules.execute 
@scope='{{ scope }}' --required,
@rule_id='{{ rule_id }}' --required
@@json=
'{
"override": {{ override }}
}'
;