detectors
Creates, updates, deletes or gets a detector
resource or lists detectors
in a region
Overview
Name | detectors |
Type | Resource |
Description | Resource Type definition for AWS::GuardDuty::Detector |
Id | aws.guardduty.detectors |
Fields
Name | Datatype | Description |
---|---|---|
finding_publishing_frequency | string | |
enable | boolean | |
data_sources | object | |
features | array | |
id | string | |
tags | array | |
region | string | AWS region. |
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | Enable, 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 detectors
in a region.
SELECT
region,
finding_publishing_frequency,
enable,
data_sources,
features,
id,
tags
FROM aws.guardduty.detectors
WHERE region = 'us-east-1';
Gets all properties from an individual detector
.
SELECT
region,
finding_publishing_frequency,
enable,
data_sources,
features,
id,
tags
FROM aws.guardduty.detectors
WHERE region = 'us-east-1' AND data__Identifier = '<Id>';
INSERT
example
Use the following StackQL query and manifest file to create a new detector
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.guardduty.detectors (
Enable,
region
)
SELECT
'{{ Enable }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.guardduty.detectors (
FindingPublishingFrequency,
Enable,
DataSources,
Features,
Tags,
region
)
SELECT
'{{ FindingPublishingFrequency }}',
'{{ Enable }}',
'{{ DataSources }}',
'{{ Features }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: detector
props:
- name: FindingPublishingFrequency
value: '{{ FindingPublishingFrequency }}'
- name: Enable
value: '{{ Enable }}'
- name: DataSources
value:
S3Logs:
Enable: '{{ Enable }}'
Kubernetes:
AuditLogs:
Enable: '{{ Enable }}'
MalwareProtection:
ScanEc2InstanceWithFindings:
EbsVolumes: '{{ EbsVolumes }}'
- name: Features
value:
- Name: '{{ Name }}'
Status: '{{ Status }}'
AdditionalConfiguration:
- Name: '{{ Name }}'
Status: '{{ Status }}'
- name: Tags
value:
- Key: '{{ Key }}'
Value: '{{ Value }}'
DELETE
example
/*+ delete */
DELETE FROM aws.guardduty.detectors
WHERE data__Identifier = '<Id>'
AND region = 'us-east-1';
Permissions
To operate on the detectors
resource, the following permissions are required:
Create
guardduty:CreateDetector,
guardduty:GetDetector,
guardduty:TagResource,
iam:CreateServiceLinkedRole,
iam:GetRole
Read
guardduty:GetDetector
Delete
guardduty:ListDetectors,
guardduty:DeleteDetector,
guardduty:GetDetector
Update
guardduty:UpdateDetector,
guardduty:GetDetector,
guardduty:ListDetectors,
iam:CreateServiceLinkedRole,
iam:GetRole
List
guardduty:ListDetectors