Skip to main content

Cotool + AWS CLI

Connect AWS to Cotool so agents run AWS CLI commands in a sandbox through an assumed IAM role to investigate CloudTrail events, identities, and resources.

Cloud & Infrastructure
Updated

The short answer

The AWS CLI integration lets Cotool agents and chats run AWS CLI commands in a sandbox against your accounts, authenticated with an assumed IAM role, so investigations can check identities, resources, and recent API activity directly in AWS.[1][2]

How it connects: Cotool authenticates by assuming a role in your account. AWS's pattern for third-party access is a role whose trust policy names the third party's account and checks an external ID that the third party generates for each customer.[1][6]

What Cotool uses from AWS CLI

CloudTrail event history
Agents can look up recent management events with the CLI. CloudTrail's LookupEvents covers events in a Region from the last 90 days.[1][8]
Security configuration
With a read-only audit policy, agents describe IAM users, roles, keys, and resource configuration. AWS's SecurityAudit policy grants access to read security configuration metadata.[1][7]

Detections, hunts, and triage

Confirm a cloud alert in AWSTriage
When a GuardDuty or CloudTrail-based alert fires, an agent queries AWS for the principal's recent calls, its attached policies, and the resource's current state before deciding.[1][3][8]
Check findings against live stateHunt
A hunt that finds an access key used from a new network asks AWS whether the key is still active and which policies its user holds.[4][7]

Setup and permissions

Create an IAM role that trusts the third party's account and requires its external ID. AWS does not treat the external ID as a secret, but it prevents another customer of the same provider from using your role.[6]

PermissionAccess
SecurityAuditAWS managed policy for reading security configuration metadata, meant for software that audits an account.[7]Read
cloudtrail:LookupEventsLook up CloudTrail management events from the last 90 days.[8]Read
sts:AssumeRoleLets the trusted principal start a role session. The session cannot exceed the role's maximum duration of 1 to 12 hours.[9]Read

How Cotool works with AWS CLI

  • Cotool added AWS and Google Cloud CLI support in sandbox chats and agents in release 0.47.0 and assumed-role authentication for CLI investigations in release 0.48.0.[1]
  • CLI calls render as terminal-style output in chat, and assume-role authentication works for EU deployments too.[1]

FAQ

How is this different from AWS S3/SQS log ingestion?
The S3/SQS integration ingests CloudTrail and other logs into Cotool for search and detections. The CLI integration queries AWS directly for current state and recent API activity.[1][5]

Sources

  1. Changelog (Cotool docs) · accessed November 16, 2026
  2. Integrations (Cotool) · accessed November 16, 2026
  3. Respond to every signal (Cotool Respond) · accessed November 16, 2026
  4. Threat hunting (Cotool Hunt) · accessed November 16, 2026
  5. AWS S3/SQS logs (Cotool docs) · accessed November 16, 2026
  6. Access to AWS accounts owned by third parties (AWS IAM User Guide) · accessed November 16, 2026
  7. SecurityAudit managed policy (AWS) · accessed November 16, 2026
  8. LookupEvents (AWS CloudTrail API Reference) · accessed November 16, 2026
  9. assume-role (AWS CLI Command Reference) · accessed November 16, 2026

Related integrations

All integrations

Use cases with AWS CLI

Attackers are scaling with tokens

Cotool helps defenders operate at machine speed. See how security teams are scaling Detection & Response.

Book a demo