|
| 1 | +--- |
| 2 | +title: Ownership challenge FAQ |
| 3 | +pcx_content_type: concept |
| 4 | +sidebar: |
| 5 | + order: 9 |
| 6 | +head: |
| 7 | + - tag: title |
| 8 | + content: Logpush ownership challenge |
| 9 | +--- |
| 10 | + |
| 11 | +The ownership challenge is a one-time verification that proves you have read access to a destination bucket before Cloudflare pushes logs to it. This mechanism prevents you from accidentally configuring a Logpush job that pushes data to a bucket you do not control. |
| 12 | + |
| 13 | +## How it works |
| 14 | + |
| 15 | +When you create a Logpush job to a storage destination, Cloudflare requires you to prove ownership of that destination: |
| 16 | + |
| 17 | +1. You request an ownership challenge for your `destination_conf`. |
| 18 | +2. Cloudflare writes a JWT to an `ownership-challenge.txt` file in your bucket. |
| 19 | +3. You read the token from your bucket and submit it with your job creation request. |
| 20 | +4. Cloudflare validates the token and creates the job. |
| 21 | + |
| 22 | +For step-by-step instructions, refer to [Manage Logpush with cURL](/logs/logpush/examples/example-logpush-curl/). |
| 23 | + |
| 24 | +## What the challenge protects against |
| 25 | + |
| 26 | +The ownership challenge primarily protects you from accidental misconfiguration. Without this verification, you could inadvertently configure a job to push to a bucket you did not intend—for example, pushing to a bucket that is actually owned by someone else. |
| 27 | + |
| 28 | +The challenge also prevents malicious scenarios where someone could: |
| 29 | + |
| 30 | +- Point a Logpush job at another customer's bucket |
| 31 | +- Push bogus or malicious log data to that bucket |
| 32 | +- Pollute or corrupt the victim's log storage |
| 33 | + |
| 34 | +:::note |
| 35 | +You may find the ownership challenge cumbersome because it is unusual and difficult to script via Terraform. However, it exists to prevent costly mistakes. |
| 36 | +::: |
| 37 | + |
| 38 | +## Challenge token structure |
| 39 | + |
| 40 | +The ownership challenge is a JSON Web Token (JWT) containing claims that bind it to a specific context. The token includes: |
| 41 | + |
| 42 | +- **Object type** - Whether the job is zone-scoped, account-scoped, or tenant-scoped |
| 43 | +- **Object ID** - The specific zone or account identifier |
| 44 | +- **Destination configuration** - The full destination configuration string |
| 45 | +- **Destination fingerprint** - A hash of the bucket name and paths/prefixes |
| 46 | +- **Expiration** - The token expires after 7 days |
| 47 | + |
| 48 | +When you submit the challenge token, Cloudflare validates that all claims match your job creation request. This prevents the token from being reused for a different account, zone, or destination. |
| 49 | + |
| 50 | +## Security considerations |
| 51 | + |
| 52 | +### Can a compromised token be exploited? |
| 53 | + |
| 54 | +In practice, an attack using a compromised ownership challenge token is extremely unlikely. An attacker would need: |
| 55 | + |
| 56 | +1. Access to your Cloudflare account (to match the object ID in the token) |
| 57 | +2. Knowledge of the exact bucket name and paths/prefixes (to match the destination fingerprint) |
| 58 | +3. To act within 7 days (before the challenge expires) |
| 59 | + |
| 60 | +Your bucket's IAM/access controls and Cloudflare account security are the primary security layers, not the ownership challenge token. |
| 61 | + |
| 62 | +### Best practices |
| 63 | + |
| 64 | +- **Delete the challenge file after job creation** - Once your Logpush job is created, you can safely delete the `ownership-challenge.txt` file from your bucket. |
| 65 | +- **Restrict bucket permissions ** - Grant write access only to Cloudflare's service accounts. For AWS S3, grant `PutObject` permission to `arn:aws:iam::391854517948:user/cloudflare-logpush`. For GCS, grant `Storage Object Admin` to `[email protected]`. |
| 66 | +- **Monitor your Logpush jobs** - Use the [Logpush health dashboards](/logs/logpush/logpush-health/) to monitor job status and detect anomalies. |
| 67 | + |
| 68 | +## Which destinations require an ownership challenge? |
| 69 | + |
| 70 | +| Destination | Ownership challenge required | |
| 71 | +| --- | --- | |
| 72 | +| AWS S3 | Yes (or use access key/secret key) | |
| 73 | +| Google Cloud Storage | Yes | |
| 74 | +| Azure Blob Storage | Yes | |
| 75 | +| Sumo Logic | Yes | |
| 76 | +| S3-compatible storage | No | |
| 77 | +| HTTP endpoints | No | |
| 78 | +| Datadog | No | |
| 79 | +| Splunk | No | |
| 80 | +| New Relic | No | |
| 81 | + |
| 82 | +For destinations that do not require an ownership challenge, Cloudflare uses alternative authentication methods such as API keys or tokens. |
| 83 | + |
| 84 | +## Related resources |
| 85 | + |
| 86 | +- [API configuration](/logs/logpush/logpush-job/api-configuration/) |
| 87 | +- [Manage Logpush with cURL](/logs/logpush/examples/example-logpush-curl/) |
| 88 | +- [Logpush permissions](/logs/logpush/permissions/) |
| 89 | +- [Enable AWS S3 destination](/logs/logpush/logpush-job/enable-destinations/aws-s3/) |
| 90 | +- [Enable GCS destination](/logs/logpush/logpush-job/enable-destinations/google-cloud-storage/) |
0 commit comments