Replace AccountA-ID with the ID of Account A and your-bucket-name with the name of your newly created bucket. This policy allows the root user in Account A to put objects into this bucket.
Step 3: Configure Cross-Account Access in AWS WAF
Log into Account A (where AWS WAF is located).
Navigate to AWS WAF & Shield section.
Choose the WAF "WebACLs" you want to log from.
Go to the "Logging" tab and click on "Add association".
In the field for the S3 bucket, provide the ARN of the S3 bucket that you created in Account B (should be something like arn:aws:s3:::your-bucket-name).
Choose the format of logs and save the settings.
Step 4: Set Up Splunk to Read Logs from the S3 Bucket in Account B
Now you have to set up Splunk to read the logs from the S3 bucket. You can do this with the Splunk Add-on for Amazon Web Services.
Log into your Splunk instance.
Install the "Splunk Add-on for Amazon Web Services" from the Splunkbase.
After installation, go to "Configuration" in the AWS add-on.
Add a new AWS Account by providing the necessary details (Account Name, Key ID, Secret Key).
Now, navigate to the "Inputs" tab and create a new input for "S3".
Choose the name of the S3 bucket you set up for AWS WAF logging.
Set up the necessary configuration details such as the interval for log checking, source type, index, etc.
Click on "Add" to complete the configuration.
Now Splunk should start indexing logs from AWS WAF stored in the specified S3 bucket. You can create searches, alerts, and reports based on these logs in your Splunk instance.
Please remember that exporting data from AWS may incur additional costs depending on the volume of data and the chosen method of export. Always check the latest AWS pricing to understand the costs associated with your chosen approach.