AWS DNS Logs
AWS VPC DNS provides DNS resolution within a Virtual Private Cloud (VPC), allowing instances to resolve domain names to IP addresses. DNS query logs, captured via Amazon Route 53 Resolver query logging, provide insight into DNS queries made by resources in the VPC, including the domain names requested, source IP, and response codes. This helps with network troubleshooting, security monitoring, and identifying potentially malicious domains.
Ingest Methods
Setup the ingestion of this source using one of the following guides.
If using an AWS S3 bucket use the following SNS topic ARN to send your bucket notifications.
arn:aws:sns:<REGION>:253602268883:runreveal_awsdns
Setup
Step 1: Enable VPC DNS Query Logging
- Sign in to the AWS Management Console and open the Amazon VPC console.
- In the navigation pane, choose "Your VPCs".
- Select the VPC for which you want to enable DNS query logging.
- Choose "Actions" > "Edit DNS hostnames".
- Select "Enable" for DNS hostnames if it's not already enabled.
- Choose "Save changes".
- Now, choose "Actions" > "Edit DNS resolution".
- Select "Enable" for DNS resolution if it's not already enabled.
- Choose "Save changes".
- Finally, choose "Actions" > "Edit VPC settings".
- Scroll down to "DNS query logging" and select "Enable".
- For "Destination", choose "Send to CloudWatch Logs".
- For "Log group name", enter a name (e.g.,
/aws/vpc/dns/<your-vpc-id>
). - Choose "Save changes".
Step 2: Create an S3 Bucket
- Open the Amazon S3 console.
- Click on "Create bucket".
- Enter a unique name for your bucket and select the region.
- Configure the bucket settings as needed (e.g., versioning, encryption).
- Click "Create bucket" to finish.
Step 3: Create an IAM Role for CloudWatch Logs
- Open the IAM console.
- In the navigation pane, choose "Roles", then "Create role".
- For "Trusted entity type", choose "AWS service".
- For "Use case", choose "CloudWatch Logs" from the dropdown.
- Choose "Next".
- In the "Add permissions" page, search for and select "AWSCloudWatchLogsFullAccess".
- Choose "Next".
- Enter a name for the role (e.g., "CloudWatchLogsToS3Role").
- Review the role details and choose "Create role".
Step 4: Create a CloudWatch Logs Subscription Filter
- Open the CloudWatch console.
- In the navigation pane, choose "Log groups".
- Find and select the log group you created for VPC DNS logs.
- Choose "Subscription filters" tab, then "Create subscription filter".
- For "Filter pattern", enter an empty string to capture all log events.
- For "Subscription filter destination", choose "Amazon S3 bucket".
- Select the S3 bucket you created earlier.
- For "Log format", choose "JSON".
- For "Compression type", choose your preferred compression method (e.g., Gzip).
- For "IAM role", select the role you created in Step 3.
- Choose "Start streaming".
Step 5: Verify Log Delivery
- Wait for some time to allow DNS queries to generate logs.
- Go to the S3 console and open your bucket.
- You should see folders created with the structure:
{your-log-group-name}/{year}/{month}/{day}/{hour}/
- Inside these folders, you'll find your VPC DNS log files.
For more information, refer to the official AWS documentation on VPC DNS Query Logging (opens in a new tab).