PCAPs bucket setup
Before you can begin a full packet capture, you must first configure a bucket that Cloudflare can use to upload your files. Setting up a bucket is not required for sample packet captures.
You can configure an Amazon S3 or Google Cloud Platform bucket to use as a target. You can also use R2 as a target using the API.
Learn how to set up a bucket for use with full packet captures.
- Log in to your Cloudflare dashboard ↗, and select you account.
- Select Magic Transit or Magic WAN.
- From the Packet captures page, select the Buckets tab.
- Select Add a bucket.
- Under Bucket configuration, select a bucket service and select Next.
- Enter the information related to your bucket for your service provider.
- When you are done, select Next.
The Prove ownership step of the Bucket configuration displays.
Before you can begin using a bucket, you must first enable destinations.
Refer to the Amazon S3 or Google Cloud Storage documentation and follow the steps for those specific services.
Next, validate the bucket and confirm ownership.
After the initial bucket set up, you need to confirm you own the bucket via an ownership challenge. After you validate your bucket, you can begin using it to collect full packet captures.
- From the Prove ownership step of the Bucket configuration, locate the Ownership token field.
- In the Ownership token field, enter the ownership token for your service provider.
- When you are done, select Create. The Packet captures page displays.
The Buckets tab displays a list of the buckets associated with your account. Refer to the Status column to see the status of your bucket configuration.
The bucket
field should be the URI of the bucket. For Amazon S3, the bucket
field is in the form s3://<bucket-name>/<directory>?region=<bucket-region>
, and for Google Cloud Storage the form is gs://<bucket-name>/<directory>
.
The response has a "filename"
parameter which contains the content of the ownership-challenge
text. Find the file in your bucket and copy the contents of the file.
Validate the bucket by inserting the copied text in the ownership_text
below:
If the status
shows success
, the bucket is configured and ready to use.
The bucket status displays one of the following options:
- Success: The bucket is fully verified and ready to use.
- Pending: The challenge response was initiated but is pending verification. Bucket verification can take five to ten minutes to finish processing.
- Failed: The bucket could not be validated. If this occurs, verify your ownership information.
View a list of all buckets configured on your account.
- Log in to your Cloudflare dashboard ↗, and select you account.
- Select Magic Transit or Magic WAN.
- In Packet captures, select Start a capture.
- Select the Buckets tab.
The list of buckets associated with your account displays.
To learn how to collect packet captures, refer to Collect packet captures.
To start collecting packet captures with R2, you first need to configure it properly. For all the required details, refer to the Cloudflare R2 documentation.
- Log in to your Cloudflare dashboard ↗, and select you account.
- Select R2 > Create bucket.
- Give your bucket a name > Create bucket.
- Go to the R2 Overview page, and select Manage R2 API Tokens.
- Select Create API Token.
- In Permissions, choose Object Read & Write. Make sure you also select Apply to specific buckets only, and select the bucket you have created for PCAPs from the drop-down menu.
- Select Create API Token.
- Make sure you copy the Secret Access Key and Access Key ID values, as you will need them for the next step.
Create your initial request to R2:
The response has a "filename"
parameter with the name of a file that Cloudflare wrote to your R2 bucket. You need to download it for the next step. Example:
Refer to the Validate a bucket API instructions for more details on the entire process to validate your R2 bucket. When specifying the R2 destination for this validation, exclude the secret and access keys from the URL.