Prerequisites
AWS Account
Connect one or more AWS accounts for EC2, S3, RDS, IAM, VPC, Lambda, CloudTrail, CloudWatch, and VPC Flow Log queries.
OCI Account (optional)
Connect Oracle Cloud accounts for Compute, Object Storage, VCN, IAM, and Audit log queries.
Targeting Cloud Accounts
Use@cloud:connection-name to direct your query to a specific AWS or OCI account. You can target multiple accounts in a single query for cross-account comparisons.
Resource Inspection
Query any cloud resource — instances, storage, databases, serverless functions, networking, and more.Security Configuration
Inspect IAM policies, security groups, encryption settings, and access controls.CloudTrail and Audit Events
Query who did what, when, and from where.CloudWatch Metrics
Query performance and health metrics from CloudWatch.Network Traffic
Query VPC Flow Logs for network traffic analysis.OCI-Specific Queries
Query Oracle Cloud Infrastructure resources and audit logs.Cross-Account Comparison
Compare configurations and resources across multiple cloud accounts.Example Conversation
You:
@cloud:prod-aws We got an alert about unauthorized access. Show me all CloudTrail events from unusual source IPs in the last 12 hours.
Kestrel:
I found 3 API calls from IP addresses not in your organization’s known CIDR ranges:You:The
AssumeRoleonarn:aws:iam::123456789012:role/deploy-botfrom198.51.100.42at 03:14 UTC — user agentaws-cli/2.15.0ListBucketsfrom the same IP at 03:16 UTC using the assumeddeploy-botsessionGetObjectons3://prod-config-bucket/database.ymlat 03:17 UTC from the same sessiondeploy-botrole was assumed using access keyAKIA...3F7Qwhich belongs to IAM userci-pipeline. This key hasn’t been rotated in 214 days.
What permissions does that deploy-bot role have? And is the access key compromised?Kestrel:
TheYou:deploy-botrole has the following attached policies:This is significantly over-permissioned for a CI/CD role. Regarding the access key — the source IP
AmazonS3FullAccess(AWS managed)custom-deploy-policy(inline) — grantsec2:*,ecs:*, andlambda:*on all resources198.51.100.42geolocates to a datacenter in Ashburn, VA (AWS us-east-1 region), which could be a legitimate CI runner. However, previous API calls fromci-pipelineall originated from10.0.x.x(your VPC). I’d recommend rotating the key immediately and scoping down the role permissions.
Generate a Terraform change to scope down that role to just the S3 and ECS permissions it actually needs.Kestrel:
Based on the CloudTrail history for this role over the last 90 days, thedeploy-botrole actually only uses these actions:s3:GetObject,s3:PutObjecton theprod-config-bucketandprod-artifactsbuckets, andecs:UpdateService,ecs:DescribeServiceson theproductioncluster. Here’s a least-privilege policy: (displays Terraform diff replacing the over-permissioned policies with a scoped-down custom policy)
Next Steps
- Kubernetes Investigation — query pods, deployments, events, and metrics
- Code Investigation — search and trace code changes across repositories
- Cost Analysis — analyze AWS spend patterns and anomalies
- Configuration Changes — generate and apply Terraform and YAML changes