Skip to main content
This guide walks you through connecting AWS CloudTrail to TruU TOTAL for persona generation and threat detection.

Overview

TOTAL ingests cloud infrastructure activity events from AWS CloudTrail via the CloudTrail Lookup Events API or by reading from an S3 bucket where CloudTrail logs are delivered. We poll for new events on a configurable interval to collect, normalize, and correlate API calls, console sign-ins, IAM changes, resource access, and security-relevant actions across your AWS environment. Connector Type: Polling

Prerequisites

  • AWS IAM access with permission to create IAM users or roles and manage policies
  • CloudTrail enabled with at least one trail logging management events (most AWS accounts have this by default)
  • For enhanced coverage: Data events enabled for S3, Lambda, or other services
  • S3 bucket where CloudTrail delivers logs (if using S3-based ingestion)
  • Approximately 15 minutes to complete setup

Step 1: Choose Your Ingestion Method

TOTAL supports two methods for ingesting CloudTrail events:
MethodBest ForLatencyCoverage
CloudTrail Lookup APIQuick setup, management events~15 minManagement events (last 90 days)
S3 BucketFull coverage, data events~5-15 minManagement + data events (unlimited retention)
We recommend the S3 Bucket method for production deployments, as it provides access to both management and data events with configurable retention.

Step 2: Create an IAM Role for TOTAL

TOTAL authenticates to your AWS account using an IAM role with cross-account assume-role trust (recommended) or an IAM user with access keys.
  1. Sign in to the AWS Console
  2. Navigate to IAMRolesCreate role
  3. Select Another AWS account as the trusted entity
  4. Enter the TOTAL AWS Account ID (provided in the TruU Portal)
  5. Check Require external ID and enter the External ID shown in the TruU Portal
  6. Click Next: Permissions
  7. Attach the following managed policy (or create a custom one — see below):
    • CloudTrailReadOnlyAccess
  8. If using S3 ingestion, also attach:
    • A custom policy granting s3:GetObject and s3:ListBucket on your CloudTrail S3 bucket
  9. Name the role: TruU-TOTAL-CloudTrail-Reader
  10. Click Create role
  11. Copy the Role ARN and paste it into the TruU Portal

Option B: IAM User with Access Keys

  1. Navigate to IAMUsersCreate user
  2. Enter:
    • Username: truu-total-cloudtrail
  3. Select Programmatic access
  4. Attach the CloudTrailReadOnlyAccess policy (and S3 read policy if applicable)
  5. Click Create user
  6. Copy the Access Key ID and Secret Access Key
  7. Paste them into the TruU Portal

Custom IAM Policy (Least Privilege)

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cloudtrail:LookupEvents",
        "cloudtrail:GetTrailStatus",
        "cloudtrail:DescribeTrails",
        "cloudtrail:ListTrails"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "s3:GetObject",
        "s3:ListBucket"
      ],
      "Resource": [
        "arn:aws:s3:::your-cloudtrail-bucket",
        "arn:aws:s3:::your-cloudtrail-bucket/*"
      ]
    }
  ]
}

Step 3: Configure S3 Bucket Access (If Using S3 Method)

  1. In the TruU Portal, enter:
    • S3 Bucket Name: Your CloudTrail log bucket name
    • S3 Prefix (optional): The path prefix if CloudTrail logs are organized by account/region
    • AWS Region: The region where your S3 bucket resides
  2. TOTAL will validate access by listing recent log files

Step 4: Verify Connectivity

Once credentials are entered in the TruU Portal:
  1. Click Test Connection — TOTAL will attempt to read recent CloudTrail events
  2. If successful, you’ll see a confirmation with the number of recent events and trails detected
  3. If configured, TOTAL will run a historical data pull to seed user personas

Security & Privacy

What We Access

  • Read-only access to CloudTrail events via the Lookup API or S3 bucket
  • Management events (API calls, console sign-ins, IAM changes)
  • Data events (if enabled): S3 object access, Lambda invocations, DynamoDB operations
  • All queries use timestamp filtering — we only fetch new events since the last poll

What We Don’t Have Access To

  • Write access to any AWS resources
  • Ability to create, modify, or delete IAM users, roles, or policies
  • Access to resource contents (S3 objects, database records, etc.)
  • Access to billing, cost management, or account settings
  • CloudTrail configuration or trail management

Updating or Rotating Credentials

Rotate Access Keys (If Using IAM User)

  1. In AWS Console, go to IAMUserstruu-total-cloudtrail
  2. Under Security credentials, click Create access key
  3. Copy the new Access Key ID and Secret Access Key
  4. Paste them in the TruU Portal
  5. After TOTAL confirms the new keys are active, deactivate the old access key

Revoke Access

To immediately remove TOTAL’s access:
  1. Option A — Disable in the TruU Portal
  2. Option B — Delete or deactivate the IAM role/user in AWS
  3. Option C — Remove the trust relationship from the IAM role (for cross-account)

Rate Limiting & Scalability

AWS CloudTrail Rate Limits

Lookup Events API

ParameterLimit
LookupEvents API2 req/s per account per region (hard limit)
Max results per request50 events
Lookback windowLast 90 days
ParameterLimit
Log delivery frequency~5 minutes
S3 GetObject rate5,500 req/s per prefix
RetentionUnlimited (customer-controlled S3 lifecycle)

Ingestion Capacity

The Lookup Events API is severely rate-limited at 2 req/s (~100 events/sec) and is only suitable for low-volume environments or initial testing. For production, TOTAL uses the S3 bucket ingestion method, where throughput is bounded by S3 read speed (5,500 req/s per prefix) — effectively unlimited for log ingestion. A large enterprise with 100K+ users across a multi-account AWS Organization generates 1M–100M+ raw CloudTrail events/day depending on data event configuration. After filtering to human identities only (excluding service roles, Lambda execution roles, machine identities), the TOTAL-relevant subset is 500K–5M events/day. The practical constraint is AWS’s ~5-minute log delivery lag, not TOTAL’s read speed. TOTAL can ingest from an organization-wide CloudTrail trail that aggregates logs from all member accounts into a single S3 bucket. AWS costs are minimal — S3 GET requests for a typical enterprise are < $10/month.

Event Freshness

AWS delivers CloudTrail logs to S3 approximately every 5 minutes. TOTAL polls on a configurable interval (default: 5 minutes). End-to-end latency is typically 5–15 minutes.

Resilience

TOTAL uses cursor-based ingestion with at-least-once delivery. The polling cursor only advances after events are successfully collected, normalized, and published. If any step fails, the cursor stays put and the next poll replays from the last known-good position. No events are lost. Transient failures (S3 errors, throttling, timeouts) are retried automatically with exponential backoff. STS-based role assumption means no long-lived credentials — tokens auto-refresh before expiry. After 5 consecutive failures, the connector self-pauses and can be re-enabled from the TruU Portal. S3 log retention is customer-controlled (typically 90+ days), so data loss requires an outage longer than your retention policy.

Connector Design

Each connector polls on an independent, configurable interval. Events are batched and published in per-user order to preserve sequence integrity for persona building. Connector workers are stateless and scale horizontally — S3 log file processing parallelizes naturally across workers for multi-account environments. All polling intervals, concurrency, and event filtering rules are tunable from the TruU Portal.

Part 2: Event Types & Data Schema

Signal Classification

Signal ClassTOTAL Category
Cloud & InfrastructureAuthentication, Admin, Data Access, Network

Event Types We Ingest

TOTAL extracts the following categories of events from AWS CloudTrail. While CloudTrail records every API call in your AWS account, TOTAL only ingests events attributable to human identities — IAM users, federated users, and SSO users. Events from service roles, Lambda execution roles, and other machine identities are filtered out. Every event below includes a userIdentity block that resolves to a specific person.

Console & Authentication Events

Event NameEvent SourceDescriptionTOTAL Classification
ConsoleLoginsignin.amazonaws.comAWS Console sign-inAuthentication
ConsoleLoginFailuresignin.amazonaws.comFailed console sign-in attemptAuthentication
SwitchRolesignin.amazonaws.comUser switched IAM roleAuthentication
AssumeRolests.amazonaws.comRole assumed via STSAuthentication
AssumeRoleWithSAMLsts.amazonaws.comRole assumed via SAML federationAuthentication
GetSessionTokensts.amazonaws.comUser requested temporary session tokenAuthentication
GetFederationTokensts.amazonaws.comUser requested federation tokenAuthentication

IAM Events

Event NameEvent SourceDescriptionTOTAL Classification
CreateUseriam.amazonaws.comNew IAM user createdAdmin
DeleteUseriam.amazonaws.comIAM user deletedAdmin
CreateRoleiam.amazonaws.comNew IAM role createdAdmin
DeleteRoleiam.amazonaws.comIAM role deletedAdmin
AttachUserPolicyiam.amazonaws.comPolicy attached to userAdmin
DetachUserPolicyiam.amazonaws.comPolicy detached from userAdmin
AttachRolePolicyiam.amazonaws.comPolicy attached to roleAdmin
PutUserPolicyiam.amazonaws.comInline policy added to userAdmin
CreateAccessKeyiam.amazonaws.comAccess key created for userAdmin
DeleteAccessKeyiam.amazonaws.comAccess key deletedAdmin
UpdateAccessKeyiam.amazonaws.comAccess key activated/deactivatedAdmin
CreateLoginProfileiam.amazonaws.comConsole password created for userAdmin
UpdateLoginProfileiam.amazonaws.comConsole password updatedAdmin
AddUserToGroupiam.amazonaws.comUser added to IAM groupAdmin
RemoveUserFromGroupiam.amazonaws.comUser removed from IAM groupAdmin
EnableMFADeviceiam.amazonaws.comMFA device enabled for userAdmin
DeactivateMFADeviceiam.amazonaws.comMFA device deactivatedAdmin

S3 Data Events (If Enabled)

Event NameEvent SourceDescriptionTOTAL Classification
GetObjects3.amazonaws.comObject downloaded from S3Data Access
PutObjects3.amazonaws.comObject uploaded to S3Data Access
DeleteObjects3.amazonaws.comObject deleted from S3Data Access
CopyObjects3.amazonaws.comObject copied within S3Data Access
CreateBuckets3.amazonaws.comNew S3 bucket createdAdmin
DeleteBuckets3.amazonaws.comS3 bucket deletedAdmin
PutBucketPolicys3.amazonaws.comBucket policy modifiedAdmin
PutBucketPublicAccessBlocks3.amazonaws.comPublic access block modifiedAdmin

EC2 & Network Events

Event NameEvent SourceDescriptionTOTAL Classification
RunInstancesec2.amazonaws.comUser launched an EC2 instanceAdmin
TerminateInstancesec2.amazonaws.comUser terminated an EC2 instanceAdmin
StopInstancesec2.amazonaws.comUser stopped an EC2 instanceAdmin
StartInstancesec2.amazonaws.comUser started an EC2 instanceAdmin
AuthorizeSecurityGroupIngressec2.amazonaws.comUser added security group inbound ruleNetwork
AuthorizeSecurityGroupEgressec2.amazonaws.comUser added security group outbound ruleNetwork
RevokeSecurityGroupIngressec2.amazonaws.comUser removed security group inbound ruleNetwork
CreateSecurityGroupec2.amazonaws.comUser created a new security groupNetwork

Lambda & Serverless Events

Event NameEvent SourceDescriptionTOTAL Classification
CreateFunctionlambda.amazonaws.comUser created a Lambda functionAdmin
UpdateFunctionCodelambda.amazonaws.comUser updated Lambda function codeAdmin
UpdateFunctionConfigurationlambda.amazonaws.comUser updated Lambda configurationAdmin
AddPermissionlambda.amazonaws.comUser added permission to LambdaAdmin

Secrets & Key Management Events

Event NameEvent SourceDescriptionTOTAL Classification
GetSecretValuesecretsmanager.amazonaws.comUser retrieved a secret from Secrets ManagerData Access
CreateSecretsecretsmanager.amazonaws.comUser created a new secretAdmin
CreateKeykms.amazonaws.comUser created a new KMS keyAdmin
DisableKeykms.amazonaws.comUser disabled a KMS keyAdmin
ScheduleKeyDeletionkms.amazonaws.comUser scheduled KMS key deletionAdmin

CloudTrail & Logging Events

Event NameEvent SourceDescriptionTOTAL Classification
StopLoggingcloudtrail.amazonaws.comUser stopped CloudTrail loggingAlert
DeleteTrailcloudtrail.amazonaws.comUser deleted a CloudTrail trailAlert
UpdateTrailcloudtrail.amazonaws.comUser modified CloudTrail trail configurationAdmin
PutEventSelectorscloudtrail.amazonaws.comUser modified event selectorsAdmin

Sample Source Event (CloudTrail — AssumeRole)

{
  "eventVersion": "1.09",
  "userIdentity": {
    "type": "IAMUser",
    "principalId": "AIDAEXAMPLE123456",
    "arn": "arn:aws:iam::123456789012:user/jane.doe",
    "accountId": "123456789012",
    "accessKeyId": "AKIAIOSFODNN7EXAMPLE",
    "userName": "jane.doe",
    "sessionContext": {
      "attributes": {
        "mfaAuthenticated": "true",
        "creationDate": "2026-03-15T08:00:00Z"
      }
    }
  },
  "eventTime": "2026-03-15T08:15:30Z",
  "eventSource": "sts.amazonaws.com",
  "eventName": "AssumeRole",
  "awsRegion": "us-east-1",
  "sourceIPAddress": "198.51.100.42",
  "userAgent": "aws-cli/2.15.0 Python/3.11.6",
  "requestParameters": {
    "roleArn": "arn:aws:iam::123456789012:role/ProductionAdmin",
    "roleSessionName": "jane-doe-prod-session",
    "durationSeconds": 3600
  },
  "responseElements": {
    "credentials": {
      "accessKeyId": "ASIAEXAMPLE789",
      "expiration": "Mar 15, 2026 9:15:30 AM",
      "sessionToken": "FwoGZX..."
    },
    "assumedRoleUser": {
      "assumedRoleId": "AROAEXAMPLE:jane-doe-prod-session",
      "arn": "arn:aws:sts::123456789012:assumed-role/ProductionAdmin/jane-doe-prod-session"
    }
  },
  "requestID": "req-id-001",
  "eventID": "evt-id-001",
  "readOnly": false,
  "resources": [
    {
      "accountId": "123456789012",
      "type": "AWS::IAM::Role",
      "ARN": "arn:aws:iam::123456789012:role/ProductionAdmin"
    }
  ],
  "eventType": "AwsApiCall",
  "managementEvent": true,
  "recipientAccountId": "123456789012",
  "eventCategory": "Management"
}

TOTAL Normalized Event

{
  "event_id": "b8c9d0e1-f2a3-4567-hijk-890123456789",
  "event_type": "AUTH",
  "source": "AWS_CLOUDTRAIL",
  "signal_type": "CLOUD",
  "domain_id": "customer-domain-001",
  "tuid": "tuid-jane-doe-001",
  "timestamp": "2026-03-15T08:15:30.000Z",
  "payload": {
    "user": "jane.doe",
    "action": "AssumeRole",
    "event_source": "sts.amazonaws.com",
    "target_role": "ProductionAdmin",
    "role_arn": "arn:aws:iam::123456789012:role/ProductionAdmin",
    "session_name": "jane-doe-prod-session",
    "source_ip": "198.51.100.42",
    "region": "us-east-1",
    "mfa_authenticated": true,
    "read_only": false
  },
  "raw_metadata": {
    "platform_event_id": "evt-id-001",
    "event_version": "1.09",
    "user_identity_type": "IAMUser",
    "principal_id": "AIDAEXAMPLE123456",
    "user_arn": "arn:aws:iam::123456789012:user/jane.doe",
    "account_id": "123456789012",
    "user_name": "jane.doe",
    "mfa_authenticated": true,
    "event_source": "sts.amazonaws.com",
    "event_name": "AssumeRole",
    "aws_region": "us-east-1",
    "source_ip": "198.51.100.42",
    "user_agent": "aws-cli/2.15.0 Python/3.11.6",
    "role_arn": "arn:aws:iam::123456789012:role/ProductionAdmin",
    "role_session_name": "jane-doe-prod-session",
    "duration_seconds": 3600,
    "assumed_role_arn": "arn:aws:sts::123456789012:assumed-role/ProductionAdmin/jane-doe-prod-session",
    "event_type": "AwsApiCall",
    "management_event": true,
    "event_category": "Management",
    "read_only": false,
    "created_at": "2026-03-15T08:15:30.000Z",
    "source_platform": "aws_cloudtrail"
  },
  "platform_event_id": "evt-id-001",
  "platform_event_source": "AWS_CLOUDTRAIL_API"
}

How This Feeds TOTAL

Persona Building

CloudTrail events define a user’s cloud infrastructure behavior profile — which AWS services they interact with, what roles they assume, which regions they operate in, and what resources they access. This forms the cloud layer of each persona, establishing expected patterns for cloud operations tied to job function.

Anomaly Detection

TOTAL’s behavioral engine uses CloudTrail events to detect:
  • Role assumption anomalies — assuming production roles at unusual times, from unusual IPs, or without MFA when MFA is normally used
  • Privilege escalation — IAM policy attachments, role creations, or access key generations that expand a user’s cloud permissions
  • Data exfiltration indicators — unusual S3 GetObject patterns, bulk downloads, or access to buckets outside normal scope
  • Security control tampering — stopping CloudTrail logging, deleting trails, or modifying security group rules to open network access
  • Secrets access anomalies — retrieving secrets or KMS keys outside normal patterns, especially for production environments
  • Infrastructure manipulation — launching instances, modifying configurations, or creating resources in regions or accounts outside the user’s baseline

Breach Lifecycle Coverage

CloudTrail events provide primary coverage across Privilege Escalation and Siege stages. Similar to EDR, this is a high-fidelity signal that emerges later in the attack chain and validates earlier persona-based risk. When an attacker reaches the cloud infrastructure layer, CloudTrail captures the precise API calls that reveal their objectives — making it invaluable for confirming and attributing threats detected by upstream identity and behavioral signals.