Skip to content

Client

detective R Documentation

Amazon Detective

Description

Detective uses machine learning and purpose-built visualizations to help you to analyze and investigate security issues across your Amazon Web Services (Amazon Web Services) workloads. Detective automatically extracts time-based events such as login attempts, API calls, and network traffic from CloudTrail and Amazon Virtual Private Cloud (Amazon VPC) flow logs. It also extracts findings detected by Amazon GuardDuty.

The Detective API primarily supports the creation and management of behavior graphs. A behavior graph contains the extracted data from a set of member accounts, and is created and managed by an administrator account.

To add a member account to the behavior graph, the administrator account sends an invitation to the account. When the account accepts the invitation, it becomes a member account in the behavior graph.

Detective is also integrated with Organizations. The organization management account designates the Detective administrator account for the organization. That account becomes the administrator account for the organization behavior graph. The Detective administrator account is also the delegated administrator account for Detective in Organizations.

The Detective administrator account can enable any organization account as a member account in the organization behavior graph. The organization accounts do not receive invitations. The Detective administrator account can also invite other accounts to the organization behavior graph.

Every behavior graph is specific to a Region. You can only use the API to manage behavior graphs that belong to the Region that is associated with the currently selected endpoint.

The administrator account for a behavior graph can use the Detective API to do the following:

  • Enable and disable Detective. Enabling Detective creates a new behavior graph.

  • View the list of member accounts in a behavior graph.

  • Add member accounts to a behavior graph.

  • Remove member accounts from a behavior graph.

  • Apply tags to a behavior graph.

The organization management account can use the Detective API to select the delegated administrator for Detective.

The Detective administrator account for an organization can use the Detective API to do the following:

  • Perform all of the functions of an administrator account.

  • Determine whether to automatically enable new organization accounts as member accounts in the organization behavior graph.

An invited member account can use the Detective API to do the following:

  • View the list of behavior graphs that they are invited to.

  • Accept an invitation to contribute to a behavior graph.

  • Decline an invitation to contribute to a behavior graph.

  • Remove their account from a behavior graph.

All API actions are logged as CloudTrail events. See Logging Detective API Calls with CloudTrail.

We replaced the term "master account" with the term "administrator account." An administrator account is used to centrally manage multiple accounts. In the case of Detective, the administrator account manages the accounts in their behavior graph.

Usage

detective(
  config = list(),
  credentials = list(),
  endpoint = NULL,
  region = NULL
)

Arguments

config

Optional configuration of credentials, endpoint, and/or region.

  • credentials:

    • creds:

      • access_key_id: AWS access key ID

      • secret_access_key: AWS secret access key

      • session_token: AWS temporary session token

    • profile: The name of a profile to use. If not given, then the default profile is used.

    • anonymous: Set anonymous credentials.

  • endpoint: The complete URL to use for the constructed client.

  • region: The AWS Region used in instantiating the client.

  • close_connection: Immediately close all HTTP connections.

  • timeout: The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.

  • s3_force_path_style: Set this to true to force the request to use path-style addressing, i.e. ⁠http://s3.amazonaws.com/BUCKET/KEY⁠.

  • sts_regional_endpoint: Set sts regional endpoint resolver to regional or legacy https://docs.aws.amazon.com/sdkref/latest/guide/feature-sts-regionalized-endpoints.html

credentials

Optional credentials shorthand for the config parameter

  • creds:

    • access_key_id: AWS access key ID

    • secret_access_key: AWS secret access key

    • session_token: AWS temporary session token

  • profile: The name of a profile to use. If not given, then the default profile is used.

  • anonymous: Set anonymous credentials.

endpoint

Optional shorthand for complete URL to use for the constructed client.

region

Optional shorthand for AWS Region used in instantiating the client.

Value

A client for the service. You can call the service's operations using syntax like svc$operation(...), where svc is the name you've assigned to the client. The available operations are listed in the Operations section.

Service syntax

svc <- detective(
  config = list(
    credentials = list(
      creds = list(
        access_key_id = "string",
        secret_access_key = "string",
        session_token = "string"
      ),
      profile = "string",
      anonymous = "logical"
    ),
    endpoint = "string",
    region = "string",
    close_connection = "logical",
    timeout = "numeric",
    s3_force_path_style = "logical",
    sts_regional_endpoint = "string"
  ),
  credentials = list(
    creds = list(
      access_key_id = "string",
      secret_access_key = "string",
      session_token = "string"
    ),
    profile = "string",
    anonymous = "logical"
  ),
  endpoint = "string",
  region = "string"
)

Operations

accept_invitation
Accepts an invitation for the member account to contribute data to a behavior graph
batch_get_graph_member_datasources
Gets data source package information for the behavior graph
batch_get_membership_datasources
Gets information on the data source package history for an account
create_graph
Creates a new behavior graph for the calling account, and sets that account as the administrator account
create_members
CreateMembers is used to send invitations to accounts
delete_graph
Disables the specified behavior graph and queues it to be deleted
delete_members
Removes the specified member accounts from the behavior graph
describe_organization_configuration
Returns information about the configuration for the organization behavior graph
disable_organization_admin_account
Removes the Detective administrator account in the current Region
disassociate_membership
Removes the member account from the specified behavior graph
enable_organization_admin_account
Designates the Detective administrator account for the organization in the current Region
get_investigation
Returns the investigation results of an investigation for a behavior graph
get_members
Returns the membership details for specified member accounts for a behavior graph
list_datasource_packages
Lists data source packages in the behavior graph
list_graphs
Returns the list of behavior graphs that the calling account is an administrator account of
list_indicators
Get the indicators from an investigation
list_investigations
List all Investigations
list_invitations
Retrieves the list of open and accepted behavior graph invitations for the member account
list_members
Retrieves the list of member accounts for a behavior graph
list_organization_admin_accounts
Returns information about the Detective administrator account for an organization
list_tags_for_resource
Returns the tag values that are assigned to a behavior graph
reject_invitation
Rejects an invitation to contribute the account data to a behavior graph
start_investigation
initiate an investigation on an entity in a graph
start_monitoring_member
Sends a request to enable data ingest for a member account that has a status of ACCEPTED_BUT_DISABLED
tag_resource
Applies tag values to a behavior graph
untag_resource
Removes tags from a behavior graph
update_datasource_packages
Starts a data source packages for the behavior graph
update_investigation_state
Update the state of an investigation
update_organization_configuration
Updates the configuration for the Organizations integration in the current Region

Examples

## Not run: 
svc <- detective()
svc$accept_invitation(
  Foo = 123
)

## End(Not run)