filters
Creates, updates, deletes or gets a filter resource or lists filters in a region
Overview
| Name | filters |
| Type | Resource |
| Description | Inspector Filter resource schema |
| Id | awscc.inspectorv2.filters |
Fields
- get (all properties)
- list (identifiers only)
| Name | Datatype | Description |
|---|---|---|
name | string | Findings filter name. |
description | string | Findings filter description. |
filter_criteria | object | Findings filter criteria. |
filter_action | string | Findings filter action. |
arn | string | Findings filter ARN. |
tags | object | |
region | string | AWS region. |
| Name | Datatype | Description |
|---|---|---|
arn | string | Findings filter ARN. |
region | string | AWS region. |
For more information, see AWS::InspectorV2::Filter.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | filters | INSERT | Name, FilterCriteria, FilterAction, region |
delete_resource | filters | DELETE | Identifier, region |
update_resource | filters | UPDATE | Identifier, PatchDocument, region |
list_resources | filters_list_only | SELECT | region |
get_resource | filters | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
Gets all properties from an individual filter.
SELECT
region,
name,
description,
filter_criteria,
filter_action,
arn,
tags
FROM awscc.inspectorv2.filters
WHERE
region = 'us-east-1' AND
Identifier = '{{ arn }}';
Lists all filters in a region.
SELECT
region,
arn
FROM awscc.inspectorv2.filters_list_only
WHERE
region = 'us-east-1';
INSERT example
Use the following StackQL query and manifest file to create a new filter resource, using stack-deploy.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO awscc.inspectorv2.filters (
Name,
FilterCriteria,
FilterAction,
region
)
SELECT
'{{ name }}',
'{{ filter_criteria }}',
'{{ filter_action }}',
'{{ region }}';
/*+ create */
INSERT INTO awscc.inspectorv2.filters (
Name,
Description,
FilterCriteria,
FilterAction,
Tags,
region
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ filter_criteria }}',
'{{ filter_action }}',
'{{ tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: filter
props:
- name: name
value: '{{ name }}'
- name: description
value: '{{ description }}'
- name: filter_criteria
value:
aws_account_id:
- comparison: '{{ comparison }}'
value: '{{ value }}'
code_vulnerability_detector_name: null
code_vulnerability_detector_tags: null
code_vulnerability_file_path: null
component_id: null
component_type: null
ec2_instance_image_id: null
ec2_instance_subnet_id: null
ec2_instance_vpc_id: null
ecr_image_architecture: null
ecr_image_hash: null
ecr_image_pushed_at:
- end_inclusive: '{{ end_inclusive }}'
start_inclusive: null
ecr_image_registry: null
ecr_image_repository_name: null
ecr_image_tags: null
epss_score:
- lower_inclusive: null
upper_inclusive: null
exploit_available: null
finding_arn: null
finding_status: null
finding_type: null
first_observed_at: null
fix_available: null
inspector_score: null
lambda_function_execution_role_arn: null
lambda_function_last_modified_at: null
lambda_function_layers: null
lambda_function_name: null
lambda_function_runtime: null
last_observed_at: null
network_protocol: null
port_range:
- begin_inclusive: '{{ begin_inclusive }}'
end_inclusive: null
related_vulnerabilities: null
resource_id: null
resource_tags:
- comparison: '{{ comparison }}'
key: '{{ key }}'
value: '{{ value }}'
resource_type: null
severity: null
title: null
updated_at: null
vendor_severity: null
vulnerability_id: null
vulnerability_source: null
vulnerable_packages:
- architecture: null
epoch: null
file_path: null
name: null
release: null
source_lambda_layer_arn: null
source_layer_hash: null
version: null
- name: filter_action
value: '{{ filter_action }}'
- name: tags
value: {}
UPDATE example
Use the following StackQL query and manifest file to update a filter resource, using stack-deploy.
/*+ update */
UPDATE awscc.inspectorv2.filters
SET PatchDocument = string('{{ {
"Name": name,
"Description": description,
"FilterCriteria": filter_criteria,
"FilterAction": filter_action,
"Tags": tags
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ arn }}';
DELETE example
/*+ delete */
DELETE FROM awscc.inspectorv2.filters
WHERE
Identifier = '{{ arn }}' AND
region = 'us-east-1';
Permissions
To operate on the filters resource, the following permissions are required:
- Create
- Read
- Update
- Delete
- List
inspector2:CreateFilter,
inspector2:ListFilters,
inspector2:TagResource
inspector2:ListFilters,
inspector2:ListTagsForResource
inspector2:ListFilters,
inspector2:UpdateFilter,
inspector2:TagResource,
inspector2:UntagResource,
inspector2:ListTagsForResource
inspector2:DeleteFilter,
inspector2:ListFilters
inspector2:ListFilters