GuardDuty

Table of Contents

Client

class GuardDuty.Client

A low-level client representing Amazon GuardDuty:

client = session.create_client('guardduty')

These are the available methods:

accept_invitation(**kwargs)

Accepts the invitation to be monitored by a master GuardDuty account.

See also: AWS API Documentation

Request Syntax

response = client.accept_invitation(
    DetectorId='string',
    InvitationId='string',
    MasterId='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty member account.
  • InvitationId (string) -- This value is used to validate the master account to the member account.
  • MasterId (string) -- The account ID of the master GuardDuty account whose invitation you're accepting.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

archive_findings(**kwargs)

Archives Amazon GuardDuty findings specified by the list of finding IDs.

See also: AWS API Documentation

Request Syntax

response = client.archive_findings(
    DetectorId='string',
    FindingIds=[
        'string',
    ]
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service whose findings you want to archive.
  • FindingIds (list) --

    IDs of the findings that you want to archive.

    • (string) -- The unique identifier for the Finding
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
create_detector(**kwargs)

Creates a single Amazon GuardDuty detector. A detector is an object that represents the GuardDuty service. A detector must be created in order for GuardDuty to become operational.

See also: AWS API Documentation

Request Syntax

response = client.create_detector(
    Enable=True|False
)
Parameters
Enable (boolean) -- A boolean value that specifies whether the detector is to be enabled.
Return type
dict
Returns
Response Syntax
{
    'DetectorId': 'string'
}

Response Structure

  • (dict) -- 200 response
    • DetectorId (string) -- The unique ID of the created detector.
create_filter(**kwargs)

Creates a filter using the specified finding criteria.

See also: AWS API Documentation

Request Syntax

response = client.create_filter(
    Action='NOOP'|'ARCHIVE',
    ClientToken='string',
    Description='string',
    DetectorId='string',
    FindingCriteria={
        'Criterion': {
            'string': {
                'Eq': [
                    'string',
                ],
                'Gt': 123,
                'Gte': 123,
                'Lt': 123,
                'Lte': 123,
                'Neq': [
                    'string',
                ]
            }
        }
    },
    Name='string',
    Rank=123
)
Parameters
  • Action (string) -- Specifies the action that is to be applied to the findings that match the filter.
  • ClientToken (string) -- The idempotency token for the create request.This field is autopopulated if not provided.
  • Description (string) -- The description of the filter.
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector that you want to update.
  • FindingCriteria (dict) --

    Represents the criteria to be used in the filter for querying findings.

    • Criterion (dict) -- Represents a map of finding properties that match specified conditions and values when querying findings.
      • (string) --
        • (dict) -- Finding attribute (for example, accountId) for which conditions and values must be specified when querying findings.
          • Eq (list) -- Represents the equal condition to be applied to a single field when querying for findings.
            • (string) --
          • Gt (integer) -- Represents the greater than condition to be applied to a single field when querying for findings.
          • Gte (integer) -- Represents the greater than equal condition to be applied to a single field when querying for findings.
          • Lt (integer) -- Represents the less than condition to be applied to a single field when querying for findings.
          • Lte (integer) -- Represents the less than equal condition to be applied to a single field when querying for findings.
          • Neq (list) -- Represents the not equal condition to be applied to a single field when querying for findings.
            • (string) --
  • Name (string) -- The name of the filter.
  • Rank (integer) -- Specifies the position of the filter in the list of current filters. Also specifies the order in which this filter is applied to the findings.
Return type

dict

Returns

Response Syntax

{
    'Name': 'string'
}

Response Structure

  • (dict) -- 200 response
    • Name (string) -- The name of the successfully created filter.

create_ip_set(**kwargs)

Creates a new IPSet - a list of trusted IP addresses that have been whitelisted for secure communication with AWS infrastructure and applications.

See also: AWS API Documentation

Request Syntax

response = client.create_ip_set(
    Activate=True|False,
    DetectorId='string',
    Format='TXT'|'STIX'|'OTX_CSV'|'ALIEN_VAULT'|'PROOF_POINT'|'FIRE_EYE',
    Location='string',
    Name='string'
)
Parameters
  • Activate (boolean) -- A boolean value that indicates whether GuardDuty is to start using the uploaded IPSet.
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector that you want to update.
  • Format (string) -- The format of the file that contains the IPSet.
  • Location (string) -- The URI of the file that contains the IPSet. For example (https://s3.us-west-2.amazonaws.com/my-bucket/my-object-key)
  • Name (string) -- The user friendly name to identify the IPSet. This name is displayed in all findings that are triggered by activity that involves IP addresses included in this IPSet.
Return type

dict

Returns

Response Syntax

{
    'IpSetId': 'string'
}

Response Structure

  • (dict) -- 200 response
    • IpSetId (string) -- The unique identifier for an IP Set

create_members(**kwargs)

Creates member accounts of the current AWS account by specifying a list of AWS account IDs. The current AWS account can then invite these members to manage GuardDuty in their accounts.

See also: AWS API Documentation

Request Syntax

response = client.create_members(
    AccountDetails=[
        {
            'AccountId': 'string',
            'Email': 'string'
        },
    ],
    DetectorId='string'
)
Parameters
  • AccountDetails (list) --

    A list of account ID and email address pairs of the accounts that you want to associate with the master GuardDuty account.

    • (dict) -- An object containing the member's accountId and email address.
      • AccountId (string) -- [REQUIRED] Member account ID.
      • Email (string) -- [REQUIRED] Member account's email address.
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account with which you want to associate member accounts.
Return type

dict

Returns

Response Syntax

{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.

create_sample_findings(**kwargs)

Generates example findings of types specified by the list of finding types. If 'NULL' is specified for findingTypes, the API generates example findings of all supported finding types.

See also: AWS API Documentation

Request Syntax

response = client.create_sample_findings(
    DetectorId='string',
    FindingTypes=[
        'string',
    ]
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector to create sample findings for.
  • FindingTypes (list) --

    Types of sample findings that you want to generate.

    • (string) -- The finding type for the finding
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

create_threat_intel_set(**kwargs)

Create a new ThreatIntelSet. ThreatIntelSets consist of known malicious IP addresses. GuardDuty generates findings based on ThreatIntelSets.

See also: AWS API Documentation

Request Syntax

response = client.create_threat_intel_set(
    Activate=True|False,
    DetectorId='string',
    Format='TXT'|'STIX'|'OTX_CSV'|'ALIEN_VAULT'|'PROOF_POINT'|'FIRE_EYE',
    Location='string',
    Name='string'
)
Parameters
  • Activate (boolean) -- A boolean value that indicates whether GuardDuty is to start using the uploaded ThreatIntelSet.
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector that you want to update.
  • Format (string) -- The format of the file that contains the ThreatIntelSet.
  • Location (string) -- The URI of the file that contains the ThreatIntelSet. For example (https://s3.us-west-2.amazonaws.com/my-bucket/my-object-key).
  • Name (string) -- A user-friendly ThreatIntelSet name that is displayed in all finding generated by activity that involves IP addresses included in this ThreatIntelSet.
Return type

dict

Returns

Response Syntax

{
    'ThreatIntelSetId': 'string'
}

Response Structure

  • (dict) -- 200 response
    • ThreatIntelSetId (string) -- The unique identifier for an threat intel set

decline_invitations(**kwargs)

Declines invitations sent to the current member account by AWS account specified by their account IDs.

See also: AWS API Documentation

Request Syntax

response = client.decline_invitations(
    AccountIds=[
        'string',
    ]
)
Parameters
AccountIds (list) --

A list of account IDs of the AWS accounts that sent invitations to the current member account that you want to decline invitations from.

  • (string) --
Return type
dict
Returns
Response Syntax
{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.
delete_detector(**kwargs)

Deletes a Amazon GuardDuty detector specified by the detector ID.

See also: AWS API Documentation

Request Syntax

response = client.delete_detector(
    DetectorId='string'
)
Parameters
DetectorId (string) -- [REQUIRED] The unique ID that specifies the detector that you want to delete.
Return type
dict
Returns
Response Syntax
{}

Response Structure

  • (dict) -- 200 response
delete_filter(**kwargs)

Deletes the filter specified by the filter name.

See also: AWS API Documentation

Request Syntax

response = client.delete_filter(
    DetectorId='string',
    FilterName='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The unique ID that specifies the detector where you want to delete a filter.
  • FilterName (string) -- [REQUIRED] The name of the filter.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

delete_invitations(**kwargs)

Deletes invitations sent to the current member account by AWS accounts specified by their account IDs.

See also: AWS API Documentation

Request Syntax

response = client.delete_invitations(
    AccountIds=[
        'string',
    ]
)
Parameters
AccountIds (list) --

A list of account IDs of the AWS accounts that sent invitations to the current member account that you want to delete invitations from.

  • (string) --
Return type
dict
Returns
Response Syntax
{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.
delete_ip_set(**kwargs)

Deletes the IPSet specified by the IPSet ID.

See also: AWS API Documentation

Request Syntax

response = client.delete_ip_set(
    DetectorId='string',
    IpSetId='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose IPSet you want to delete.
  • IpSetId (string) -- [REQUIRED] The unique ID that specifies the IPSet that you want to delete.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

delete_members(**kwargs)

Deletes GuardDuty member accounts (to the current GuardDuty master account) specified by the account IDs.

See also: AWS API Documentation

Request Syntax

response = client.delete_members(
    AccountIds=[
        'string',
    ],
    DetectorId='string'
)
Parameters
  • AccountIds (list) --

    A list of account IDs of the GuardDuty member accounts that you want to delete.

    • (string) --
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account whose members you want to delete.
Return type

dict

Returns

Response Syntax

{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.

delete_threat_intel_set(**kwargs)

Deletes ThreatIntelSet specified by the ThreatIntelSet ID.

See also: AWS API Documentation

Request Syntax

response = client.delete_threat_intel_set(
    DetectorId='string',
    ThreatIntelSetId='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose ThreatIntelSet you want to delete.
  • ThreatIntelSetId (string) -- [REQUIRED] The unique ID that specifies the ThreatIntelSet that you want to delete.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

disassociate_from_master_account(**kwargs)

Disassociates the current GuardDuty member account from its master account.

See also: AWS API Documentation

Request Syntax

response = client.disassociate_from_master_account(
    DetectorId='string'
)
Parameters
DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty member account.
Return type
dict
Returns
Response Syntax
{}

Response Structure

  • (dict) -- 200 response
disassociate_members(**kwargs)

Disassociates GuardDuty member accounts (to the current GuardDuty master account) specified by the account IDs.

See also: AWS API Documentation

Request Syntax

response = client.disassociate_members(
    AccountIds=[
        'string',
    ],
    DetectorId='string'
)
Parameters
  • AccountIds (list) --

    A list of account IDs of the GuardDuty member accounts that you want to disassociate from master.

    • (string) --
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account whose members you want to disassociate from master.
Return type

dict

Returns

Response Syntax

{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_detector(**kwargs)

Retrieves an Amazon GuardDuty detector specified by the detectorId.

See also: AWS API Documentation

Request Syntax

response = client.get_detector(
    DetectorId='string'
)
Parameters
DetectorId (string) -- [REQUIRED] The unique ID of the detector that you want to retrieve.
Return type
dict
Returns
Response Syntax
{
    'CreatedAt': 'string',
    'ServiceRole': 'string',
    'Status': 'ENABLED'|'DISABLED',
    'UpdatedAt': 'string'
}

Response Structure

  • (dict) -- 200 response
    • CreatedAt (string) -- The first time a resource was created. The format will be ISO-8601.
    • ServiceRole (string) -- Customer serviceRole name or ARN for accessing customer resources
    • Status (string) -- The status of detector.
    • UpdatedAt (string) -- The first time a resource was created. The format will be ISO-8601.
get_filter(**kwargs)

Returns the details of the filter specified by the filter name.

See also: AWS API Documentation

Request Syntax

response = client.get_filter(
    DetectorId='string',
    FilterName='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The detector ID that specifies the GuardDuty service where you want to list the details of the specified filter.
  • FilterName (string) -- [REQUIRED] The name of the filter whose details you want to get.
Return type

dict

Returns

Response Syntax

{
    'Action': 'NOOP'|'ARCHIVE',
    'Description': 'string',
    'FindingCriteria': {
        'Criterion': {
            'string': {
                'Eq': [
                    'string',
                ],
                'Gt': 123,
                'Gte': 123,
                'Lt': 123,
                'Lte': 123,
                'Neq': [
                    'string',
                ]
            }
        }
    },
    'Name': 'string',
    'Rank': 123
}

Response Structure

  • (dict) -- 200 response
    • Action (string) -- Specifies the action that is to be applied to the findings that match the filter.
    • Description (string) -- The description of the filter.
    • FindingCriteria (dict) -- Represents the criteria to be used in the filter for querying findings.
      • Criterion (dict) -- Represents a map of finding properties that match specified conditions and values when querying findings.
        • (string) --
          • (dict) -- Finding attribute (for example, accountId) for which conditions and values must be specified when querying findings.
            • Eq (list) -- Represents the equal condition to be applied to a single field when querying for findings.
              • (string) --
            • Gt (integer) -- Represents the greater than condition to be applied to a single field when querying for findings.
            • Gte (integer) -- Represents the greater than equal condition to be applied to a single field when querying for findings.
            • Lt (integer) -- Represents the less than condition to be applied to a single field when querying for findings.
            • Lte (integer) -- Represents the less than equal condition to be applied to a single field when querying for findings.
            • Neq (list) -- Represents the not equal condition to be applied to a single field when querying for findings.
              • (string) --
    • Name (string) -- The name of the filter.
    • Rank (integer) -- Specifies the position of the filter in the list of current filters. Also specifies the order in which this filter is applied to the findings.

get_findings(**kwargs)

Describes Amazon GuardDuty findings specified by finding IDs.

See also: AWS API Documentation

Request Syntax

response = client.get_findings(
    DetectorId='string',
    FindingIds=[
        'string',
    ],
    SortCriteria={
        'AttributeName': 'string',
        'OrderBy': 'ASC'|'DESC'
    }
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service whose findings you want to retrieve.
  • FindingIds (list) --

    IDs of the findings that you want to retrieve.

    • (string) -- The unique identifier for the Finding
  • SortCriteria (dict) --

    Represents the criteria used for sorting findings.

    • AttributeName (string) -- Represents the finding attribute (for example, accountId) by which to sort findings.
    • OrderBy (string) -- Order by which the sorted findings are to be displayed.
Return type

dict

Returns

Response Syntax

{
    'Findings': [
        {
            'AccountId': 'string',
            'Arn': 'string',
            'Confidence': 123.0,
            'CreatedAt': 'string',
            'Description': 'string',
            'Id': 'string',
            'Partition': 'string',
            'Region': 'string',
            'Resource': {
                'AccessKeyDetails': {
                    'AccessKeyId': 'string',
                    'PrincipalId': 'string',
                    'UserName': 'string',
                    'UserType': 'string'
                },
                'InstanceDetails': {
                    'AvailabilityZone': 'string',
                    'IamInstanceProfile': {
                        'Arn': 'string',
                        'Id': 'string'
                    },
                    'ImageDescription': 'string',
                    'ImageId': 'string',
                    'InstanceId': 'string',
                    'InstanceState': 'string',
                    'InstanceType': 'string',
                    'LaunchTime': 'string',
                    'NetworkInterfaces': [
                        {
                            'Ipv6Addresses': [
                                'string',
                            ],
                            'NetworkInterfaceId': 'string',
                            'PrivateDnsName': 'string',
                            'PrivateIpAddress': 'string',
                            'PrivateIpAddresses': [
                                {
                                    'PrivateDnsName': 'string',
                                    'PrivateIpAddress': 'string'
                                },
                            ],
                            'PublicDnsName': 'string',
                            'PublicIp': 'string',
                            'SecurityGroups': [
                                {
                                    'GroupId': 'string',
                                    'GroupName': 'string'
                                },
                            ],
                            'SubnetId': 'string',
                            'VpcId': 'string'
                        },
                    ],
                    'Platform': 'string',
                    'ProductCodes': [
                        {
                            'Code': 'string',
                            'ProductType': 'string'
                        },
                    ],
                    'Tags': [
                        {
                            'Key': 'string',
                            'Value': 'string'
                        },
                    ]
                },
                'ResourceType': 'string'
            },
            'SchemaVersion': 'string',
            'Service': {
                'Action': {
                    'ActionType': 'string',
                    'AwsApiCallAction': {
                        'Api': 'string',
                        'CallerType': 'string',
                        'DomainDetails': {},
                        'RemoteIpDetails': {
                            'City': {
                                'CityName': 'string'
                            },
                            'Country': {
                                'CountryCode': 'string',
                                'CountryName': 'string'
                            },
                            'GeoLocation': {
                                'Lat': 123.0,
                                'Lon': 123.0
                            },
                            'IpAddressV4': 'string',
                            'Organization': {
                                'Asn': 'string',
                                'AsnOrg': 'string',
                                'Isp': 'string',
                                'Org': 'string'
                            }
                        },
                        'ServiceName': 'string'
                    },
                    'DnsRequestAction': {
                        'Domain': 'string'
                    },
                    'NetworkConnectionAction': {
                        'Blocked': True|False,
                        'ConnectionDirection': 'string',
                        'LocalPortDetails': {
                            'Port': 123,
                            'PortName': 'string'
                        },
                        'Protocol': 'string',
                        'RemoteIpDetails': {
                            'City': {
                                'CityName': 'string'
                            },
                            'Country': {
                                'CountryCode': 'string',
                                'CountryName': 'string'
                            },
                            'GeoLocation': {
                                'Lat': 123.0,
                                'Lon': 123.0
                            },
                            'IpAddressV4': 'string',
                            'Organization': {
                                'Asn': 'string',
                                'AsnOrg': 'string',
                                'Isp': 'string',
                                'Org': 'string'
                            }
                        },
                        'RemotePortDetails': {
                            'Port': 123,
                            'PortName': 'string'
                        }
                    },
                    'PortProbeAction': {
                        'Blocked': True|False,
                        'PortProbeDetails': [
                            {
                                'LocalPortDetails': {
                                    'Port': 123,
                                    'PortName': 'string'
                                },
                                'RemoteIpDetails': {
                                    'City': {
                                        'CityName': 'string'
                                    },
                                    'Country': {
                                        'CountryCode': 'string',
                                        'CountryName': 'string'
                                    },
                                    'GeoLocation': {
                                        'Lat': 123.0,
                                        'Lon': 123.0
                                    },
                                    'IpAddressV4': 'string',
                                    'Organization': {
                                        'Asn': 'string',
                                        'AsnOrg': 'string',
                                        'Isp': 'string',
                                        'Org': 'string'
                                    }
                                }
                            },
                        ]
                    }
                },
                'Archived': True|False,
                'Count': 123,
                'DetectorId': 'string',
                'EventFirstSeen': 'string',
                'EventLastSeen': 'string',
                'ResourceRole': 'string',
                'ServiceName': 'string',
                'UserFeedback': 'string'
            },
            'Severity': 123.0,
            'Title': 'string',
            'Type': 'string',
            'UpdatedAt': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • Findings (list) -- A list of findings.
      • (dict) -- Representation of a abnormal or suspicious activity.
        • AccountId (string) -- AWS account ID where the activity occurred that prompted GuardDuty to generate a finding.
        • Arn (string) -- The ARN of a finding described by the action.
        • Confidence (float) -- The confidence level of a finding.
        • CreatedAt (string) -- The time stamp at which a finding was generated.
        • Description (string) -- The description of a finding.
        • Id (string) -- The identifier that corresponds to a finding described by the action.
        • Partition (string) -- The AWS resource partition.
        • Region (string) -- The AWS region where the activity occurred that prompted GuardDuty to generate a finding.
        • Resource (dict) -- The AWS resource associated with the activity that prompted GuardDuty to generate a finding.
          • AccessKeyDetails (dict) -- The IAM access key details (IAM user information) of a user that engaged in the activity that prompted GuardDuty to generate a finding.
            • AccessKeyId (string) -- Access key ID of the user.
            • PrincipalId (string) -- The principal ID of the user.
            • UserName (string) -- The name of the user.
            • UserType (string) -- The type of the user.
          • InstanceDetails (dict) -- The information about the EC2 instance associated with the activity that prompted GuardDuty to generate a finding.
            • AvailabilityZone (string) -- The availability zone of the EC2 instance.
            • IamInstanceProfile (dict) -- The profile information of the EC2 instance.
              • Arn (string) -- AWS EC2 instance profile ARN.
              • Id (string) -- AWS EC2 instance profile ID.
            • ImageDescription (string) -- The image description of the EC2 instance.
            • ImageId (string) -- The image ID of the EC2 instance.
            • InstanceId (string) -- The ID of the EC2 instance.
            • InstanceState (string) -- The state of the EC2 instance.
            • InstanceType (string) -- The type of the EC2 instance.
            • LaunchTime (string) -- The launch time of the EC2 instance.
            • NetworkInterfaces (list) -- The network interface information of the EC2 instance.
              • (dict) -- The network interface information of the EC2 instance.
                • Ipv6Addresses (list) -- A list of EC2 instance IPv6 address information.
                  • (string) -- IpV6 address of the EC2 instance.
                • NetworkInterfaceId (string) -- The ID of the network interface
                • PrivateDnsName (string) -- Private DNS name of the EC2 instance.
                • PrivateIpAddress (string) -- Private IP address of the EC2 instance.
                • PrivateIpAddresses (list) -- Other private IP address information of the EC2 instance.
                  • (dict) -- Other private IP address information of the EC2 instance.
                    • PrivateDnsName (string) -- Private DNS name of the EC2 instance.
                    • PrivateIpAddress (string) -- Private IP address of the EC2 instance.
                • PublicDnsName (string) -- Public DNS name of the EC2 instance.
                • PublicIp (string) -- Public IP address of the EC2 instance.
                • SecurityGroups (list) -- Security groups associated with the EC2 instance.
                  • (dict) -- Security groups associated with the EC2 instance.
                    • GroupId (string) -- EC2 instance's security group ID.
                    • GroupName (string) -- EC2 instance's security group name.
                • SubnetId (string) -- The subnet ID of the EC2 instance.
                • VpcId (string) -- The VPC ID of the EC2 instance.
            • Platform (string) -- The platform of the EC2 instance.
            • ProductCodes (list) -- The product code of the EC2 instance.
              • (dict) -- The product code of the EC2 instance.
                • Code (string) -- Product code information.
                • ProductType (string) -- Product code type.
            • Tags (list) -- The tags of the EC2 instance.
              • (dict) -- A tag of the EC2 instance.
                • Key (string) -- EC2 instance tag key.
                • Value (string) -- EC2 instance tag value.
          • ResourceType (string) -- The type of the AWS resource.
        • SchemaVersion (string) -- Findings' schema version.
        • Service (dict) -- Additional information assigned to the generated finding by GuardDuty.
          • Action (dict) -- Information about the activity described in a finding.
            • ActionType (string) -- GuardDuty Finding activity type.
            • AwsApiCallAction (dict) -- Information about the AWS_API_CALL action described in this finding.
              • Api (string) -- AWS API name.
              • CallerType (string) -- AWS API caller type.
              • DomainDetails (dict) -- Domain information for the AWS API call.
              • RemoteIpDetails (dict) -- Remote IP information of the connection.
                • City (dict) -- City information of the remote IP address.
                  • CityName (string) -- City name of the remote IP address.
                • Country (dict) -- Country code of the remote IP address.
                  • CountryCode (string) -- Country code of the remote IP address.
                  • CountryName (string) -- Country name of the remote IP address.
                • GeoLocation (dict) -- Location information of the remote IP address.
                  • Lat (float) -- Latitude information of remote IP address.
                  • Lon (float) -- Longitude information of remote IP address.
                • IpAddressV4 (string) -- IPV4 remote address of the connection.
                • Organization (dict) -- ISP Organization information of the remote IP address.
                  • Asn (string) -- Autonomous system number of the internet provider of the remote IP address.
                  • AsnOrg (string) -- Organization that registered this ASN.
                  • Isp (string) -- ISP information for the internet provider.
                  • Org (string) -- Name of the internet provider.
              • ServiceName (string) -- AWS service name whose API was invoked.
            • DnsRequestAction (dict) -- Information about the DNS_REQUEST action described in this finding.
              • Domain (string) -- Domain information for the DNS request.
            • NetworkConnectionAction (dict) -- Information about the NETWORK_CONNECTION action described in this finding.
              • Blocked (boolean) -- Network connection blocked information.
              • ConnectionDirection (string) -- Network connection direction.
              • LocalPortDetails (dict) -- Local port information of the connection.
                • Port (integer) -- Port number of the local connection.
                • PortName (string) -- Port name of the local connection.
              • Protocol (string) -- Network connection protocol.
              • RemoteIpDetails (dict) -- Remote IP information of the connection.
                • City (dict) -- City information of the remote IP address.
                  • CityName (string) -- City name of the remote IP address.
                • Country (dict) -- Country code of the remote IP address.
                  • CountryCode (string) -- Country code of the remote IP address.
                  • CountryName (string) -- Country name of the remote IP address.
                • GeoLocation (dict) -- Location information of the remote IP address.
                  • Lat (float) -- Latitude information of remote IP address.
                  • Lon (float) -- Longitude information of remote IP address.
                • IpAddressV4 (string) -- IPV4 remote address of the connection.
                • Organization (dict) -- ISP Organization information of the remote IP address.
                  • Asn (string) -- Autonomous system number of the internet provider of the remote IP address.
                  • AsnOrg (string) -- Organization that registered this ASN.
                  • Isp (string) -- ISP information for the internet provider.
                  • Org (string) -- Name of the internet provider.
              • RemotePortDetails (dict) -- Remote port information of the connection.
                • Port (integer) -- Port number of the remote connection.
                • PortName (string) -- Port name of the remote connection.
            • PortProbeAction (dict) -- Information about the PORT_PROBE action described in this finding.
              • Blocked (boolean) -- Port probe blocked information.
              • PortProbeDetails (list) -- A list of port probe details objects.
                • (dict) -- Details about the port probe finding.
                  • LocalPortDetails (dict) -- Local port information of the connection.
                    • Port (integer) -- Port number of the local connection.
                    • PortName (string) -- Port name of the local connection.
                  • RemoteIpDetails (dict) -- Remote IP information of the connection.
                    • City (dict) -- City information of the remote IP address.
                      • CityName (string) -- City name of the remote IP address.
                    • Country (dict) -- Country code of the remote IP address.
                      • CountryCode (string) -- Country code of the remote IP address.
                      • CountryName (string) -- Country name of the remote IP address.
                    • GeoLocation (dict) -- Location information of the remote IP address.
                      • Lat (float) -- Latitude information of remote IP address.
                      • Lon (float) -- Longitude information of remote IP address.
                    • IpAddressV4 (string) -- IPV4 remote address of the connection.
                    • Organization (dict) -- ISP Organization information of the remote IP address.
                      • Asn (string) -- Autonomous system number of the internet provider of the remote IP address.
                      • AsnOrg (string) -- Organization that registered this ASN.
                      • Isp (string) -- ISP information for the internet provider.
                      • Org (string) -- Name of the internet provider.
          • Archived (boolean) -- Indicates whether this finding is archived.
          • Count (integer) -- Total count of the occurrences of this finding type.
          • DetectorId (string) -- Detector ID for the GuardDuty service.
          • EventFirstSeen (string) -- First seen timestamp of the activity that prompted GuardDuty to generate this finding.
          • EventLastSeen (string) -- Last seen timestamp of the activity that prompted GuardDuty to generate this finding.
          • ResourceRole (string) -- Resource role information for this finding.
          • ServiceName (string) -- The name of the AWS service (GuardDuty) that generated a finding.
          • UserFeedback (string) -- Feedback left about the finding.
        • Severity (float) -- The severity of a finding.
        • Title (string) -- The title of a finding.
        • Type (string) -- The type of a finding described by the action.
        • UpdatedAt (string) -- The time stamp at which a finding was last updated.

get_findings_statistics(**kwargs)

Lists Amazon GuardDuty findings' statistics for the specified detector ID.

See also: AWS API Documentation

Request Syntax

response = client.get_findings_statistics(
    DetectorId='string',
    FindingCriteria={
        'Criterion': {
            'string': {
                'Eq': [
                    'string',
                ],
                'Gt': 123,
                'Gte': 123,
                'Lt': 123,
                'Lte': 123,
                'Neq': [
                    'string',
                ]
            }
        }
    },
    FindingStatisticTypes=[
        'COUNT_BY_SEVERITY',
    ]
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service whose findings' statistics you want to retrieve.
  • FindingCriteria (dict) --

    Represents the criteria used for querying findings.

    • Criterion (dict) -- Represents a map of finding properties that match specified conditions and values when querying findings.
      • (string) --
        • (dict) -- Finding attribute (for example, accountId) for which conditions and values must be specified when querying findings.
          • Eq (list) -- Represents the equal condition to be applied to a single field when querying for findings.
            • (string) --
          • Gt (integer) -- Represents the greater than condition to be applied to a single field when querying for findings.
          • Gte (integer) -- Represents the greater than equal condition to be applied to a single field when querying for findings.
          • Lt (integer) -- Represents the less than condition to be applied to a single field when querying for findings.
          • Lte (integer) -- Represents the less than equal condition to be applied to a single field when querying for findings.
          • Neq (list) -- Represents the not equal condition to be applied to a single field when querying for findings.
            • (string) --
  • FindingStatisticTypes (list) --

    Types of finding statistics to retrieve.

    • (string) -- The types of finding statistics.
Return type

dict

Returns

Response Syntax

{
    'FindingStatistics': {
        'CountBySeverity': {
            'string': 123
        }
    }
}

Response Structure

  • (dict) -- 200 response
    • FindingStatistics (dict) -- Finding statistics object.
      • CountBySeverity (dict) -- Represents a map of severity to count statistic for a set of findings
        • (string) --
          • (integer) -- The count of findings for the given severity.

get_invitations_count()

Returns the count of all GuardDuty membership invitations that were sent to the current member account except the currently accepted invitation.

See also: AWS API Documentation

Request Syntax

response = client.get_invitations_count()
Return type
dict
Returns
Response Syntax
{
    'InvitationsCount': 123
}

Response Structure

  • (dict) -- 200 response
    • InvitationsCount (integer) -- The number of received invitations.
get_ip_set(**kwargs)

Retrieves the IPSet specified by the IPSet ID.

See also: AWS API Documentation

Request Syntax

response = client.get_ip_set(
    DetectorId='string',
    IpSetId='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose IPSet you want to retrieve.
  • IpSetId (string) -- [REQUIRED] The unique ID that specifies the IPSet that you want to describe.
Return type

dict

Returns

Response Syntax

{
    'Format': 'TXT'|'STIX'|'OTX_CSV'|'ALIEN_VAULT'|'PROOF_POINT'|'FIRE_EYE',
    'Location': 'string',
    'Name': 'string',
    'Status': 'INACTIVE'|'ACTIVATING'|'ACTIVE'|'DEACTIVATING'|'ERROR'|'DELETE_PENDING'|'DELETED'
}

Response Structure

  • (dict) -- 200 response
    • Format (string) -- The format of the file that contains the IPSet.
    • Location (string) -- The URI of the file that contains the IPSet. For example (https://s3.us-west-2.amazonaws.com/my-bucket/my-object-key)
    • Name (string) -- The user friendly name to identify the IPSet. This name is displayed in all findings that are triggered by activity that involves IP addresses included in this IPSet.
    • Status (string) -- The status of ipSet file uploaded.

get_master_account(**kwargs)

Provides the details for the GuardDuty master account to the current GuardDuty member account.

See also: AWS API Documentation

Request Syntax

response = client.get_master_account(
    DetectorId='string'
)
Parameters
DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty member account.
Return type
dict
Returns
Response Syntax
{
    'Master': {
        'AccountId': 'string',
        'InvitationId': 'string',
        'InvitedAt': 'string',
        'RelationshipStatus': 'string'
    }
}

Response Structure

  • (dict) -- 200 response
    • Master (dict) -- Contains details about the master account.
      • AccountId (string) -- Master account ID
      • InvitationId (string) -- This value is used to validate the master account to the member account.
      • InvitedAt (string) -- Timestamp at which the invitation was sent
      • RelationshipStatus (string) -- The status of the relationship between the master and member accounts.
get_members(**kwargs)

Retrieves GuardDuty member accounts (to the current GuardDuty master account) specified by the account IDs.

See also: AWS API Documentation

Request Syntax

response = client.get_members(
    AccountIds=[
        'string',
    ],
    DetectorId='string'
)
Parameters
  • AccountIds (list) --

    A list of account IDs of the GuardDuty member accounts that you want to describe.

    • (string) --
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account whose members you want to retrieve.
Return type

dict

Returns

Response Syntax

{
    'Members': [
        {
            'AccountId': 'string',
            'DetectorId': 'string',
            'Email': 'string',
            'InvitedAt': 'string',
            'MasterId': 'string',
            'RelationshipStatus': 'string',
            'UpdatedAt': 'string'
        },
    ],
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • Members (list) -- A list of member descriptions.
      • (dict) -- Contains details about the member account.
        • AccountId (string) -- AWS account ID.
        • DetectorId (string) -- The unique identifier for a detector.
        • Email (string) -- Member account's email address.
        • InvitedAt (string) -- Timestamp at which the invitation was sent
        • MasterId (string) -- The master account ID.
        • RelationshipStatus (string) -- The status of the relationship between the member and the master.
        • UpdatedAt (string) -- The first time a resource was created. The format will be ISO-8601.
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_threat_intel_set(**kwargs)

Retrieves the ThreatIntelSet that is specified by the ThreatIntelSet ID.

See also: AWS API Documentation

Request Syntax

response = client.get_threat_intel_set(
    DetectorId='string',
    ThreatIntelSetId='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose ThreatIntelSet you want to describe.
  • ThreatIntelSetId (string) -- [REQUIRED] The unique ID that specifies the ThreatIntelSet that you want to describe.
Return type

dict

Returns

Response Syntax

{
    'Format': 'TXT'|'STIX'|'OTX_CSV'|'ALIEN_VAULT'|'PROOF_POINT'|'FIRE_EYE',
    'Location': 'string',
    'Name': 'string',
    'Status': 'INACTIVE'|'ACTIVATING'|'ACTIVE'|'DEACTIVATING'|'ERROR'|'DELETE_PENDING'|'DELETED'
}

Response Structure

  • (dict) -- 200 response
    • Format (string) -- The format of the threatIntelSet.
    • Location (string) -- The URI of the file that contains the ThreatIntelSet. For example (https://s3.us-west-2.amazonaws.com/my-bucket/my-object-key).
    • Name (string) -- A user-friendly ThreatIntelSet name that is displayed in all finding generated by activity that involves IP addresses included in this ThreatIntelSet.
    • Status (string) -- The status of threatIntelSet file uploaded.

get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
invite_members(**kwargs)

Invites other AWS accounts (created as members of the current AWS account by CreateMembers) to enable GuardDuty and allow the current AWS account to view and manage these accounts' GuardDuty findings on their behalf as the master account.

See also: AWS API Documentation

Request Syntax

response = client.invite_members(
    AccountIds=[
        'string',
    ],
    DetectorId='string',
    DisableEmailNotification=True|False,
    Message='string'
)
Parameters
  • AccountIds (list) --

    A list of account IDs of the accounts that you want to invite to GuardDuty as members.

    • (string) --
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account with which you want to invite members.
  • DisableEmailNotification (boolean) -- A boolean value that specifies whether you want to disable email notification to the accounts that you’re inviting to GuardDuty as members.
  • Message (string) -- The invitation message that you want to send to the accounts that you’re inviting to GuardDuty as members.
Return type

dict

Returns

Response Syntax

{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.

list_detectors(**kwargs)

Lists detectorIds of all the existing Amazon GuardDuty detector resources.

See also: AWS API Documentation

Request Syntax

response = client.list_detectors(
    MaxResults=123,
    NextToken='string'
)
Parameters
  • MaxResults (integer) -- You can use this parameter to indicate the maximum number of detectors that you want in the response.
  • NextToken (string) -- You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListDetectors 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.
Return type

dict

Returns

Response Syntax

{
    'DetectorIds': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- 200 response
    • DetectorIds (list) -- A list of detector Ids.
      • (string) -- The unique identifier for a detector.
    • 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.

list_filters(**kwargs)

Returns a paginated list of the current filters.

See also: AWS API Documentation

Request Syntax

response = client.list_filters(
    DetectorId='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service where you want to list filters.
  • MaxResults (integer) -- Indicates the maximum number of items that you want in the response. The maximum value is 50.
  • NextToken (string) -- Paginates results. Set the value of this parameter to NULL on your first call to the ListFilters operation.For subsequent calls to the operation, fill nextToken in the request with the value of nextToken from the previous response to continue listing data.
Return type

dict

Returns

Response Syntax

{
    'FilterNames': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- 200 response
    • FilterNames (list) -- A list of filter names
      • (string) -- The unique identifier for a filter
    • 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.

list_findings(**kwargs)

Lists Amazon GuardDuty findings for the specified detector ID.

See also: AWS API Documentation

Request Syntax

response = client.list_findings(
    DetectorId='string',
    FindingCriteria={
        'Criterion': {
            'string': {
                'Eq': [
                    'string',
                ],
                'Gt': 123,
                'Gte': 123,
                'Lt': 123,
                'Lte': 123,
                'Neq': [
                    'string',
                ]
            }
        }
    },
    MaxResults=123,
    NextToken='string',
    SortCriteria={
        'AttributeName': 'string',
        'OrderBy': 'ASC'|'DESC'
    }
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service whose findings you want to list.
  • FindingCriteria (dict) --

    Represents the criteria used for querying findings.

    • Criterion (dict) -- Represents a map of finding properties that match specified conditions and values when querying findings.
      • (string) --
        • (dict) -- Finding attribute (for example, accountId) for which conditions and values must be specified when querying findings.
          • Eq (list) -- Represents the equal condition to be applied to a single field when querying for findings.
            • (string) --
          • Gt (integer) -- Represents the greater than condition to be applied to a single field when querying for findings.
          • Gte (integer) -- Represents the greater than equal condition to be applied to a single field when querying for findings.
          • Lt (integer) -- Represents the less than condition to be applied to a single field when querying for findings.
          • Lte (integer) -- Represents the less than equal condition to be applied to a single field when querying for findings.
          • Neq (list) -- Represents the not equal condition to be applied to a single field when querying for findings.
            • (string) --
  • MaxResults (integer) -- You 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.
  • NextToken (string) -- You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListFindings 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.
  • SortCriteria (dict) --

    Represents the criteria used for sorting findings.

    • AttributeName (string) -- Represents the finding attribute (for example, accountId) by which to sort findings.
    • OrderBy (string) -- Order by which the sorted findings are to be displayed.
Return type

dict

Returns

Response Syntax

{
    'FindingIds': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- 200 response
    • FindingIds (list) -- The list of the Findings.
      • (string) -- The unique identifier for the Finding
    • 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.

list_invitations(**kwargs)

Lists all GuardDuty membership invitations that were sent to the current AWS account.

See also: AWS API Documentation

Request Syntax

response = client.list_invitations(
    MaxResults=123,
    NextToken='string'
)
Parameters
  • MaxResults (integer) -- You can use this parameter to indicate the maximum number of invitations 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 ListInvitations action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
Return type

dict

Returns

Response Syntax

{
    'Invitations': [
        {
            'AccountId': 'string',
            'InvitationId': 'string',
            'InvitedAt': 'string',
            'RelationshipStatus': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- 200 response
    • Invitations (list) -- A list of invitation descriptions.
      • (dict) -- Invitation from an AWS account to become the current account's master.
        • AccountId (string) -- Inviter account ID
        • InvitationId (string) -- This value is used to validate the inviter account to the member account.
        • InvitedAt (string) -- Timestamp at which the invitation was sent
        • RelationshipStatus (string) -- The status of the relationship between the inviter and invitee accounts.
    • 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.

list_ip_sets(**kwargs)

Lists the IPSets of the GuardDuty service specified by the detector ID.

See also: AWS API Documentation

Request Syntax

response = client.list_ip_sets(
    DetectorId='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector that you want to retrieve.
  • MaxResults (integer) -- You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 7. The maximum value is 7.
  • NextToken (string) -- You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the ListIPSet 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.
Return type

dict

Returns

Response Syntax

{
    'IpSetIds': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- 200 response
    • IpSetIds (list) -- A list of the IP set IDs
      • (string) -- The unique identifier for an IP Set
    • 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.

list_members(**kwargs)

Lists details about all member accounts for the current GuardDuty master account.

See also: AWS API Documentation

Request Syntax

response = client.list_members(
    DetectorId='string',
    MaxResults=123,
    NextToken='string',
    OnlyAssociated='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account whose members you want to list.
  • MaxResults (integer) -- You can use this parameter to indicate the maximum number of items you want in the response. The default value is 1. 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 ListMembers action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.
  • OnlyAssociated (string) -- Specifies what member accounts the response is to include based on their relationship status with the master account. The default value is TRUE. If onlyAssociated is set to TRUE, the response will include member accounts whose relationship status with the master is set to Enabled, Disabled. If onlyAssociated is set to FALSE, the response will include all existing member accounts.
Return type

dict

Returns

Response Syntax

{
    'Members': [
        {
            'AccountId': 'string',
            'DetectorId': 'string',
            'Email': 'string',
            'InvitedAt': 'string',
            'MasterId': 'string',
            'RelationshipStatus': 'string',
            'UpdatedAt': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) -- 200 response
    • Members (list) -- A list of member descriptions.
      • (dict) -- Contains details about the member account.
        • AccountId (string) -- AWS account ID.
        • DetectorId (string) -- The unique identifier for a detector.
        • Email (string) -- Member account's email address.
        • InvitedAt (string) -- Timestamp at which the invitation was sent
        • MasterId (string) -- The master account ID.
        • RelationshipStatus (string) -- The status of the relationship between the member and the master.
        • UpdatedAt (string) -- The first time a resource was created. The format will be ISO-8601.
    • 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.

list_threat_intel_sets(**kwargs)

Lists the ThreatIntelSets of the GuardDuty service specified by the detector ID.

See also: AWS API Documentation

Request Syntax

response = client.list_threat_intel_sets(
    DetectorId='string',
    MaxResults=123,
    NextToken='string'
)
Parameters
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose ThreatIntelSets you want to list.
  • MaxResults (integer) -- You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 7. The maximum value is 7.
  • NextToken (string) -- Pagination token to start retrieving threat intel sets from.
Return type

dict

Returns

Response Syntax

{
    'NextToken': 'string',
    'ThreatIntelSetIds': [
        'string',
    ]
}

Response Structure

  • (dict) -- 200 response
    • 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.
    • ThreatIntelSetIds (list) -- The list of the threat intel set IDs
      • (string) -- The unique identifier for an threat intel set

start_monitoring_members(**kwargs)

Re-enables GuardDuty to monitor findings of the member accounts specified by the account IDs. A master GuardDuty account can run this command after disabling GuardDuty from monitoring these members' findings by running StopMonitoringMembers.

See also: AWS API Documentation

Request Syntax

response = client.start_monitoring_members(
    AccountIds=[
        'string',
    ],
    DetectorId='string'
)
Parameters
  • AccountIds (list) --

    A list of account IDs of the GuardDuty member accounts whose findings you want the master account to monitor.

    • (string) --
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account whom you want to re-enable to monitor members' findings.
Return type

dict

Returns

Response Syntax

{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.

stop_monitoring_members(**kwargs)

Disables GuardDuty from monitoring findings of the member accounts specified by the account IDs. After running this command, a master GuardDuty account can run StartMonitoringMembers to re-enable GuardDuty to monitor these members’ findings.

See also: AWS API Documentation

Request Syntax

response = client.stop_monitoring_members(
    AccountIds=[
        'string',
    ],
    DetectorId='string'
)
Parameters
  • AccountIds (list) --

    A list of account IDs of the GuardDuty member accounts whose findings you want the master account to stop monitoring.

    • (string) --
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account that you want to stop from monitor members' findings.
Return type

dict

Returns

Response Syntax

{
    'UnprocessedAccounts': [
        {
            'AccountId': 'string',
            'Result': 'string'
        },
    ]
}

Response Structure

  • (dict) -- 200 response
    • UnprocessedAccounts (list) -- A list of objects containing the unprocessed account and a result string explaining why it was unprocessed.
      • (dict) -- An object containing the unprocessed account and a result string explaining why it was unprocessed.
        • AccountId (string) -- AWS Account ID.
        • Result (string) -- A reason why the account hasn't been processed.

unarchive_findings(**kwargs)

Unarchives Amazon GuardDuty findings specified by the list of finding IDs.

See also: AWS API Documentation

Request Syntax

response = client.unarchive_findings(
    DetectorId='string',
    FindingIds=[
        'string',
    ]
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service whose findings you want to unarchive.
  • FindingIds (list) --

    IDs of the findings that you want to unarchive.

    • (string) -- The unique identifier for the Finding
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

update_detector(**kwargs)

Updates an Amazon GuardDuty detector specified by the detectorId.

See also: AWS API Documentation

Request Syntax

response = client.update_detector(
    DetectorId='string',
    Enable=True|False
)
Parameters
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector that you want to update.
  • Enable (boolean) -- Updated boolean value for the detector that specifies whether the detector is enabled.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

update_filter(**kwargs)

Updates the filter specified by the filter name.

See also: AWS API Documentation

Request Syntax

response = client.update_filter(
    Action='NOOP'|'ARCHIVE',
    Description='string',
    DetectorId='string',
    FilterName='string',
    FindingCriteria={
        'Criterion': {
            'string': {
                'Eq': [
                    'string',
                ],
                'Gt': 123,
                'Gte': 123,
                'Lt': 123,
                'Lte': 123,
                'Neq': [
                    'string',
                ]
            }
        }
    },
    Rank=123
)
Parameters
  • Action (string) -- Specifies the action that is to be applied to the findings that match the filter.
  • Description (string) -- The description of the filter.
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector that specifies the GuardDuty service where you want to update a filter.
  • FilterName (string) -- [REQUIRED] The name of the filter.
  • FindingCriteria (dict) --

    Represents the criteria to be used in the filter for querying findings.

    • Criterion (dict) -- Represents a map of finding properties that match specified conditions and values when querying findings.
      • (string) --
        • (dict) -- Finding attribute (for example, accountId) for which conditions and values must be specified when querying findings.
          • Eq (list) -- Represents the equal condition to be applied to a single field when querying for findings.
            • (string) --
          • Gt (integer) -- Represents the greater than condition to be applied to a single field when querying for findings.
          • Gte (integer) -- Represents the greater than equal condition to be applied to a single field when querying for findings.
          • Lt (integer) -- Represents the less than condition to be applied to a single field when querying for findings.
          • Lte (integer) -- Represents the less than equal condition to be applied to a single field when querying for findings.
          • Neq (list) -- Represents the not equal condition to be applied to a single field when querying for findings.
            • (string) --
  • Rank (integer) -- Specifies the position of the filter in the list of current filters. Also specifies the order in which this filter is applied to the findings.
Return type

dict

Returns

Response Syntax

{
    'Name': 'string'
}

Response Structure

  • (dict) -- 200 response
    • Name (string) -- The name of the filter.

update_findings_feedback(**kwargs)

Marks specified Amazon GuardDuty findings as useful or not useful.

See also: AWS API Documentation

Request Syntax

response = client.update_findings_feedback(
    Comments='string',
    DetectorId='string',
    Feedback='USEFUL'|'NOT_USEFUL',
    FindingIds=[
        'string',
    ]
)
Parameters
  • Comments (string) -- Additional feedback about the GuardDuty findings.
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service whose findings you want to mark as useful or not useful.
  • Feedback (string) -- Valid values: USEFUL | NOT_USEFUL
  • FindingIds (list) --

    IDs of the findings that you want to mark as useful or not useful.

    • (string) -- The unique identifier for the Finding
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

update_ip_set(**kwargs)

Updates the IPSet specified by the IPSet ID.

See also: AWS API Documentation

Request Syntax

response = client.update_ip_set(
    Activate=True|False,
    DetectorId='string',
    IpSetId='string',
    Location='string',
    Name='string'
)
Parameters
  • Activate (boolean) -- The updated boolean value that specifies whether the IPSet is active or not.
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose IPSet you want to update.
  • IpSetId (string) -- [REQUIRED] The unique ID that specifies the IPSet that you want to update.
  • Location (string) -- The updated URI of the file that contains the IPSet. For example (https://s3.us-west-2.amazonaws.com/my-bucket/my-object-key).
  • Name (string) -- The unique ID that specifies the IPSet that you want to update.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

update_threat_intel_set(**kwargs)

Updates the ThreatIntelSet specified by ThreatIntelSet ID.

See also: AWS API Documentation

Request Syntax

response = client.update_threat_intel_set(
    Activate=True|False,
    DetectorId='string',
    Location='string',
    Name='string',
    ThreatIntelSetId='string'
)
Parameters
  • Activate (boolean) -- The updated boolean value that specifies whether the ThreateIntelSet is active or not.
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose ThreatIntelSet you want to update.
  • Location (string) -- The updated URI of the file that contains the ThreateIntelSet. For example (https://s3.us-west-2.amazonaws.com/my-bucket/my-object-key)
  • Name (string) -- The unique ID that specifies the ThreatIntelSet that you want to update.
  • ThreatIntelSetId (string) -- [REQUIRED] The unique ID that specifies the ThreatIntelSet that you want to update.
Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) -- 200 response

Paginators

The available paginators are:

class GuardDuty.Paginator.ListDetectors
paginator = client.get_paginator('list_detectors')
paginate(**kwargs)

Creates an iterator that will paginate through responses from GuardDuty.Client.list_detectors().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
PaginationConfig (dict) --

A dictionary that provides parameters to control pagination.

  • MaxItems (integer) --

    The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

  • PageSize (integer) --

    The size of each page.

  • StartingToken (string) --

    A token to specify where to start paginating. This is the NextToken from a previous response.

Return type
dict
Returns
Response Syntax
{
    'DetectorIds': [
        'string',
    ],

}

Response Structure

  • (dict) -- 200 response
    • DetectorIds (list) -- A list of detector Ids.
      • (string) -- The unique identifier for a detector.
class GuardDuty.Paginator.ListFilters
paginator = client.get_paginator('list_filters')
paginate(**kwargs)

Creates an iterator that will paginate through responses from GuardDuty.Client.list_filters().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    DetectorId='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service where you want to list filters.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'FilterNames': [
        'string',
    ],

}

Response Structure

  • (dict) -- 200 response
    • FilterNames (list) -- A list of filter names
      • (string) -- The unique identifier for a filter

class GuardDuty.Paginator.ListFindings
paginator = client.get_paginator('list_findings')
paginate(**kwargs)

Creates an iterator that will paginate through responses from GuardDuty.Client.list_findings().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    DetectorId='string',
    FindingCriteria={
        'Criterion': {
            'string': {
                'Eq': [
                    'string',
                ],
                'Gt': 123,
                'Gte': 123,
                'Lt': 123,
                'Lte': 123,
                'Neq': [
                    'string',
                ]
            }
        }
    },
    SortCriteria={
        'AttributeName': 'string',
        'OrderBy': 'ASC'|'DESC'
    },
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • DetectorId (string) -- [REQUIRED] The ID of the detector that specifies the GuardDuty service whose findings you want to list.
  • FindingCriteria (dict) --

    Represents the criteria used for querying findings.

    • Criterion (dict) -- Represents a map of finding properties that match specified conditions and values when querying findings.
      • (string) --
        • (dict) -- Finding attribute (for example, accountId) for which conditions and values must be specified when querying findings.
          • Eq (list) -- Represents the equal condition to be applied to a single field when querying for findings.
            • (string) --
          • Gt (integer) -- Represents the greater than condition to be applied to a single field when querying for findings.
          • Gte (integer) -- Represents the greater than equal condition to be applied to a single field when querying for findings.
          • Lt (integer) -- Represents the less than condition to be applied to a single field when querying for findings.
          • Lte (integer) -- Represents the less than equal condition to be applied to a single field when querying for findings.
          • Neq (list) -- Represents the not equal condition to be applied to a single field when querying for findings.
            • (string) --
  • SortCriteria (dict) --

    Represents the criteria used for sorting findings.

    • AttributeName (string) -- Represents the finding attribute (for example, accountId) by which to sort findings.
    • OrderBy (string) -- Order by which the sorted findings are to be displayed.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'FindingIds': [
        'string',
    ],

}

Response Structure

  • (dict) -- 200 response
    • FindingIds (list) -- The list of the Findings.
      • (string) -- The unique identifier for the Finding

class GuardDuty.Paginator.ListIPSets
paginator = client.get_paginator('list_ip_sets')
paginate(**kwargs)

Creates an iterator that will paginate through responses from GuardDuty.Client.list_ip_sets().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    DetectorId='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector that you want to retrieve.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'IpSetIds': [
        'string',
    ],

}

Response Structure

  • (dict) -- 200 response
    • IpSetIds (list) -- A list of the IP set IDs
      • (string) -- The unique identifier for an IP Set

class GuardDuty.Paginator.ListInvitations
paginator = client.get_paginator('list_invitations')
paginate(**kwargs)

Creates an iterator that will paginate through responses from GuardDuty.Client.list_invitations().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
PaginationConfig (dict) --

A dictionary that provides parameters to control pagination.

  • MaxItems (integer) --

    The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

  • PageSize (integer) --

    The size of each page.

  • StartingToken (string) --

    A token to specify where to start paginating. This is the NextToken from a previous response.

Return type
dict
Returns
Response Syntax
{
    'Invitations': [
        {
            'AccountId': 'string',
            'InvitationId': 'string',
            'InvitedAt': 'string',
            'RelationshipStatus': 'string'
        },
    ],

}

Response Structure

  • (dict) -- 200 response
    • Invitations (list) -- A list of invitation descriptions.
      • (dict) -- Invitation from an AWS account to become the current account's master.
        • AccountId (string) -- Inviter account ID
        • InvitationId (string) -- This value is used to validate the inviter account to the member account.
        • InvitedAt (string) -- Timestamp at which the invitation was sent
        • RelationshipStatus (string) -- The status of the relationship between the inviter and invitee accounts.
class GuardDuty.Paginator.ListMembers
paginator = client.get_paginator('list_members')
paginate(**kwargs)

Creates an iterator that will paginate through responses from GuardDuty.Client.list_members().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    DetectorId='string',
    OnlyAssociated='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • DetectorId (string) -- [REQUIRED] The unique ID of the detector of the GuardDuty account whose members you want to list.
  • OnlyAssociated (string) -- Specifies what member accounts the response is to include based on their relationship status with the master account. The default value is TRUE. If onlyAssociated is set to TRUE, the response will include member accounts whose relationship status with the master is set to Enabled, Disabled. If onlyAssociated is set to FALSE, the response will include all existing member accounts.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'Members': [
        {
            'AccountId': 'string',
            'DetectorId': 'string',
            'Email': 'string',
            'InvitedAt': 'string',
            'MasterId': 'string',
            'RelationshipStatus': 'string',
            'UpdatedAt': 'string'
        },
    ],

}

Response Structure

  • (dict) -- 200 response
    • Members (list) -- A list of member descriptions.
      • (dict) -- Contains details about the member account.
        • AccountId (string) -- AWS account ID.
        • DetectorId (string) -- The unique identifier for a detector.
        • Email (string) -- Member account's email address.
        • InvitedAt (string) -- Timestamp at which the invitation was sent
        • MasterId (string) -- The master account ID.
        • RelationshipStatus (string) -- The status of the relationship between the member and the master.
        • UpdatedAt (string) -- The first time a resource was created. The format will be ISO-8601.

class GuardDuty.Paginator.ListThreatIntelSets
paginator = client.get_paginator('list_threat_intel_sets')
paginate(**kwargs)

Creates an iterator that will paginate through responses from GuardDuty.Client.list_threat_intel_sets().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    DetectorId='string',
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters
  • DetectorId (string) -- [REQUIRED] The detectorID that specifies the GuardDuty service whose ThreatIntelSets you want to list.
  • PaginationConfig (dict) --

    A dictionary that provides parameters to control pagination.

    • MaxItems (integer) --

      The total number of items to return. If the total number of items available is more than the value specified in max-items then a NextToken will be provided in the output that you can use to resume pagination.

    • PageSize (integer) --

      The size of each page.

    • StartingToken (string) --

      A token to specify where to start paginating. This is the NextToken from a previous response.

Return type

dict

Returns

Response Syntax

{
    'ThreatIntelSetIds': [
        'string',
    ]
}

Response Structure

  • (dict) -- 200 response
    • ThreatIntelSetIds (list) -- The list of the threat intel set IDs
      • (string) -- The unique identifier for an threat intel set