Cloudflare Rules can now sign requests to private S3 and Google Cloud Storage buckets without a Worker
New HMAC, SigV4 and date functions in the Rules language let a Request Header Transform Rule build the Authorization header for private bucket reads. The signing functions require a Pro, Business or Enterprise plan.
Cloudflare published a changelog entry on November 27, 2026 adding HMAC signing, Signature Version 4 (SigV4) key derivation and UTC date formatting to the Rules language. According to the entry, these functions can be used in Request Header Transform Rules "to authenticate reads from private Amazon S3 and Google Cloud Storage buckets". The supporting documentation says the goal is to do this "without a Worker".
This article is based on three Cloudflare pages: the changelog entry, a new how-to guide and the Rules language function reference. All three are the vendor's own; no independent coverage was found at the time of writing.
What was added
The changelog lists six functions:
- hmac_md5(), hmac_sha1(), hmac_sha256() and hmac_sha512() compute raw keyed digests. The reference says hmac_sha256() returns a raw 32-byte digest, not hexadecimal or Base64 text, and recommends it over the MD5 and SHA-1 variants for new integrations.
- sign_sigv4_hmac_sha256() derives the SigV4 signing key and returns the signature as 64 lowercase hexadecimal characters. It takes seven required arguments: the string to sign, the secret, a Unix timestamp, region, service, key prefix and scope terminator.
- format_date() formats the request timestamp as UTC text, for example format_date(http.request.timestamp.sec, "%Y%m%dT%H%M%SZ") for an x-amz-date or x-goog-date header.
- encode_hex() converts raw digests to lowercase hexadecimal text.
Per the reference, the common scope values are the bucket Region, "s3", "AWS4" and "aws4_request" for Amazon S3, and "auto", "storage", "GOOG4" and "goog4_request" for Google Cloud Storage.
How the setup works
The guide pairs two rules. A Cloud Connector rule routes the hostname to the bucket, and a Request Header Transform Rule sets three origin headers: a date, a payload hash and Authorization. Because the date comes from http.request.timestamp.sec, callers do not need to send a date header. The example in the guide signs GET and HEAD requests for a single object with an empty query string and body, and Cloudflare states that it does not implement general-purpose request canonicalization, uploads or presigned URLs.
For Google Cloud Storage the guide requires an HMAC access ID and secret, not an RSA service account key. For temporary AWS credentials, the session token has to be added as a fourth header and inserted into the canonical request by hand; the guide notes that the signing function does not obtain or refresh credentials.
Plans and limits
- The HMAC and SigV4 signing functions are available on Pro, Business and Enterprise plans.
- format_date() is available on all plans without an additional entitlement, in URI, request header and response header rewrite expressions, not in rule filters. It can appear up to four times per rewrite expression.
- Each HMAC function can appear up to five times in a request or response header rewrite expression; sign_sigv4_hmac_sha256() can appear once per expression.
What Cloudflare warns about
The guide is explicit that origin authentication is not visitor authorization: any visitor who matches the rule can trigger a signed read, so the public hostname needs its own access controls if the object must stay private. It also warns that secrets written into expressions are visible to anyone who can read the rule configuration, and recommends restricting that access, using least-privilege credentials and rotating them. Cloudflare recommends bypassing the cache while validating the setup so a cached response does not hide an authentication failure.
What is not covered
The changelog does not mention pricing changes, and the documentation does not describe a way to store the secret outside the rule expression. Developers remain responsible for constructing the canonical request and the string to sign, which means any extra signed header or query string requires changing the expression.
Por que isso importa
- Cloudflare now documents how to sign reads of private S3 or Google Cloud Storage objects with a rule instead of writing a Worker for it.
- The secret sits in the rule configuration, so who can read your Cloudflare rules becomes a credentials question, as Cloudflare's own guide points out.
- The signed read is available to any visitor matching the rule, so teams must add their own access controls before using it for private files, such as model artifacts or datasets.
Pontos principais
- Cloudflare added hmac_md5(), hmac_sha1(), hmac_sha256(), hmac_sha512(), sign_sigv4_hmac_sha256(), format_date() and encode_hex() to the Rules language on November 27, 2026.
- Signing functions require Pro, Business or Enterprise; format_date() works on all plans.
- The documented example covers bodyless GET and HEAD reads of one object; uploads and presigned URLs are out of scope.
- You still build the canonical request and string to sign yourself.
Fontes
- CloudflarePrimáriaSign storage requests with HMAC and automatic UTC datesdevelopers.cloudflare.com
- CloudflarePrimáriaSign requests to private S3 and GCS bucketsdevelopers.cloudflare.com
- CloudflarePrimáriaRules language: Functionsdevelopers.cloudflare.com
- cloudflare
- object-storage
- authentication
- edge
- sigv4
- Cloudflare