Skip to main content

ip_sets

Creates, updates, deletes, gets or lists an ip_sets resource.

Overview

Nameip_sets
TypeResource
Idaws.guardduty.ip_sets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
expected_bucket_ownerstringThe Amazon Web Services account ID that owns the Amazon S3 bucket specified in the location parameter. This field appears in the response only if it was provided during IPSet creation or update.
formatstringThe format of the file that contains the IPSet. (TXT, STIX, OTX_CSV, ALIEN_VAULT, PROOF_POINT, FIRE_EYE)
locationstringThe URI of the file that contains the IPSet.
namestringThe user-friendly name for the IPSet.
statusstringThe status of IPSet file that was uploaded. (INACTIVE, ACTIVATING, ACTIVE, DEACTIVATING, ERROR, DELETE_PENDING, DELETED)
tagsobjectThe tags of the IPSet resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_ip_setselectdetector_id, ip_set_id, regionRetrieves the IPSet specified by the ipSetId.
list_ip_setsselectdetector_id, regionmaxResults, nextTokenLists the IPSets of the GuardDuty service specified by the detector ID. If you use this operation from a member account, the IPSets returned are the IPSets from the associated administrator account.
create_ip_setinsertdetector_id, region, ActivateCreates a new IPSet, which is called a trusted IP list in the console user interface. An IPSet is a list of IP addresses that are trusted for secure communication with Amazon Web Services infrastructure and applications. GuardDuty doesn't generate findings for IP addresses that are included in IPSets. Only users from the administrator account can use this operation.
update_ip_setupdatedetector_id, ip_set_id, regionUpdates the IPSet specified by the IPSet ID.
delete_ip_setdeletedetector_id, ip_set_id, regionDeletes the IPSet specified by the ipSetId. IPSets are called trusted IP lists in the console user interface.

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 associated with the IPSet. To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.
ip_set_idstringThe unique ID of the IPSet to delete.
regionstringAWS region (default: us-east-1)
maxResultsintegerYou can use this parameter to indicate the maximum number of items 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 the IPSet specified by the ipSetId.

SELECT
expected_bucket_owner,
format,
location,
name,
status,
tags
FROM aws.guardduty.ip_sets
WHERE detector_id = '{{ detector_id }}' -- required
AND ip_set_id = '{{ ip_set_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new IPSet, which is called a trusted IP list in the console user interface. An IPSet is a list of IP addresses that are trusted for secure communication with Amazon Web Services infrastructure and applications. GuardDuty doesn't generate findings for IP addresses that are included in IPSets. Only users from the administrator account can use this operation.

INSERT INTO aws.guardduty.ip_sets (
Name,
Format,
Location,
Activate,
ClientToken,
Tags,
ExpectedBucketOwner,
detector_id,
region
)
SELECT
'{{ Name }}',
'{{ Format }}',
'{{ Location }}',
{{ Activate }} /* required */,
'{{ ClientToken }}',
'{{ Tags }}',
'{{ ExpectedBucketOwner }}',
'{{ detector_id }}',
'{{ region }}'
RETURNING
ip_set_id
;

UPDATE examples

Updates the IPSet specified by the IPSet ID.

UPDATE aws.guardduty.ip_sets
SET
Name = '{{ Name }}',
Location = '{{ Location }}',
Activate = {{ Activate }},
ExpectedBucketOwner = '{{ ExpectedBucketOwner }}'
WHERE
detector_id = '{{ detector_id }}' --required
AND ip_set_id = '{{ ip_set_id }}' --required
AND region = '{{ region }}' --required;

DELETE examples

Deletes the IPSet specified by the ipSetId. IPSets are called trusted IP lists in the console user interface.

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