detectors
Creates, updates, deletes, gets or lists a detectors resource.
Overview
| Name | detectors |
| Type | Resource |
| Id | aws.guardduty.detectors |
Fields
The following fields are returned by SELECT queries:
- get_detector
- list_detectors
| Name | Datatype | Description |
|---|---|---|
created_at | string | The timestamp of when the detector was created. |
data_sources | object | Describes which data sources are enabled for the detector. |
features | array | Describes the features that have been enabled for the detector. |
finding_publishing_frequency | string | The publishing frequency of the finding. (FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS) |
service_role | string | The GuardDuty service role. |
status | string | The detector status. (ENABLED, DISABLED) |
tags | object | The tags of the detector resource. |
updated_at | string | The last-updated timestamp for the detector. |
| Name | Datatype | Description |
|---|---|---|
detector_id | string | A list of detector IDs. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_detector | select | detector_id, region | 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. | |
list_detectors | select | region | maxResults, nextToken | Lists detectorIds of all the existing Amazon GuardDuty detector resources. |
create_detector | insert | region, Enable | 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. | |
update_detector | update | detector_id, region | 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. | |
delete_detector | delete | detector_id, region | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
detector_id | string | The 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. |
region | string | AWS region (default: us-east-1) |
maxResults | integer | You 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. |
nextToken | string | You 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
- get_detector
- list_detectors
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
;
Lists detectorIds of all the existing Amazon GuardDuty detector resources.
SELECT
detector_id
FROM aws.guardduty.detectors
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
;
INSERT examples
- create_detector
- Manifest
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
;
# Description fields are for documentation purposes
- name: detectors
props:
- name: region
value: "{{ region }}"
description: Required parameter for the detectors resource.
- name: Enable
value: {{ Enable }}
- name: ClientToken
value: "{{ ClientToken }}"
- name: FindingPublishingFrequency
value: "{{ FindingPublishingFrequency }}"
valid_values: ['FIFTEEN_MINUTES', 'ONE_HOUR', 'SIX_HOURS']
- name: DataSources
description: |
Contains information about which data sources are enabled.
value:
S3Logs:
Enable: {{ Enable }}
Kubernetes:
AuditLogs:
Enable: {{ Enable }}
MalwareProtection:
ScanEc2InstanceWithFindings:
EbsVolumes: {{ EbsVolumes }}
- name: Tags
value: "{{ Tags }}"
- name: Features
value:
- Name: "{{ Name }}"
Status: "{{ Status }}"
AdditionalConfiguration: "{{ AdditionalConfiguration }}"
UPDATE examples
- update_detector
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
- delete_detector
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
;