Governance Rules - Get

Get a specific governance rule for the requested scope by ruleId

GET https://management.azure.com/{scope}/providers/Microsoft.Security/governanceRules/{ruleId}?api-version=2022-01-01-preview

URI Parameters

Name In Required Type Description
ruleId
path True

string

The governance rule key - unique key for the standard governance rule (GUID)

scope
path True

string

The scope of the Governance rules. Valid scopes are: management group (format: 'providers/Microsoft.Management/managementGroups/{managementGroup}'), subscription (format: 'subscriptions/{subscriptionId}'), or security connector (format: 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Security/securityConnectors/{securityConnectorName})'

api-version
query True

string

API version for the operation

Responses

Name Type Description
200 OK

GovernanceRule

OK

Other Status Codes

CloudError

Error response describing why the operation failed

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Get a governance rule over management group scope
Get a governance rule over security connector scope
Get a governance rule over subscription scope

Get a governance rule over management group scope

Sample request

GET https://management.azure.com/providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8?api-version=2022-01-01-preview

Sample response

{
  "id": "providers/Microsoft.Management/managementGroups/contoso/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
  "name": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
  "type": "Microsoft.Security/governanceRules",
  "properties": {
    "tenantId": "f0b6d37b-e4bc-4719-9291-c066c3194f23",
    "displayName": "Management group rule",
    "description": "A rule for a management group",
    "remediationTimeframe": "7.00:00:00",
    "isGracePeriod": true,
    "rulePriority": 200,
    "isDisabled": false,
    "ruleType": "Integrated",
    "sourceResourceType": "Assessments",
    "conditionSets": [
      {
        "conditions": [
          {
            "property": "$.AssessmentKey",
            "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]",
            "operator": "In"
          }
        ]
      }
    ],
    "ownerSource": {
      "type": "Manually",
      "value": "user@contoso.com"
    },
    "governanceEmailNotification": {
      "disableManagerEmailNotification": false,
      "disableOwnerEmailNotification": false
    },
    "excludedScopes": [
      "/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23"
    ],
    "includeMemberScopes": false,
    "metadata": {
      "createdBy": "c23b5354-ff0a-4b2a-9f92-6f144effd936",
      "createdOn": "2022-11-10T08:31:26.7993124Z",
      "updatedBy": "c23b5354-ff0a-4b2a-9f92-6f144effd936",
      "updatedOn": "2022-11-10T08:31:26.7993124Z"
    }
  }
}

Get a governance rule over security connector scope

Sample request

GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourceGroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8?api-version=2022-01-01-preview

Sample response

{
  "id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/resourcegroups/gcpResourceGroup/providers/Microsoft.Security/securityConnectors/gcpconnector/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
  "name": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
  "type": "Microsoft.Security/governanceRules",
  "properties": {
    "tenantId": "f0b6d37b-e4bc-4719-9291-c066c3194f23",
    "displayName": "GCP Admin's rule",
    "description": "A rule on critical GCP recommendations",
    "remediationTimeframe": "7.00:00:00",
    "isGracePeriod": true,
    "rulePriority": 200,
    "isDisabled": false,
    "ruleType": "Integrated",
    "sourceResourceType": "Assessments",
    "conditionSets": [
      {
        "conditions": [
          {
            "property": "$.AssessmentKey",
            "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]",
            "operator": "In"
          }
        ]
      }
    ],
    "ownerSource": {
      "type": "Manually",
      "value": "user@contoso.com"
    },
    "governanceEmailNotification": {
      "disableManagerEmailNotification": false,
      "disableOwnerEmailNotification": false
    },
    "excludedScopes": [],
    "includeMemberScopes": false,
    "metadata": {
      "createdBy": "c23b5354-ff0a-4b2a-9f92-6f144effd936",
      "createdOn": "2022-11-10T08:31:26.7993124Z",
      "updatedBy": "c23b5354-ff0a-4b2a-9f92-6f144effd936",
      "updatedOn": "2022-11-10T08:31:26.7993124Z"
    }
  }
}

Get a governance rule over subscription scope

Sample request

GET https://management.azure.com/subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8?api-version=2022-01-01-preview

Sample response

{
  "id": "subscriptions/20ff7fc3-e762-44dd-bd96-b71116dcdc23/providers/Microsoft.Security/governanceRules/ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
  "name": "ad9a8e26-29d9-4829-bb30-e597a58cdbb8",
  "type": "Microsoft.Security/governanceRules",
  "properties": {
    "tenantId": "f0b6d37b-e4bc-4719-9291-c066c3194f23",
    "displayName": "Admin's rule",
    "description": "A rule for critical recommendations",
    "remediationTimeframe": "7.00:00:00",
    "isGracePeriod": true,
    "rulePriority": 200,
    "isDisabled": false,
    "ruleType": "Integrated",
    "sourceResourceType": "Assessments",
    "conditionSets": [
      {
        "conditions": [
          {
            "property": "$.AssessmentKey",
            "value": "[\"b1cd27e0-4ecc-4246-939f-49c426d9d72f\", \"fe83f80b-073d-4ccf-93d9-6797eb870201\"]",
            "operator": "In"
          }
        ]
      }
    ],
    "ownerSource": {
      "type": "Manually",
      "value": "user@contoso.com"
    },
    "governanceEmailNotification": {
      "disableManagerEmailNotification": false,
      "disableOwnerEmailNotification": false
    },
    "excludedScopes": [],
    "includeMemberScopes": false,
    "metadata": {
      "createdBy": "c23b5354-ff0a-4b2a-9f92-6f144effd936",
      "createdOn": "2022-11-10T08:31:26.7993124Z",
      "updatedBy": "c23b5354-ff0a-4b2a-9f92-6f144effd936",
      "updatedOn": "2022-11-10T08:31:26.7993124Z"
    }
  }
}

Definitions

Name Description
CloudError

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

CloudErrorBody

The error detail.

Condition

Governance rule's condition

ErrorAdditionalInfo

The resource management error additional info.

GovernanceRule

Governance rule over a given scope

GovernanceRuleConditionOperator

The governance rule Condition's Operator, for example Equals for severity or In for list of assessments, see examples

GovernanceRuleEmailNotification

The governance email weekly notification configuration

GovernanceRuleMetadata

The governance rule metadata

GovernanceRuleOwnerSource

Describe the owner source of governance rule

GovernanceRuleOwnerSourceType

The owner type for the governance rule owner source

GovernanceRuleSourceResourceType

The governance rule source, what the rule affects, e.g. Assessments

GovernanceRuleType

The rule type of the governance rule, defines the source of the rule e.g. Integrated

CloudError

Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.).

Name Type Description
error.additionalInfo

ErrorAdditionalInfo[]

The error additional info.

error.code

string

The error code.

error.details

CloudErrorBody[]

The error details.

error.message

string

The error message.

error.target

string

The error target.

CloudErrorBody

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

CloudErrorBody[]

The error details.

message

string

The error message.

target

string

The error target.

Condition

Governance rule's condition

Name Type Description
operator

GovernanceRuleConditionOperator

The governance rule Condition's Operator, for example Equals for severity or In for list of assessments, see examples

property

string

The governance rule Condition's Property, e.g. Severity or AssessmentKey, see examples

value

string

The governance rule Condition's Value like severity Low, High or assessments keys, see examples

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

GovernanceRule

Governance rule over a given scope

Name Type Description
id

string

Resource Id

name

string

Resource name

properties.conditionSets

Condition[]

The governance rule conditionSets - see examples

properties.description

string

Description of the governance rule

properties.displayName

string

Display name of the governance rule

properties.excludedScopes

string[]

Excluded scopes, filter out the descendants of the scope (on management scopes)

properties.governanceEmailNotification

GovernanceRuleEmailNotification

The email notifications settings for the governance rule, states whether to disable notifications for mangers and owners

properties.includeMemberScopes

boolean

Defines whether the rule is management scope rule (master connector as a single scope or management scope)

properties.isDisabled

boolean

Defines whether the rule is active/inactive

properties.isGracePeriod

boolean

Defines whether there is a grace period on the governance rule

properties.metadata

GovernanceRuleMetadata

The governance rule metadata

properties.ownerSource

GovernanceRuleOwnerSource

The owner source for the governance rule - e.g. Manually by user@contoso.com - see example

properties.remediationTimeframe

string

Governance rule remediation timeframe - this is the time that will affect on the grace-period duration e.g. 7.00:00:00 - means 7 days

properties.rulePriority

integer

The governance rule priority, priority to the lower number. Rules with the same priority on the same scope will not be allowed

properties.ruleType

GovernanceRuleType

The rule type of the governance rule, defines the source of the rule e.g. Integrated

properties.sourceResourceType

GovernanceRuleSourceResourceType

The governance rule source, what the rule affects, e.g. Assessments

properties.tenantId

string

The tenantId (GUID)

type

string

Resource type

GovernanceRuleConditionOperator

The governance rule Condition's Operator, for example Equals for severity or In for list of assessments, see examples

Name Type Description
Equals

string

Checks that the string value of the data defined in Property equals the given value - exact fit

In

string

Checks that the string value of the data defined in Property equals any of the given values (exact fit)

GovernanceRuleEmailNotification

The governance email weekly notification configuration

Name Type Description
disableManagerEmailNotification

boolean

Defines whether manager email notifications are disabled

disableOwnerEmailNotification

boolean

Defines whether owner email notifications are disabled

GovernanceRuleMetadata

The governance rule metadata

Name Type Description
createdBy

string

Governance rule Created by object id (GUID)

createdOn

string

Governance rule creation date

updatedBy

string

Governance rule last updated by object id (GUID)

updatedOn

string

Governance rule last update date

GovernanceRuleOwnerSource

Describe the owner source of governance rule

Name Type Description
type

GovernanceRuleOwnerSourceType

The owner type for the governance rule owner source

value

string

The source value e.g. tag key like owner name or email address

GovernanceRuleOwnerSourceType

The owner type for the governance rule owner source

Name Type Description
ByTag

string

The rule source type defined using resource tag

Manually

string

The rule source type defined manually

GovernanceRuleSourceResourceType

The governance rule source, what the rule affects, e.g. Assessments

Name Type Description
Assessments

string

The source of the governance rule is assessments

GovernanceRuleType

The rule type of the governance rule, defines the source of the rule e.g. Integrated

Name Type Description
Integrated

string

The source of the rule type definition is integrated

ServiceNow

string

The source of the rule type definition is ServiceNow