Skip to main content

security_controls

Creates, updates, deletes or gets a security_control resource or lists security_controls in a region

Overview

Namesecurity_controls
TypeResource
DescriptionA security control in Security Hub describes a security best practice related to a specific resource.
Idawscc.securityhub.security_controls

Fields

NameDatatypeDescription
security_control_idstringThe unique identifier of a security control across standards. Values for this field typically consist of an AWS service name and a number, such as APIGateway.3.
last_update_reasonstringThe most recent reason for updating the customizable properties of a security control. This differs from the UpdateReason field of the BatchUpdateStandardsControlAssociations API, which tracks the reason for updating the enablement status of a control. This field accepts alphanumeric characters in addition to white spaces, dashes, and underscores.
parametersobjectAn object that identifies the name of a control parameter, its current value, and whether it has been customized.
regionstringAWS region.

For more information, see AWS::SecurityHub::SecurityControl.

Methods

NameResourceAccessible byRequired Params
create_resourcesecurity_controlsINSERTParameters, region
delete_resourcesecurity_controlsDELETEIdentifier, region
update_resourcesecurity_controlsUPDATEIdentifier, PatchDocument, region
list_resourcessecurity_controls_list_onlySELECTregion
get_resourcesecurity_controlsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual security_control.

SELECT
region,
security_control_id,
security_control_arn,
last_update_reason,
parameters
FROM awscc.securityhub.security_controls
WHERE
region = '{{ region }}' AND
Identifier = '{{ security_control_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new security_control resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.securityhub.security_controls (
Parameters,
region
)
SELECT
'{{ parameters }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a security_control resource, using stack-deploy.

/*+ update */
UPDATE awscc.securityhub.security_controls
SET PatchDocument = string('{{ {
"SecurityControlArn": security_control_arn,
"LastUpdateReason": last_update_reason,
"Parameters": parameters
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ security_control_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.securityhub.security_controls
WHERE
Identifier = '{{ security_control_id }}' 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:

ParameterDescription
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 security_controls resource, the following permissions are required:

securityhub:BatchGetSecurityControls,
securityhub:DescribeStandardsControls,
securityhub:UpdateSecurityControl,
securityhub:UpdateStandardsControl