Back to blog

Integrating Object Storage with Selectel CDN: Validating Access Controls and Origin Costs

CdnChart EngineeringPublished on 2026-11-2916 min read1,555
Integrating Object Storage with Selectel CDN: Validating Access Controls and Origin Costs

Start with end-to-end permissions and costs on both sides

Selectel CDN can serve as a content delivery layer in front of object storage, but being able to download an object through the CDN is not a complete production-readiness criterion. For public images, versioned frontend assets, and installation packages, the main requirements are correct object paths, origin protocols, cache policies, and manageable costs. For paid files, user attachments, and content whose access may need to be revoked, you must also demonstrate that unauthorized requests are rejected even when the content is already cached.

Costs also extend beyond CDN egress. Downloads from the edge generate delivery usage, while initial CDN fetches, revalidation, prefetching, and cache updates may generate object storage requests and egress. Any same-region exemptions, internal network discounts, or additional origin shielding charges depend jointly on the selected storage service, region, and CDN billing rules. Do not assume origin fetches are free simply because both services come from the same provider.

This article covers architectures that use Selectel CDN to deliver content from Selectel or another provider's object storage. It does not equate S3 storage egress charges with CDN delivery pricing. The practical procurement decision is this: Public assets can be piloted using a dedicated bucket or prefix; private assets should enter production only after origin authorization, edge authentication, and revocation timing have all been verified. If essential access controls are unsupported, retain an authentication gateway or application-authorized direct downloads rather than making the entire bucket public.

What the official documentation confirms

Selectel's CDN product overview lists support for connecting your own storage, HTTPS, temporary content links, domain- or IP-based access restrictions, CORS, raw logs, prefetching, and origin shielding. The page also states that origin shielding is available by default: an edge cache miss goes to the shield first, and the origin is requested only if the shield also misses.

This information supports considering the service for object storage delivery, but it does not provide the private-bucket signing configuration details, regional object storage pricing, temporary-link algorithm, or default cache-key rules needed for this assessment. It therefore does not establish that the service can directly sign requests for any S3-compatible private bucket, nor does support for temporary links mean that per-request authentication is already enabled. The actual account configuration, delivery option selected for the resource, and contractual scope still require individual verification.

Divide the download path into three separate boundaries

An object storage integration involves at least three permission relationships: users to the CDN, the CDN through the shield to storage, and administrators to the control plane. Each addresses a different problem, and none can substitute for another.

Boundary

Key question

Required evidence

User to CDN

Who can read files, and when do links expire?

Rejection tests for unsigned, expired, and tampered requests, including with a warm cache

CDN to object storage

What authorizes the CDN to read private objects?

Origin-fetch identity, authorization scope, and storage access logs

Administrator to control plane

Who can change bucket permissions, cache rules, and keys?

Least-privilege roles, change records, and a credential rotation procedure

A private origin does not make edge content private

Suppose object storage permits reads only by a particular service identity, but after fetching a file, the CDN serves it to everyone as a publicly cached object. The bucket does not allow anonymous reads, yet users may still bypass application authorization and obtain the file through its CDN URL.

Conversely, enabling temporary links on the CDN does not mean the origin cannot be accessed directly. If the original object storage URL still allows anonymous downloads, users can bypass CDN rules, undermining both access controls and cost controls.

Private content therefore requires at least two independent acceptance checks: anonymous origin requests must be rejected, and the CDN must reject requests without valid authorization, whether the cache is cold or warm. Origin shielding can reduce repeated origin fetches, but it cannot replace either control.

Domain restrictions and CORS are not user authorization

The domain restrictions listed on the product page can provide some hotlink protection, but their actual basis must be confirmed—for example, whether they check Referer and how they handle an empty Referer. Clients can construct their own request headers, so this restriction alone cannot protect paid downloads or personal data.

CORS determines whether browser scripts can read cross-origin responses. It does not prevent command-line downloads or replace authentication. When a web frontend needs access to restricted objects, allow only the necessary application Origins, methods, and request headers. Do not resolve integration errors by allowing arbitrary credentialed cross-origin access.

Choose the origin integration method for your use case

Public static assets: expose only objects that are genuinely public

Public images, stylesheets, and installation packages can use an anonymously readable origin with CDN caching. Here, “public” must mean that the business intentionally permits distribution, not that permissions on an entire bucket have been temporarily relaxed just to make CDN origin fetches work.

Keep public assets in separate buckets from user attachments, backups, and data exports, or at least use prefixes whose permissions can be controlled independently. Public downloads generally do not require anonymous bucket listing, let alone write or delete access. Tests should cover reads at known paths as well as listing, writing, and deletion, so that one downloadable file does not conceal overly broad permissions.

This approach is simple to deploy, but the origin URL remains directly usable, and direct downloads may bypass the CDN and generate storage egress. If direct access must be restricted, use a verifiable CDN origin-fetch identity rather than relying on the origin hostname remaining undiscovered.

Private buckets: verify origin authorization before entering access keys

For private buckets, request an explanation of the specific origin authorization mechanism before purchase: whether it supports the target storage service's signing protocol, which addressing styles it supports, whether access can be limited to buckets and prefixes, how credentials are rotated, and whether credentials are stored only on the server side.

S3 compatibility describes an API interface. It does not automatically mean that a CDN supports the service's region fields, signature version, endpoint format, or temporary credentials. Signatures also commonly depend on Host, path, query parameters, and time. CDN path rewriting or header changes can therefore cause access to be denied.

Prefer a read-only service identity scoped to the objects required for delivery. During rotation, validate the new identity first, switch the origin configuration next, and revoke the old identity last. Never put administrative account keys in a frontend, public URL, script repository, or support-ticket screenshot.

If the specific resource in your Selectel account cannot meet these requirements, an authenticating origin gateway can be placed between the CDN and storage. The gateway reads private objects and returns controlled responses, but adds service maintenance, connection-handling requirements, and potentially additional egress costs. Budget for it as a formal architecture component, not a cost-free compatibility workaround.

Storage presigned URLs are generally unsuitable as permanent CDN origin URLs

Storage presigned URLs are often bound to an expiration time and request details. Using one as a fixed origin URL may cause every cold-cache request to fail after it expires. If each user has different signature parameters, the same file may instead be fragmented into many cache entries.

A more dangerous approach is to remove signature parameters from the cache key to improve the hit ratio without checking access permissions before returning cached content. The first authorized request could then populate the cache, allowing subsequent unauthorized requests to retrieve the same file.

A sound approach is usually to validate user authorization at the edge and use a separate service identity for origin fetches, or to handle authorization through an application gateway. To use the first approach, confirm that temporary links on the selected Selectel resource are validated before every cached response is delivered. Do not infer this from the feature name alone.

Align Host, SNI, and object paths before configuring the integration

Common object storage addressing styles place the bucket name either in the hostname or in the path. Suppose the test object is /assets/release-v1.bin and users access www.example.com. The object key ultimately requested by the CDN must match the key in storage, without adding the bucket name twice or dropping a prefix during the origin fetch.

The configuration specification should include at least:

  • The user-facing domain and certificate, and whether HTTPS is enforced.

  • The actual object storage endpoint, bucket region, and addressing style.

  • The origin protocol, Host, TLS SNI, and certificate verification method.

  • The mapping from user-facing paths to object keys, and whether query parameters are forwarded to the origin.

  • The origin-fetch identity and its permission scope, including a gateway identity if needed.

  • Separate cache rules for successful responses, error responses, and authentication responses.

A working user-facing certificate does not prove that TLS verification between the CDN and storage is correct. The origin IP may be correct while Host selects the wrong bucket; Host may be correct while SNI or certificate verification does not match. When troubleshooting 403 or 404 responses, compare the actual origin request first rather than immediately relaxing bucket permissions.

Compare origin responses while preserving Host and SNI

The following example is for an origin or authentication gateway under your control. api.example.com represents an origin hostname with a configured certificate, and 203.0.113.10 is a documentation example address, not a Selectel endpoint. Real tests must use only addresses you are authorized to access, and origin details should not be disclosed publicly.

curl --resolve api.example.com:443:203.0.113.10 \
  --connect-timeout 5 --max-time 30 \
  -sS -D origin-headers.txt -o origin-body.bin \
  -w 'status=%{http_code} bytes=%{size_download}\n' \
  'https://api.example.com/assets/release-v1.bin'

This command changes the connection destination while preserving the URL's Host and TLS SNI. Do not use a direct request to an HTTPS origin IP with certificate verification disabled as evidence that the real origin-fetch path works. Managed object storage may also require a specific endpoint or use dynamic addresses, so do not indiscriminately pin its IP.

If the origin is intended to be private, a 403 response to an anonymous request may be the expected result. Test the service identity separately using a protected SDK or signing tool. If an object intended to be public returns 403, check the bucket policy and object permissions. For 404, first check the bucket, object key, and path mapping. Some storage services may use a uniform error response to conceal whether an object exists, so make the final determination using storage logs as well.

Cache acceptance testing must verify both authorization and content

First define which inputs change the file

The cache key must retain dimensions that change the response content, such as the object path, actual version parameters, image transformation parameters, and request headers that genuinely affect the returned content. Tracking parameters unrelated to content may be excluded, but first confirm that the origin does not return different files based on them.

Do not assume that the CDN automatically bypasses caching when Cookie or Authorization is present. Check the actual rules for the resource. For downloads whose content differs by user, an identical URL is not sufficient justification for a shared cache.

Files whose contents are identical for all authorized users can share a file cache after reliable edge authentication, provided authentication occurs before the cached response is returned and signature exclusion rules cannot let unauthorized requests bypass validation. Without configuration documentation and warm-cache test evidence supporting this behavior, stop sharing private-object caches and use a per-request authorization path instead.

Build a permission and cache test matrix

Run the following tests only on dedicated test objects that contain no real personal data. Generate valid links through the actual application issuance process, and do not save them in command history or public logs.

Test request

Cold-cache acceptance criterion

Warm-cache acceptance criterion

Access the target object with valid authorization

Return the correct content

Return the same content while still checking authorization

No authorization supplied

Deny access

Must not succeed because content is already cached

Expired or tampered authorization

Deny access

Must not return the cached file

Reuse authorization for another object

Deny access according to the authorization scope

Must not extend permissions across objects

An unauthorized account accesses the same path

Deny access

Must not share another user's private response

Direct request to the storage endpoint

Follow the intended origin permission model

Remain unaffected by the CDN cache state

Test order matters. First complete a download with valid authorization, then send unauthorized and expired requests from a fresh session. This exposes implementations that authenticate only on origin fetches. For expiration tests, avoid the exact expiration boundary, account for clock skew, and verify which layer rejects the request after expiration.

Link expiration and content revocation are also different. The former limits subsequent requests; the latter may require revoking every existing access path. Plan temporary-link validity, edge purging, shield invalidation, browser caching, and the treatment of old URLs together. CDN purges cannot reclaim copies users have already downloaded.

Compare content with real GET requests, not just HEAD

The following example performs two GET requests for a public test object. For private objects, supply authorization through a protected test program; do not put real Tokens in shared commands.

for n in 1 2; do
  curl --connect-timeout 5 --max-time 30 \
    -sS -D "cdn-${n}.headers" -o "cdn-${n}.bin" \
    -w 'status=%{http_code} bytes=%{size_download} ttfb=%{time_starttransfer} total=%{time_total}\n' \
    'https://www.example.com/assets/release-v1.bin'
done
sha256sum cdn-1.bin cdn-2.bin

Check status codes, file sizes, content hashes, and the response's Cache-Control, Vary, ETag, Age, and any cache diagnostic fields actually present. This example does not assume that Selectel returns a particular proprietary cache-hit header. A faster second request or an increasing Age is only an indication of caching. Matching file hashes establish only that these two responses contain identical content, not that permissions are correct.

The command's TTFB is curl's cumulative time from the start of the request until the first byte, not origin processing time alone; total is the duration of the complete transfer. Each curl invocation here generally establishes a new connection, so the results do not directly represent browser performance with connection reuse. HEAD may follow a different processing path and cannot replace GET-based content and byte-count validation.

How shielding, Range, and error caching affect origin costs

An edge MISS does not equal one complete storage read

According to the official product page, an edge cache miss may be served by the origin shield. Edge MISS counts therefore cannot be directly converted into object storage GET counts or egress bytes. Even with edge logs, storage-side access records or usage data are needed to cross-check actual origin fetches.

Origin shielding can reduce duplicate fetches of the same object by multiple edge locations, but it cannot eliminate all origin requests. New objects, version changes, reads after invalidation, uncacheable responses, revalidation, and prefetching can all generate storage requests. Conditional requests may count as requests even when they return 304 without a full response body, depending on the storage billing rules.

For large files, focus on Range rather than request hit ratio alone

Downloaders and players frequently use Range. A small range request might fetch the same amount from the origin, or it might cause the CDN to read a larger chunk or the entire object. This depends on the implementation and must not be assumed.

curl --connect-timeout 5 --max-time 30 \
  -sS -D range.headers -o range.bin \
  -H 'Range: bytes=0-1048575' \
  'https://www.example.com/assets/release-v1.bin'

The test object must be larger than the requested range. A response that correctly supports this range should return 206. Verify Content-Range, the actual body length, and the corresponding byte content. If the response is 200 with the full file, check whether the origin supports Range, whether the CDN forwards the header, and whether compression or transformation rules are involved. Successfully returning the full file does not demonstrate support for resumable downloads.

Next, test adjacent ranges, repeated ranges, and seeks to different positions while observing incremental requests and bytes on the storage side. Hits on many small images can make the request hit ratio look good, while misses on a few large files account for most egress. Cost analysis therefore also requires byte-based metrics. However, origin costs cannot be estimated simply by multiplying user-delivered bytes by the miss ratio, because shielding, chunking, revalidation, and prefetching change that relationship.

Define error caching and stale-content behavior separately

If an origin 403 response is cached, users may continue receiving access denials after credentials are fixed. A cached 404 can make a newly uploaded file temporarily unavailable. Confirm which status codes are cacheable, how long they are cached, and how to purge them precisely after a fix. Do not assume that the successful-response TTL also applies to errors.

The Selectel product page lists Use Stale, which is worth evaluating for continued delivery of public static assets during origin failures. However, serving old content after authorization is revoked, a sensitive file is withdrawn, or the origin returns 403 may violate business requirements. Separately test origin timeouts, 5xx responses, 403 responses, and object deletion after a successful cached response expires. Specify which conditions permit stale delivery rather than enabling it uniformly for all resources.

Make cost validation a controlled, reconcilable experiment

Split the budget into four layers, not one traffic rate

The official product page mentions pay-as-you-go pricing as well as monthly traffic packages configured per CDN resource, with usage-based charges beyond the allowance. Confirm the billing model applicable to the selected resource during procurement rather than budgeting solely from the summary at the top of the page.

The page displays prices in rubles, but the materials reviewed here do not provide usable CDN package figures or regional object storage rates for calculation. They therefore do not support RMB conversions or per-GB cost conclusions. Request an itemized quote covering:

Cost layer

Scope and units to confirm

CDN delivery

Delivery regions, currency, package per resource, included traffic, overage rate, and GB or GiB

Object storage

Storage region, capacity units, units for reads and other requests, and destination of origin-fetch egress

Additional features

Whether shielding, prefetching, logs, purges, and certificates incur separate charges or have allowance limits

Supporting architecture

Authentication gateway, compute instances, log retention, operations, and migration costs

Also confirm how failed requests, interrupted transfers, response headers, retries, and cross-region access are metered, whether taxes are included, and how long usage takes to appear in billing. Object storage capacity pricing is not egress pricing, and entry-level prices for other cloud products cannot be used to infer CDN costs.

Use a dedicated prefix to test cold reads, warm reads, and purges separately

Create a dedicated test prefix and prepare small objects, large objects, and Range test objects, recording their sizes and content hashes. Make test usage separately attributable wherever possible. If billing provides only account-level aggregates, isolate the test window and record other application activity; otherwise, the entire increase cannot be attributed to the CDN.

Use the following sequence:

  1. Record the starting CDN usage, storage request, and egress baselines, using a consistent time zone.

  2. Request a new, uncached object version and record the request time, response, and storage reads.

  3. Repeat requests under the same conditions and compare incremental storage usage during the warm-cache phase.

  4. Repeat requests from representative user regions and observe whether shielding reduces duplicate reads.

  5. Perform prefetching, targeted purges, and object updates separately, recording the corresponding cost changes.

  6. Run small Range requests and failed-authorization tests, checking request and byte metering.

  7. Wait until usage and billing data have been fully recorded before drawing reconciliation conclusions.

Do not force cold-cache requests with random query parameters unless you have confirmed that those parameters participate in the cache key and do not affect authorization or object content. A more controlled approach is to use new versioned object keys and limit the test scale to avoid unnecessary egress from the test itself.

Explain reconciliation differences rather than just looking for a smaller bill

An acceptable cost audit trail should establish how many user requests succeeded and failed, how much the edge actually delivered, how much was read from storage, and which measurement definitions each dataset uses. User retries, interrupted connections, prefetching, multiple cache layers, and log delays can all cause differences.

If storage egress during the warm-cache phase remains close to user download volume, investigate cache-key fragmentation, overly short TTLs, uncacheable responses, Range amplification, or direct access bypassing the CDN. If request counts fall but bytes remain high, prioritize large files and prefetch behavior. Do not extrapolate a short experiment into a monthly budget while differences remain unexplained.

Phased rollout and procurement acceptance: set explicit pass criteria

For the first phase, migrate only one public asset prefix or one controlled download use case, not all static assets and private attachments at once. Before rollout, prepare the user-facing domain certificate, origin Host and SNI, and DNS and TTL plans. Retain the original path and check whether existing security rules incorrectly block origin fetches. When adjusting rules, change only the necessary domains, paths, and service identities, then review and revert temporary settings after testing.

The observation window should cover cache expiration, at least one asset release, authorization expiration, and the posting of usage charges—not just the few minutes after a DNS change. For performance observations across representative regions, CdnChart's website speed test can help organize access samples, but private-bucket authorization and billing attribution must still be verified within your own account. Selectel provider information can help compile vendor background, but directory information must not be treated as a commitment about features available in your current account.

Include the following conditions in the acceptance checklist:

  • Permissions pass: Anonymous access to private objects at the origin is denied; unauthorized, expired, and tampered requests are also rejected with a warm cache; authorization cannot be extended to other objects.

  • Content passes: File hashes, types, sizes, and Range behavior are correct; version updates become visible; policies for 403, 404, and stale content meet business requirements.

  • Costs pass: CDN and storage measurement definitions, regions, currencies, and units are clear; incremental usage from cold reads, warm reads, purges, and prefetching can be explained.

  • Operations pass: Credentials can be rotated with least privilege, and logs support troubleshooting; targeted purges, configuration restoration, and switching back to the original path have all been rehearsed.

Unauthorized downloads, incorrect files, or certificate problems should trigger an immediate stop to the affected rollout. Origin costs exceeding the agreed budget threshold, persistent authentication failures, or unexplained read amplification should pause expansion pending review. Rollback requires more than changing DNS: issued links, old caches, and origin permissions must also be handled. For private content, temporarily opening the entire bucket must never be used as a recovery measure.

The final decision can be straightforward. For public, versioned objects approved for distribution, expand the integration once paths are correct and warm caching demonstrably reduces actual storage reads. For private objects, retain application authorization or a gateway if per-request authentication and controlled origin access cannot be demonstrated. Whether Selectel CDN suits this use case depends on those two sets of evidence—not on the convenience of using one provider or a single download appearing faster.

  • Selectel CDN
  • Object storage CDN integration acceptance testing
  • Private bucket access permissions
  • CDN origin cost reconciliation

Related posts