<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
---
name: investigating-aws-cloudtrail-logs
description: >-
  Analyze AWS CloudTrail logs to investigate unauthorized access, privilege escalation, and data exfiltration.
domain: cybersecurity
subdomain: cloud-forensics
tags:
  - aws
  - cloudtrail
  - forensics
  - cloud-security
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1078.004"]
---

# Investigating AWS CloudTrail Logs

## Overview

Analyze AWS CloudTrail logs to investigate unauthorized access, privilege escalation, and data exfiltration.

## Prerequisites

| Requirement | Install |
|---|---|
| AWS CLI | `pip install awscli` |
| jq | `apt install jq` |
| Python 3.10+ | For agent tooling |

## Key Concepts

CloudTrail records API calls across AWS. Investigation covers event
filtering, timeline reconstruction, IAM analysis, cross-account correlation.

## Quick Reference

```bash
aws cloudtrail lookup-events --lookup-attributes AttributeKey=EventName,AttributeValue=ConsoleLogin
node agent.js query --event-name AssumeRole --start 2026-01-01
node agent.js timeline --trail main-trail --hours 24
node agent.js report --investigation CT-2026-001
```

## Workflow

1. Define scope
2. Query events
3. Build timeline
4. Identify anomalies
5. Trace IAM
6. Correlate logs
7. Document

## Detection

```yaml
title: Investigating Aws Cloudtrail Logs Detection
id: d6cb0f36-6f67-4a54-9067-e405a62c6a70
status: experimental
description: Detects suspicious activity related to investigating aws cloudtrail logs techniques in cloud forensics context
logsource:
  product: aws
  service: cloudtrail
detection:
  selection:
    eventName: "*Unauthorized*"
  condition: selection
level: high
tags:
  - attack.t1078.004
  - attack.collection
falsepositives:
  - Scheduled compliance scanning by authorized security tools
```

## Verification

- Verify queries
- Confirm timeline
- Validate anomalies
- Check correlation
- Verify evidence

## References

- OWASP Testing Guide — https://owasp.org/www-project-web-security-testing-guide/
- MITRE ATT&CK — https://attack.mitre.org/
- NIST SP 800-53 — https://csf.tools/reference/nist-sp-800-53/
