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 | aws.inspectorv2.filters |
Fields
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. |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Name, FilterCriteria, FilterAction, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all filters
in a region.
SELECT
region,
name,
description,
filter_criteria,
filter_action,
arn
FROM aws.inspectorv2.filters
WHERE region = 'us-east-1';
Gets all properties from an individual filter
.
SELECT
region,
name,
description,
filter_criteria,
filter_action,
arn
FROM aws.inspectorv2.filters
WHERE region = 'us-east-1' AND data__Identifier = '<Arn>';
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 aws.inspectorv2.filters (
Name,
FilterCriteria,
FilterAction,
region
)
SELECT
'{{ Name }}',
'{{ FilterCriteria }}',
'{{ FilterAction }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.inspectorv2.filters (
Name,
Description,
FilterCriteria,
FilterAction,
region
)
SELECT
'{{ Name }}',
'{{ Description }}',
'{{ FilterCriteria }}',
'{{ FilterAction }}',
'{{ 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: FilterCriteria
value:
AwsAccountId:
- Comparison: '{{ Comparison }}'
Value: '{{ Value }}'
ComponentId: null
ComponentType: null
Ec2InstanceImageId: null
Ec2InstanceSubnetId: null
Ec2InstanceVpcId: null
EcrImageArchitecture: null
EcrImageHash: null
EcrImageTags: null
EcrImagePushedAt:
- EndInclusive: '{{ EndInclusive }}'
StartInclusive: null
EcrImageRegistry: null
EcrImageRepositoryName: null
FindingArn: null
FindingStatus: null
FindingType: null
FirstObservedAt: null
InspectorScore:
- LowerInclusive: null
UpperInclusive: null
LastObservedAt: null
NetworkProtocol: null
PortRange:
- BeginInclusive: '{{ BeginInclusive }}'
EndInclusive: null
RelatedVulnerabilities: null
ResourceId: null
ResourceTags:
- Comparison: '{{ Comparison }}'
Key: '{{ Key }}'
Value: '{{ Value }}'
ResourceType: null
Severity: null
Title: null
UpdatedAt: null
VendorSeverity: null
VulnerabilityId: null
VulnerabilitySource: null
VulnerablePackages:
- Architecture: null
Epoch: null
Name: null
Release: null
SourceLayerHash: null
Version: null
- name: FilterAction
value: '{{ FilterAction }}'
DELETE
example
/*+ delete */
DELETE FROM aws.inspectorv2.filters
WHERE data__Identifier = '<Arn>'
AND region = 'us-east-1';
Permissions
To operate on the filters
resource, the following permissions are required:
Create
inspector2:CreateFilter,
inspector2:ListFilters
Read
inspector2:ListFilters
Update
inspector2:ListFilters,
inspector2:UpdateFilter
Delete
inspector2:DeleteFilter,
inspector2:ListFilters
List
inspector2:ListFilters