Hongmu Notes
Home Summary of pitfalls Which is better: the Return Source Authentication feature or timestamp-based anti-link劫持 mechanism?
Summary of pitfalls

Which is better: the Return Source Authentication feature or timestamp-based anti-link劫持 mechanism?

Which is better: the Return Source Authentication feature or timestamp-based anti-link劫持 mechanism?

Resource origin authentication and timestamp-based anti-spoofing are both common technical measures used to protect resources against unauthorized access; each has its own advantages and disadvantages – the appropriate solution can be selected based on specific requirements.

  1. Return Source Authentication:

    • Advantage: Source-based authentication determines whether to grant access to the original content on the source server by verifying the authentication information contained in the request. This approach offers greater flexibility, as it allows for the configuration of various authentication rules based on specific requirements, enabling more granular access control.
    • Disadvantages: Source-side authentication requires authentication between the CDN and the source server, which may increase request processing time and network overhead. Additionally, the management and updating of authentication information require corresponding policy and resource investments.
  2. Timestamp-based防盗链:

    • Advantage: The timestamp-based防盗链 mechanism involves adding a timestamp parameter to the resource URL, ensuring that each request URL is unique. By verifying the timestamp within the URL, it is possible to determine whether a request is valid. This approach is simple and easy to implement, as it requires no additional authentication steps.
    • Disadvantages: The timestamp-based防盗链机制 is relatively simple, and its authentication mechanism is rather rudimentary, making it vulnerable to attacks by malicious users. Since a new URL must be generated for each request, this increases the URL length and reduces the cache hit rate, which may adversely affect the performance of the CDN cache.

Overall, source-based authentication offers more flexible and granular access control capabilities, making it suitable for scenarios requiring advanced resource protection and access permission management. In contrast, timestamp-based anti-link-hijacking is simpler and more convenient, ideal for scenarios with较低 security requirements or where the resources themselves are not particularly sensitive. The choice between these two approaches should be based on actual requirements and the desired level of resource protection.

微信赞赏

WeChat

支付宝赞赏

Alipay

✍️ Author: Hong Mu

webmaster · Thanks for reading, stay tuned for more exciting content

Author homepage View home page →

Related articles

How to upload files using Qiniu Cloud Object Storage with PHP? How to compress images during file upload?

How to upload files using Qiniu Cloud Object Storage with PHP? How to compress images during file upload? Summary of pitfalls

Recently, I came across an image-sharing platform and, out of necessity, decided to use Object Storage. After reviewing the official documentation, I finally managed to implement the functionality I needed – so, here's a summary! How do you upload files to Qiniu Cloud Object Storage? First, include the official SDK file in your project. Then, in PHP, simply write the code; due to the confidentiality requirements of my business, I will only share the code for the file-upload portion! <?php require'./vendor/a...
👁 173
Qiniu Cloud Object Storage enables simple PHP file uploads.

Qiniu Cloud Object Storage enables simple PHP file uploads. Summary of pitfalls

Qiniu Cloud Object Storage supports simple file uploads; the official documentation also provides upload code examples. The following code can be used to test file uploads—simply replace the placeholders with your own access key and storage bucket name. <?php require 'vendor/autoload.php'; use Qiniu\Auth; // Import the upload class use Qiniu\Storage\Uploa...
👁 192
How can I download files from my private storage using Qiniu Cloud Object Storage with PHP?

How can I download files from my private storage using Qiniu Cloud Object Storage with PHP? Summary of pitfalls

To download a file from a Qiniu Cloud Private Space, you first need to obtain its download link. You can follow these steps to do so: 1. Obtain the download domain name for your private space: -In the Qiniu Cloud backend, select the corresponding storage space. -Navigate to the "Domain Settings" page. -Locate the download domain name for your private space (e.g., http://<domain>); note this address for later use. 2. Generate a download link: Use the Qiniu Cloud PHP SDK...
👁 179
After enabling the Private Space feature in Qiniu Cloud Object Storage and subsequently activating the Timestamp-based Anti-Link Hijacking feature, how can you retrieve a download link using PHP?

After enabling the Private Space feature in Qiniu Cloud Object Storage and subsequently activating the Timestamp-based Anti-Link Hijacking feature, how can you retrieve a download link using PHP? Summary of pitfalls

This tool is really handy! After enabling the private space feature in Qiniu Cloud Object Storage, the timestamp-based防盗 linking feature was also activated. How can you obtain a download link? When the timestamp verification feature is enabled for your Qiniu Cloud Object Storage private space, you need to include a timestamp parameter when generating a temporary download link. Here are the specific steps: To obtain the download domain name for your private space: In the Qiniu Cloud backend, select the corresponding storage space, navigate to the "Domain Name Settings" page, and locate the section for the private space...
👁 212
Qiniu Cloud – Are there any ways to prevent unauthorized transactions on my object storage account?

Qiniu Cloud – Are there any ways to prevent unauthorized transactions on my object storage account? Summary of pitfalls

The CDN supports various防盗链配置 options; different防盗链 mechanisms are suitable for different application scenarios. It is recommended to configure the following in the "CDN> Domain Name Management> Configuration> Access Control" section: 1. Referer-based防盗链: Only HTTP requests that include the corresponding Referer HTTP header can access the resource. However, from a technical perspective, the Referer header can be forged...
👁 375
What does "CDN return traffic" mean?

What does "CDN return traffic" mean? Summary of pitfalls

CDN origin traffic refers to the data transfer volume that occurs when a user requests content hosted on a CDN node; if the requested content is not cached at that node or if the cached content has expired, the CDN will send a request to the origin server to retrieve the original content, then transmit that content back to the CDN node over the network, and finally deliver it to the user. The amount of data transferred during this process is known as origin traffic. The primary purpose of a CDN is to cache content at nodes located as close as possible to the end users...
👁 341

Recommended reading

What does `if __name__ == '__main__' ` mean in Python?

What does `if __name__ == '__main__' ` mean in Python? Language Notes python

`if __name__ == '__main__':` is a commonly used conditional statement in Python that allows a Python file to be executed as an independent script or imported as a module by other Python scripts. Specifically, when a Python file is run as a script, the `if __name__ == '__main__':` clause...
👁 136
(PC+WAP) Blue Atmospheric Infrastructure Construction Project – Construction Industry PbootCMS Website Template; Download Source Code for Infrastructure Facility Project Company Websites – 0107

(PC+WAP) Blue Atmospheric Infrastructure Construction Project – Construction Industry PbootCMS Website Template; Download Source Code for Infrastructure Facility Project Company Websites – 0107 Practical Collection pbootcms Template

This PbootCMS template features a sophisticated blue color scheme, making it ideal for infrastructure construction projects and construction-related enterprises; it supports both PC and WAP devices. Its robust, professional design effectively showcases infrastructure projects, engineering case studies, and corporate strength, helping construction or infrastructure companies establish an authoritative online presence. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin...
👁 70
(Adaptive mobile version) Responsive communication, power finance, and healthcare technology websites – PBootCMS template; Black-themed smart medical device website source code download – 0745

(Adaptive mobile version) Responsive communication, power finance, and healthcare technology websites – PBootCMS template; Black-themed smart medical device website source code download – 0745 Practical Collection pbootcms Template

A responsive PbootCMS website template for communication, power, finance, healthcare technology, and smart medical devices – compatible with both PC and WAP devices. The sleek black design is ideal for showcasing high-end medical equipment, smart technology products, and more. It helps technology companies establish a professional, premium brand image online. Template Display | Installation Instructions | Website Backend: /admin.php | Username: admin | Password: admin | Extraction Password: www.4...
👁 48
Responsive Brand Window Display Website Template 0216

Responsive Brand Window Display Website Template 0216 Practical Collection Yiyou template

An eyouCMS responsive website template designed for the brand window display and retail display industry. Its creative visual design style is ideal for showcasing window display concepts, display solutions, brand presentations, and commercial space case studies. This template helps display display design firms showcase their professional expertise online and attract brand clients. Template Demo | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Common Installation Questions for YouyouCMS...
👁 59
Responsive commercial space design and construction website template – 0882

Responsive commercial space design and construction website template – 0882 Practical Collection Yiyou template

An EyouCMS responsive website template designed for the design and construction of commercial spaces. Its modern and professional design style effectively showcases commercial space design projects, construction techniques, and brand strength, helping commercial space design firms attract corporate clients online. Template Display | Installation Instructions | Website Backend: /login.php | Username: admin | Password: admin | Related Articles: Summary of Common Installation Issues for EyouCMS | EyouCMS...
👁 48
PHP check if an image is a 404 error

PHP check if an image is a 404 error Language Notes PHP

In PHP, you can determine whether an image corresponds to a 404 error by sending an HTTP request. The specific implementation involves using the `curl` library or the `file_get_contents` function to send an HTTP request and then checking whether the response status code is 404. Here is an example of code using the `curl` library: `function is_image_404_using_curl($image_url...)`
👁 283