azure_active_directory_object resource
Use the azure_active_directory_object
InSpec audit resource to test the properties of an Azure Active Directory object.
Azure REST API version, endpoint, and HTTP client parameters
This resource interacts with API versions supported by the resource provider.
You can specify the api_version
as a resource parameter to use a specific version of the Azure REST API.
If you don’t specify an API version, this resource uses the latest version available.
For more information about API versioning, see the azure_generic_resource
.
By default, this resource uses the azure_cloud
global endpoint and default HTTP client settings.
You can override these settings if you need to connect to a different Azure environment (such as Azure Government or Azure China).
For more information about configuration options, see the resource pack README.
Syntax
describe azure_active_directory_object(id: 'ACTIVE_DIRECTORY_OBJECT_ID') do
it { should exist }
end
Parameters
Parameter id
is mandatory.
id
- The Active Directory object ID.
For example,
0bf29229-50d7-433c-b08e-2a5d8b293cb5
Properties
id
- The object’s globally unique ID.
deletedDateTime
- The date and time that the object was deleted.
classification
- The classification of the AD object.
createdDateTime
- The created Datetime of the AD object.
creationOptions
- The creationOptions of the AD object.
description
- The description of the AD object.
displayName
- The display name of the AD object.
expirationDateTime
- The expiration Datetime of the AD object.
groupTypes
- The group types of the AD object group.
isAssignableToRole
- The roles assignable to the AD object.
mail
- The configured mail for the AD object.
mailEnabled
- The mail-enabled configuration parameter.
mailNickname
- The mail nickname configuration.
membershipRule
- The membership rule for the AD object.
membershipRuleProcessingState
- The processing state of the membership rule.
onPremisesDomainName
- The specified domain name for the on-premises domain.
onPremisesLastSyncDateTime
- The on-premises latest sync date time.
onPremisesNetBiosName
- The on-premises net bios name.
onPremisesSamAccountName
- The on-premises SAM account name.
onPremisesSecurityIdentifier
- The on-premises security identifier.
onPremisesSyncEnabled
- The on-premises sync enabled configuration.
onPremisesProvisioningErrors
- The on-premises provisioning errors.
preferredDataLocation
- The preferred data location.
preferredLanguage
- The preferred language.
proxyAddresses
- The proxy addresses for the object.
renewedDateTime
- The renewed date time of the AD object.
resourceBehaviorOptions
- The behavior options set for the resource.
resourceProvisioningOptions
- The resource provisioning options set.
securityEnabled
- The security-enabled configured.
securityIdentifier
- The security identifier configured.
theme
- The theme of the object.
visibility
- The visibility status of the object.
Examples
Test if an Active Directory object is referenced with a valid ID:
describe azure_active_directory_object(id: 'ACTIVE_DIRECTORY_OBJECT_ID') do
it { should exist }
end
Test if an Active Directory object is referenced with an invalid ID:
describe azure_active_directory_object(id: 'ACTIVE_DIRECTORY_OBJECT_ID') do
it { should_not exist }
end
Matchers
For a full list of available matchers, see our Universal Matchers page.This resource has the following special matchers.
exists
describe azure_active_directory_object(id: 'ACTIVE_DIRECTORY_OBJECT_ID') do
it { should exist }
end
Azure permissions
Graph resources require specific privileges granted to your service principal. Please refer to the Microsoft Documentation for information on how to grant these permissions to your application.