A method, apparatus, system, and computer-readable storage medium for preventing webpage tampering.
By receiving and caching page data on the bypass WAF and configuring a specific communication protocol, the problem of the bypass WAF of the load balancer not supporting webpage anti-tampering is solved, realizing webpage anti-tampering capability and security assurance, and supporting access control and tampering identification.
Patent Information
- Application Number
- CN202310627823.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2043-05-30
AI Technical Summary
Existing mainstream cloud service providers' bypass WAF products based on load balancing do not support webpage anti-tampering functions, leading to system availability risks.
By receiving traffic requests forwarded by the load balancer on the bypass WAF, it determines whether the target page belongs to the anti-tampering protected resource. If it is not cached, it requests and caches the page data from the origin server and responds to the load balancer with cached data. It can configure a specific communication protocol to directly respond to the target page data and supports access control verification and periodic data comparison to identify tampering.
It implements a bypass WAF based on load balancing devices, which has the ability to prevent web page tampering, ensures the integrity and security of page data, supports restricted access protection for specific users or roles, and promptly identifies and alerts users to tampering risks.
Smart Images

Figure CN116668445B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of network security, and specifically relates to a method, device and computer-readable storage medium for preventing webpage tampering. Background Technology
[0002] This section is intended to provide background or context for embodiments of the invention as set forth in the claims. The description herein is not intended to imply that it is prior art simply because it is included in this section.
[0003] To avoid system availability risks caused by sequential deployment of WAFs, most mainstream cloud vendors currently provide... Figure 1 The cloud-based bypass WAF (Web Application Firewall) solution based on a load balancer (LB / Connector) shown can directly forward requests to the origin server when the WAF fails, thus achieving a balance between availability and security.
[0004] The core processing idea of cloud-based bypass WAF is that the load balancer forwards the request traffic to the WAF for detection, and then the load balancer decides whether to forward the traffic to the actual service site (origin site) based on the detection result of the WAF response.
[0005] However, most mainstream cloud service providers' bypass WAF products based on load balancing do not support webpage anti-tampering functionality, which has become an urgent problem to be solved. Summary of the Invention
[0006] To address the problems existing in the prior art, a method, apparatus, system, and computer-readable storage medium for preventing webpage tampering are proposed. Using this method, apparatus, and computer-readable storage medium, a bypass WAF based on a load balancing device can be equipped with webpage tampering capabilities.
[0007] The present invention provides the following solutions.
[0008] Firstly, a webpage anti-tampering method is provided, applied to a bypass WAF, comprising: receiving a traffic request for a target page forwarded by a load balancer; when it is determined that the target page belongs to an anti-tampering protected resource, sending a page data request for the target page data to the origin server without caching the target page data; receiving and caching the target page data responded by the origin server; and responding to the load balancer with the cached target page data.
[0009] In one implementation, the bypass WAF is configured with a specific communication protocol for directly responding to cached target page data to the load balancer.
[0010] In one implementation, after receiving a traffic request for a target page forwarded by a load balancer, the method further includes: determining whether the traffic request requires access control verification; if access control verification is required, performing the following verification actions: forwarding the HTTP header of the traffic request and the assembled identity verification message to the origin server; receiving an authorization access instruction from the origin server, the authorization access instruction indicating whether access authorization has been obtained; and determining whether to respond to the load balancer with cached target page data based on the access authorization instruction.
[0011] In one implementation, the method further includes: if the authorized access instruction indicates that access authorization has been obtained, then responding to the load balancer with cached target page data; if the authorized access instruction indicates that access authorization has not been obtained, then returning a denied access response to the load balancer.
[0012] In one implementation, the method further includes: periodically sending traffic requests to the origin server for the anti-tampering protection resource to obtain the response data of the origin server for the anti-tampering protection resource; and determining whether the anti-tampering protection resource has been tampered with by comparing whether the response data is consistent with the cached data of the anti-tampering protection resource.
[0013] In one implementation, sending a page data request for target page data to the origin server further includes: accessing the origin server through a load balancing device and sending the page data request for target page data.
[0014] In one implementation, the bypass WAF is configured with anti-tampering protection resources that need to be protected. The method further includes: repeatedly learning the response results of the source station to the website resources, identifying the correct website resource page data, and caching it as anti-tampering protection resources.
[0015] Secondly, a method for preventing webpage tampering is provided, comprising: a load balancer receiving request traffic from a user terminal for target page data and forwarding the request traffic to a bypass WAF; the bypass WAF executing the method of the first aspect to respond to the load balancer with cached target page data; and the load balancer returning the target page data to the user terminal.
[0016] Thirdly, a webpage anti-tampering system is provided, comprising: a user terminal for sending request traffic for target page data to a load balancing device; a load balancing device for forwarding the request traffic to a bypass WAF and returning the target page data responded by the bypass WAF to the user terminal; a bypass WAF for performing the method as described in any one of claims 1-7; and an origin server for responding to the page data request for target page data sent by the bypass WAF by responding with target page data.
[0017] Fourthly, a webpage anti-tampering device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform: the method of the first aspect.
[0018] Fifthly, a computer-readable storage medium is provided, which stores a program that, when executed by a multi-core processor, causes the multi-core processor to perform the method of the first or second aspect.
[0019] One of the advantages of the above embodiments is that it enables bypass WAFs based on load balancing devices to have webpage anti-tampering capabilities.
[0020] Other advantages of the present invention will be explained in more detail below with reference to the accompanying drawings.
[0021] It should be understood that the above description is merely an overview of the technical solution of the present invention, so as to enable a clearer understanding of the technical means of the present invention, and thus to implement it in accordance with the contents of the specification. To make the above and other objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are illustrated below. Attached Figure Description
[0022] By reading the detailed description of the exemplary embodiments below, those skilled in the art will understand the advantages and benefits described herein, as well as other advantages and benefits. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0023] Figure 1 This is a schematic diagram of the cloud-based bypass WAF architecture based on a load balancing device.
[0024] Figure 2 This is a flowchart illustrating a webpage anti-tampering method according to an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of the interactive process of a webpage anti-tampering method according to an embodiment of the present invention;
[0026] Figure 4 This is a flowchart illustrating a webpage anti-tampering method according to another embodiment of the present invention;
[0027] Figure 5 This is a schematic diagram of the interactive process of a webpage anti-tampering method according to another embodiment of the present invention.
[0028] In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts. Detailed Implementation
[0029] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0030] In the description of the embodiments of this application, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, numbers, steps, behaviors, components, portions or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence of one or more other features, numbers, steps, behaviors, components, portions or combinations thereof.
[0031] Unless otherwise stated, " / " means "or". For example, A / B can mean A or B. In this article, "and / or" is merely a way of describing the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.
[0032] The terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of embodiments of this application, unless otherwise stated, "a plurality of" means two or more.
[0033] To clearly illustrate the embodiments of this application, some concepts that may appear in subsequent embodiments will be introduced first.
[0034] A bypass WAF (Web Application Firewall) is a device that detects and blocks attacks such as SQL injection, cross-site scripting, web trojan uploads, command / code injection, file inclusion, access to sensitive files, third-party application vulnerability attacks, CC attacks, malicious crawler scanning, and cross-site request forgery by inspecting HTTP(S) requests, thereby protecting the security and stability of web services.
[0035] Load balancing (LB) devices are a type of cluster technology that balances the load (work tasks) and distributes them across multiple unit operations to improve concurrent processing capabilities.
[0036] It should also be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.
[0037] Figure 2 This is a flowchart illustrating a webpage anti-tampering method according to an embodiment of this application, applied to a bypass WAF to achieve webpage anti-tampering capabilities. In this process, from a device perspective, the executing entity can be one or more electronic devices; from a program perspective, the executing entity can correspondingly be a program mounted on these electronic devices. In this embodiment, the executing entity of the method can be... Figure 1 The processor in the illustrated embodiment.
[0038] like Figure 2 As shown, the method provided in this embodiment may include the following steps:
[0039] 201. Receive traffic requests for a target page forwarded by the load balancer (LB);
[0040] 202. Determine whether the target page data belongs to the anti-tampering protected resources; among which, the anti-tampering protected resources that need to be protected can be pre-configured on the WAF.
[0041] Furthermore, when it is determined that the target page belongs to the anti-tampering protected resource, the following steps 203-206 are performed to carry out anti-tampering operations:
[0042] 203. Determine whether the target page data is cached on the WAF;
[0043] If the target page data is not cached on the WAF, perform the following steps 204-205 to cache the target page data:
[0044] 204. Send a page data request for the target page data to the origin server;
[0045] 205. Receive and cache the target page data from the origin server's response;
[0046] If the target page data is cached on the WAF, or if the target page data from the origin server's response has been cached on the WAF after the above steps 204-205, then perform the following step 206:
[0047] 206. Respond to the load balancer with cached target page data.
[0048] Conversely, when it is determined that the target page data does not belong to the tamper-proof protected resources, perform the following step 207:
[0049] 207. Process directly and normally, without the need for additional anti-tampering measures.
[0050] Figure 3 This diagram illustrates the webpage anti-tampering interaction between the user client, load balancer, WAF, and origin server. The following section combines... Figure 3 The interaction process is described in detail.
[0051] S1. The user sends a traffic request for the target page to the load balancer.
[0052] S2. The load balancer forwards (mirrores) the traffic request to the WAF;
[0053] S3, WAF determines whether the target page corresponding to the traffic request belongs to the anti-tampering protected resource;
[0054] S4. If the target page is a tamper-proof protected resource and the WAF does not cache the target page, then request the target page data from the origin server.
[0055] S5. The origin server responds to the WAF with the data for the target page;
[0056] S6. The WAF caches the target page data. At this point, the WAF caches the target page.
[0057] S7, WAF responds to the load balancer with cached target page data;
[0058] S8. The load balancing device returns the cached target page data to the user terminal in a tamper-proof manner.
[0059] Thus, when a WAF encounters an uncached page that needs to be protected against tampering, it will access the origin server to obtain the page data, and then cache and respond to it, enabling a bypass WAF based on a load balancer to have the ability to prevent web page tampering.
[0060] In one implementation, the bypass WAF is configured with a specific communication protocol to directly respond to the load balancer with cached target page data. For example, the HTTP protocol can be reused as the specific communication protocol for this configuration, but a special response code, such as 700, can be used. This enables the direct response of cached target webpage data to the load balancer.
[0061] Generally, website tamper protection can only protect pages that can be accessed without identity verification, such as public pages. However, if tamper protection is required for restricted access for specific users or roles, it is necessary to add access control verification to protect resources that require user identity verification.
[0062] Figure 4A flowchart illustrating a webpage anti-tampering method according to another embodiment of this application is shown, wherein after step 201 above, additional access control verification steps 410-440 are designed:
[0063] 410. Determine whether the target page corresponding to the traffic request needs access control verification;
[0064] Specifically, different target pages have different access control requirements. For example, if the target page is a private page, access control verification may be required; conversely, if the target page is a public page, access control verification may not be required. You can configure the WAF to specify the resources that require access control verification.
[0065] If access control verification is required, perform the following verification actions 420-440:
[0066] 420. Forward the HTTP header of the traffic request and the assembled identity verification message to the origin server;
[0067] 430. Receive the authorized access instruction from the source server.
[0068] The origin server performs access control verification on the identity verification message and then generates the authorized access instruction, which is used to indicate whether access authorization is granted.
[0069] 440. Determine whether to respond to the load balancer with cached target page data based on the access authorization instruction.
[0070] Furthermore, the 440 specifically includes:
[0071] 441. If the authorized access instruction indicates that access authorization has been obtained, then the cached target page data should be sent to the load balancer.
[0072] 442. If the authorized access command indicates that access authorization has not been obtained, then return an access denied response to the load balancer.
[0073] Figure 5 The diagram illustrates the interaction between the client, load balancer, WAF, and origin server for access control verification. The following section combines... Figure 5 The interaction process is described in detail.
[0074] S1. The user sends a traffic request for the target page to the load balancer.
[0075] S2. The load balancer forwards (mirrores) the traffic request to the WAF;
[0076] S3, WAF determines whether the target page corresponding to the traffic request needs access control verification;
[0077] S4. If verification is required, the WAF forwards the HTTP header and the identity verification message assembled according to the traffic request to the origin server.
[0078] S5. The origin server performs access control verification based on this identity verification message;
[0079] S6. The source server responds to the WAF to indicate whether access is authorized;
[0080] S7. If authorized access is granted, the WAF responds to the load balancer with the cached target page data.
[0081] S8. The load balancing device returns tamper-proof cached target page data to the user terminal;
[0082] S9. If unauthorized access is not granted, the WAF returns a denied access message to the load balancer.
[0083] S10, The load balancer returns a denial of access to the user.
[0084] This enables tamper-proof protection of web pages under restricted access for specific users or roles.
[0085] In one implementation, the method further includes: periodically sending traffic requests to the origin server for any one or more anti-tampering protection resources to obtain response data from the origin server for the anti-tampering protection resources; and determining whether the anti-tampering protection resources have been tampered with by comparing whether the response data is consistent with the cached data of the anti-tampering protection resources.
[0086] It is understandable that if the webpage data on the origin server is tampered with at some point, it will inevitably differ from the cached webpage data previously cached on the WAF. By periodically forwarding traffic requests to the origin server and comparing the response data of the origin server with the WAF cached data, it is possible to effectively identify whether the origin server data has been tampered with, thereby providing timely risk warnings.
[0087] In one implementation, sending a page data request for target page data to the origin server further includes: accessing the origin server via a load balancer and sending the page data request for the target page data. This simplifies the cloud network access architecture.
[0088] Optionally, by repeatedly learning from the origin server's responses to website resources, the correct website resource page data can be identified and cached as anti-tampering protected resources. It's understandable that before anti-tampering protection takes effect, a WAF typically has a learning phase. This phase involves learning about website resources to determine the specific resources that need protection. For example, for the same access address, the origin server may provide both correct and incorrect responses. By learning from a certain number of response results, it can better identify which page is correct and needs to be saved.
[0089] Based on the same technical concept, this invention also provides another method for preventing webpage tampering, the execution subject of which is a load balancer and a WAF.
[0090] In this process, the load balancer receives request traffic from the user client for target page data and forwards the request traffic to the WAF; the WAF executes the method described in the above embodiments to respond to the load balancer with cached target page data; finally, the load balancer returns the target page data to the user client.
[0091] It is understood that the method in this embodiment can implement the various processes of the foregoing embodiments and achieve the same effect and function, which will not be repeated here.
[0092] Based on the same technical concept, embodiments of the present invention also provide a webpage anti-tampering system for executing the webpage anti-tampering method provided in any of the above embodiments.
[0093] like Figure 3 As shown, the system includes:
[0094] On the user side, it is used to send request traffic for target page data to the load balancing device;
[0095] Load balancing devices are used to forward request traffic to a WAF and return the target page data of the WAF response to the user.
[0096] WAF, used to perform the methods as described in the above embodiments; and
[0097] The origin server is used to respond to page data requests sent by the WAF for target page data and to provide the target page data.
[0098] It is understood that the above embodiments have fully explained how the user terminal, load balancing device, WAF and origin server work together to achieve bypass WAF webpage anti-tampering, and will not be repeated here.
[0099] In the description of this specification, the references to terms such as "some possible implementations," "some embodiments," "examples," "specific examples," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0100] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0101] Regarding the method flowcharts of embodiments of this application, certain operations are described as different steps performed in a certain order. Such flowcharts are illustrative and not restrictive. Some steps described herein may be grouped together and performed in a single operation, some steps may be divided into multiple sub-steps, and some steps may be performed in an order different from that shown herein. The various steps shown in the flowcharts may be implemented in any way by any circuit structure and / or tangible mechanism (e.g., software running on a computer device, hardware (e.g., logic functions implemented by a processor or chip), and / or any combination thereof).
[0102] According to some embodiments of this application, a webpage anti-tampering device is provided, the device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described in the above embodiments.
[0103] According to some embodiments of this application, a non-volatile computer storage medium is provided for a webpage anti-tampering method, having stored thereon computer-executable instructions configured to execute, when run by a processor, the method described in the above embodiments.
[0104] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. Furthermore, although the operations of the method of the invention are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all of the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0105] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the descriptions of the apparatus, device, and computer-readable storage medium embodiments are simplified because they are substantially similar to the method embodiments; relevant details can be found in the descriptions of the method embodiments.
[0106] The apparatus, device, and computer-readable storage medium provided in the embodiments of this application are one-to-one corresponding to the method. Therefore, the apparatus, device, and computer-readable storage medium also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the apparatus, device, and computer-readable storage medium will not be repeated here.
[0107] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
Claims
1. A method for preventing webpage tampering, characterized in that, Applied to bypass WAF, the method includes: Receive traffic requests for the target page forwarded by the load balancer; When it is determined that the target page belongs to the anti-tampering protected resource, a page data request for the target page data is sent to the origin server without caching the target page data; Receive and cache the target page data of the origin server's response; and, The target page data is cached and responded to the load balancing device through a specific communication protocol, wherein the specific communication protocol is used to indicate a communication method that reuses the HTTP protocol but uses a special response code; The anti-tampering protected resources are the correct website resource page data identified by repeatedly learning the source site's response results to website resources.
2. The method according to claim 1, characterized in that, The bypass WAF is configured with a specific communication protocol for directly responding to the cached target page data of the load balancing device.
3. The method according to claim 1, characterized in that, After receiving the traffic request for the target page forwarded by the load balancer, the method further includes: Determine whether the traffic request requires access control verification; If the access control verification is required, perform the following verification actions: Forward the HTTP headers of the traffic request and the assembled identity verification message to the origin server; Receive the authorized access instruction from the source station, the authorized access instruction being used to indicate whether access authorization is granted; The access authorization instruction determines whether to respond to the load balancer with the cached target page data.
4. The method according to claim 3, characterized in that, The method further includes: If the authorized access instruction indicates that access authorization has been obtained, then the cached target page data is responded to the load balancing device. If the authorized access instruction indicates that access authorization has not been obtained, then an access denial response is returned to the load balancer.
5. The method according to claim 1, characterized in that, Also includes: Periodically, traffic requests for the tamper-proof protected resource will be sent to the origin server to obtain the response data of the origin server for the tamper-proof protected resource; By comparing the response data with the cached data of the tamper-proof protected resource, it can be determined whether the tamper-proof protected resource has been tampered with.
6. The method according to claim 1, characterized in that, Sending a page data request for the target page data to the origin server further includes: accessing the origin server through a load balancing device and sending a page data request for the target page data.
7. The method according to claim 1, characterized in that, The bypass WAF is configured with the tamper-proof protected resources that need to be protected, and the method also... include: In this process, the system repeatedly learns from the source site's response to website resources, identifies the correct website resource page data, and caches it as the anti-tampering protected resource.
8. A method for preventing webpage tampering, characterized in that, include: The load balancing device receives request traffic from the user terminal for data of the target page and forwards the request traffic to the bypass WAF; The bypass WAF performs the method as described in any one of claims 1-7 to respond to the load balancing device with the cached target page data; The load balancing device returns the target page data to the user terminal.
9. A webpage anti-tampering system, characterized in that, include: On the user side, it is used to send request traffic for target page data to the load balancing device; A load balancing device is used to forward the request traffic to a bypass WAF and return the target page data of the bypass WAF response to the user terminal. The bypass WAF is used to perform the method as described in any one of claims 1-7; The origin server is used to respond to the page data request sent by the bypass WAF for the target page data and to provide the target page data.
10. A webpage anti-tampering device, characterized in that, include: At least one processor; And a memory communicatively connected to at least one processor; wherein the memory stores instructions executable by at least one processor, the instructions being executed by at least one processor to enable at least one processor to perform: the method as described in any one of claims 1-7.
11. A computer-readable storage medium storing a program that, when executed by a multi-core processor, causes the multi-core processor to perform the method as claimed in any one of claims 1-7 or the method as claimed in claim 8.
Citation Information
Patent Citations
Method and device for defending user website from being tampered
CN103118033A
Web application firewall method and system based on application gateway
CN111181924A
WEB page tampering detection method and system
CN114444127A
WAF bypass deployment system and method
CN115529164A
