URL Validation
Application Scenario
Some bad sites may steal links from other sites to enrich their content without any costs. Link stealing damages the interests of the original websites and it is also a strain on their servers. OBS provides URL validation to solve this problem.
In HTTP, a website can detect the web page that accesses a target web page using the Referer field. As the Referer field can trace sources, specific techniques can be used to block or return to specific web pages if the pages are not from the website. URL validation checks whether the Referer field in requests matches the whitelist or blacklist by setting Referer. If the field matches the whitelist, the requests are allowed. Otherwise, the requests are blocked or specific pages are displayed.
OBS supports URL validation based on the Referer header field in HTTP requests to prevent a user's data in OBS from being stolen by other users. OBS supports both whitelists and blacklists.
The principles for setting Referer are as follows:
- The length of a whitelist or blacklist cannot exceed 1,024 characters.
- Referer format:
- You can enter multiple referers, each in a line.
- The referer parameter supports asterisks (*) and question marks (?). An asterisk works as a wildcard that can replace zero or multiple characters, and a question mark (?) can replace a single character.
- If the referer header field contains http or https during download, the referer must contain http or https.
- If Whitelisted Referers is left blank but Blacklisted Referers is not, all websites except those specified in the blacklist are allowed to access data in the target bucket.
- If Whitelisted Referers is configured, only the websites specified in the whitelist are allowed to access data in the target bucket, regardless of whether Blacklisted Referers is configured or not.
If Whitelisted Referers is configured the same as Blacklisted Referers, the blacklist takes effect. For example, if both Whitelisted Referers and Blacklisted Referers are set to https://www.example.com, access requests from this address will be blocked.
- If both Whitelisted Referers and Blacklisted Referers are left blank, all websites are allowed to access data in the target bucket by default.
- Before determining whether a user has the four types of permissions (Read, Write, ACL View, and ACL Edit) for a bucket or objects in the bucket, check whether this user complies with the URL validation principles of the Referer field.
How to Use This Function
You can use OBS Console or APIs to set URL validation.
For details about how to set URL validation on OBS Console, see Configuring URL Validation.
Last Article: CDN Acceleration
Next Article: Tags
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.