You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::GuardDuty::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for Amazon GuardDuty. To construct a client, you need to configure a :region and :credentials.

guardduty = Aws::GuardDuty::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::GuardDuty::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::GuardDuty::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#accept_invitation(options = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.accept_invitation({
  detector_id: "__string", # required
  invitation_id: "InvitationId", # required
  master_id: "MasterId", # required
})

Options Hash (options):

  • :detector_id (required, String)
  • :invitation_id (required, String)

    This value is used to validate the master account to the member account.

  • :master_id (required, String)

    The account ID of the master GuardDuty account whose invitation you\'re accepting.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#archive_findings(options = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.archive_findings({
  detector_id: "__string", # required
  finding_ids: ["FindingId"], # required
})

Options Hash (options):

  • :detector_id (required, String)
  • :finding_ids (required, Array<String>)

    IDs of the findings that you want to archive.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_detector(options = {}) ⇒ Types::CreateDetectorResponse

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.

Examples:

Request syntax with placeholder values


resp = client.create_detector({
  client_token: "__stringMin0Max64",
  enable: false, # required
  finding_publishing_frequency: "FIFTEEN_MINUTES", # accepts FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS
})

Response structure


resp.detector_id #=> String

Options Hash (options):

  • :client_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The idempotency token for the create request.

  • :enable (required, Boolean)

    A boolean value that specifies whether the detector is to be enabled.

  • :finding_publishing_frequency (String)

    A enum value that specifies how frequently customer got Finding updates published.

Returns:

See Also:

#create_filter(options = {}) ⇒ Types::CreateFilterResponse

Creates a filter using the specified finding criteria.

Examples:

Request syntax with placeholder values


resp = client.create_filter({
  action: "NOOP", # accepts NOOP, ARCHIVE
  client_token: "__stringMin0Max64",
  description: "FilterDescription",
  detector_id: "__string", # required
  finding_criteria: { # required
    criterion: {
      "__string" => {
        eq: ["__string"],
        gt: 1,
        gte: 1,
        lt: 1,
        lte: 1,
        neq: ["__string"],
      },
    },
  },
  name: "FilterName", # required
  rank: 1,
})

Response structure


resp.name #=> String

Options Hash (options):

  • :action (String)

    Specifies the action that is to be applied to the findings that match the filter.

  • :client_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The idempotency token for the create request.

  • :description (String)

    The description of the filter.

  • :detector_id (required, String)
  • :finding_criteria (required, Types::FindingCriteria)

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

  • :name (required, 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.

Returns:

See Also:

#create_ip_set(options = {}) ⇒ Types::CreateIPSetResponse

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

Examples:

Request syntax with placeholder values


resp = client.create_ip_set({
  activate: false, # required
  client_token: "__stringMin0Max64",
  detector_id: "__string", # required
  format: "TXT", # required, accepts TXT, STIX, OTX_CSV, ALIEN_VAULT, PROOF_POINT, FIRE_EYE
  location: "Location", # required
  name: "Name", # required
})

Response structure


resp.ip_set_id #=> String

Options Hash (options):

  • :activate (required, Boolean)

    A boolean value that indicates whether GuardDuty is to start using the uploaded IPSet.

  • :client_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The idempotency token for the create request.

  • :detector_id (required, String)
  • :format (required, String)

    The format of the file that contains the IPSet.

  • :location (required, 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 (required, 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.

Returns:

See Also:

#create_members(options = {}) ⇒ Types::CreateMembersResponse

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.

Examples:

Request syntax with placeholder values


resp = client.create_members({
  account_details: [ # required
    {
      account_id: "AccountId", # required
      email: "Email", # required
    },
  ],
  detector_id: "__string", # required
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_details (required, Array<Types::AccountDetail>)

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

  • :detector_id (required, String)

Returns:

See Also:

#create_sample_findings(options = {}) ⇒ Struct

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.

Examples:

Request syntax with placeholder values


resp = client.create_sample_findings({
  detector_id: "__string", # required
  finding_types: ["FindingType"],
})

Options Hash (options):

  • :detector_id (required, String)
  • :finding_types (Array<String>)

    Types of sample findings that you want to generate.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_threat_intel_set(options = {}) ⇒ Types::CreateThreatIntelSetResponse

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

Examples:

Request syntax with placeholder values


resp = client.create_threat_intel_set({
  activate: false, # required
  client_token: "__stringMin0Max64",
  detector_id: "__string", # required
  format: "TXT", # required, accepts TXT, STIX, OTX_CSV, ALIEN_VAULT, PROOF_POINT, FIRE_EYE
  location: "Location", # required
  name: "Name", # required
})

Response structure


resp.threat_intel_set_id #=> String

Options Hash (options):

  • :activate (required, Boolean)

    A boolean value that indicates whether GuardDuty is to start using the uploaded ThreatIntelSet.

  • :client_token (String)

    This parameter will be auto-filled on your behalf with a random UUIDv4 when no value is provided. The idempotency token for the create request.

  • :detector_id (required, String)
  • :format (required, String)

    The format of the file that contains the ThreatIntelSet.

  • :location (required, 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 (required, String)

    A user-friendly ThreatIntelSet name that is displayed in all finding generated by activity that involves IP addresses included in this ThreatIntelSet.

Returns:

See Also:

#decline_invitations(options = {}) ⇒ Types::DeclineInvitationsResponse

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

Examples:

Request syntax with placeholder values


resp = client.decline_invitations({
  account_ids: ["__string"], # required
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

Returns:

See Also:

#delete_detector(options = {}) ⇒ Struct

Deletes a Amazon GuardDuty detector specified by the detector ID.

Examples:

Request syntax with placeholder values


resp = client.delete_detector({
  detector_id: "__string", # required
})

Options Hash (options):

  • :detector_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_filter(options = {}) ⇒ Struct

Deletes the filter specified by the filter name.

Examples:

Request syntax with placeholder values


resp = client.delete_filter({
  detector_id: "__string", # required
  filter_name: "__string", # required
})

Options Hash (options):

  • :detector_id (required, String)
  • :filter_name (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_invitations(options = {}) ⇒ Types::DeleteInvitationsResponse

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

Examples:

Request syntax with placeholder values


resp = client.delete_invitations({
  account_ids: ["__string"], # required
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

Returns:

See Also:

#delete_ip_set(options = {}) ⇒ Struct

Deletes the IPSet specified by the IPSet ID.

Examples:

Request syntax with placeholder values


resp = client.delete_ip_set({
  detector_id: "__string", # required
  ip_set_id: "__string", # required
})

Options Hash (options):

  • :detector_id (required, String)
  • :ip_set_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_members(options = {}) ⇒ Types::DeleteMembersResponse

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

Examples:

Request syntax with placeholder values


resp = client.delete_members({
  account_ids: ["__string"], # required
  detector_id: "__string", # required
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

  • :detector_id (required, String)

Returns:

See Also:

#delete_threat_intel_set(options = {}) ⇒ Struct

Deletes ThreatIntelSet specified by the ThreatIntelSet ID.

Examples:

Request syntax with placeholder values


resp = client.delete_threat_intel_set({
  detector_id: "__string", # required
  threat_intel_set_id: "__string", # required
})

Options Hash (options):

  • :detector_id (required, String)
  • :threat_intel_set_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#disassociate_from_master_account(options = {}) ⇒ Struct

Disassociates the current GuardDuty member account from its master account.

Examples:

Request syntax with placeholder values


resp = client.({
  detector_id: "__string", # required
})

Options Hash (options):

  • :detector_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#disassociate_members(options = {}) ⇒ Types::DisassociateMembersResponse

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

Examples:

Request syntax with placeholder values


resp = client.disassociate_members({
  account_ids: ["__string"], # required
  detector_id: "__string", # required
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

  • :detector_id (required, String)

Returns:

See Also:

#get_detector(options = {}) ⇒ Types::GetDetectorResponse

Retrieves an Amazon GuardDuty detector specified by the detectorId.

Examples:

Request syntax with placeholder values


resp = client.get_detector({
  detector_id: "__string", # required
})

Response structure


resp.created_at #=> String
resp.finding_publishing_frequency #=> String, one of "FIFTEEN_MINUTES", "ONE_HOUR", "SIX_HOURS"
resp.service_role #=> String
resp.status #=> String, one of "ENABLED", "DISABLED"
resp.updated_at #=> String

Options Hash (options):

  • :detector_id (required, String)

Returns:

See Also:

#get_filter(options = {}) ⇒ Types::GetFilterResponse

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

Examples:

Request syntax with placeholder values


resp = client.get_filter({
  detector_id: "__string", # required
  filter_name: "__string", # required
})

Response structure


resp.action #=> String, one of "NOOP", "ARCHIVE"
resp.description #=> String
resp.finding_criteria.criterion #=> Hash
resp.finding_criteria.criterion["__string"].eq #=> Array
resp.finding_criteria.criterion["__string"].eq[0] #=> String
resp.finding_criteria.criterion["__string"].gt #=> Integer
resp.finding_criteria.criterion["__string"].gte #=> Integer
resp.finding_criteria.criterion["__string"].lt #=> Integer
resp.finding_criteria.criterion["__string"].lte #=> Integer
resp.finding_criteria.criterion["__string"].neq #=> Array
resp.finding_criteria.criterion["__string"].neq[0] #=> String
resp.name #=> String
resp.rank #=> Integer

Options Hash (options):

  • :detector_id (required, String)
  • :filter_name (required, String)

Returns:

See Also:

#get_findings(options = {}) ⇒ Types::GetFindingsResponse

Describes Amazon GuardDuty findings specified by finding IDs.

Examples:

Request syntax with placeholder values


resp = client.get_findings({
  detector_id: "__string", # required
  finding_ids: ["FindingId"], # required
  sort_criteria: {
    attribute_name: "__string",
    order_by: "ASC", # accepts ASC, DESC
  },
})

Response structure


resp.findings #=> Array
resp.findings[0]. #=> String
resp.findings[0].arn #=> String
resp.findings[0].confidence #=> Float
resp.findings[0].created_at #=> String
resp.findings[0].description #=> String
resp.findings[0].id #=> String
resp.findings[0].partition #=> String
resp.findings[0].region #=> String
resp.findings[0].resource.access_key_details.access_key_id #=> String
resp.findings[0].resource.access_key_details.principal_id #=> String
resp.findings[0].resource.access_key_details.user_name #=> String
resp.findings[0].resource.access_key_details.user_type #=> String
resp.findings[0].resource.instance_details.availability_zone #=> String
resp.findings[0].resource.instance_details.iam_instance_profile.arn #=> String
resp.findings[0].resource.instance_details.iam_instance_profile.id #=> String
resp.findings[0].resource.instance_details.image_description #=> String
resp.findings[0].resource.instance_details.image_id #=> String
resp.findings[0].resource.instance_details.instance_id #=> String
resp.findings[0].resource.instance_details.instance_state #=> String
resp.findings[0].resource.instance_details.instance_type #=> String
resp.findings[0].resource.instance_details.launch_time #=> String
resp.findings[0].resource.instance_details.network_interfaces #=> Array
resp.findings[0].resource.instance_details.network_interfaces[0].ipv_6_addresses #=> Array
resp.findings[0].resource.instance_details.network_interfaces[0].ipv_6_addresses[0] #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].network_interface_id #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].private_dns_name #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].private_ip_address #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].private_ip_addresses #=> Array
resp.findings[0].resource.instance_details.network_interfaces[0].private_ip_addresses[0].private_dns_name #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].private_ip_addresses[0].private_ip_address #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].public_dns_name #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].public_ip #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].security_groups #=> Array
resp.findings[0].resource.instance_details.network_interfaces[0].security_groups[0].group_id #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].security_groups[0].group_name #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].subnet_id #=> String
resp.findings[0].resource.instance_details.network_interfaces[0].vpc_id #=> String
resp.findings[0].resource.instance_details.platform #=> String
resp.findings[0].resource.instance_details.product_codes #=> Array
resp.findings[0].resource.instance_details.product_codes[0].code #=> String
resp.findings[0].resource.instance_details.product_codes[0].product_type #=> String
resp.findings[0].resource.instance_details.tags #=> Array
resp.findings[0].resource.instance_details.tags[0].key #=> String
resp.findings[0].resource.instance_details.tags[0].value #=> String
resp.findings[0].resource.resource_type #=> String
resp.findings[0].schema_version #=> String
resp.findings[0].service.action.action_type #=> String
resp.findings[0].service.action.aws_api_call_action.api #=> String
resp.findings[0].service.action.aws_api_call_action.caller_type #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.city.city_name #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.country.country_code #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.country.country_name #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.geo_location.lat #=> Float
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.geo_location.lon #=> Float
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.ip_address_v4 #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.organization.asn #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.organization.asn_org #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.organization.isp #=> String
resp.findings[0].service.action.aws_api_call_action.remote_ip_details.organization.org #=> String
resp.findings[0].service.action.aws_api_call_action.service_name #=> String
resp.findings[0].service.action.dns_request_action.domain #=> String
resp.findings[0].service.action.network_connection_action.blocked #=> true/false
resp.findings[0].service.action.network_connection_action.connection_direction #=> String
resp.findings[0].service.action.network_connection_action.local_port_details.port #=> Integer
resp.findings[0].service.action.network_connection_action.local_port_details.port_name #=> String
resp.findings[0].service.action.network_connection_action.protocol #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.city.city_name #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.country.country_code #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.country.country_name #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.geo_location.lat #=> Float
resp.findings[0].service.action.network_connection_action.remote_ip_details.geo_location.lon #=> Float
resp.findings[0].service.action.network_connection_action.remote_ip_details.ip_address_v4 #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.organization.asn #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.organization.asn_org #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.organization.isp #=> String
resp.findings[0].service.action.network_connection_action.remote_ip_details.organization.org #=> String
resp.findings[0].service.action.network_connection_action.remote_port_details.port #=> Integer
resp.findings[0].service.action.network_connection_action.remote_port_details.port_name #=> String
resp.findings[0].service.action.port_probe_action.blocked #=> true/false
resp.findings[0].service.action.port_probe_action.port_probe_details #=> Array
resp.findings[0].service.action.port_probe_action.port_probe_details[0].local_port_details.port #=> Integer
resp.findings[0].service.action.port_probe_action.port_probe_details[0].local_port_details.port_name #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.city.city_name #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.country.country_code #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.country.country_name #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.geo_location.lat #=> Float
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.geo_location.lon #=> Float
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.ip_address_v4 #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.organization.asn #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.organization.asn_org #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.organization.isp #=> String
resp.findings[0].service.action.port_probe_action.port_probe_details[0].remote_ip_details.organization.org #=> String
resp.findings[0].service.archived #=> true/false
resp.findings[0].service.count #=> Integer
resp.findings[0].service.detector_id #=> String
resp.findings[0].service.event_first_seen #=> String
resp.findings[0].service.event_last_seen #=> String
resp.findings[0].service.resource_role #=> String
resp.findings[0].service.service_name #=> String
resp.findings[0].service.user_feedback #=> String
resp.findings[0].severity #=> Float
resp.findings[0].title #=> String
resp.findings[0].type #=> String
resp.findings[0].updated_at #=> String

Options Hash (options):

  • :detector_id (required, String)
  • :finding_ids (required, Array<String>)

    IDs of the findings that you want to retrieve.

  • :sort_criteria (Types::SortCriteria)

    Represents the criteria used for sorting findings.

Returns:

See Also:

#get_findings_statistics(options = {}) ⇒ Types::GetFindingsStatisticsResponse

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

Examples:

Request syntax with placeholder values


resp = client.get_findings_statistics({
  detector_id: "__string", # required
  finding_criteria: {
    criterion: {
      "__string" => {
        eq: ["__string"],
        gt: 1,
        gte: 1,
        lt: 1,
        lte: 1,
        neq: ["__string"],
      },
    },
  },
  finding_statistic_types: ["COUNT_BY_SEVERITY"], # required, accepts COUNT_BY_SEVERITY
})

Response structure


resp.finding_statistics.count_by_severity #=> Hash
resp.finding_statistics.count_by_severity["__string"] #=> Integer

Options Hash (options):

  • :detector_id (required, String)
  • :finding_criteria (Types::FindingCriteria)

    Represents the criteria used for querying findings.

  • :finding_statistic_types (required, Array<String>)

    Types of finding statistics to retrieve.

Returns:

See Also:

#get_invitations_count(options = {}) ⇒ Types::GetInvitationsCountResponse

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

Examples:

Request syntax with placeholder values


resp = client.get_invitations_count()

Response structure


resp.invitations_count #=> Integer

Returns:

See Also:

#get_ip_set(options = {}) ⇒ Types::GetIPSetResponse

Retrieves the IPSet specified by the IPSet ID.

Examples:

Request syntax with placeholder values


resp = client.get_ip_set({
  detector_id: "__string", # required
  ip_set_id: "__string", # required
})

Response structure


resp.format #=> String, one of "TXT", "STIX", "OTX_CSV", "ALIEN_VAULT", "PROOF_POINT", "FIRE_EYE"
resp.location #=> String
resp.name #=> String
resp.status #=> String, one of "INACTIVE", "ACTIVATING", "ACTIVE", "DEACTIVATING", "ERROR", "DELETE_PENDING", "DELETED"

Options Hash (options):

  • :detector_id (required, String)
  • :ip_set_id (required, String)

Returns:

See Also:

#get_master_account(options = {}) ⇒ Types::GetMasterAccountResponse

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

Examples:

Request syntax with placeholder values


resp = client.({
  detector_id: "__string", # required
})

Response structure


resp.master. #=> String
resp.master.invitation_id #=> String
resp.master.invited_at #=> String
resp.master.relationship_status #=> String

Options Hash (options):

  • :detector_id (required, String)

Returns:

See Also:

#get_members(options = {}) ⇒ Types::GetMembersResponse

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

Examples:

Request syntax with placeholder values


resp = client.get_members({
  account_ids: ["__string"], # required
  detector_id: "__string", # required
})

Response structure


resp.members #=> Array
resp.members[0]. #=> String
resp.members[0].detector_id #=> String
resp.members[0].email #=> String
resp.members[0].invited_at #=> String
resp.members[0].master_id #=> String
resp.members[0].relationship_status #=> String
resp.members[0].updated_at #=> String
resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

  • :detector_id (required, String)

Returns:

See Also:

#get_threat_intel_set(options = {}) ⇒ Types::GetThreatIntelSetResponse

Retrieves the ThreatIntelSet that is specified by the ThreatIntelSet ID.

Examples:

Request syntax with placeholder values


resp = client.get_threat_intel_set({
  detector_id: "__string", # required
  threat_intel_set_id: "__string", # required
})

Response structure


resp.format #=> String, one of "TXT", "STIX", "OTX_CSV", "ALIEN_VAULT", "PROOF_POINT", "FIRE_EYE"
resp.location #=> String
resp.name #=> String
resp.status #=> String, one of "INACTIVE", "ACTIVATING", "ACTIVE", "DEACTIVATING", "ERROR", "DELETE_PENDING", "DELETED"

Options Hash (options):

  • :detector_id (required, String)
  • :threat_intel_set_id (required, String)

Returns:

See Also:

#invite_members(options = {}) ⇒ Types::InviteMembersResponse

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.

Examples:

Request syntax with placeholder values


resp = client.invite_members({
  account_ids: ["__string"], # required
  detector_id: "__string", # required
  disable_email_notification: false,
  message: "Message",
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

  • :detector_id (required, String)
  • :disable_email_notification (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.

Returns:

See Also:

#list_detectors(options = {}) ⇒ Types::ListDetectorsResponse

Lists detectorIds of all the existing Amazon GuardDuty detector resources.

Examples:

Request syntax with placeholder values


resp = client.list_detectors({
  max_results: 1,
  next_token: "__string",
})

Response structure


resp.detector_ids #=> Array
resp.detector_ids[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response.

  • :next_token (String)

Returns:

See Also:

#list_filters(options = {}) ⇒ Types::ListFiltersResponse

Returns a paginated list of the current filters.

Examples:

Request syntax with placeholder values


resp = client.list_filters({
  detector_id: "__string", # required
  max_results: 1,
  next_token: "__string",
})

Response structure


resp.filter_names #=> Array
resp.filter_names[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :detector_id (required, String)
  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response.

  • :next_token (String)

Returns:

See Also:

#list_findings(options = {}) ⇒ Types::ListFindingsResponse

Lists Amazon GuardDuty findings for the specified detector ID.

Examples:

Request syntax with placeholder values


resp = client.list_findings({
  detector_id: "__string", # required
  finding_criteria: {
    criterion: {
      "__string" => {
        eq: ["__string"],
        gt: 1,
        gte: 1,
        lt: 1,
        lte: 1,
        neq: ["__string"],
      },
    },
  },
  max_results: 1,
  next_token: "NextToken",
  sort_criteria: {
    attribute_name: "__string",
    order_by: "ASC", # accepts ASC, DESC
  },
})

Response structure


resp.finding_ids #=> Array
resp.finding_ids[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :detector_id (required, String)
  • :finding_criteria (Types::FindingCriteria)

    Represents the criteria used for querying findings.

  • :max_results (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.

  • :next_token (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.

  • :sort_criteria (Types::SortCriteria)

    Represents the criteria used for sorting findings.

Returns:

See Also:

#list_invitations(options = {}) ⇒ Types::ListInvitationsResponse

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

Examples:

Request syntax with placeholder values


resp = client.list_invitations({
  max_results: 1,
  next_token: "__string",
})

Response structure


resp.invitations #=> Array
resp.invitations[0]. #=> String
resp.invitations[0].invitation_id #=> String
resp.invitations[0].invited_at #=> String
resp.invitations[0].relationship_status #=> String
resp.next_token #=> String

Options Hash (options):

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response.

  • :next_token (String)

Returns:

See Also:

#list_ip_sets(options = {}) ⇒ Types::ListIPSetsResponse

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

Examples:

Request syntax with placeholder values


resp = client.list_ip_sets({
  detector_id: "__string", # required
  max_results: 1,
  next_token: "__string",
})

Response structure


resp.ip_set_ids #=> Array
resp.ip_set_ids[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :detector_id (required, String)
  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response.

  • :next_token (String)

Returns:

See Also:

#list_members(options = {}) ⇒ Types::ListMembersResponse

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

Examples:

Request syntax with placeholder values


resp = client.list_members({
  detector_id: "__string", # required
  max_results: 1,
  next_token: "__string",
  only_associated: "__string",
})

Response structure


resp.members #=> Array
resp.members[0]. #=> String
resp.members[0].detector_id #=> String
resp.members[0].email #=> String
resp.members[0].invited_at #=> String
resp.members[0].master_id #=> String
resp.members[0].relationship_status #=> String
resp.members[0].updated_at #=> String
resp.next_token #=> String

Options Hash (options):

  • :detector_id (required, String)
  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response.

  • :next_token (String)
  • :only_associated (String)

Returns:

See Also:

#list_threat_intel_sets(options = {}) ⇒ Types::ListThreatIntelSetsResponse

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

Examples:

Request syntax with placeholder values


resp = client.list_threat_intel_sets({
  detector_id: "__string", # required
  max_results: 1,
  next_token: "__string",
})

Response structure


resp.next_token #=> String
resp.threat_intel_set_ids #=> Array
resp.threat_intel_set_ids[0] #=> String

Options Hash (options):

  • :detector_id (required, String)
  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response.

  • :next_token (String)

Returns:

See Also:

#start_monitoring_members(options = {}) ⇒ Types::StartMonitoringMembersResponse

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.

Examples:

Request syntax with placeholder values


resp = client.start_monitoring_members({
  account_ids: ["__string"], # required
  detector_id: "__string", # required
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

  • :detector_id (required, String)

Returns:

See Also:

#stop_monitoring_members(options = {}) ⇒ Types::StopMonitoringMembersResponse

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.

Examples:

Request syntax with placeholder values


resp = client.stop_monitoring_members({
  account_ids: ["__string"], # required
  detector_id: "__string", # required
})

Response structure


resp.unprocessed_accounts #=> Array
resp.unprocessed_accounts[0]. #=> String
resp.unprocessed_accounts[0].result #=> String

Options Hash (options):

  • :account_ids (required, Array<String>)

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

  • :detector_id (required, String)

Returns:

See Also:

#unarchive_findings(options = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


resp = client.unarchive_findings({
  detector_id: "__string", # required
  finding_ids: ["FindingId"], # required
})

Options Hash (options):

  • :detector_id (required, String)
  • :finding_ids (required, Array<String>)

    IDs of the findings that you want to unarchive.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_detector(options = {}) ⇒ Struct

Updates an Amazon GuardDuty detector specified by the detectorId.

Examples:

Request syntax with placeholder values


resp = client.update_detector({
  detector_id: "__string", # required
  enable: false,
  finding_publishing_frequency: "FIFTEEN_MINUTES", # accepts FIFTEEN_MINUTES, ONE_HOUR, SIX_HOURS
})

Options Hash (options):

  • :detector_id (required, String)
  • :enable (Boolean)

    Updated boolean value for the detector that specifies whether the detector is enabled.

  • :finding_publishing_frequency (String)

    A enum value that specifies how frequently customer got Finding updates published.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_filter(options = {}) ⇒ Types::UpdateFilterResponse

Updates the filter specified by the filter name.

Examples:

Request syntax with placeholder values


resp = client.update_filter({
  action: "NOOP", # accepts NOOP, ARCHIVE
  description: "FilterDescription",
  detector_id: "__string", # required
  filter_name: "__string", # required
  finding_criteria: {
    criterion: {
      "__string" => {
        eq: ["__string"],
        gt: 1,
        gte: 1,
        lt: 1,
        lte: 1,
        neq: ["__string"],
      },
    },
  },
  rank: 1,
})

Response structure


resp.name #=> String

Options Hash (options):

  • :action (String)

    Specifies the action that is to be applied to the findings that match the filter.

  • :description (String)

    The description of the filter.

  • :detector_id (required, String)
  • :filter_name (required, String)
  • :finding_criteria (Types::FindingCriteria)

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

  • :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.

Returns:

See Also:

#update_findings_feedback(options = {}) ⇒ Struct

Marks specified Amazon GuardDuty findings as useful or not useful.

Examples:

Request syntax with placeholder values


resp = client.update_findings_feedback({
  comments: "Comments",
  detector_id: "__string", # required
  feedback: "USEFUL", # required, accepts USEFUL, NOT_USEFUL
  finding_ids: ["FindingId"], # required
})

Options Hash (options):

  • :comments (String)

    Additional feedback about the GuardDuty findings.

  • :detector_id (required, String)
  • :feedback (required, String)

    Valid values: USEFUL | NOT_USEFUL

  • :finding_ids (required, Array<String>)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_ip_set(options = {}) ⇒ Struct

Updates the IPSet specified by the IPSet ID.

Examples:

Request syntax with placeholder values


resp = client.update_ip_set({
  activate: false,
  detector_id: "__string", # required
  ip_set_id: "__string", # required
  location: "Location",
  name: "Name",
})

Options Hash (options):

  • :activate (Boolean)

    The updated boolean value that specifies whether the IPSet is active or not.

  • :detector_id (required, String)
  • :ip_set_id (required, String)
  • :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.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_threat_intel_set(options = {}) ⇒ Struct

Updates the ThreatIntelSet specified by ThreatIntelSet ID.

Examples:

Request syntax with placeholder values


resp = client.update_threat_intel_set({
  activate: false,
  detector_id: "__string", # required
  location: "Location",
  name: "Name",
  threat_intel_set_id: "__string", # required
})

Options Hash (options):

  • :activate (Boolean)

    The updated boolean value that specifies whether the ThreateIntelSet is active or not.

  • :detector_id (required, String)
  • :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.

  • :threat_intel_set_id (required, String)

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.