Interface management and control method and device, equipment and storage medium
By reading and applying interface control policies in the browser, hiding and disabling APIs and generating target APIs, the security risk of web pages bypassing APIs is solved, and the security of the browser is improved.
Patent Information
- Application Number
- CN202311757453.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2025-06-20
AI Technical Summary
Even if the API is disabled, web pages can still bypass the disable restrictions in various ways and obtain relevant API information, thereby exploiting API vulnerabilities, resulting in security risks in the browser during access.
Before accessing the web page, read the interface control policy for the API, and according to the policy, hide part of the API interface and generate another part of the API interface. The generated API interface is the target interface for web page calls, and the hidden API interface is the preset interface for prohibiting web page calls.
It effectively avoids web pages from obtaining interface information of preset interfaces by bypassing the disabled settings, preventing the browser interface from being hijacked by bad web pages, and reducing the security risks of the browser.
Smart Images

Figure CN120180393A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular, to an interface control method, apparatus, device, and storage medium. Background Art
[0002] With the development of computer technology, in order to enrich the user experience and achieve specific business requirements, more and more software begins to call Application Programming Interfaces (APIs) to utilize external data and functions, and can also interact with other software components.
[0003] However, during the use of browser JavaScript APIs, even if the API is disabled, the web page will bypass the disable restriction in various ways to obtain relevant API information, analyze the vulnerabilities of the API, and exploit them, resulting in security risks during the browser access process. Summary of the Invention
[0004] Embodiments of the present application provide an interface control method, apparatus, device, and storage medium, aiming to solve the problem that even if the API is disabled, the web page can still obtain relevant API information, causing security risks.
[0005] Other features and advantages of the present application will become apparent through the following detailed description, or be partially learned through the practice of the present application.
[0006] According to one aspect of the embodiments of the present application, an interface control method is provided, including: in response to a web page access instruction, reading an interface control policy; according to the interface control policy, hiding a preset interface and generating a target interface; parsing the web page and providing the target interface to the web page.
[0007] In some embodiments of the present application, the step of hiding a preset interface and generating a target interface according to the interface control policy specifically includes: according to the interface control policy, determining the interfaces that the web page can access and the interfaces that are prohibited from being accessed; using the interfaces that are prohibited from being accessed as the preset interfaces and hiding the interface information; using the interfaces that can be accessed as the target interfaces and generating interfaces according to the interface information.
[0008] In some embodiments of the present application, before the step of reading the interface control policy in response to the web page access instruction, the interface control method further includes: in response to a user configuration instruction, configuring the interface control policy; storing the interface control policy locally.
[0009] In some embodiments of the present application, before reading the interface control policy in response to a web page access instruction, the interface control method further includes: receiving the interface control policy sent by the management platform.
[0010] In some embodiments of the present application, after parsing the web page and providing the target interface to the web page, the interface control method further includes: updating the interface control policy; in response to a refresh of the web page, reading the updated interface control policy; and updating the target interface and the preset interface according to the updated interface control policy.
[0011] In some embodiments of the present application, the step of, in response to a refresh of the web page, reading the updated interface control policy specifically includes: in response to the update of the interface control policy, refreshing the web page; and reading the updated interface control policy.
[0012] In some embodiments of the present application, the step of, in response to the update of the interface control policy, refreshing the web page specifically includes: in response to the update of the interface control policy, sending a prompt message for refreshing the web page to the user; and in response to the user's confirmation of the prompt message, refreshing the web page.
[0013] According to one aspect of the embodiments of the present application, there is provided an interface control device, including: a policy reading module, configured to read an interface control policy in response to a web page access instruction; an interface control module, configured to hide a preset interface and generate a target interface according to the interface control policy; and a web page parsing module, configured to parse a web page and provide the target interface to the web page.
[0014] In some embodiments of the present application, the interface control module specifically includes: an interface determination sub-module, configured to determine, according to the interface control policy, the interfaces that the web page can access and the interfaces that are prohibited from being accessed; an interface hiding sub-module, configured to use the interfaces that are prohibited from being accessed as preset interfaces and hide the interface information; and an interface generation sub-module, configured to use the interfaces that can be accessed as target interfaces and generate interfaces according to the interface information.
[0015] In some embodiments of the present application, the interface control device further includes: a policy configuration module, configured to configure the interface control policy in response to a user's configuration instruction; and a policy receiving module, configured to store the interface control policy locally.
[0016] In some embodiments of the present application, the interface control device further includes: a policy receiving module, configured to receive the interface control policy sent by the management platform.
[0017] In some embodiments of the present application, the interface control device further includes: a policy update module for updating the interface control policy; a policy rereading module for reading the updated interface control policy in response to a refresh of the web page; and an interface update module for updating the target interface and the preset interface according to the updated interface control policy.
[0018] In some embodiments of the present application, the policy rereading module specifically includes: a web page refresh sub-module for refreshing the web page in response to an update of the interface control policy; and a policy reading sub-module for reading the updated interface control policy.
[0019] In some embodiments of the present application, the web page refresh sub-module specifically includes: an information prompt unit for sending a prompt message for refreshing the web page to the user in response to an update of the interface control policy; and a web page refresh unit for refreshing the web page in response to the user's confirmation of the prompt message.
[0020] According to one aspect of the embodiments of the present application, there is provided a computer-readable medium having a computer program stored thereon, and when the computer program is executed by a processor, it implements the interface control method as described in the above embodiments.
[0021] According to one aspect of the embodiments of the present application, there is provided an electronic device, including: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the interface control method as described in the above embodiments.
[0022] In the technical solutions provided by some embodiments of the present application, before accessing a web page, an interface control policy for an API is read, and according to the interface control policy, a part of the API interfaces are hidden and a part of the API interfaces are generated. The generated API interfaces are target interfaces for the web page to call, and the hidden API interfaces are preset interfaces prohibited from being called by the web page. After the preset interfaces are hidden, the web page cannot obtain any information about the preset interfaces, nor can it determine the existence of the preset interfaces, and thus there will be no way to obtain the interface information of the preset interfaces by various means of bypassing the disabling settings, avoiding the hijacking of the browser's interfaces by malicious web pages and reducing the security risks of the browser.
[0023] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings herein are incorporated into and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the accompanying drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts. In the drawings:
[0025] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown.
[0026] Figure 2 A schematic flowchart showing a process of interface control provided by an embodiment of the present application is shown.
[0027] Figure 3 It shows according to Figure 2 Another specific implementation flowchart of the interface control method shown in the corresponding embodiment is shown.
[0028] Figure 4 It shows according to Figure 3 A specific implementation flowchart of step S500 in the interface control method shown in the corresponding embodiment is shown.
[0029] Figure 5 A schematic diagram showing the structure of an interface control device provided by an embodiment of the present application is shown.
[0030] Figure 6 A schematic diagram showing the structure of an electronic device provided by an embodiment of the present application is shown. Detailed implementation manners
[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more complete and comprehensive, and will fully convey the concept of the example embodiments to those skilled in the art.
[0032] In addition, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present application.
[0033] The block diagrams shown in the drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0034] The flowcharts shown in the drawings are only exemplary descriptions, and do not necessarily include all contents and operations / steps, nor are they necessarily executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined. Therefore, the actual execution order may change according to the actual situation.
[0035] Figure 1 The schematic diagram shows an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied. As Figure 1 shown, the system architecture may include a client 100 and a server 200.
[0036] A browser is installed on the client 100, which is a terminal device for users to operate communication software. It can be a mobile terminal, a notebook, a desktop computer, a wearable device, a digital camera, or any other terminal device with a browser installed. The server 200 is a computing device that provides computing, application, and management services for the client 100. A corresponding web page runs on it. It can send web page information to the client 100 in real time. It can be a data center, a server cluster, a server, and a desktop workstation, etc.
[0037] The user uses the client 100 to enter the corresponding website address in the browser for access operations. The client 100 responds to the web page access instruction, reads the interface control policy, then hides the preset interface according to the interface control policy, generates a target interface, parses the web page, and sends the access request to the server 200. The server 200 responds to the access request, returns the web page information to the client 100, and at the same time, initiates an API call request to the client 100 according to the requirement. The client 100 determines whether to allow the API call according to the call request.
[0038] It should be noted that the client 100 and the server 200 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but are not limited thereto. The client 100 and the server 200 can be connected through Bluetooth, USB (Universal Serial Bus), or other communication connection methods. The present invention does not make any restrictions here.
[0039] The following details the implementation of the technical solution of the embodiment of the present application:
[0040] Figure 2The flowchart of an interface control method according to an embodiment of the present application is shown. The interface control method can be executed by a client, and the client can be Figure 1 the client shown in
[0041] Referring to Figure 2 shown, the interface control method at least includes:
[0042] Step S100, in response to a web page access instruction, read the interface control policy.
[0043] Step S200, according to the interface control policy, hide the preset interface and generate a target interface.
[0044] Step S300, parse the web page and provide the target interface to the web page.
[0045] In the embodiment of the present application, before accessing a web page, read the interface control policy for APIs, and according to the interface control policy, hide a part of the API interfaces and generate a part of the API interfaces. The generated API interfaces are the target interfaces for the web page to call, and the hidden API interfaces are the preset interfaces prohibited from being called by the web page. After the preset interfaces are hidden, the web page cannot obtain any information about the preset interfaces, nor can it determine the existence of the preset interfaces, so there will be no way to obtain the interface information of the preset interfaces by various means of bypassing the disabling settings, avoiding the hijacking of the browser's interfaces by malicious web pages and reducing the security risks of the browser.
[0046] In step S100, when the user needs to access a web page, first read the interface control policy and load the interface control policy. The interface control policy is pre - placed in the browser. Whenever the browser needs to access a web page, it will first read the interface control policy to determine the interface permissions corresponding to the target web page to be accessed. The above - mentioned interface control policy can be a JSON configuration file, which contains the API access regulations for different web pages. The above - mentioned interface control policy can be issued by a management platform or configured locally, that is, it can be saved locally or dynamically obtained from a remote server.
[0047] In some other embodiments of the present application, before step S100, the interface control method further includes:
[0048] Receive the interface control policy issued by the management platform.
[0049] In the embodiments of the present application, the interface control policy can be managed and issued by the management platform. Specifically, the management platform first configures the interface control policy, determines the access permissions corresponding to each web page, determines the target interfaces that can be called by the web page and the preset interfaces that need to be hidden. The permissions can be set in the form of a whitelist, or in the form of a blacklist, or in the form of a combination of a whitelist and a blacklist. The present application does not make a limitation here.
[0050] When using the whitelist method, the APIs in the whitelist are determined as target interfaces, and the APIs not in the whitelist are determined as preset interfaces.
[0051] When using the blacklist method, the APIs in the blacklist are determined as preset interfaces, and the APIs not in the blacklist are determined as target interfaces.
[0052] When using the combination of whitelist and blacklist, the APIs in the whitelist are determined as target interfaces, the APIs in the blacklist are determined as preset interfaces, and the interfaces that are neither in the whitelist nor in the blacklist are determined as disabled interfaces. Disabled interfaces are interfaces that are prohibited from being called by web pages, but the interface information is not hidden. These APIs have a relatively high security level and low security risks.
[0053] The interface control policy is issued through the management platform, which facilitates enterprise users to perform batch network security management, realizes the dynamic update of the dynamic interface control policy, improves the security of web page access, and prevents potential malicious behaviors and attacks.
[0054] In other embodiments of the present application, before step S100, the interface control method further includes:
[0055] Responding to a user's configuration instruction, configuring the interface control policy.
[0056] Storing the interface control policy locally.
[0057] In this embodiment, the management platform can also open permissions to users to configure corresponding configuration policies locally. Specifically, users can configure the interface control policy on the relevant configuration page of the browser. It can be to determine the target interfaces that can be called and the preset interfaces that need to be hidden for each web page, or to determine the web pages that have the right to access and the web pages that need to be hidden for each interface.
[0058] The user operates on the local side to generate a configuration instruction. In response to the user's configuration instruction, the interface control policy is configured. After the configuration is completed, the interface control policy is directly stored locally.
[0059] In some embodiments, the configuration of the interface control policy can also be decentralized. After the user configures the interface control policy locally, it can be uploaded to other blockchain nodes through the blockchain. After receiving the interface control policy, other blockchain nodes will also deploy accordingly according to the interface control policy. Users with open permissions can configure the policy on any blockchain node and complete the policy distribution. Moreover, the distributed interface control policy is not easily hijacked and modified, making the configuration of the interface control policy more flexible and convenient, and improving the timeliness and security of policy configuration.
[0060] Here, it should be noted that the above configuration of the interface control policy can be configured by the user one by one according to actual needs, or can be automatically configured according to the relevant information of each web page. This application does not make any limitations here. Among them, the automatic configuration method of the interface control policy can specifically include the following steps: obtaining the interface call information of each web page; determining the interface control policy corresponding to each web page according to the interface call information of each web page.
[0061] In this embodiment, first obtain the interface call information corresponding to each web page, and then determine the interface control policy corresponding to each web page. Specifically, the interface call information includes the interface information of each interface that the web page needs to call, the data flow information when the web page calls each interface, and the data flow information between the web page server and the local end. According to the interface call information, it can be determined whether there is a risk in the network interaction process of the web page, the security risk of the web page can be judged, and then the interfaces that the web page can call and the interfaces that cannot be called can be determined, forming the corresponding interface control policy.
[0062] In an embodiment of the present application, the specific generation method can use a neural network model. After converting the data flow information in the interface call information into a five-tuple and then into a data flow vector, and converting the interface information into an interface vector, the above vectors are spliced together to form an interface call information vector matrix, and then the interface call information vector matrix is input into the policy model. The policy model outputs the control policy of the corresponding web page, and the policy model is a neural network model. Finally, the control policies of each web page are aggregated together to obtain the interface control policy.
[0063] Among them, the training method of the policy model mainly includes:
[0064] Obtain an interface call information sample set, where the interface call information sample set contains multiple interface call information samples, each of the interface call information samples corresponds to a web page and is accompanied by a corresponding control policy label.
[0065] Extract the corresponding interface call information sample vector matrix from the interface call information samples.
[0066] Input the interface call information sample vector matrix into the policy model one by one to obtain the control policy labels output by the policy model.
[0067] Update the parameters of the policy model according to the labels of the interface call information samples and the results output by the policy model until a predetermined condition is met, stop training, and obtain a trained policy model.
[0068] In this embodiment, in order to analyze and learn the feature matrix of the current interface call information, the convolutional neural network can well capture features such as locality contained in the data itself, mine the spatial correlation of the data, and has strong generalization ability and robustness. When training, there can be various conditions for marking the stop of training, that is, the conditions for the model to be trained well. Specifically, the following embodiments can be referred to.
[0069] Specifically, in some embodiments, the step of updating the parameters of the policy model according to the labels of the interface call information samples and the results output by the policy model until a predetermined condition is met, stop training, and obtain a trained policy model may specifically include:
[0070] If in the interface call information sample set, there are less than a predetermined number of interface call information samples, and the control policies output after the interface call information sample vector matrix after feature extraction is input into the parsing model are consistent with the control policy labels, then update the parameters of the policy model.
[0071] If in the interface call information sample set, there are more than a predetermined number of interface call information samples, and the control policies output after the interface call information sample vector matrix after feature extraction is input into the parsing model are consistent with the control policy labels, then a predetermined end condition is reached, end training, and obtain a trained policy model.
[0072] Specifically, in some other embodiments, the step of updating the parameters of the policy model according to the labels of the interface call information samples and the results output by the policy model until a predetermined condition is met, stop training, and obtain a trained policy model may specifically include:
[0073] Determine the loss function according to the labels of the interface call information samples and the results output by the policy model.
[0074] Update the parameters of the policy model according to the loss function until a predetermined end condition is reached, end training, and obtain a trained policy model.
[0075] In this embodiment, the loss function reaching the predetermined end condition may be that the loss function converges or the loss function is less than a predetermined loss (for example, 0.001).
[0076] In the above embodiments, the configuration of the web page control policy is performed through a neural network model obtained through multiple trainings, and the corresponding configuration results are obtained. The neural network model is obtained through multiple trainings. The more samples it is trained with, the more accurate the results are. During its operation, it basically does not require maintenance, which also reduces the maintenance cost, improves the efficiency and accuracy of web page recognition, reduces the false alarm rate, and improves the network security of users.
[0077] Specifically, in some embodiments, to determine the interface control policy corresponding to each web page, in addition to using the above interface call information as a basis, the current network environment and business requirements can also be used as a basis.
[0078] In some embodiments, the policy model can be composed of multiple sub-models. Different sub-models correspond to different network environments and business requirements. Then, the interface call information of a web page can be output by multiple sub-models with control policies in multiple situations, and finally, multiple interface control policies in different situations are obtained for users to switch and use in different situations.
[0079] In step S200, according to the interface control policy, a part of the API interfaces are hidden, and a part of the API interfaces are generated. The generated API interfaces are the target interfaces for the web page to call, and the hidden API interfaces are the preset interfaces prohibited from being called by the web page. After the preset interfaces are hidden, the web page cannot obtain any information about the preset interfaces and cannot determine the existence of the preset interfaces, and there will be no way to obtain the interface information of the preset interfaces by various means of bypassing the disabling settings, avoiding the hijacking of the browser's interfaces by malicious web pages and reducing the security risks of the browser.
[0080] Specifically, in some embodiments, the specific implementation manner of step S200 can refer to the following embodiments. This embodiment is based on Figure 2 The detailed description of step S200 in the interface control method shown in the corresponding embodiment. In the interface control method, step S200 may include the following steps:
[0081] According to the interface control policy, determine the interfaces that the web page can access and the interfaces prohibited from access.
[0082] Use the interfaces prohibited from access as preset interfaces and hide the interface information.
[0083] Use the interfaces that can be accessed as target interfaces and generate interfaces according to the interface information.
[0084] In the embodiments of the present application, according to the interface control policy, the API interfaces to be generated (i.e., the APIs for web page calls) and the API interfaces to be hidden (i.e., the APIs prohibited from web page calls) are determined. For the prohibited interfaces, they are used as preset interfaces, and their interface information is hidden, so that the web page cannot perceive the existence of the preset interfaces during the access process, and there will be no way to obtain the interface information of the preset interfaces by various means of bypassing the disable settings, avoiding the hijacking of the browser's interfaces by malicious web pages and reducing the security risks of the browser. For the accessible interfaces, they are used as target interfaces, and interfaces are generated according to their interface information, and in step S300, they are available for web page calls at any time.
[0085] In step S300, for the target interfaces for web page calls in the interface control policy, after parsing the web page, they can be called at any time according to the needs of the web page.
[0086] In some embodiments, as Figure 3 shown, after step S300, the interface control method further includes:
[0087] Step S400, updating the interface control policy.
[0088] Step S500, in response to the refresh of the web page, reading the updated interface control policy.
[0089] Step S600, according to the updated interface control policy, updating the target interface and the preset interface.
[0090] In the embodiments of the present application, the interface control policy can be dynamically updated. Specifically, after the interface control policy is updated, if the web page is refreshed, the updated interface control policy is read to update the interface permissions, that is, updating the target interface and the preset interface corresponding to the web page, and then parsing the web page to provide the updated target interface for the web page.
[0091] In step S400, the interface control policy can be updated in real time. In different network environments and for different business requirements, different interface control policies are needed to cope with them. Therefore, when the network environment changes and the business requirements change, the corresponding interface control policy should also change. The update of the interface control policy can be that the management platform directly issues a new interface control policy, or switching a suitable interface control policy at the local end, which is not limited in the present application.
[0092] In step S500, after the web page is refreshed, the updated interface control policy is read to update the interface permissions.
[0093] In some embodiments, after the interface control policy is updated, the user needs to manually perform a refresh operation, after which the web page is refreshed and the updated interface control policy is read to update the interface permissions.
[0094] In other embodiments, it may also be that after the interface control policy is updated, a web page refresh instruction is triggered, and the web page refresh step is entered. The updated interface control policy is read to update the interface permissions.
[0095] Specifically, in some embodiments, the specific implementation manner of step S500 can refer to Figure 4 . Figure 4 It is based on Figure 3 the detailed description of step S500 in the interface control method shown in the corresponding embodiment. In the interface control method, step S500 may include the following steps:
[0096] Step S510, in response to the update of the interface control policy, refresh the web page.
[0097] Step S520, read the updated interface control policy.
[0098] In the embodiments of the present application, when the interface control policy is updated, a web page refresh operation is triggered to refresh the web page. After the web page is refreshed, the updated interface control policy is read to update the interface permissions.
[0099] Specifically, in step S510, after the interface control policy is updated, in response to the update of the interface control policy, a prompt message for refreshing the web page is first sent to the user to prompt the user that the interface control policy has been updated and the web page needs to be refreshed to load the new control policy. If the user confirms the need to refresh the current web page, in response to the user's confirmation of the prompt message, the web page is refreshed; otherwise, the user is waited to manually refresh the web page to avoid the loss of relevant content edited by the user on the current web page due to the web page refresh, and at the same time, the user can be reminded to refresh the web page in time to load the latest interface control policy, improving the immediacy of the interface control policy update while ensuring the user experience, and thus improving the user's network security.
[0100] In step S520, the updated interface control policy is read to update the interface permissions.
[0101] In step S600, the updated interface control policy is used to update the interface permissions, that is, the target interface and the preset interface corresponding to the web page are updated, and then the web page is parsed to provide the updated target interface for the web page.
[0102] The following introduces the device embodiments of the present application, which can be used to execute the interface control method in the above embodiments of the present application. For the details not disclosed in the device embodiments of the present application, please refer to the embodiments of the above interface control method of the present application.
[0103] Figure 5 The block diagram of an interface control device according to an embodiment of the present application is shown.
[0104] Referring to Figure 5 As shown, an interface control device 500 according to an embodiment of the present application includes: a policy reading module 510, an interface control module 520, and a web page parsing module 530.
[0105] Among them, the policy reading module 510 is used to read the interface control policy in response to a web page access instruction; the interface control module 520 is used to hide a preset interface according to the interface control policy and generate a target interface; the web page parsing module 530 is used to parse the web page and provide the target interface to the web page.
[0106] In some embodiments of the present application, the interface control module specifically includes: an interface determination sub-module, which is used to determine the interfaces that can be accessed by the web page and the interfaces that are prohibited from being accessed according to the interface control policy; an interface hiding sub-module, which is used to use the prohibited interfaces as preset interfaces and hide the interface information; an interface generation sub-module, which is used to use the interfaces that can be accessed as target interfaces and generate interfaces according to the interface information.
[0107] In some embodiments of the present application, the interface control device further includes: a policy configuration module, which is used to configure the interface control policy in response to a user's configuration instruction; a policy receiving module, which is used to store the interface control policy locally.
[0108] In some embodiments of the present application, the interface control device further includes: a policy receiving module, which receives the interface control policy issued by the management platform.
[0109] In some embodiments of the present application, the interface control device further includes: a policy update module, which is used to update the interface control policy; a policy re-reading module, which is used to read the updated interface control policy in response to the refresh of the web page; an interface update module, which is used to update the target interface and the preset interface according to the updated interface control policy.
[0110] In some embodiments of the present application, the policy re-reading module specifically includes: a web page refresh sub-module, which is used to refresh the web page in response to the update of the interface control policy; a policy reading sub-module, which is used to read the updated interface control policy.
[0111] In some embodiments of the present application, the web page refresh sub-module specifically includes: an information prompt unit, configured to send a prompt message for refreshing the web page to the user in response to an update of the interface control policy; and a web page refresh unit, configured to refresh the web page in response to the user's confirmation of the prompt message.
[0112] In the embodiments of the present application, before accessing a web page, an interface control policy for an API is read, and according to the interface control policy, a part of the API interfaces are hidden and a part of the API interfaces are generated. The generated API interfaces are target interfaces for the web page to call, and the hidden API interfaces are preset interfaces prohibited from being called by the web page. After the preset interfaces are hidden, the web page cannot obtain any information about the preset interfaces, nor can it determine the existence of the preset interfaces, so there will be no way to obtain the interface information of the preset interfaces by various means of bypassing the disabling settings, avoiding the hijacking of the browser's interfaces by malicious web pages and reducing the security risk of the browser.
[0113] Figure 6 The structural diagram of a computer system of an electronic device suitable for implementing the embodiments of the present application is shown.
[0114] It should be noted that Figure 6 The computer system of the electronic device shown is only an example and should not bring any limitations to the functions and usage scopes of the embodiments of the present application.
[0115] As Figure 6 shown, the computer system includes a central processing unit (CPU) 1801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1802 or the program loaded from the storage section 1808 into the random access memory (RAM) 1803, such as executing the method described in the above embodiments. In the RAM 1803, various programs and data required for system operation are also stored. The CPU 1801, ROM 1802, and RAM 1803 are connected to each other through a bus 1804. The input / output (I / O) interface 1805 is also connected to the bus 1804.
[0116] The following components are connected to the I / O interface 1805: an input section 1806 including a keyboard, a mouse, etc.; an output section 1807 including such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc. and a speaker, etc.; a storage section 1808 including a hard disk, etc.; and a communication section 1809 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1809 performs communication processing via a network such as the Internet. A drive 1810 is also connected to the I / O interface 1805 as required. A removable medium 1811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1810 as required so that a computer program read from it is installed into the storage section 1808 as required.
[0117] Specifically, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 1809, and / or installed from the removable medium 1811. When the computer program is executed by a central processing unit (CPU) 1801, various functions defined in the system of the present application are executed.
[0118] It should be noted that the computer-readable medium shown in the embodiments of the present application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present application, the computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable computer program. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, and this computer-readable medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. Among them, each block in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0120] The units involved in the embodiments described in this application can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation to the unit itself in certain cases.
[0121] As another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiments.
[0122] It should be noted that although several modules or units of a device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more of the above-mentioned modules or units can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0123] From the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented in software, or in a manner combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of this application.
[0124] After considering the specification and practicing the embodiments disclosed herein, those skilled in the art will readily conceive of other embodiments of this application. This application is intended to cover any variations, uses, or adaptations of this application, which follow the general principles of this application and include common general knowledge or conventional technical means in the technical field not disclosed in this application.
[0125] It should be understood that this application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is only limited by the appended claims.
Claims
1. An interface control method, characterized in that, The interface control method includes: In response to a web page access instruction, read the interface control policy; According to the interface control policy, hide the preset interface and generate a target interface; Parse the web page and provide the target interface to the web page.
2. The interface control method according to claim 1, characterized in that, The step of hiding the preset interface and generating the target interface according to the interface control policy specifically includes: According to the interface control policy, determine the interfaces that the web page can access and the interfaces that are prohibited from access; Use the interfaces that are prohibited from access as the preset interfaces and hide the interface information; Use the interfaces that can be accessed as the target interfaces and generate interfaces according to the interface information.
3. The interface control method according to claim 1, characterized in that, Before the step of reading the interface control policy in response to a web page access instruction, the interface control method further includes: In response to a user's configuration instruction, configure the interface control policy; Store the interface control policy locally.
4. The interface control method according to claim 1, characterized in that, Before the step of reading the interface control policy in response to a web page access instruction, the interface control method further includes: Receive the interface control policy issued by the management platform.
5. The interface control method according to claim 1, characterized in that, After the step of parsing the web page and providing the target interface to the web page, the interface control method further includes: Update the interface control policy; In response to a refresh of the web page, read the updated interface control policy; According to the updated interface control policy, update the target interface and the preset interface.
6. The interface control method according to claim 5, characterized in that, The step of reading the updated interface control policy in response to a refresh of the web page specifically includes: In response to the update of the interface control policy, refresh the web page; Read the updated interface control policy.
7. The interface control method according to claim 6, characterized in that, The step of refreshing the web page in response to the update of the interface control policy specifically includes: In response to the update of the interface control policy, send a prompt message for refreshing the web page to the user; In response to the user's confirmation of the prompt message, refresh the web page.
8. An interface control device, characterized in that, The interface control device includes: A policy reading module, configured to read the interface control policy in response to a web page access instruction; An interface control module, configured to hide the preset interface and generate a target interface according to the interface control policy; A web page parsing module, configured to parse the web page and provide the target interface to the web page.
9. A computer-readable medium, on which a computer program is stored, characterized in that, The computer program, when executed by a processor, implements the interface control method according to any one of claims 1 to 7.
10. An electronic device, characterized in that, It includes: One or more processors; A storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the one or more processors to implement the interface control method according to any one of claims 1 to 7.