Skip to main content

detectors

Creates, updates, deletes or gets a detector resource or lists detectors in a region

Overview

Namedetectors
TypeResource
DescriptionResource Type definition for AWS::GuardDuty::Detector
Idaws.guardduty.detectors

Fields

NameDatatypeDescription
finding_publishing_frequencystring
enableboolean
data_sourcesobject
featuresarray
idstring
tagsarray
regionstringAWS region.

Methods

NameAccessible byRequired Params
create_resourceINSERTEnable, region
delete_resourceDELETEdata__Identifier, region
update_resourceUPDATEdata__Identifier, data__PatchDocument, region
list_resourcesSELECTregion
get_resourceSELECTdata__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.

/*+ create */
INSERT INTO aws.guardduty.detectors (
Enable,
region
)
SELECT
'{{ Enable }}',
'{{ region }}';

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