Skip to main content

detectors

Creates, updates, deletes, gets or lists a detectors resource.

Overview

Namedetectors
TypeResource
Idaws.guardduty.detectors

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
created_atstringThe timestamp of when the detector was created.
data_sourcesobjectDescribes which data sources are enabled for the detector.
featuresarrayDescribes the features that have been enabled for the detector.
finding_publishing_frequencystringThe publishing frequency of the finding. (FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS)
service_rolestringThe GuardDuty service role.
statusstringThe detector status. (ENABLED, DISABLED)
tagsobjectThe tags of the detector resource.
updated_atstringThe last-updated timestamp for the detector.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_detectorselectdetector_id, regionRetrieves a GuardDuty detector specified by the detectorId. There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.
list_detectorsselectregionmaxResults, nextTokenLists detectorIds of all the existing Amazon GuardDuty detector resources.
create_detectorinsertregion, EnableCreates a single GuardDuty detector. A detector is a resource that represents the GuardDuty service. To start using GuardDuty, you must create a detector in each Region where you enable the service. You can have only one detector per account per Region. All data sources are enabled in a new detector by default. When you don't specify any features, with an exception to RUNTIME_MONITORING, all the optional features are enabled by default. When you specify some of the features, any feature that is not specified in the API call gets enabled by default, with an exception to RUNTIME_MONITORING. Specifying both EKS Runtime Monitoring (EKS_RUNTIME_MONITORING) and Runtime Monitoring (RUNTIME_MONITORING) will cause an error. You can add only one of these two features because Runtime Monitoring already includes the threat detection for Amazon EKS resources. For more information, see Runtime Monitoring. There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.
update_detectorupdatedetector_id, regionUpdates the GuardDuty detector specified by the detector ID. Specifying both EKS Runtime Monitoring (EKS_RUNTIME_MONITORING) and Runtime Monitoring (RUNTIME_MONITORING) will cause an error. You can add only one of these two features because Runtime Monitoring already includes the threat detection for Amazon EKS resources. For more information, see Runtime Monitoring. There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.
delete_detectordeletedetector_id, regionDeletes an Amazon GuardDuty detector that is specified by the detector ID.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
detector_idstringThe unique ID of the detector that you want to delete. To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.
regionstringAWS region (default: us-east-1)
maxResultsintegerYou can use this parameter to indicate the maximum number of items that you want in the response. The default value is 50. The maximum value is 50.
nextTokenstringYou can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

SELECT examples

Retrieves a GuardDuty detector specified by the detectorId. There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.

SELECT
created_at,
data_sources,
features,
finding_publishing_frequency,
service_role,
status,
tags,
updated_at
FROM aws.guardduty.detectors
WHERE detector_id = '{{ detector_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a single GuardDuty detector. A detector is a resource that represents the GuardDuty service. To start using GuardDuty, you must create a detector in each Region where you enable the service. You can have only one detector per account per Region. All data sources are enabled in a new detector by default. When you don't specify any features, with an exception to RUNTIME_MONITORING, all the optional features are enabled by default. When you specify some of the features, any feature that is not specified in the API call gets enabled by default, with an exception to RUNTIME_MONITORING. Specifying both EKS Runtime Monitoring (EKS_RUNTIME_MONITORING) and Runtime Monitoring (RUNTIME_MONITORING) will cause an error. You can add only one of these two features because Runtime Monitoring already includes the threat detection for Amazon EKS resources. For more information, see Runtime Monitoring. There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.

INSERT INTO aws.guardduty.detectors (
Enable,
ClientToken,
FindingPublishingFrequency,
DataSources,
Tags,
Features,
region
)
SELECT
{{ Enable }} /* required */,
'{{ ClientToken }}',
'{{ FindingPublishingFrequency }}',
'{{ DataSources }}',
'{{ Tags }}',
'{{ Features }}',
'{{ region }}'
RETURNING
detector_id,
unprocessed_data_sources
;

UPDATE examples

Updates the GuardDuty detector specified by the detector ID. Specifying both EKS Runtime Monitoring (EKS_RUNTIME_MONITORING) and Runtime Monitoring (RUNTIME_MONITORING) will cause an error. You can add only one of these two features because Runtime Monitoring already includes the threat detection for Amazon EKS resources. For more information, see Runtime Monitoring. There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.

UPDATE aws.guardduty.detectors
SET
Enable = {{ Enable }},
FindingPublishingFrequency = '{{ FindingPublishingFrequency }}',
DataSources = '{{ DataSources }}',
Features = '{{ Features }}'
WHERE
detector_id = '{{ detector_id }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes an Amazon GuardDuty detector that is specified by the detector ID.

DELETE FROM aws.guardduty.detectors
WHERE detector_id = '{{ detector_id }}' --required
AND region = '{{ region }}' --required
;