-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into RESOURCE-534-create-the-unit-tests-and-docs-…
…for-azure-microsoft-defender-for-cloud-resource-for-security-contact
- Loading branch information
Showing
22 changed files
with
355 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.118.12 | ||
1.118.14 |
123 changes: 123 additions & 0 deletions
123
docs-chef-io/content/inspec/resources/azure_mysql_server_configuration.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
+++ | ||
title = "azure_mysql_database_configuration Resource" | ||
platform = "azure" | ||
draft = false | ||
gh_repo = "inspec-azure" | ||
|
||
[menu.inspec] | ||
title = "azure_mysql_database_configuration" | ||
identifier = "inspec/resources/azure/azure_mysql_database_configuration Resource" | ||
parent = "inspec/resources/azure" | ||
+++ | ||
|
||
Use the `azure_mysql_database_configuration` InSpec audit resource to test the properties of an Azure MySQL Database Configuration on a MySQL Database Server. | ||
|
||
## Syntax | ||
|
||
`resource_group`, `server_name` and `name`, or the `resource_id` are required parameters. | ||
|
||
```ruby | ||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME', name: 'CONFIGURATION_NAME') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
```ruby | ||
describe azure_mysql_database_configuration(resource_id: 'RESOURCE_ID') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Parameters | ||
|
||
`resource_group` | ||
: Azure resource group where the targeted resource resides. | ||
|
||
`server_name` | ||
: The name of the server on which the database resides. | ||
|
||
`name` | ||
: The unique name of the database configuration. | ||
|
||
`resource_id` | ||
: The unique resource ID. | ||
|
||
Either one of the parameter sets can be provided for a valid query: | ||
|
||
- `resource_id` | ||
- `resource_group`, `server_name`, and `name` | ||
|
||
## Properties | ||
|
||
`id` | ||
: The id of the resource. | ||
|
||
`name` | ||
: The name of the resource. | ||
|
||
`type` | ||
: The type of the resource. | ||
|
||
`properties.allowedValues` | ||
: Allowed values of the configuration. | ||
|
||
`properties.dataType` | ||
: Data type of the configuration. | ||
|
||
`properties.defaultValue` | ||
: Default value of the configuration. | ||
|
||
`properties.description` | ||
: Description of the configuration. | ||
|
||
`properties.source` | ||
: Source of the configuration. | ||
|
||
`properties.value` | ||
: Value of the configuration. | ||
|
||
|
||
For properties applicable to all resources, such as `type`, `id`, and `properties`, refer to [`azure_generic_resource`]({{< relref "azure_generic_resource.md#properties" >}}). | ||
|
||
Also, refer to [Azure documentation](https://learn.microsoft.com/en-us/rest/api/mysql/singleserver/configurations/get?tabs=HTTP) for other properties available. | ||
Any attribute in the response may be accessed with the key names separated by dots (`.`). | ||
|
||
## Examples | ||
|
||
### Test the resource name | ||
|
||
```ruby | ||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME', name: 'CONFIGURATION_NAME') do | ||
its('name') { should be 'CONFIGURATION_NAME' } | ||
end | ||
``` | ||
|
||
```ruby | ||
describe azure_mysql_database_configuration(resource_id: 'RESOURCE_ID') do | ||
its('name') { should be 'CONFIGURATION_NAME' } | ||
end | ||
``` | ||
|
||
## Matchers | ||
|
||
This InSpec audit resource has the following special matchers. For a full list of available matchers, please visit our [Universal Matchers page](https://docs.chef.io/inspec/matchers/). | ||
|
||
### exists | ||
|
||
```ruby | ||
# If we expect the resource to always exist. | ||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME', name: 'CONFIGURATION_NAME') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
```ruby | ||
# If we expect the resource to never exist. | ||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME', name: 'CONFIGURATION_NAME') do | ||
it { should_not exist } | ||
end | ||
``` | ||
|
||
## Azure Permissions | ||
|
||
{{% azure_permissions_service_principal role="contributor" %}} |
110 changes: 110 additions & 0 deletions
110
docs-chef-io/content/inspec/resources/azure_mysql_server_configurations.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
+++ | ||
title = "azure_mysql_database_configurations Resource" | ||
platform = "azure" | ||
draft = false | ||
gh_repo = "inspec-azure" | ||
|
||
[menu.inspec] | ||
title = "azure_mysql_database_configurations" | ||
identifier = "inspec/resources/azure/azure_mysql_database_configurations Resource" | ||
parent = "inspec/resources/azure" | ||
+++ | ||
|
||
Use the `azure_mysql_database_configurations` InSpec audit resource to test the properties of an Azure MySQL Database Configuration on a MySQL Database Server. | ||
|
||
## Azure REST API Version, Endpoint, and HTTP Client Parameters | ||
|
||
{{% inspec_azure_common_parameters %}} | ||
|
||
## Installation | ||
|
||
{{% inspec_azure_install %}} | ||
|
||
## Syntax | ||
|
||
The `resource_group` and `server_name` are required parameters. | ||
|
||
```ruby | ||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Parameters | ||
|
||
`resource_group` | ||
: Azure resource group where the targeted resource resides. | ||
|
||
`server_name` | ||
: The name of the server in which the database resides. | ||
|
||
## Properties | ||
|
||
`ids` | ||
: A list of the unique resource IDs. | ||
|
||
: **Field**: `id` | ||
|
||
`names` | ||
: A list of names of all the resources being interrogated. | ||
|
||
: **Field**: `name` | ||
|
||
`types` | ||
: A list of the types of resources being interrogated. | ||
|
||
: **Field**: `type` | ||
|
||
`properties` | ||
: A list of properties for all the resources being interrogated. | ||
|
||
: **Field**: `properties` | ||
|
||
{{% inspec_filter_table %}} | ||
|
||
## Examples | ||
|
||
### Check resources are present | ||
|
||
```ruby | ||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME') do | ||
it { should exist } | ||
its('names') { should include 'my-db' } | ||
end | ||
``` | ||
|
||
### Filter the results to include only those with names match the specified string value | ||
|
||
```ruby | ||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME').where{ name.eql?('user-override') } do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
## Matchers | ||
|
||
{{% inspec_matchers_link %}} | ||
|
||
### exists | ||
|
||
The control passes if the filter returns at least one result. Use `should_not` if you expect zero matches. | ||
|
||
```ruby | ||
# If we expect resources to exist. | ||
|
||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME') do | ||
it { should exist } | ||
end | ||
``` | ||
|
||
```ruby | ||
# If we expect resources not to exist. | ||
|
||
describe azure_mysql_database_configuration(resource_group: 'RESOURCE_GROUP', server_name: 'SERVER_NAME') do | ||
it { should_not exist } | ||
end | ||
``` | ||
|
||
## Azure Permissions | ||
|
||
{{% azure_permissions_service_principal role="contributor" %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.