Investigate (incident queries)
Last updated 26 November 2026
Use cases: Query Parquet in S3 · Who deleted it?
Investigate answers the questions you ask during an incident (“who deleted this bucket?”, “who keeps getting access denied?”, “who read these objects?”) from the logs AWS already writes to your S3 buckets. Pick a question, the time and a name or two; ARNscope writes the SQL, runs it with DuckDB under your AWS profile and sums up the result in one sentence, with the next question one click away.
There is no Athena table to create, no log pipeline and no query to write. Every run is read-only, and nothing runs until you press Run.
Where to find it
- Databases page → Investigate, at the top of the list (under SQL consoles). This is the gallery of questions.
- The Investigate tab of any DuckDB console.
- S3, right-click a folder that holds AWS logs: an Investigate · CloudTrail (or S3 server access logs, CloudFront, VPC flow logs) group lists the questions for those logs, already pointed at the folder and, when the path names a day, at that day.
- VPC flow logs, a flow log delivered to S3 → Analyse with DuckDB. See VPC flow logs.
The questions
| Logs | Question | What it returns |
|---|---|---|
| CloudTrail | Who deleted or changed this resource? | Every call that names the resource (a name or ARN, matched anywhere in the event), newest first: who, from which IP, and whether AWS refused it. Options: an exact event name, changes only (skips Get, List, Describe), include refused calls. |
| CloudTrail | Recent errors and access denied, by principal | Calls AWS refused or failed, grouped by principal, error and API, with first and last seen. Optionally one principal, or access denied only. |
| S3 server access logs | Who read or deleted these objects? | GET, PUT and DELETE requests on a bucket or key prefix, with requester, IP, status and bytes sent. Filter by requester or IP, and by reads, deletes and writes. |
| CloudFront | Top errors by edge location and path | 4xx and 5xx counts by edge location, path and status, so you can tell one bad edge location from a bad origin. Optionally one distribution, a path prefix, an edge location, or 5xx only. |
| VPC flow logs in S3 | Rejected traffic to this IP or port | Connections security groups or network ACLs refused, by source, destination and port. |
| VPC flow logs in S3 | Top talkers | Accepted traffic by source, destination and port, largest first. |
| VPC flow logs in S3 | Traffic between two IPs | Every flow between two addresses, in both directions, accepted and rejected. |
These follow-up questions are offered from an answer:
| Logs | Question |
|---|---|
| CloudTrail | Everything this principal did (reads included) |
| CloudTrail | All calls from this IP address |
| CloudTrail | Who assumed this role? (AssumeRole, also with SAML or a web identity; reads 12 hours before the range, since sessions outlive the call that starts them) |
The gallery also has two cards that open pages ARNscope already had: a 5xx spike by target and path opens Load balancers, and flow logs delivered to S3 open VPC flow logs.
How it finds the logs
Each card shows where the logs are before you open it. ARNscope finds them with read-only settings calls and caches the result like other lists. It reads no log until you press Run.
| Logs | How the location is found |
|---|---|
| CloudTrail | DescribeTrails when the gallery opens (trails of other regions included). The card says “Found from trail name (all regions)” and the folder, AWSLogs/<account>/CloudTrail/, or under the organization ID for an organization trail. Multi-region trails come first. |
| S3 server access logs | Type the bucket you are investigating and press Find logs: GetBucketLogging gives the target bucket and prefix, and whether the keys use the simple or the date-partitioned layout. |
| CloudFront | Picked by hand: Pick location… and choose the folder the standard logs are delivered to. |
| VPC flow logs | From the flow log’s S3 destination, on the VPC flow logs page. |
Pick location… on any card picks a folder by hand instead, for example a trail in another account whose bucket your profile can read.
Ask a question
Open shows the question’s form:
- Log folder and, for CloudTrail and VPC flow logs, the region folder to read (
us-east-1, for example). One region folder a run. - Time: 15m, 1h, 6h, 24h, or Custom from and to, in UTC, up to 31 days. A preset counts back from the moment you press Run.
- The question’s own fields (a resource, a principal, an IP).
- The generated SQL, which you can read and edit. Editing turns the form off for that SQL and turns off the answer line; Back to the generated SQL restores it. Open in console copies the SQL to the console’s Query tab.
The strip above the results shows the scan preview and how the time narrows the read, for example “only files written 01:31–02:46 UTC, by name (+15 min for late delivery)”. The SQL reads only the date (and hour) folders or file names of the range, so a one-hour question reads one hour of files, not the whole bucket.
When you press Run, ARNscope lists every folder in the range again, since new files arrive all the time, and leaves out the hours that have no files. If none of them have files, it says so and reads nothing. Above 1 GB or 10,000 files it asks first.
The answer
The answer is one sentence built from the rows, not generated by AI. For “Who deleted or changed this resource?” it reads, for example:
assumed-role/ci-deploy-role/gh-actions-8812ranDeleteBucketonfernwood-uploadsat 2026-11-25 02:14:07 UTC from 203.0.113.42. The same principal made 4 other changes before it. 2 earlier attempts byassumed-role/AWSReservedSSO_Developer_a1b2c3d4/maya.chenwere refused.
Under it, Next: offers the follow-ups the rows suggest: “Everything gh-actions-8812 did”, “Who assumed ci-deploy-role?”, “All calls from 203.0.113.42”. Each one runs straight away with the same logs and time.
The rows are below the answer. For CloudTrail, the selected row’s whole event opens beside the table as formatted JSON, with Copy JSON. Results are capped at 1,000 rows.
Log formats
| Logs | Read as |
|---|---|
| CloudTrail | The gzip JSON files a trail delivers |
| S3 server access logs | The text log format, simple or date-partitioned keys |
| CloudFront | Standard (legacy) log files, <distribution>.YYYY-MM-DD-HH.<id>.gz |
| VPC flow logs | Text (.log.gz) or Parquet, the default format or a custom one, Hive-compatible prefixes and hourly partitions. A custom format needs srcaddr, dstaddr, dstport, protocol, packets, bytes, start, end and action. |
Permissions
| What | Actions |
|---|---|
| Finding CloudTrail logs | cloudtrail:DescribeTrails |
| Finding S3 server access logs | s3:GetBucketLogging and s3:GetBucketLocation on the bucket you investigate |
| Reading the logs | s3:ListBucket, s3:GetObject and s3:GetBucketLocation on the log bucket. If it is encrypted with a KMS key, kms:Decrypt on that key. |
Without DescribeTrails or GetBucketLogging, pick the folder by hand. The IAM permission check shows which of these your role has.
Limitations
- CloudFront folders are picked by hand. ARNscope does not look up a distribution’s logging settings. Only standard (legacy) log files are read: not real-time logs, and not standard logging v2 output in other formats or folder layouts.
- Log delivery delay. AWS writes these logs minutes after the events: CloudTrail typically within about 5 minutes, VPC flow logs to S3 about every 5 minutes, and S3 server access logs on a best-effort basis, sometimes hours later. The last minutes of a range may not be in S3 yet.
- Time-range padding. Log files are named by when they were written, not by the events inside, so each question reads a little past the range: 15 minutes after for CloudTrail, an hour after for S3 server access logs, 5 minutes before and 15 after for VPC flow logs, and 12 hours before for “Who assumed this role?”. CloudFront files are read by the hour. The rows are still filtered to the range.
- One region folder a run for CloudTrail and VPC flow logs.
- Up to 31 days a run, and 1,000 rows of results.
- ALB access logs are on the Load balancers page, not here.
- Read-only. Investigate changes nothing in AWS and does not turn logging on. Its sessions are ordinary read-only DuckDB sessions with your profile: they read whatever its IAM permissions allow, and the questions read only the log folder and hours you pick.
Missing a question you ask at 2am? Write to [email protected].