All posts

Tracking AWS Resource Access with AWS CLI: How to See Who Did What and When

They told you AWS was secure. They didn’t tell you how hard it is to know exactly who touched what, and when. If you’ve ever had to answer the question, “Who accessed this resource?”, you know the AWS CLI can be powerful — and unforgiving. Security teams ask for traceability, managers ask for reports, and engineers just want clear answers without scrolling through endless logs. This is where the AWS CLI becomes both a spotlight and a scalpel. Why This Isn’t Optional Anymore Cloud access trac

Free White Paper

Customer Support Access to Production + AWS IAM Policies: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

They told you AWS was secure. They didn’t tell you how hard it is to know exactly who touched what, and when.

If you’ve ever had to answer the question, “Who accessed this resource?”, you know the AWS CLI can be powerful — and unforgiving. Security teams ask for traceability, managers ask for reports, and engineers just want clear answers without scrolling through endless logs. This is where the AWS CLI becomes both a spotlight and a scalpel.

Why This Isn’t Optional Anymore

Cloud access tracking is more than compliance. It’s incident response, attack detection, and accountability. If you can’t track usage by user, role, service, timestamp, and action, you are operating blind. AWS knows this — that’s why CloudTrail is on by default in new accounts. But having logs isn’t the same as using them.

Finding Access Data With AWS CLI

AWS CLI lets you query CloudTrail records directly to identify who accessed what and when. Done right, you skip the console clicking and get structured, filterable data in seconds.

Start by listing recent trails:

aws cloudtrail describe-trails

Check that your trail is logging management and data events. Then, pull events for a specific resource:

aws cloudtrail lookup-events \
 --lookup-attributes AttributeKey=ResourceName,AttributeValue=YOUR_RESOURCE \
 --max-results 50

This returns JSON detailing usernames, actions, source IPs, and timestamps.

Continue reading? Get the full guide.

Customer Support Access to Production + AWS IAM Policies: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

You can filter by user instead:

aws cloudtrail lookup-events \
 --lookup-attributes AttributeKey=Username,AttributeValue=USERNAME

The result is your direct answer to: Who accessed it, what they did, and when they did it.

Going Deeper: Real-Time and Cross-Account Monitoring

Event data is most useful when it’s usable now, not after an incident. Setting up real-time queries requires pushing events into services like CloudWatch Logs or streaming into an external system. For multi-account AWS Organizations setups, aggregate trails capture all accounts in one place.

Avoid the Trap of Raw JSON Overload

The default AWS CLI output dumps a torrent of JSON. This slows analysis and increases human error. Use --query with JMESPath expressions to strip down to essentials:

aws cloudtrail lookup-events \
 --lookup-attributes AttributeKey=Username,AttributeValue=USERNAME \
 --query 'Events[].{Time:EventTime,User:Username,Action:EventName,IP:SourceIPAddress}'

Readable output means faster answers.

The Confidence of Knowing

When you can answer the who-what-when instantly, you make better decisions. You cut false alarms, speed incident triage, and earn the trust of your team. This isn’t just logging — it’s operational clarity.

If you want this visibility without the setup grind, you can see it live in minutes with hoop.dev. No manual parsing, no waiting on queries, just immediate, searchable answers to “Who accessed what and when?” across your AWS environment.

Do you want me to also provide you with an SEO-optimized title and meta description for this blog so it has the best chance of ranking #1 for your target keyword?

Get started

See hoop.dev in action

One gateway for every database, container, and AI agent. Deploy in minutes.

Get a demoMore posts