security_profiles
Creates, updates, deletes or gets a security_profile resource or lists security_profiles in a region
Overview
| Name | security_profiles |
| Type | Resource |
| Description | A security profile defines a set of expected behaviors for devices in your account. |
| Id | awscc.iot.security_profiles |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
security_profile_name | string | A unique identifier for the security profile. |
security_profile_description | string | A description of the security profile. |
behaviors | array | Specifies the behaviors that, when violated by a device (thing), cause an alert. |
alert_targets | object | Specifies the destinations to which alerts are sent. |
additional_metrics_to_retain_v2 | array | A list of metrics whose data is retained (stored). By default, data is retained for any metric used in the profile's behaviors, but it is also retained for any metric specified here. |
metrics_export_config | object | A structure containing the mqtt topic for metrics export. |
tags | array | Metadata that can be used to manage the security profile. |
target_arns | array | A set of target ARNs that the security profile is attached to. |
security_profile_arn | string | The ARN (Amazon resource name) of the created security profile. |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
security_profile_name | string | A unique identifier for the security profile. |
region | string | AWS region. |
For more information, see AWS::IoT::SecurityProfile.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | security_profiles | INSERT | , region |
delete_resource | security_profiles | DELETE | Identifier, region |
update_resource | security_profiles | UPDATE | Identifier, PatchDocument, region |
list_resources | security_profiles_list_only | SELECT | region |
get_resource | security_profiles | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual security_profile.
SELECT
region,
security_profile_name,
security_profile_description,
behaviors,
alert_targets,
additional_metrics_to_retain_v2,
metrics_export_config,
tags,
target_arns,
security_profile_arn
FROM awscc.iot.security_profiles
WHERE
region = 'us-east-1' AND
Identifier = '{{ security_profile_name }}';
Lists all security_profiles in a region.
SELECT
region,
security_profile_name
FROM awscc.iot.security_profiles_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new security_profile resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.iot.security_profiles (
,
region
)
SELECT
'{{ }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.iot.security_profiles (
SecurityProfileName,
SecurityProfileDescription,
Behaviors,
AlertTargets,
AdditionalMetricsToRetainV2,
MetricsExportConfig,
Tags,
TargetArns,
region
)
SELECT
'{{ security_profile_name }}',
'{{ security_profile_description }}',
'{{ behaviors }}',
'{{ alert_targets }}',
'{{ additional_metrics_to_retain_v2 }}',
'{{ metrics_export_config }}',
'{{ tags }}',
'{{ target_arns }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: security_profile
props:
- name: security_profile_name
value: '{{ security_profile_name }}'
- name: security_profile_description
value: '{{ security_profile_description }}'
- name: behaviors
value:
- name: '{{ name }}'
metric: '{{ metric }}'
metric_dimension:
dimension_name: '{{ dimension_name }}'
operator: '{{ operator }}'
criteria:
comparison_operator: '{{ comparison_operator }}'
value:
count: '{{ count }}'
cidrs:
- '{{ cidrs[0] }}'
ports:
- '{{ ports[0] }}'
number: null
numbers:
- null
strings:
- '{{ strings[0] }}'
duration_seconds: '{{ duration_seconds }}'
consecutive_datapoints_to_alarm: '{{ consecutive_datapoints_to_alarm }}'
consecutive_datapoints_to_clear: '{{ consecutive_datapoints_to_clear }}'
statistical_threshold:
statistic: '{{ statistic }}'
ml_detection_config:
confidence_level: '{{ confidence_level }}'
suppress_alerts: '{{ suppress_alerts }}'
export_metric: '{{ export_metric }}'
- name: alert_targets
value: {}
- name: additional_metrics_to_retain_v2
value:
- metric: '{{ metric }}'
metric_dimension: null
export_metric: null
- name: metrics_export_config
value:
mqtt_topic: '{{ mqtt_topic }}'
role_arn: '{{ role_arn }}'
- name: tags
value:
- key: '{{ key }}'
value: '{{ value }}'
- name: target_arns
value:
- '{{ target_arns[0] }}'
UPDATE example
Use the following StackQL query and manifest file to update a security_profile resource, using stack-deploy.
/*+ update */
UPDATE awscc.iot.security_profiles
SET PatchDocument = string('{{ {
"SecurityProfileDescription": security_profile_description,
"Behaviors": behaviors,
"AlertTargets": alert_targets,
"AdditionalMetricsToRetainV2": additional_metrics_to_retain_v2,
"MetricsExportConfig": metrics_export_config,
"Tags": tags,
"TargetArns": target_arns
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ security_profile_name }}';
DELETE example
/*+ delete */
DELETE FROM awscc.iot.security_profiles
WHERE
Identifier = '{{ security_profile_name }}' AND
region = 'us-east-1';
Permissions
To operate on the security_profiles resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
iot:CreateSecurityProfile,
iot:AttachSecurityProfile,
iot:DescribeSecurityProfile,
iot:TagResource,
iam:PassRole
iot:DescribeSecurityProfile,
iot:ListTagsForResource,
iot:ListTargetsForSecurityProfile
iot:UpdateSecurityProfile,
iot:ListTargetsForSecurityProfile,
iot:AttachSecurityProfile,
iot:DetachSecurityProfile,
iot:ListTagsForResource,
iot:UntagResource,
iot:TagResource,
iam:PassRole
iot:DescribeSecurityProfile,
iot:DeleteSecurityProfile
iot:ListSecurityProfiles