Class: Aws::Inspector::Client

Inherits:
Seahorse::Client::Base
  • Object
show all
Includes:
ClientStubs
Defined in:
lib/aws-sdk-inspector/client.rb

Overview

An API client for Inspector. To construct a client, you need to configure a ‘:region` and `:credentials`.

client = Aws::Inspector::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

For details on configuring region and credentials see the [developer guide](/sdk-for-ruby/v3/developer-guide/setup-config.html).

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

Class Attribute Summary collapse

API Operations collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Client

Returns a new instance of Client.

Parameters:

  • options (Hash)

Options Hash (options):

  • :plugins (Array<Seahorse::Client::Plugin>) — default: []]

    A list of plugins to apply to the client. Each plugin is either a class name or an instance of a plugin class.

  • :credentials (required, Aws::CredentialProvider)

    Your AWS credentials. This can be an instance of any one of the following classes:

    • ‘Aws::Credentials` - Used for configuring static, non-refreshing credentials.

    • ‘Aws::SharedCredentials` - Used for loading static credentials from a shared file, such as `~/.aws/config`.

    • ‘Aws::AssumeRoleCredentials` - Used when you need to assume a role.

    • ‘Aws::AssumeRoleWebIdentityCredentials` - Used when you need to assume a role after providing credentials via the web.

    • ‘Aws::SSOCredentials` - Used for loading credentials from AWS SSO using an access token generated from `aws login`.

    • ‘Aws::ProcessCredentials` - Used for loading credentials from a process that outputs to stdout.

    • ‘Aws::InstanceProfileCredentials` - Used for loading credentials from an EC2 IMDS on an EC2 instance.

    • ‘Aws::ECSCredentials` - Used for loading credentials from instances running in ECS.

    • ‘Aws::CognitoIdentityCredentials` - Used for loading credentials from the Cognito Identity service.

    When ‘:credentials` are not configured directly, the following locations will be searched for credentials:

    • Aws.config`

    • The ‘:access_key_id`, `:secret_access_key`, `:session_token`, and `:account_id` options.

    • ENV, ENV, ENV, and ENV

    • ‘~/.aws/credentials`

    • ‘~/.aws/config`

    • EC2/ECS IMDS instance profile - When used by default, the timeouts are very aggressive. Construct and pass an instance of ‘Aws::InstanceProfileCredentials` or `Aws::ECSCredentials` to enable retries and extended timeouts. Instance profile credential fetching can be disabled by setting ENV to true.

  • :region (required, String)

    The AWS region to connect to. The configured ‘:region` is used to determine the service `:endpoint`. When not passed, a default `:region` is searched for in the following locations:

  • :access_key_id (String)
  • :account_id (String)
  • :active_endpoint_cache (Boolean) — default: false

    When set to ‘true`, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to `false`.

  • :adaptive_retry_wait_to_fill (Boolean) — default: true

    Used only in ‘adaptive` retry mode. When true, the request will sleep until there is sufficent client side capacity to retry the request. When false, the request will raise a `RetryCapacityNotAvailableError` and will not retry instead of sleeping.

  • :client_side_monitoring (Boolean) — default: false

    When ‘true`, client-side metrics will be collected for all API requests from this client.

  • :client_side_monitoring_client_id (String) — default: ""

    Allows you to provide an identifier for this client which will be attached to all generated client side metrics. Defaults to an empty string.

  • :client_side_monitoring_host (String) — default: "127.0.0.1"

    Allows you to specify the DNS hostname or IPv4 or IPv6 address that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_port (Integer) — default: 31000

    Required for publishing client metrics. The port that the client side monitoring agent is running on, where client metrics will be published via UDP.

  • :client_side_monitoring_publisher (Aws::ClientSideMonitoring::Publisher) — default: Aws::ClientSideMonitoring::Publisher

    Allows you to provide a custom client-side monitoring publisher class. By default, will use the Client Side Monitoring Agent Publisher.

  • :convert_params (Boolean) — default: true

    When ‘true`, an attempt is made to coerce request parameters into the required types.

  • :correct_clock_skew (Boolean) — default: true

    Used only in ‘standard` and adaptive retry modes. Specifies whether to apply a clock skew correction and retry requests with skewed client clocks.

  • :defaults_mode (String) — default: "legacy"

    See DefaultsModeConfiguration for a list of the accepted modes and the configuration defaults that are included.

  • :disable_host_prefix_injection (Boolean) — default: false

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available.

  • :disable_request_compression (Boolean) — default: false

    When set to ‘true’ the request body will not be compressed for supported operations.

  • :endpoint (String, URI::HTTPS, URI::HTTP)

    Normally you should not configure the ‘:endpoint` option directly. This is normally constructed from the `:region` option. Configuring `:endpoint` is normally reserved for connecting to test or custom endpoints. The endpoint should be a URI formatted like:

    'http://example.com'
    'https://example.com'
    'http://example.com:123'
    
  • :endpoint_cache_max_entries (Integer) — default: 1000

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000.

  • :endpoint_cache_max_threads (Integer) — default: 10

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10.

  • :endpoint_cache_poll_interval (Integer) — default: 60

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec.

  • :endpoint_discovery (Boolean) — default: false

    When set to ‘true`, endpoint discovery will be enabled for operations when available.

  • :ignore_configured_endpoint_urls (Boolean)

    Setting to true disables use of endpoint URLs provided via environment variables and the shared configuration file.

  • :log_formatter (Aws::Log::Formatter) — default: Aws::Log::Formatter.default

    The log formatter.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the ‘:logger` at.

  • :logger (Logger)

    The Logger instance to send log messages to. If this option is not set, logging will be disabled.

  • :max_attempts (Integer) — default: 3

    An integer representing the maximum number attempts that will be made for a single request, including the initial attempt. For example, setting this value to 5 will result in a request being retried up to 4 times. Used in ‘standard` and `adaptive` retry modes.

  • :profile (String) — default: "default"

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, ‘default’ is used.

  • :request_min_compression_size_bytes (Integer) — default: 10240

    The minimum size in bytes that triggers compression for request bodies. The value must be non-negative integer value between 0 and 10485780 bytes inclusive.

  • :retry_backoff (Proc)

    A proc or lambda used for backoff. Defaults to 2**retries * retry_base_delay. This option is only used in the ‘legacy` retry mode.

  • :retry_base_delay (Float) — default: 0.3

    The base delay in seconds used by the default backoff function. This option is only used in the ‘legacy` retry mode.

  • :retry_jitter (Symbol) — default: :none

    A delay randomiser function used by the default backoff function. Some predefined functions can be referenced by name - :none, :equal, :full, otherwise a Proc that takes and returns a number. This option is only used in the ‘legacy` retry mode.

    @see www.awsarchitectureblog.com/2015/03/backoff.html

  • :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, auth errors, endpoint discovery, and errors from expired credentials. This option is only used in the ‘legacy` retry mode.

  • :retry_max_delay (Integer) — default: 0

    The maximum number of seconds to delay between retries (0 for no limit) used by the default backoff function. This option is only used in the ‘legacy` retry mode.

  • :retry_mode (String) — default: "legacy"

    Specifies which retry algorithm to use. Values are:

    • ‘legacy` - The pre-existing retry behavior. This is default value if no retry mode is provided.

    • ‘standard` - A standardized set of retry rules across the AWS SDKs. This includes support for retry quotas, which limit the number of unsuccessful retries a client can make.

    • ‘adaptive` - An experimental retry mode that includes all the functionality of `standard` mode along with automatic client side throttling. This is a provisional mode that may change behavior in the future.

  • :sdk_ua_app_id (String)

    A unique and opaque application ID that is appended to the User-Agent header as app/sdk_ua_app_id. It should have a maximum length of 50. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id.

  • :secret_access_key (String)
  • :session_token (String)
  • :sigv4a_signing_region_set (Array)

    A list of regions that should be signed with SigV4a signing. When not passed, a default ‘:sigv4a_signing_region_set` is searched for in the following locations:

  • :simple_json (Boolean) — default: false

    Disables request parameter conversion, validation, and formatting. Also disables response data type conversions. The request parameters hash must be formatted exactly as the API expects.This option is useful when you want to ensure the highest level of performance by avoiding overhead of walking request parameters and response data structures.

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

  • :telemetry_provider (Aws::Telemetry::TelemetryProviderBase) — default: Aws::Telemetry::NoOpTelemetryProvider

    Allows you to provide a telemetry provider, which is used to emit telemetry data. By default, uses ‘NoOpTelemetryProvider` which will not record or emit any telemetry data. The SDK supports the following telemetry providers:

    • OpenTelemetry (OTel) - To use the OTel provider, install and require the

    ‘opentelemetry-sdk` gem and then, pass in an instance of a `Aws::Telemetry::OTelProvider` for telemetry provider.

  • :token_provider (Aws::TokenProvider)

    A Bearer Token Provider. This can be an instance of any one of the following classes:

    • ‘Aws::StaticTokenProvider` - Used for configuring static, non-refreshing tokens.

    • ‘Aws::SSOTokenProvider` - Used for loading tokens from AWS SSO using an access token generated from `aws login`.

    When ‘:token_provider` is not configured directly, the `Aws::TokenProviderChain` will be used to search for tokens configured for your profile in shared configuration files.

  • :use_dualstack_endpoint (Boolean)

    When set to ‘true`, dualstack enabled endpoints (with `.aws` TLD) will be used if available.

  • :use_fips_endpoint (Boolean)

    When set to ‘true`, fips compatible endpoints will be used if available. When a `fips` region is used, the region is normalized and this config is set to `true`.

  • :validate_params (Boolean) — default: true

    When ‘true`, request parameters are validated before sending the request.

  • :endpoint_provider (Aws::Inspector::EndpointProvider)

    The endpoint provider used to resolve endpoints. Any object that responds to ‘#resolve_endpoint(parameters)` where `parameters` is a Struct similar to `Aws::Inspector::EndpointParameters`.

  • :http_continue_timeout (Float) — default: 1

    The number of seconds to wait for a 100-continue response before sending the request body. This option has no effect unless the request has “Expect” header set to “100-continue”. Defaults to ‘nil` which disables this behaviour. This value can safely be set per request on the session.

  • :http_idle_timeout (Float) — default: 5

    The number of seconds a connection is allowed to sit idle before it is considered stale. Stale connections are closed and removed from the pool before making a request.

  • :http_open_timeout (Float) — default: 15

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_proxy (URI::HTTP, String)

    A proxy to send requests through. Formatted like ‘proxy.com:123’.

  • :http_read_timeout (Float) — default: 60

    The default number of seconds to wait for response data. This value can safely be set per-request on the session.

  • :http_wire_trace (Boolean) — default: false

    When ‘true`, HTTP debug output will be sent to the `:logger`.

  • :on_chunk_received (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the response body is received. It provides three arguments: the chunk, the number of bytes received, and the total number of bytes in the response (or nil if the server did not send a ‘content-length`).

  • :on_chunk_sent (Proc)

    When a Proc object is provided, it will be used as callback when each chunk of the request body is sent. It provides three arguments: the chunk, the number of bytes read from the body, and the total number of bytes in the body.

  • :raise_response_errors (Boolean) — default: true

    When ‘true`, response errors are raised.

  • :ssl_ca_bundle (String)

    Full path to the SSL certificate authority bundle file that should be used when verifying peer certificates. If you do not pass ‘:ssl_ca_bundle` or `:ssl_ca_directory` the the system default will be used if available.

  • :ssl_ca_directory (String)

    Full path of the directory that contains the unbundled SSL certificate authority files for verifying peer certificates. If you do not pass ‘:ssl_ca_bundle` or `:ssl_ca_directory` the the system default will be used if available.

  • :ssl_ca_store (String)

    Sets the X509::Store to verify peer certificate.

  • :ssl_cert (OpenSSL::X509::Certificate)

    Sets a client certificate when creating http connections.

  • :ssl_key (OpenSSL::PKey)

    Sets a client key when creating http connections.

  • :ssl_timeout (Float)

    Sets the SSL timeout in seconds

  • :ssl_verify_peer (Boolean) — default: true

    When ‘true`, SSL peer certificates are verified when establishing a connection.



451
452
453
# File 'lib/aws-sdk-inspector/client.rb', line 451

def initialize(*args)
  super
end

Class Attribute Details

.identifierObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



3135
3136
3137
# File 'lib/aws-sdk-inspector/client.rb', line 3135

def identifier
  @identifier
end

Class Method Details

.errors_moduleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



3138
3139
3140
# File 'lib/aws-sdk-inspector/client.rb', line 3138

def errors_module
  Errors
end

Instance Method Details

#add_attributes_to_findings(params = {}) ⇒ Types::AddAttributesToFindingsResponse

Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

Examples:

Example: Add attributes to findings


# Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

resp = client.add_attributes_to_findings({
  attributes: [
    {
      key: "Example", 
      value: "example", 
    }, 
  ], 
  finding_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU", 
  ], 
})

resp.to_h outputs the following:
{
  failed_items: {
  }, 
}

Request syntax with placeholder values


resp = client.add_attributes_to_findings({
  finding_arns: ["Arn"], # required
  attributes: [ # required
    {
      key: "AttributeKey", # required
      value: "AttributeValue",
    },
  ],
})

Response structure


resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :finding_arns (required, Array<String>)

    The ARNs that specify the findings that you want to assign attributes to.

  • :attributes (required, Array<Types::Attribute>)

    The array of attributes that you want to assign to specified findings.

Returns:

See Also:



516
517
518
519
# File 'lib/aws-sdk-inspector/client.rb', line 516

def add_attributes_to_findings(params = {}, options = {})
  req = build_request(:add_attributes_to_findings, params)
  req.send_request(options)
end

#build_request(operation_name, params = {}) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

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


3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
# File 'lib/aws-sdk-inspector/client.rb', line 3108

def build_request(operation_name, params = {})
  handlers = @handlers.for(operation_name)
  tracer = config.telemetry_provider.tracer_provider.tracer(
    Aws::Telemetry.module_to_tracer_name('Aws::Inspector')
  )
  context = Seahorse::Client::RequestContext.new(
    operation_name: operation_name,
    operation: config.api.operation(operation_name),
    client: self,
    params: params,
    config: config,
    tracer: tracer
  )
  context[:gem_name] = 'aws-sdk-inspector'
  context[:gem_version] = '1.70.0'
  Seahorse::Client::Request.new(handlers, context)
end

#create_assessment_target(params = {}) ⇒ Types::CreateAssessmentTargetResponse

Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target. If the [service-linked role] isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account. For more information, see [ Amazon Inspector Assessment Targets].

[1]: docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html [2]: docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html

Examples:

Example: Create assessment target


# Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. You can
# create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account.

resp = client.create_assessment_target({
  assessment_target_name: "ExampleAssessmentTarget", 
  resource_group_arn: "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv", 
})

resp.to_h outputs the following:
{
  assessment_target_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX", 
}

Request syntax with placeholder values


resp = client.create_assessment_target({
  assessment_target_name: "AssessmentTargetName", # required
  resource_group_arn: "Arn",
})

Response structure


resp.assessment_target_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_target_name (required, String)

    The user-defined name that identifies the assessment target that you want to create. The name must be unique within the AWS account.

  • :resource_group_arn (String)

    The ARN that specifies the resource group that is used to create the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Returns:

See Also:



582
583
584
585
# File 'lib/aws-sdk-inspector/client.rb', line 582

def create_assessment_target(params = {}, options = {})
  req = build_request(:create_assessment_target, params)
  req.send_request(options)
end

#create_assessment_template(params = {}) ⇒ Types::CreateAssessmentTemplateResponse

Creates an assessment template for the assessment target that is specified by the ARN of the assessment target. If the [service-linked role] isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments.

[1]: docs.aws.amazon.com/inspector/latest/userguide/inspector_slr.html

Examples:

Example: Create assessment template


# Creates an assessment template for the assessment target that is specified by the ARN of the assessment target.

resp = client.create_assessment_template({
  assessment_target_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX", 
  assessment_template_name: "ExampleAssessmentTemplate", 
  duration_in_seconds: 180, 
  rules_package_arns: [
    "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-11B9DBXp", 
  ], 
  user_attributes_for_findings: [
    {
      key: "Example", 
      value: "example", 
    }, 
  ], 
})

resp.to_h outputs the following:
{
  assessment_template_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T", 
}

Request syntax with placeholder values


resp = client.create_assessment_template({
  assessment_target_arn: "Arn", # required
  assessment_template_name: "AssessmentTemplateName", # required
  duration_in_seconds: 1, # required
  rules_package_arns: ["Arn"], # required
  user_attributes_for_findings: [
    {
      key: "AttributeKey", # required
      value: "AttributeValue",
    },
  ],
})

Response structure


resp.assessment_template_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_target_arn (required, String)

    The ARN that specifies the assessment target for which you want to create the assessment template.

  • :assessment_template_name (required, String)

    The user-defined name that identifies the assessment template that you want to create. You can create several assessment templates for an assessment target. The names of the assessment templates that correspond to a particular assessment target must be unique.

  • :duration_in_seconds (required, Integer)

    The duration of the assessment run in seconds.

  • :rules_package_arns (required, Array<String>)

    The ARNs that specify the rules packages that you want to attach to the assessment template.

  • :user_attributes_for_findings (Array<Types::Attribute>)

    The user-defined attributes that are assigned to every finding that is generated by the assessment run that uses this assessment template. An attribute is a key and value pair (an Attribute object). Within an assessment template, each key must be unique.

Returns:

See Also:



672
673
674
675
# File 'lib/aws-sdk-inspector/client.rb', line 672

def create_assessment_template(params = {}, options = {})
  req = build_request(:create_assessment_template, params)
  req.send_request(options)
end

#create_exclusions_preview(params = {}) ⇒ Types::CreateExclusionsPreviewResponse

Starts the generation of an exclusions preview for the specified assessment template. The exclusions preview lists the potential exclusions (ExclusionPreview) that Inspector can detect before it runs the assessment.

Examples:

Request syntax with placeholder values


resp = client.create_exclusions_preview({
  assessment_template_arn: "Arn", # required
})

Response structure


resp.preview_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_template_arn (required, String)

    The ARN that specifies the assessment template for which you want to create an exclusions preview.

Returns:

See Also:



704
705
706
707
# File 'lib/aws-sdk-inspector/client.rb', line 704

def create_exclusions_preview(params = {}, options = {})
  req = build_request(:create_exclusions_preview, params)
  req.send_request(options)
end

#create_resource_group(params = {}) ⇒ Types::CreateResourceGroupResponse

Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon Inspector assessment target. For more information, see CreateAssessmentTarget.

Examples:

Example: Create resource group


# Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2 instances
# to be included in an Amazon Inspector assessment target. The created resource group is then used to create an Amazon
# Inspector assessment target. 

resp = client.create_resource_group({
  resource_group_tags: [
    {
      key: "Name", 
      value: "example", 
    }, 
  ], 
})

resp.to_h outputs the following:
{
  resource_group_arn: "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-AB6DMKnv", 
}

Request syntax with placeholder values


resp = client.create_resource_group({
  resource_group_tags: [ # required
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Response structure


resp.resource_group_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

Returns:

See Also:



766
767
768
769
# File 'lib/aws-sdk-inspector/client.rb', line 766

def create_resource_group(params = {}, options = {})
  req = build_request(:create_resource_group, params)
  req.send_request(options)
end

#delete_assessment_run(params = {}) ⇒ Struct

Deletes the assessment run that is specified by the ARN of the assessment run.

Examples:

Example: Delete assessment run


# Deletes the assessment run that is specified by the ARN of the assessment run.

resp = client.delete_assessment_run({
  assessment_run_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe", 
})

Request syntax with placeholder values


resp = client.delete_assessment_run({
  assessment_run_arn: "Arn", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arn (required, String)

    The ARN that specifies the assessment run that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



798
799
800
801
# File 'lib/aws-sdk-inspector/client.rb', line 798

def delete_assessment_run(params = {}, options = {})
  req = build_request(:delete_assessment_run, params)
  req.send_request(options)
end

#delete_assessment_target(params = {}) ⇒ Struct

Deletes the assessment target that is specified by the ARN of the assessment target.

Examples:

Example: Delete assessment target


# Deletes the assessment target that is specified by the ARN of the assessment target.

resp = client.delete_assessment_target({
  assessment_target_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", 
})

Request syntax with placeholder values


resp = client.delete_assessment_target({
  assessment_target_arn: "Arn", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_target_arn (required, String)

    The ARN that specifies the assessment target that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



830
831
832
833
# File 'lib/aws-sdk-inspector/client.rb', line 830

def delete_assessment_target(params = {}, options = {})
  req = build_request(:delete_assessment_target, params)
  req.send_request(options)
end

#delete_assessment_template(params = {}) ⇒ Struct

Deletes the assessment template that is specified by the ARN of the assessment template.

Examples:

Example: Delete assessment template


# Deletes the assessment template that is specified by the ARN of the assessment template.

resp = client.delete_assessment_template({
  assessment_template_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T", 
})

Request syntax with placeholder values


resp = client.delete_assessment_template({
  assessment_template_arn: "Arn", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_template_arn (required, String)

    The ARN that specifies the assessment template that you want to delete.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



863
864
865
866
# File 'lib/aws-sdk-inspector/client.rb', line 863

def delete_assessment_template(params = {}, options = {})
  req = build_request(:delete_assessment_template, params)
  req.send_request(options)
end

#describe_assessment_runs(params = {}) ⇒ Types::DescribeAssessmentRunsResponse

Describes the assessment runs that are specified by the ARNs of the assessment runs.

Examples:

Example: Describte assessment runs


# Describes the assessment runs that are specified by the ARNs of the assessment runs.

resp = client.describe_assessment_runs({
  assessment_run_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
  ], 
})

resp.to_h outputs the following:
{
  assessment_runs: [
    {
      name: "Run 1 for ExampleAssessmentTemplate", 
      arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
      assessment_template_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", 
      completed_at: Time.parse("1458680301.4"), 
      created_at: Time.parse("1458680170.035"), 
      data_collected: true, 
      duration_in_seconds: 3600, 
      finding_counts: {
        "High" => 14, 
        "Informational" => 0, 
        "Low" => 0, 
        "Medium" => 2, 
        "Undefined" => 0, 
      }, 
      notifications: [
      ], 
      rules_package_arns: [
        "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP", 
      ], 
      started_at: Time.parse("1458680170.161"), 
      state: "COMPLETED", 
      state_changed_at: Time.parse("1458680301.4"), 
      state_changes: [
        {
          state: "CREATED", 
          state_changed_at: Time.parse("1458680170.035"), 
        }, 
        {
          state: "START_DATA_COLLECTION_PENDING", 
          state_changed_at: Time.parse("1458680170.065"), 
        }, 
        {
          state: "START_DATA_COLLECTION_IN_PROGRESS", 
          state_changed_at: Time.parse("1458680170.096"), 
        }, 
        {
          state: "COLLECTING_DATA", 
          state_changed_at: Time.parse("1458680170.161"), 
        }, 
        {
          state: "STOP_DATA_COLLECTION_PENDING", 
          state_changed_at: Time.parse("1458680239.883"), 
        }, 
        {
          state: "DATA_COLLECTED", 
          state_changed_at: Time.parse("1458680299.847"), 
        }, 
        {
          state: "EVALUATING_RULES", 
          state_changed_at: Time.parse("1458680300.099"), 
        }, 
        {
          state: "COMPLETED", 
          state_changed_at: Time.parse("1458680301.4"), 
        }, 
      ], 
      user_attributes_for_findings: [
      ], 
    }, 
  ], 
  failed_items: {
  }, 
}

Request syntax with placeholder values


resp = client.describe_assessment_runs({
  assessment_run_arns: ["Arn"], # required
})

Response structure


resp.assessment_runs #=> Array
resp.assessment_runs[0].arn #=> String
resp.assessment_runs[0].name #=> String
resp.assessment_runs[0].assessment_template_arn #=> String
resp.assessment_runs[0].state #=> String, one of "CREATED", "START_DATA_COLLECTION_PENDING", "START_DATA_COLLECTION_IN_PROGRESS", "COLLECTING_DATA", "STOP_DATA_COLLECTION_PENDING", "DATA_COLLECTED", "START_EVALUATING_RULES_PENDING", "EVALUATING_RULES", "FAILED", "ERROR", "COMPLETED", "COMPLETED_WITH_ERRORS", "CANCELED"
resp.assessment_runs[0].duration_in_seconds #=> Integer
resp.assessment_runs[0].rules_package_arns #=> Array
resp.assessment_runs[0].rules_package_arns[0] #=> String
resp.assessment_runs[0].user_attributes_for_findings #=> Array
resp.assessment_runs[0].user_attributes_for_findings[0].key #=> String
resp.assessment_runs[0].user_attributes_for_findings[0].value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.assessment_runs[0].created_at #=> Time
resp.assessment_runs[0].started_at #=> Time
resp.assessment_runs[0].completed_at #=> Time
resp.assessment_runs[0].state_changed_at #=> Time
resp.assessment_runs[0].data_collected #=> Boolean
resp.assessment_runs[0].state_changes #=> Array
resp.assessment_runs[0].state_changes[0].state_changed_at #=> Time
resp.assessment_runs[0].state_changes[0].state #=> String, one of "CREATED", "START_DATA_COLLECTION_PENDING", "START_DATA_COLLECTION_IN_PROGRESS", "COLLECTING_DATA", "STOP_DATA_COLLECTION_PENDING", "DATA_COLLECTED", "START_EVALUATING_RULES_PENDING", "EVALUATING_RULES", "FAILED", "ERROR", "COMPLETED", "COMPLETED_WITH_ERRORS", "CANCELED"
resp.assessment_runs[0].notifications #=> Array
resp.assessment_runs[0].notifications[0].date #=> Time
resp.assessment_runs[0].notifications[0].event #=> String, one of "ASSESSMENT_RUN_STARTED", "ASSESSMENT_RUN_COMPLETED", "ASSESSMENT_RUN_STATE_CHANGED", "FINDING_REPORTED", "OTHER"
resp.assessment_runs[0].notifications[0].message #=> String
resp.assessment_runs[0].notifications[0].error #=> Boolean
resp.assessment_runs[0].notifications[0].sns_topic_arn #=> String
resp.assessment_runs[0].notifications[0].sns_publish_status_code #=> String, one of "SUCCESS", "TOPIC_DOES_NOT_EXIST", "ACCESS_DENIED", "INTERNAL_ERROR"
resp.assessment_runs[0].finding_counts #=> Hash
resp.assessment_runs[0].finding_counts["Severity"] #=> Integer
resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arns (required, Array<String>)

    The ARN that specifies the assessment run that you want to describe.

Returns:

See Also:



1002
1003
1004
1005
# File 'lib/aws-sdk-inspector/client.rb', line 1002

def describe_assessment_runs(params = {}, options = {})
  req = build_request(:describe_assessment_runs, params)
  req.send_request(options)
end

#describe_assessment_targets(params = {}) ⇒ Types::DescribeAssessmentTargetsResponse

Describes the assessment targets that are specified by the ARNs of the assessment targets.

Examples:

Example: Describte assessment targets


# Describes the assessment targets that are specified by the ARNs of the assessment targets.

resp = client.describe_assessment_targets({
  assessment_target_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", 
  ], 
})

resp.to_h outputs the following:
{
  assessment_targets: [
    {
      name: "ExampleAssessmentTarget", 
      arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", 
      created_at: Time.parse("1458074191.459"), 
      resource_group_arn: "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI", 
      updated_at: Time.parse("1458074191.459"), 
    }, 
  ], 
  failed_items: {
  }, 
}

Request syntax with placeholder values


resp = client.describe_assessment_targets({
  assessment_target_arns: ["Arn"], # required
})

Response structure


resp.assessment_targets #=> Array
resp.assessment_targets[0].arn #=> String
resp.assessment_targets[0].name #=> String
resp.assessment_targets[0].resource_group_arn #=> String
resp.assessment_targets[0].created_at #=> Time
resp.assessment_targets[0].updated_at #=> Time
resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_target_arns (required, Array<String>)

    The ARNs that specifies the assessment targets that you want to describe.

Returns:

See Also:



1067
1068
1069
1070
# File 'lib/aws-sdk-inspector/client.rb', line 1067

def describe_assessment_targets(params = {}, options = {})
  req = build_request(:describe_assessment_targets, params)
  req.send_request(options)
end

#describe_assessment_templates(params = {}) ⇒ Types::DescribeAssessmentTemplatesResponse

Describes the assessment templates that are specified by the ARNs of the assessment templates.

Examples:

Example: Describte assessment templates


# Describes the assessment templates that are specified by the ARNs of the assessment templates.

resp = client.describe_assessment_templates({
  assessment_template_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", 
  ], 
})

resp.to_h outputs the following:
{
  assessment_templates: [
    {
      name: "ExampleAssessmentTemplate", 
      arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", 
      assessment_run_count: 0, 
      assessment_target_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", 
      created_at: Time.parse("1458074191.844"), 
      duration_in_seconds: 3600, 
      rules_package_arns: [
        "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP", 
      ], 
      user_attributes_for_findings: [
      ], 
    }, 
  ], 
  failed_items: {
  }, 
}

Request syntax with placeholder values


resp = client.describe_assessment_templates({
  assessment_template_arns: ["Arn"], # required
})

Response structure


resp.assessment_templates #=> Array
resp.assessment_templates[0].arn #=> String
resp.assessment_templates[0].name #=> String
resp.assessment_templates[0].assessment_target_arn #=> String
resp.assessment_templates[0].duration_in_seconds #=> Integer
resp.assessment_templates[0].rules_package_arns #=> Array
resp.assessment_templates[0].rules_package_arns[0] #=> String
resp.assessment_templates[0].user_attributes_for_findings #=> Array
resp.assessment_templates[0].user_attributes_for_findings[0].key #=> String
resp.assessment_templates[0].user_attributes_for_findings[0].value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.assessment_templates[0].last_assessment_run_arn #=> String
resp.assessment_templates[0].assessment_run_count #=> Integer
resp.assessment_templates[0].created_at #=> Time
resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_template_arns (required, Array<String>)

Returns:

See Also:



1143
1144
1145
1146
# File 'lib/aws-sdk-inspector/client.rb', line 1143

def describe_assessment_templates(params = {}, options = {})
  req = build_request(:describe_assessment_templates, params)
  req.send_request(options)
end

#describe_cross_account_access_role(params = {}) ⇒ Types::DescribeCrossAccountAccessRoleResponse

Describes the IAM role that enables Amazon Inspector to access your AWS account.

Examples:

Example: Describte cross account access role


# Describes the IAM role that enables Amazon Inspector to access your AWS account.

resp = client.({
})

resp.to_h outputs the following:
{
  registered_at: Time.parse("1458069182.826"), 
  role_arn: "arn:aws:iam::123456789012:role/inspector", 
  valid: true, 
}

Response structure


resp.role_arn #=> String
resp.valid #=> Boolean
resp.registered_at #=> Time

Parameters:

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

    ({})

Returns:

See Also:



1182
1183
1184
1185
# File 'lib/aws-sdk-inspector/client.rb', line 1182

def (params = {}, options = {})
  req = build_request(:describe_cross_account_access_role, params)
  req.send_request(options)
end

#describe_exclusions(params = {}) ⇒ Types::DescribeExclusionsResponse

Describes the exclusions that are specified by the exclusions’ ARNs.

Examples:

Request syntax with placeholder values


resp = client.describe_exclusions({
  exclusion_arns: ["Arn"], # required
  locale: "EN_US", # accepts EN_US
})

Response structure


resp.exclusions #=> Hash
resp.exclusions["Arn"].arn #=> String
resp.exclusions["Arn"].title #=> String
resp.exclusions["Arn"].description #=> String
resp.exclusions["Arn"].recommendation #=> String
resp.exclusions["Arn"].scopes #=> Array
resp.exclusions["Arn"].scopes[0].key #=> String, one of "INSTANCE_ID", "RULES_PACKAGE_ARN"
resp.exclusions["Arn"].scopes[0].value #=> String
resp.exclusions["Arn"].attributes #=> Array
resp.exclusions["Arn"].attributes[0].key #=> String
resp.exclusions["Arn"].attributes[0].value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :exclusion_arns (required, Array<String>)

    The list of ARNs that specify the exclusions that you want to describe.

  • :locale (String)

    The locale into which you want to translate the exclusion’s title, description, and recommendation.

Returns:

See Also:



1230
1231
1232
1233
# File 'lib/aws-sdk-inspector/client.rb', line 1230

def describe_exclusions(params = {}, options = {})
  req = build_request(:describe_exclusions, params)
  req.send_request(options)
end

#describe_findings(params = {}) ⇒ Types::DescribeFindingsResponse

Describes the findings that are specified by the ARNs of the findings.

Examples:

Example: Describe findings


# Describes the findings that are specified by the ARNs of the findings.

resp = client.describe_findings({
  finding_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4", 
  ], 
})

resp.to_h outputs the following:
{
  failed_items: {
  }, 
  findings: [
    {
      arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4", 
      asset_attributes: {
        ipv4_addresses: [
        ], 
        schema_version: 1, 
      }, 
      asset_type: "ec2-instance", 
      attributes: [
      ], 
      confidence: 10, 
      created_at: Time.parse("1458680301.37"), 
      description: "Amazon Inspector did not find any potential security issues during this assessment.", 
      indicator_of_compromise: false, 
      numeric_severity: 0, 
      recommendation: "No remediation needed.", 
      schema_version: 1, 
      service: "Inspector", 
      service_attributes: {
        assessment_run_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
        rules_package_arn: "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-X1KXtawP", 
        schema_version: 1, 
      }, 
      severity: "Informational", 
      title: "No potential security issues found", 
      updated_at: Time.parse("1458680301.37"), 
      user_attributes: [
      ], 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_findings({
  finding_arns: ["Arn"], # required
  locale: "EN_US", # accepts EN_US
})

Response structure


resp.findings #=> Array
resp.findings[0].arn #=> String
resp.findings[0].schema_version #=> Integer
resp.findings[0].service #=> String
resp.findings[0].service_attributes.schema_version #=> Integer
resp.findings[0].service_attributes.assessment_run_arn #=> String
resp.findings[0].service_attributes.rules_package_arn #=> String
resp.findings[0].asset_type #=> String, one of "ec2-instance"
resp.findings[0].asset_attributes.schema_version #=> Integer
resp.findings[0].asset_attributes.agent_id #=> String
resp.findings[0].asset_attributes.auto_scaling_group #=> String
resp.findings[0].asset_attributes.ami_id #=> String
resp.findings[0].asset_attributes.hostname #=> String
resp.findings[0].asset_attributes.ipv4_addresses #=> Array
resp.findings[0].asset_attributes.ipv4_addresses[0] #=> String
resp.findings[0].asset_attributes.tags #=> Array
resp.findings[0].asset_attributes.tags[0].key #=> String
resp.findings[0].asset_attributes.tags[0].value #=> String
resp.findings[0].asset_attributes.network_interfaces #=> Array
resp.findings[0].asset_attributes.network_interfaces[0].network_interface_id #=> String
resp.findings[0].asset_attributes.network_interfaces[0].subnet_id #=> String
resp.findings[0].asset_attributes.network_interfaces[0].vpc_id #=> String
resp.findings[0].asset_attributes.network_interfaces[0].private_dns_name #=> String
resp.findings[0].asset_attributes.network_interfaces[0].private_ip_address #=> String
resp.findings[0].asset_attributes.network_interfaces[0].private_ip_addresses #=> Array
resp.findings[0].asset_attributes.network_interfaces[0].private_ip_addresses[0].private_dns_name #=> String
resp.findings[0].asset_attributes.network_interfaces[0].private_ip_addresses[0].private_ip_address #=> String
resp.findings[0].asset_attributes.network_interfaces[0].public_dns_name #=> String
resp.findings[0].asset_attributes.network_interfaces[0].public_ip #=> String
resp.findings[0].asset_attributes.network_interfaces[0].ipv6_addresses #=> Array
resp.findings[0].asset_attributes.network_interfaces[0].ipv6_addresses[0] #=> String
resp.findings[0].asset_attributes.network_interfaces[0].security_groups #=> Array
resp.findings[0].asset_attributes.network_interfaces[0].security_groups[0].group_name #=> String
resp.findings[0].asset_attributes.network_interfaces[0].security_groups[0].group_id #=> String
resp.findings[0].id #=> String
resp.findings[0].title #=> String
resp.findings[0].description #=> String
resp.findings[0].recommendation #=> String
resp.findings[0].severity #=> String, one of "Low", "Medium", "High", "Informational", "Undefined"
resp.findings[0].numeric_severity #=> Float
resp.findings[0].confidence #=> Integer
resp.findings[0].indicator_of_compromise #=> Boolean
resp.findings[0].attributes #=> Array
resp.findings[0].attributes[0].key #=> String
resp.findings[0].attributes[0].value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.findings[0].user_attributes #=> Array
resp.findings[0].user_attributes[0].key #=> String
resp.findings[0].user_attributes[0].value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.findings[0].created_at #=> Time
resp.findings[0].updated_at #=> Time
resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :finding_arns (required, Array<String>)

    The ARN that specifies the finding that you want to describe.

  • :locale (String)

    The locale into which you want to translate a finding description, recommendation, and the short description that identifies the finding.

Returns:

See Also:



1364
1365
1366
1367
# File 'lib/aws-sdk-inspector/client.rb', line 1364

def describe_findings(params = {}, options = {})
  req = build_request(:describe_findings, params)
  req.send_request(options)
end

#describe_resource_groups(params = {}) ⇒ Types::DescribeResourceGroupsResponse

Describes the resource groups that are specified by the ARNs of the resource groups.

Examples:

Example: Describe resource groups


# Describes the resource groups that are specified by the ARNs of the resource groups.

resp = client.describe_resource_groups({
  resource_group_arns: [
    "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI", 
  ], 
})

resp.to_h outputs the following:
{
  failed_items: {
  }, 
  resource_groups: [
    {
      arn: "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-PyGXopAI", 
      created_at: Time.parse("1458074191.098"), 
      tags: [
        {
          key: "Name", 
          value: "example", 
        }, 
      ], 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_resource_groups({
  resource_group_arns: ["Arn"], # required
})

Response structure


resp.resource_groups #=> Array
resp.resource_groups[0].arn #=> String
resp.resource_groups[0].tags #=> Array
resp.resource_groups[0].tags[0].key #=> String
resp.resource_groups[0].tags[0].value #=> String
resp.resource_groups[0].created_at #=> Time
resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :resource_group_arns (required, Array<String>)

    The ARN that specifies the resource group that you want to describe.

Returns:

See Also:



1431
1432
1433
1434
# File 'lib/aws-sdk-inspector/client.rb', line 1431

def describe_resource_groups(params = {}, options = {})
  req = build_request(:describe_resource_groups, params)
  req.send_request(options)
end

#describe_rules_packages(params = {}) ⇒ Types::DescribeRulesPackagesResponse

Describes the rules packages that are specified by the ARNs of the rules packages.

Examples:

Example: Describe rules packages


# Describes the rules packages that are specified by the ARNs of the rules packages.

resp = client.describe_rules_packages({
  rules_package_arns: [
    "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ", 
  ], 
})

resp.to_h outputs the following:
{
  failed_items: {
  }, 
  rules_packages: [
    {
      version: "1.1", 
      name: "Security Best Practices", 
      arn: "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ", 
      description: "The rules in this package help determine whether your systems are configured securely.", 
      provider: "Amazon Web Services, Inc.", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.describe_rules_packages({
  rules_package_arns: ["Arn"], # required
  locale: "EN_US", # accepts EN_US
})

Response structure


resp.rules_packages #=> Array
resp.rules_packages[0].arn #=> String
resp.rules_packages[0].name #=> String
resp.rules_packages[0].version #=> String
resp.rules_packages[0].provider #=> String
resp.rules_packages[0].description #=> String
resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :rules_package_arns (required, Array<String>)

    The ARN that specifies the rules package that you want to describe.

  • :locale (String)

    The locale that you want to translate a rules package description into.

Returns:

See Also:



1500
1501
1502
1503
# File 'lib/aws-sdk-inspector/client.rb', line 1500

def describe_rules_packages(params = {}, options = {})
  req = build_request(:describe_rules_packages, params)
  req.send_request(options)
end

#get_assessment_report(params = {}) ⇒ Types::GetAssessmentReportResponse

Produces an assessment report that includes detailed and comprehensive results of a specified assessment run.

Examples:

Request syntax with placeholder values


resp = client.get_assessment_report({
  assessment_run_arn: "Arn", # required
  report_file_format: "HTML", # required, accepts HTML, PDF
  report_type: "FINDING", # required, accepts FINDING, FULL
})

Response structure


resp.status #=> String, one of "WORK_IN_PROGRESS", "FAILED", "COMPLETED"
resp.url #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arn (required, String)

    The ARN that specifies the assessment run for which you want to generate a report.

  • :report_file_format (required, String)

    Specifies the file format (html or pdf) of the assessment report that you want to generate.

  • :report_type (required, String)

    Specifies the type of the assessment report that you want to generate. There are two types of assessment reports: a finding report and a full report. For more information, see [Assessment Reports].

    [1]: docs.aws.amazon.com/inspector/latest/userguide/inspector_reports.html

Returns:

See Also:



1547
1548
1549
1550
# File 'lib/aws-sdk-inspector/client.rb', line 1547

def get_assessment_report(params = {}, options = {})
  req = build_request(:get_assessment_report, params)
  req.send_request(options)
end

#get_exclusions_preview(params = {}) ⇒ Types::GetExclusionsPreviewResponse

Retrieves the exclusions preview (a list of ExclusionPreview objects) specified by the preview token. You can obtain the preview token by running the CreateExclusionsPreview API.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.get_exclusions_preview({
  assessment_template_arn: "Arn", # required
  preview_token: "UUID", # required
  next_token: "PaginationToken",
  max_results: 1,
  locale: "EN_US", # accepts EN_US
})

Response structure


resp.preview_status #=> String, one of "WORK_IN_PROGRESS", "COMPLETED"
resp.exclusion_previews #=> Array
resp.exclusion_previews[0].title #=> String
resp.exclusion_previews[0].description #=> String
resp.exclusion_previews[0].recommendation #=> String
resp.exclusion_previews[0].scopes #=> Array
resp.exclusion_previews[0].scopes[0].key #=> String, one of "INSTANCE_ID", "RULES_PACKAGE_ARN"
resp.exclusion_previews[0].scopes[0].value #=> String
resp.exclusion_previews[0].attributes #=> Array
resp.exclusion_previews[0].attributes[0].key #=> String
resp.exclusion_previews[0].attributes[0].value #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_template_arn (required, String)

    The ARN that specifies the assessment template for which the exclusions preview was requested.

  • :preview_token (required, String)

    The unique identifier associated of the exclusions preview.

  • :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 GetExclusionsPreviewRequest action. Subsequent calls to the action fill nextToken in the request with the value of nextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 100. The maximum value is 500.

  • :locale (String)

    The locale into which you want to translate the exclusion’s title, description, and recommendation.

Returns:

See Also:



1616
1617
1618
1619
# File 'lib/aws-sdk-inspector/client.rb', line 1616

def get_exclusions_preview(params = {}, options = {})
  req = build_request(:get_exclusions_preview, params)
  req.send_request(options)
end

#get_telemetry_metadata(params = {}) ⇒ Types::GetTelemetryMetadataResponse

Information about the data that is collected for the specified assessment run.

Examples:

Example: Get telemetry metadata


# Information about the data that is collected for the specified assessment run.

resp = client.({
  assessment_run_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
})

resp.to_h outputs the following:
{
  telemetry_metadata: [
    {
      count: 2, 
      data_size: 345, 
      message_type: "InspectorDuplicateProcess", 
    }, 
    {
      count: 3, 
      data_size: 255, 
      message_type: "InspectorTimeEventMsg", 
    }, 
    {
      count: 4, 
      data_size: 1082, 
      message_type: "InspectorNetworkInterface", 
    }, 
    {
      count: 2, 
      data_size: 349, 
      message_type: "InspectorDnsEntry", 
    }, 
    {
      count: 11, 
      data_size: 2514, 
      message_type: "InspectorDirectoryInfoMsg", 
    }, 
    {
      count: 1, 
      data_size: 179, 
      message_type: "InspectorTcpV6ListeningPort", 
    }, 
    {
      count: 101, 
      data_size: 10949, 
      message_type: "InspectorTerminal", 
    }, 
    {
      count: 26, 
      data_size: 5916, 
      message_type: "InspectorUser", 
    }, 
    {
      count: 282, 
      data_size: 32148, 
      message_type: "InspectorDynamicallyLoadedCodeModule", 
    }, 
    {
      count: 18, 
      data_size: 10172, 
      message_type: "InspectorCreateProcess", 
    }, 
    {
      count: 3, 
      data_size: 8001, 
      message_type: "InspectorProcessPerformance", 
    }, 
    {
      count: 1, 
      data_size: 360, 
      message_type: "InspectorOperatingSystem", 
    }, 
    {
      count: 6, 
      data_size: 546, 
      message_type: "InspectorStopProcess", 
    }, 
    {
      count: 1, 
      data_size: 1553, 
      message_type: "InspectorInstanceMetaData", 
    }, 
    {
      count: 2, 
      data_size: 434, 
      message_type: "InspectorTcpV4Connection", 
    }, 
    {
      count: 474, 
      data_size: 2960322, 
      message_type: "InspectorPackageInfo", 
    }, 
    {
      count: 3, 
      data_size: 2235, 
      message_type: "InspectorSystemPerformance", 
    }, 
    {
      count: 105, 
      data_size: 46048, 
      message_type: "InspectorCodeModule", 
    }, 
    {
      count: 1, 
      data_size: 182, 
      message_type: "InspectorUdpV6ListeningPort", 
    }, 
    {
      count: 2, 
      data_size: 371, 
      message_type: "InspectorUdpV4ListeningPort", 
    }, 
    {
      count: 18, 
      data_size: 8362, 
      message_type: "InspectorKernelModule", 
    }, 
    {
      count: 29, 
      data_size: 48788, 
      message_type: "InspectorConfigurationInfo", 
    }, 
    {
      count: 1, 
      data_size: 79, 
      message_type: "InspectorMonitoringStart", 
    }, 
    {
      count: 5, 
      data_size: 0, 
      message_type: "InspectorSplitMsgBegin", 
    }, 
    {
      count: 51, 
      data_size: 4593, 
      message_type: "InspectorGroup", 
    }, 
    {
      count: 1, 
      data_size: 184, 
      message_type: "InspectorTcpV4ListeningPort", 
    }, 
    {
      count: 1159, 
      data_size: 3146579, 
      message_type: "Total", 
    }, 
    {
      count: 5, 
      data_size: 0, 
      message_type: "InspectorSplitMsgEnd", 
    }, 
    {
      count: 1, 
      data_size: 612, 
      message_type: "InspectorLoadImageInProcess", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.({
  assessment_run_arn: "Arn", # required
})

Response structure


resp. #=> Array
resp.[0].message_type #=> String
resp.[0].count #=> Integer
resp.[0].data_size #=> Integer

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arn (required, String)

    The ARN that specifies the assessment run that has the telemetry data that you want to obtain.

Returns:

See Also:



1809
1810
1811
1812
# File 'lib/aws-sdk-inspector/client.rb', line 1809

def (params = {}, options = {})
  req = build_request(:get_telemetry_metadata, params)
  req.send_request(options)
end

#list_assessment_run_agents(params = {}) ⇒ Types::ListAssessmentRunAgentsResponse

Lists the agents of the assessment runs that are specified by the ARNs of the assessment runs.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: List assessment run agents


# Lists the agents of the assessment runs that are specified by the ARNs of the assessment runs.

resp = client.list_assessment_run_agents({
  assessment_run_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
  max_results: 123, 
})

resp.to_h outputs the following:
{
  assessment_run_agents: [
    {
      agent_health: "HEALTHY", 
      agent_health_code: "RUNNING", 
      agent_id: "i-49113b93", 
      assessment_run_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
      telemetry_metadata: [
        {
          count: 2, 
          data_size: 345, 
          message_type: "InspectorDuplicateProcess", 
        }, 
        {
          count: 3, 
          data_size: 255, 
          message_type: "InspectorTimeEventMsg", 
        }, 
        {
          count: 4, 
          data_size: 1082, 
          message_type: "InspectorNetworkInterface", 
        }, 
        {
          count: 2, 
          data_size: 349, 
          message_type: "InspectorDnsEntry", 
        }, 
        {
          count: 11, 
          data_size: 2514, 
          message_type: "InspectorDirectoryInfoMsg", 
        }, 
        {
          count: 1, 
          data_size: 179, 
          message_type: "InspectorTcpV6ListeningPort", 
        }, 
        {
          count: 101, 
          data_size: 10949, 
          message_type: "InspectorTerminal", 
        }, 
        {
          count: 26, 
          data_size: 5916, 
          message_type: "InspectorUser", 
        }, 
        {
          count: 282, 
          data_size: 32148, 
          message_type: "InspectorDynamicallyLoadedCodeModule", 
        }, 
        {
          count: 18, 
          data_size: 10172, 
          message_type: "InspectorCreateProcess", 
        }, 
        {
          count: 3, 
          data_size: 8001, 
          message_type: "InspectorProcessPerformance", 
        }, 
        {
          count: 1, 
          data_size: 360, 
          message_type: "InspectorOperatingSystem", 
        }, 
        {
          count: 6, 
          data_size: 546, 
          message_type: "InspectorStopProcess", 
        }, 
        {
          count: 1, 
          data_size: 1553, 
          message_type: "InspectorInstanceMetaData", 
        }, 
        {
          count: 2, 
          data_size: 434, 
          message_type: "InspectorTcpV4Connection", 
        }, 
        {
          count: 474, 
          data_size: 2960322, 
          message_type: "InspectorPackageInfo", 
        }, 
        {
          count: 3, 
          data_size: 2235, 
          message_type: "InspectorSystemPerformance", 
        }, 
        {
          count: 105, 
          data_size: 46048, 
          message_type: "InspectorCodeModule", 
        }, 
        {
          count: 1, 
          data_size: 182, 
          message_type: "InspectorUdpV6ListeningPort", 
        }, 
        {
          count: 2, 
          data_size: 371, 
          message_type: "InspectorUdpV4ListeningPort", 
        }, 
        {
          count: 18, 
          data_size: 8362, 
          message_type: "InspectorKernelModule", 
        }, 
        {
          count: 29, 
          data_size: 48788, 
          message_type: "InspectorConfigurationInfo", 
        }, 
        {
          count: 1, 
          data_size: 79, 
          message_type: "InspectorMonitoringStart", 
        }, 
        {
          count: 5, 
          data_size: 0, 
          message_type: "InspectorSplitMsgBegin", 
        }, 
        {
          count: 51, 
          data_size: 4593, 
          message_type: "InspectorGroup", 
        }, 
        {
          count: 1, 
          data_size: 184, 
          message_type: "InspectorTcpV4ListeningPort", 
        }, 
        {
          count: 1159, 
          data_size: 3146579, 
          message_type: "Total", 
        }, 
        {
          count: 5, 
          data_size: 0, 
          message_type: "InspectorSplitMsgEnd", 
        }, 
        {
          count: 1, 
          data_size: 612, 
          message_type: "InspectorLoadImageInProcess", 
        }, 
      ], 
    }, 
  ], 
  next_token: "1", 
}

Request syntax with placeholder values


resp = client.list_assessment_run_agents({
  assessment_run_arn: "Arn", # required
  filter: {
    agent_healths: ["HEALTHY"], # required, accepts HEALTHY, UNHEALTHY, UNKNOWN
    agent_health_codes: ["IDLE"], # required, accepts IDLE, RUNNING, SHUTDOWN, UNHEALTHY, THROTTLED, UNKNOWN
  },
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.assessment_run_agents #=> Array
resp.assessment_run_agents[0].agent_id #=> String
resp.assessment_run_agents[0].assessment_run_arn #=> String
resp.assessment_run_agents[0].agent_health #=> String, one of "HEALTHY", "UNHEALTHY", "UNKNOWN"
resp.assessment_run_agents[0].agent_health_code #=> String, one of "IDLE", "RUNNING", "SHUTDOWN", "UNHEALTHY", "THROTTLED", "UNKNOWN"
resp.assessment_run_agents[0].agent_health_details #=> String
resp.assessment_run_agents[0].auto_scaling_group #=> String
resp.assessment_run_agents[0]. #=> Array
resp.assessment_run_agents[0].[0].message_type #=> String
resp.assessment_run_agents[0].[0].count #=> Integer
resp.assessment_run_agents[0].[0].data_size #=> Integer
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arn (required, String)

    The ARN that specifies the assessment run whose agents you want to list.

  • :filter (Types::AgentFilter)

    You can use this parameter to specify a subset of data to be included in the action’s response.

    For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.

  • :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 ListAssessmentRunAgents action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2049
2050
2051
2052
# File 'lib/aws-sdk-inspector/client.rb', line 2049

def list_assessment_run_agents(params = {}, options = {})
  req = build_request(:list_assessment_run_agents, params)
  req.send_request(options)
end

#list_assessment_runs(params = {}) ⇒ Types::ListAssessmentRunsResponse

Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment templates.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: List assessment runs


# Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the assessment
# templates.

resp = client.list_assessment_runs({
  assessment_template_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", 
  ], 
  max_results: 123, 
})

resp.to_h outputs the following:
{
  assessment_run_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v", 
  ], 
  next_token: "1", 
}

Request syntax with placeholder values


resp = client.list_assessment_runs({
  assessment_template_arns: ["Arn"],
  filter: {
    name_pattern: "NamePattern",
    states: ["CREATED"], # accepts CREATED, START_DATA_COLLECTION_PENDING, START_DATA_COLLECTION_IN_PROGRESS, COLLECTING_DATA, STOP_DATA_COLLECTION_PENDING, DATA_COLLECTED, START_EVALUATING_RULES_PENDING, EVALUATING_RULES, FAILED, ERROR, COMPLETED, COMPLETED_WITH_ERRORS, CANCELED
    duration_range: {
      min_seconds: 1,
      max_seconds: 1,
    },
    rules_package_arns: ["Arn"],
    start_time_range: {
      begin_date: Time.now,
      end_date: Time.now,
    },
    completion_time_range: {
      begin_date: Time.now,
      end_date: Time.now,
    },
    state_change_time_range: {
      begin_date: Time.now,
      end_date: Time.now,
    },
  },
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_template_arns (Array<String>)

    The ARNs that specify the assessment templates whose assessment runs you want to list.

  • :filter (Types::AssessmentRunFilter)

    You can use this parameter to specify a subset of data to be included in the action’s response.

    For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.

  • :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 ListAssessmentRuns action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items that you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2149
2150
2151
2152
# File 'lib/aws-sdk-inspector/client.rb', line 2149

def list_assessment_runs(params = {}, options = {})
  req = build_request(:list_assessment_runs, params)
  req.send_request(options)
end

#list_assessment_targets(params = {}) ⇒ Types::ListAssessmentTargetsResponse

Lists the ARNs of the assessment targets within this AWS account. For more information about assessment targets, see [Amazon Inspector Assessment Targets].

[1]: docs.aws.amazon.com/inspector/latest/userguide/inspector_applications.html

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: List assessment targets


# Lists the ARNs of the assessment targets within this AWS account. 

resp = client.list_assessment_targets({
  max_results: 123, 
})

resp.to_h outputs the following:
{
  assessment_target_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", 
  ], 
  next_token: "1", 
}

Request syntax with placeholder values


resp = client.list_assessment_targets({
  filter: {
    assessment_target_name_pattern: "NamePattern",
  },
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :filter (Types::AssessmentTargetFilter)

    You can use this parameter to specify a subset of data to be included in the action’s response.

    For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.

  • :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 ListAssessmentTargets action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2226
2227
2228
2229
# File 'lib/aws-sdk-inspector/client.rb', line 2226

def list_assessment_targets(params = {}, options = {})
  req = build_request(:list_assessment_targets, params)
  req.send_request(options)
end

#list_assessment_templates(params = {}) ⇒ Types::ListAssessmentTemplatesResponse

Lists the assessment templates that correspond to the assessment targets that are specified by the ARNs of the assessment targets.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: List assessment templates


# Lists the assessment templates that correspond to the assessment targets that are specified by the ARNs of the
# assessment targets.

resp = client.list_assessment_templates({
  assessment_target_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", 
  ], 
  max_results: 123, 
})

resp.to_h outputs the following:
{
  assessment_template_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw", 
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-Uza6ihLh", 
  ], 
  next_token: "1", 
}

Request syntax with placeholder values


resp = client.list_assessment_templates({
  assessment_target_arns: ["Arn"],
  filter: {
    name_pattern: "NamePattern",
    duration_range: {
      min_seconds: 1,
      max_seconds: 1,
    },
    rules_package_arns: ["Arn"],
  },
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_target_arns (Array<String>)

    A list of ARNs that specifies the assessment targets whose assessment templates you want to list.

  • :filter (Types::AssessmentTemplateFilter)

    You can use this parameter to specify a subset of data to be included in the action’s response.

    For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.

  • :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 ListAssessmentTemplates action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2313
2314
2315
2316
# File 'lib/aws-sdk-inspector/client.rb', line 2313

def list_assessment_templates(params = {}, options = {})
  req = build_request(:list_assessment_templates, params)
  req.send_request(options)
end

#list_event_subscriptions(params = {}) ⇒ Types::ListEventSubscriptionsResponse

Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template. For more information, see SubscribeToEvent and UnsubscribeFromEvent.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: List event subscriptions


# Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment template. 

resp = client.list_event_subscriptions({
  max_results: 123, 
  resource_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0", 
})

resp.to_h outputs the following:
{
  next_token: "1", 
  subscriptions: [
    {
      event_subscriptions: [
        {
          event: "ASSESSMENT_RUN_COMPLETED", 
          subscribed_at: Time.parse("1459455440.867"), 
        }, 
      ], 
      resource_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0", 
      topic_arn: "arn:aws:sns:us-west-2:123456789012:exampletopic", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.list_event_subscriptions({
  resource_arn: "Arn",
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.subscriptions #=> Array
resp.subscriptions[0].resource_arn #=> String
resp.subscriptions[0].topic_arn #=> String
resp.subscriptions[0].event_subscriptions #=> Array
resp.subscriptions[0].event_subscriptions[0].event #=> String, one of "ASSESSMENT_RUN_STARTED", "ASSESSMENT_RUN_COMPLETED", "ASSESSMENT_RUN_STATE_CHANGED", "FINDING_REPORTED", "OTHER"
resp.subscriptions[0].event_subscriptions[0].subscribed_at #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (String)

    The ARN of the assessment template for which you want to list the existing event subscriptions.

  • :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 ListEventSubscriptions action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2394
2395
2396
2397
# File 'lib/aws-sdk-inspector/client.rb', line 2394

def list_event_subscriptions(params = {}, options = {})
  req = build_request(:list_event_subscriptions, params)
  req.send_request(options)
end

#list_exclusions(params = {}) ⇒ Types::ListExclusionsResponse

List exclusions that are generated by the assessment run.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Request syntax with placeholder values


resp = client.list_exclusions({
  assessment_run_arn: "Arn", # required
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arn (required, String)

    The ARN of the assessment run that generated the exclusions that you want to list.

  • :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 ListExclusionsRequest action. Subsequent calls to the action fill nextToken in the request with the value of nextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 100. The maximum value is 500.

Returns:

See Also:



2442
2443
2444
2445
# File 'lib/aws-sdk-inspector/client.rb', line 2442

def list_exclusions(params = {}, options = {})
  req = build_request(:list_exclusions, params)
  req.send_request(options)
end

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

Lists findings that are generated by the assessment runs that are specified by the ARNs of the assessment runs.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: List findings


# Lists findings that are generated by the assessment runs that are specified by the ARNs of the assessment runs.

resp = client.list_findings({
  assessment_run_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE", 
  ], 
  max_results: 123, 
})

resp.to_h outputs the following:
{
  finding_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-MKkpXXPE/finding/0-HwPnsDm4", 
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-4r1V2mAw/run/0-v5D6fI3v/finding/0-tyvmqBLy", 
  ], 
  next_token: "1", 
}

Request syntax with placeholder values


resp = client.list_findings({
  assessment_run_arns: ["Arn"],
  filter: {
    agent_ids: ["AgentId"],
    auto_scaling_groups: ["AutoScalingGroup"],
    rule_names: ["RuleName"],
    severities: ["Low"], # accepts Low, Medium, High, Informational, Undefined
    rules_package_arns: ["Arn"],
    attributes: [
      {
        key: "AttributeKey", # required
        value: "AttributeValue",
      },
    ],
    user_attributes: [
      {
        key: "AttributeKey", # required
        value: "AttributeValue",
      },
    ],
    creation_time_range: {
      begin_date: Time.now,
      end_date: Time.now,
    },
  },
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arns (Array<String>)

    The ARNs of the assessment runs that generate the findings that you want to list.

  • :filter (Types::FindingFilter)

    You can use this parameter to specify a subset of data to be included in the action’s response.

    For a record to match a filter, all specified filter attributes must match. When multiple values are specified for a filter attribute, any of the values can match.

  • :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. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2543
2544
2545
2546
# File 'lib/aws-sdk-inspector/client.rb', line 2543

def list_findings(params = {}, options = {})
  req = build_request(:list_findings, params)
  req.send_request(options)
end

#list_rules_packages(params = {}) ⇒ Types::ListRulesPackagesResponse

Lists all available Amazon Inspector rules packages.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: List rules packages


# Lists all available Amazon Inspector rules packages.

resp = client.list_rules_packages({
  max_results: 123, 
})

resp.to_h outputs the following:
{
  next_token: "1", 
  rules_package_arns: [
    "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-9hgA516p", 
    "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-H5hpSawc", 
    "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-JJOtZiqQ", 
    "arn:aws:inspector:us-west-2:758058086616:rulespackage/0-vg5GGHSD", 
  ], 
}

Request syntax with placeholder values


resp = client.list_rules_packages({
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :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 ListRulesPackages action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2606
2607
2608
2609
# File 'lib/aws-sdk-inspector/client.rb', line 2606

def list_rules_packages(params = {}, options = {})
  req = build_request(:list_rules_packages, params)
  req.send_request(options)
end

#list_tags_for_resource(params = {}) ⇒ Types::ListTagsForResourceResponse

Lists all tags associated with an assessment template.

Examples:

Example: List tags for resource


# Lists all tags associated with an assessment template.

resp = client.list_tags_for_resource({
  resource_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-gcwFliYu", 
})

resp.to_h outputs the following:
{
  tags: [
    {
      key: "Name", 
      value: "Example", 
    }, 
  ], 
}

Request syntax with placeholder values


resp = client.list_tags_for_resource({
  resource_arn: "Arn", # required
})

Response structure


resp.tags #=> Array
resp.tags[0].key #=> String
resp.tags[0].value #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The ARN that specifies the assessment template whose tags you want to list.

Returns:

See Also:



2656
2657
2658
2659
# File 'lib/aws-sdk-inspector/client.rb', line 2656

def list_tags_for_resource(params = {}, options = {})
  req = build_request(:list_tags_for_resource, params)
  req.send_request(options)
end

#preview_agents(params = {}) ⇒ Types::PreviewAgentsResponse

Previews the agents installed on the EC2 instances that are part of the specified assessment target.

The returned response is a pageable response and is Enumerable. For details on usage see PageableResponse.

Examples:

Example: Preview agents


# Previews the agents installed on the EC2 instances that are part of the specified assessment target.

resp = client.preview_agents({
  max_results: 123, 
  preview_agents_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq", 
})

resp.to_h outputs the following:
{
  agent_previews: [
    {
      agent_id: "i-49113b93", 
    }, 
  ], 
  next_token: "1", 
}

Request syntax with placeholder values


resp = client.preview_agents({
  preview_agents_arn: "Arn", # required
  next_token: "PaginationToken",
  max_results: 1,
})

Response structure


resp.agent_previews #=> Array
resp.agent_previews[0].hostname #=> String
resp.agent_previews[0].agent_id #=> String
resp.agent_previews[0].auto_scaling_group #=> String
resp.agent_previews[0].agent_health #=> String, one of "HEALTHY", "UNHEALTHY", "UNKNOWN"
resp.agent_previews[0].agent_version #=> String
resp.agent_previews[0].operating_system #=> String
resp.agent_previews[0].kernel_version #=> String
resp.agent_previews[0].ipv4_address #=> String
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :preview_agents_arn (required, String)

    The ARN of the assessment target whose agents you want to preview.

  • :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 PreviewAgents action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

  • :max_results (Integer)

    You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Returns:

See Also:



2731
2732
2733
2734
# File 'lib/aws-sdk-inspector/client.rb', line 2731

def preview_agents(params = {}, options = {})
  req = build_request(:preview_agents, params)
  req.send_request(options)
end

#register_cross_account_access_role(params = {}) ⇒ Struct

Registers the IAM role that grants Amazon Inspector access to AWS Services needed to perform security assessments.

Examples:

Example: Register cross account access role


# Registers the IAM role that Amazon Inspector uses to list your EC2 instances at the start of the assessment run or when
# you call the PreviewAgents action.

resp = client.({
  role_arn: "arn:aws:iam::123456789012:role/inspector", 
})

Request syntax with placeholder values


resp = client.({
  role_arn: "Arn", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :role_arn (required, String)

    The ARN of the IAM role that grants Amazon Inspector access to AWS Services needed to perform security assessments.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2765
2766
2767
2768
# File 'lib/aws-sdk-inspector/client.rb', line 2765

def (params = {}, options = {})
  req = build_request(:register_cross_account_access_role, params)
  req.send_request(options)
end

#remove_attributes_from_findings(params = {}) ⇒ Types::RemoveAttributesFromFindingsResponse

Removes entire attributes (key and value pairs) from the findings that are specified by the ARNs of the findings where an attribute with the specified key exists.

Examples:

Example: Remove attributes from findings


# Removes entire attributes (key and value pairs) from the findings that are specified by the ARNs of the findings where
# an attribute with the specified key exists.

resp = client.remove_attributes_from_findings({
  attribute_keys: [
    "key=Example,value=example", 
  ], 
  finding_arns: [
    "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU", 
  ], 
})

resp.to_h outputs the following:
{
  failed_items: {
  }, 
}

Request syntax with placeholder values


resp = client.remove_attributes_from_findings({
  finding_arns: ["Arn"], # required
  attribute_keys: ["AttributeKey"], # required
})

Response structure


resp.failed_items #=> Hash
resp.failed_items["Arn"].failure_code #=> String, one of "INVALID_ARN", "DUPLICATE_ARN", "ITEM_DOES_NOT_EXIST", "ACCESS_DENIED", "LIMIT_EXCEEDED", "INTERNAL_ERROR"
resp.failed_items["Arn"].retryable #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :finding_arns (required, Array<String>)

    The ARNs that specify the findings that you want to remove attributes from.

  • :attribute_keys (required, Array<String>)

    The array of attribute keys that you want to remove from specified findings.

Returns:

See Also:



2824
2825
2826
2827
# File 'lib/aws-sdk-inspector/client.rb', line 2824

def remove_attributes_from_findings(params = {}, options = {})
  req = build_request(:remove_attributes_from_findings, params)
  req.send_request(options)
end

#set_tags_for_resource(params = {}) ⇒ Struct

Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.

Examples:

Example: Set tags for resource


# Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment template.

resp = client.set_tags_for_resource({
  resource_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0", 
  tags: [
    {
      key: "Example", 
      value: "example", 
    }, 
  ], 
})

Request syntax with placeholder values


resp = client.set_tags_for_resource({
  resource_arn: "Arn", # required
  tags: [
    {
      key: "TagKey", # required
      value: "TagValue",
    },
  ],
})

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The ARN of the assessment template that you want to set tags to.

  • :tags (Array<Types::Tag>)

    A collection of key and value pairs that you want to set to the assessment template.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2872
2873
2874
2875
# File 'lib/aws-sdk-inspector/client.rb', line 2872

def set_tags_for_resource(params = {}, options = {})
  req = build_request(:set_tags_for_resource, params)
  req.send_request(options)
end

#start_assessment_run(params = {}) ⇒ Types::StartAssessmentRunResponse

Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must not exceed the limit of running up to 500 concurrent agents per AWS account.

Examples:

Example: Start assessment run


# Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you must
# not exceed the limit of running up to 500 concurrent agents per AWS account.

resp = client.start_assessment_run({
  assessment_run_name: "examplerun", 
  assessment_template_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T", 
})

resp.to_h outputs the following:
{
  assessment_run_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-jOoroxyY", 
}

Request syntax with placeholder values


resp = client.start_assessment_run({
  assessment_template_arn: "Arn", # required
  assessment_run_name: "AssessmentRunName",
})

Response structure


resp.assessment_run_arn #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_template_arn (required, String)

    The ARN of the assessment template of the assessment run that you want to start.

  • :assessment_run_name (String)

    You can specify the name for the assessment run. The name must be unique for the assessment template whose ARN is used to start the assessment run.

Returns:

See Also:



2925
2926
2927
2928
# File 'lib/aws-sdk-inspector/client.rb', line 2925

def start_assessment_run(params = {}, options = {})
  req = build_request(:start_assessment_run, params)
  req.send_request(options)
end

#stop_assessment_run(params = {}) ⇒ Struct

Stops the assessment run that is specified by the ARN of the assessment run.

Examples:

Example: Stop assessment run


# Stops the assessment run that is specified by the ARN of the assessment run.

resp = client.stop_assessment_run({
  assessment_run_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-it5r2S4T/run/0-11LMTAVe", 
})

Request syntax with placeholder values


resp = client.stop_assessment_run({
  assessment_run_arn: "Arn", # required
  stop_action: "START_EVALUATION", # accepts START_EVALUATION, SKIP_EVALUATION
})

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_run_arn (required, String)

    The ARN of the assessment run that you want to stop.

  • :stop_action (String)

    An input option that can be set to either START_EVALUATION or SKIP_EVALUATION. START_EVALUATION (the default value), stops the AWS agent from collecting data and begins the results evaluation and the findings generation process. SKIP_EVALUATION cancels the assessment run immediately, after which no findings are generated.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



2965
2966
2967
2968
# File 'lib/aws-sdk-inspector/client.rb', line 2965

def stop_assessment_run(params = {}, options = {})
  req = build_request(:stop_assessment_run, params)
  req.send_request(options)
end

#subscribe_to_event(params = {}) ⇒ Struct

Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

Examples:

Example: Subscribe to event


# Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a
# specified SNS topic.

resp = client.subscribe_to_event({
  event: "ASSESSMENT_RUN_COMPLETED", 
  resource_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0", 
  topic_arn: "arn:aws:sns:us-west-2:123456789012:exampletopic", 
})

Request syntax with placeholder values


resp = client.subscribe_to_event({
  resource_arn: "Arn", # required
  event: "ASSESSMENT_RUN_STARTED", # required, accepts ASSESSMENT_RUN_STARTED, ASSESSMENT_RUN_COMPLETED, ASSESSMENT_RUN_STATE_CHANGED, FINDING_REPORTED, OTHER
  topic_arn: "Arn", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The ARN of the assessment template that is used during the event for which you want to receive SNS notifications.

  • :event (required, String)

    The event for which you want to receive SNS notifications.

  • :topic_arn (required, String)

    The ARN of the SNS topic to which the SNS notifications are sent.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3009
3010
3011
3012
# File 'lib/aws-sdk-inspector/client.rb', line 3009

def subscribe_to_event(params = {}, options = {})
  req = build_request(:subscribe_to_event, params)
  req.send_request(options)
end

#unsubscribe_from_event(params = {}) ⇒ Struct

Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a specified SNS topic.

Examples:

Example: Unsubscribe from event


# Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to a
# specified SNS topic.

resp = client.unsubscribe_from_event({
  event: "ASSESSMENT_RUN_COMPLETED", 
  resource_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX/template/0-7sbz2Kz0", 
  topic_arn: "arn:aws:sns:us-west-2:123456789012:exampletopic", 
})

Request syntax with placeholder values


resp = client.unsubscribe_from_event({
  resource_arn: "Arn", # required
  event: "ASSESSMENT_RUN_STARTED", # required, accepts ASSESSMENT_RUN_STARTED, ASSESSMENT_RUN_COMPLETED, ASSESSMENT_RUN_STATE_CHANGED, FINDING_REPORTED, OTHER
  topic_arn: "Arn", # required
})

Parameters:

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

    ({})

Options Hash (params):

  • :resource_arn (required, String)

    The ARN of the assessment template that is used during the event for which you want to stop receiving SNS notifications.

  • :event (required, String)

    The event for which you want to stop receiving SNS notifications.

  • :topic_arn (required, String)

    The ARN of the SNS topic to which SNS notifications are sent.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3053
3054
3055
3056
# File 'lib/aws-sdk-inspector/client.rb', line 3053

def unsubscribe_from_event(params = {}, options = {})
  req = build_request(:unsubscribe_from_event, params)
  req.send_request(options)
end

#update_assessment_target(params = {}) ⇒ Struct

Updates the assessment target that is specified by the ARN of the assessment target.

If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

Examples:

Example: Update assessment target


# Updates the assessment target that is specified by the ARN of the assessment target.

resp = client.update_assessment_target({
  assessment_target_arn: "arn:aws:inspector:us-west-2:123456789012:target/0-nvgVhaxX", 
  assessment_target_name: "Example", 
  resource_group_arn: "arn:aws:inspector:us-west-2:123456789012:resourcegroup/0-yNbgL5Pt", 
})

Request syntax with placeholder values


resp = client.update_assessment_target({
  assessment_target_arn: "Arn", # required
  assessment_target_name: "AssessmentTargetName", # required
  resource_group_arn: "Arn",
})

Parameters:

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

    ({})

Options Hash (params):

  • :assessment_target_arn (required, String)

    The ARN of the assessment target that you want to update.

  • :assessment_target_name (required, String)

    The name of the assessment target that you want to update.

  • :resource_group_arn (String)

    The ARN of the resource group that is used to specify the new resource group to associate with the assessment target.

Returns:

  • (Struct)

    Returns an empty response.

See Also:



3099
3100
3101
3102
# File 'lib/aws-sdk-inspector/client.rb', line 3099

def update_assessment_target(params = {}, options = {})
  req = build_request(:update_assessment_target, params)
  req.send_request(options)
end

#waiter_namesObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Deprecated.


3128
3129
3130
# File 'lib/aws-sdk-inspector/client.rb', line 3128

def waiter_names
  []
end