configuration_policies
Creates, updates, deletes or gets a configuration_policy resource or lists configuration_policies in a region
Overview
| Name | configuration_policies |
| Type | Resource |
| Description | The AWS::SecurityHub::ConfigurationPolicy resource represents the Central Configuration Policy in your account. |
| Id | awscc.securityhub.configuration_policies |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the configuration policy. |
name | string | The name of the configuration policy. |
description | string | The description of the configuration policy. |
configuration_policy | object | An object that defines how Security Hub is configured. |
id | string | The universally unique identifier (UUID) of the configuration policy. |
created_at | string | The date and time, in UTC and ISO 8601 format. |
updated_at | string | The date and time, in UTC and ISO 8601 format. |
service_enabled | boolean | Indicates whether the service that the configuration policy applies to is enabled in the policy. |
tags | object | A key-value pair to associate with the Security Hub V2 resource. You can specify a key that is 1 to 128 Unicode characters in length and cannot be prefixed with aws:. You can use any of the following characters: the set of Unicode letters, digits, whitespace, _, ., /, =, +, and -. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | The Amazon Resource Name (ARN) of the configuration policy. |
region | string | AWS region. |
For more information, see AWS::SecurityHub::ConfigurationPolicy.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | configuration_policies | INSERT | ConfigurationPolicy, Name, region |
delete_resource | configuration_policies | DELETE | Identifier, region |
update_resource | configuration_policies | UPDATE | Identifier, PatchDocument, region |
list_resources | configuration_policies_list_only | SELECT | region |
get_resource | configuration_policies | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual configuration_policy.
SELECT
region,
arn,
name,
description,
configuration_policy,
id,
created_at,
updated_at,
service_enabled,
tags
FROM awscc.securityhub.configuration_policies
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
Lists all configuration_policies in a region.
SELECT
region,
arn
FROM awscc.securityhub.configuration_policies_list_only
WHERE
region = '{{ region }}';
INSERT example
Use the following StackQL query and manifest file to create a new configuration_policy resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.securityhub.configuration_policies (
Name,
ConfigurationPolicy,
region
)
SELECT
'{{ name }}',
'{{ configuration_policy }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
/*+ create */
INSERT INTO awscc.securityhub.configuration_policies (
Name,
Description,
ConfigurationPolicy,
Tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ configuration_policy }}',
'{{ tags }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: configuration_policy
props:
- name: name
value: '{{ name }}'
- name: description
value: '{{ description }}'
- name: configuration_policy
value:
security_hub:
enabled_standard_identifiers:
- '{{ enabled_standard_identifiers[0] }}'
service_enabled: '{{ service_enabled }}'
security_controls_configuration:
disabled_security_control_identifiers:
- '{{ disabled_security_control_identifiers[0] }}'
enabled_security_control_identifiers:
- '{{ enabled_security_control_identifiers[0] }}'
security_control_custom_parameters:
- parameters: {}
security_control_id: '{{ security_control_id }}'
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a configuration_policy resource, using stack-deploy.
/*+ update */
UPDATE awscc.securityhub.configuration_policies
SET PatchDocument = string('{{ {
"Name": name,
"Description": description,
"ConfigurationPolicy": configuration_policy,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
DELETE example
/*+ delete */
DELETE FROM awscc.securityhub.configuration_policies
WHERE
Identifier = '{{ arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
Additional Parameters
Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:
| Parameter | Description |
|---|---|
ClientToken | A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request. If you do not specify a client token, one is generated for inclusion in the request. |
RoleArn | The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.If you do not specify a role, a temporary session is created using your AWS user credentials. |
TypeVersionId | For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used. |
Permissions
To operate on the configuration_policies resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
securityhub:CreateConfigurationPolicy,
securityhub:TagResource,
securityhub:ListTagsForResource
securityhub:GetConfigurationPolicy,
securityhub:ListTagsForResource
securityhub:UpdateConfigurationPolicy,
securityhub:TagResource,
securityhub:UntagResource,
securityhub:ListTagsForResource
securityhub:GetConfigurationPolicy,
securityhub:DeleteConfigurationPolicy
securityhub:ListConfigurationPolicies,
securityhub:ListTagsForResource