Business resource access control method, device, electronic device and storage medium
By displaying random paths and verification controls on the first page of the target application, a two-factor authentication mechanism without installing software is implemented, which solves the maintenance costs and security vulnerabilities of existing SPA technology and improves the security and efficiency of network attack protection.
Patent Information
- Application Number
- CN202410780636.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2044-06-17
AI Technical Summary
Existing Single Package Authorization (SPA) technology requires the installation of specific software or tools, has maintenance costs and potential security vulnerabilities, and is difficult to effectively protect against network attacks.
By displaying a randomly generated random path and verification control on the first page of the target application, requiring users to enter an authorization code and complete two-factor authentication before displaying the login page and business resources, page technology is used to achieve efficient security protection without installing software.
It effectively prevents scanning and attacks by network attackers, ensures that only authorized employees can access business resources, and reduces software management costs and the risk of security vulnerabilities.
Smart Images

Figure CN118353720B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network security technology, and in particular to a method, device, electronic device and storage medium for controlling access to business resources. Background Art
[0002] Cyber attackers usually use scanning operations to detect weaknesses or vulnerabilities in applications, and then launch attacks against the detected weaknesses or vulnerabilities.
[0003] Currently, the Single Packet Authorization (SPA) technology can be used to effectively avoid scanning operations by network attackers. When a client attempts to establish a connection with the application server, SPA technology requires the client to send a specially constructed authentication data packet to the server. The server verifies the permissions of the authentication data packet and only opens the port or service to the client after the verification is successful.
[0004] However, the existing SPA technology requires the installation of specific software or tools in the device to construct the authentication data packet. On the one hand, the software or tool requires maintenance costs, and on the other hand, it may have technical defects or potential vulnerabilities that can be exploited by network attackers. Therefore, a more secure and efficient application protection method is currently needed. Summary of the invention
[0005] In view of this, the embodiments of the present disclosure provide a method, device, electronic device and storage medium for controlling access to business resources, which can protect business resources safely and efficiently.
[0006] On the one hand, the present disclosure provides a method for controlling access to business resources, the method comprising: in response to an access request initiated for a first page of a target application through a specific address, displaying the first page, wherein the first page includes a verification control, and the specific address of the first page includes a randomly generated random path; receiving an authorization code entered in the verification control, and in response to the authorization code being successfully authenticated, displaying a login page of the target application; receiving authentication information entered in the login page, and in response to the authentication information being successfully authenticated, displaying a page of related business resources of the target application.
[0007] On the other hand, the present disclosure also provides an access control device for business resources, the device comprising: a first page display unit, for displaying a first page of a target application in response to an access request initiated through a specific address, wherein the first page includes a verification control, and the specific address includes a randomly generated random path; a login page display unit, for receiving an authorization code entered in the verification control, and in response to the authorization code being successfully authenticated, displaying a login page of the target application; a page resource display unit, for receiving authentication information entered in the login page, and in response to the authentication information being successfully authenticated, displaying a page of related business resources of the target application.
[0008] Another aspect of the present disclosure provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method described above is implemented.
[0009] Another aspect of the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0010] In the technical solutions of some embodiments of the present disclosure, a first page can be set for the target application, and the business resources of the target application can be accessed only after completing the authentication in the first page. Among them, the specific address of the first page will contain a randomly generated random path, and usually only employees within the enterprise can know the specific address. After accessing the first page, it is also necessary to complete the authentication of the authorization code in the first page before entering the login page of the target application. Generally speaking, the authorization code can only be obtained by employees within the enterprise. In this way, based on the dual authentication of the specific address and authorization code of the first page, it can ensure that the business resources of the target application can only be accessed by employees with authority within the enterprise. Since the network attacker cannot know the specific address and authorization code of the first page, it is impossible to establish an effective connection with the server of the target application, and thus cannot perform a scanning operation on the server of the target application. The above-mentioned technical solution of the present disclosure can be implemented based on page technology, without the need to install specific software or tools, and can protect the application safely and efficiently. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0012] Figure 1 A schematic diagram of a network architecture of a method for controlling access to business resources provided by an embodiment of the present disclosure is shown;
[0013] Figure 2 A schematic diagram showing a flow chart of a method for controlling access to business resources provided by an embodiment of the present disclosure is shown;
[0014] Figure 3 A schematic diagram of a scenario of a method for controlling access to business resources provided by an embodiment of the present disclosure is shown;
[0015] Figure 4 A schematic diagram of a scenario of a method for controlling access to business resources provided by an embodiment of the present disclosure is shown;
[0016] Figure 5 A schematic diagram showing a flow chart of a method for controlling access to business resources provided by an embodiment of the present disclosure is shown;
[0017] Figure 6 A schematic diagram showing a flow chart of a method for controlling access to business resources provided by an embodiment of the present disclosure is shown;
[0018] Figure 7 A schematic diagram of an access control device provided by an embodiment of the present disclosure is shown;
[0019] Figure 8 A schematic diagram of an electronic device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0021] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0022] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.
[0023] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0024] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.
[0025] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.
[0026] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.
[0027] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0028] Office security usually involves the security management of networks, identities, and terminals. By implementing private network networking, access control, terminal management in private networks, and information security protection, digital office can be made safer, more efficient, and easier to use. Security management at the network level can ensure that private networks such as office networks can operate safely and efficiently, thereby ensuring that business data can be safely transmitted and stored. Security management at the identity level can improve the efficiency and security of identity authentication for users accessing private networks. Security management at the terminal level can achieve unified management of terminal devices within the private network, data leakage prevention, and terminal threat protection, thereby ensuring the security of corporate data.
[0029] In actual applications, the security management of networks, identities, and terminals can achieve technical linkage in multiple technical branches such as networking strategies, network access and control, remote access, unified terminal management, terminal detection and response, enterprise data leakage prevention, and identity authentication management, making digital office simpler, more efficient, and easier to implement.
[0030] SPA is a security technology used to reduce the risk of scanning. Before trying to establish a connection, a specially constructed authentication package is sent to the server. The authentication package contains enough information for the server to verify the client, so as to determine whether the client initiating the request has the authority to access the specified service or resource. After successful verification, the server will open the port or service and allow the client to establish a formal connection. Related technologies are usually implemented using a four-layer single-packet authorization scheme. This method requires users to install specific software or tools to specially construct TCP or UDP four-layer data packets to request access to network services. For enterprises, software tools have compatibility issues with operating systems or network devices, and may increase the management costs of enterprises in software maintenance. On the other hand, the software and tools that SPA relies on may contain technical defects or undiscovered vulnerabilities, which may be exploited by attackers to bypass the SPA mechanism. For enterprise employees, they also need to download and install related clients, which may be cumbersome and reduce the promotion and implementation of security solutions within the enterprise.
[0031] Based on this, the present disclosure provides a method for access control of business resources, which is applied to the server and can be applied to corporate offices. The seven-layer SPA solution is deployed on the server, which can achieve the stealth effect of Web applications without installing any software, improve the security of the process of obtaining business resources, and also achieve the effect of being unable to be scanned and avoided from being attacked.
[0032] Combined with reference Figure 1 , Figure 1 A schematic diagram of the network architecture of a method for controlling access to business resources provided for an embodiment of the present disclosure. Herein, resources refer to content that is stored and transmitted in a digital manner and can be accessed through a network, such as audio and video files, pictures, and texts. The client is installed on a terminal device, and the server is deployed on a server device. A SPA solution is deployed on the server, and based on the SPA solution, the resources of the target application can be hidden according to the administrator's settings. For a hidden target application, a corresponding first page will be generated. When accessing a hidden resource, the client needs to access the first page and perform verification on the first page. When verification succeeds, a page of related business resources is displayed on the client's display device; when verification fails, a 404 page is displayed, indicating that the client cannot access the hidden resource.
[0033] According to an embodiment of the present disclosure, an embodiment of a method for access control of business resources is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] In this embodiment, a method for controlling access to business resources is provided, which is applied to a client. Figure 2 is a flow chart of a method for controlling access to business resources according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:
[0035] Step S101 , in response to an access request initiated via a specific address for a first page of a target application, display the first page.
[0036] The first page includes a verification control, and the specific address includes a randomly generated random path.
[0037] The target application refers to a Web application that has the business stealth function enabled according to actual needs. By default, the application with the stealth function enabled cannot be directly accessed, and its corresponding first page and authorization code will be generated based on the seven-layer application stealth solution deployed on the server. The specific address is private, and the specific address and authorization code of the first page can be issued to specific people. The first page is equivalent to the exclusive knocking page of the application with the stealth function enabled. All pages other than the first page, including static resources, cannot be accessed without authorization. The style of the first page is domain / sc / random path, where the random path is randomly generated, and domain / sc can be the domain name of the target application.
[0038] When the target application needs to be accessed and the target application is set to invisible state, if the client user is issued the first page link (i.e., specific address) and authorization code of the target application, an access request can be directly initiated to the first page of the target application, and the first page is displayed on the client's display device. A verification control is provided on the first page, which can be in the form of a text input box for entering the authorization code.
[0039] Step S102, receiving the authorization code input in the verification control, and in response to the authorization code being successfully authenticated, displaying the login page of the target application.
[0040] The client user enters the authorization code in the verification control, and the authorization code corresponds to the first page. After receiving the input authorization code, the server verifies it. After successful verification, the client receives data indicating successful verification and displays the login page of the target application on the client's display device. The login page is the login page of the target application.
[0041] If the entered authorization code cannot be verified, the client cannot receive relevant data of the target application and cannot display the login page of the target application.
[0042] Step S103, receiving the authentication information input in the login page, and in response to the authentication information being successfully authenticated, displaying a page of relevant business resources of the target application.
[0043] Client users can enter authentication information on the target application's login page. The authentication information can include user name, password, verification code, etc. After the user enters the authentication information on the login page, clicks the control that indicates submission. The server receives the authentication information and performs authentication. When the authentication is successful, the page of the target application's related business resources is displayed on the client.
[0044] The access control method for business resources provided in this embodiment, when receiving an access request initiated for the first page of the target application, displays the first page, verifies the authorization code entered in the first page, and when the verification is successful, displays the login page of the target application for the user to enter the authentication information, authenticates the authentication information, and when the authentication is successful, displays the page of the relevant business resources of the target application. This scenario is as follows Figure 3 This method can directly enable the stealth function for the target application that needs authentication, thereby generating its corresponding first page. Only users who enter the authorization code and pass the verification on the first page can normally access the login page of the target application to log in. The Web application can be made invisible without installing a client, achieving the effect of being unable to be scanned or attacked, and can safely and efficiently protect business resources.
[0045] In some optional embodiments, the method for accessing a service resource further includes:
[0046] Step S21: If no access request is initiated for the first page, or the authorization code fails to be authenticated, a resource access request is initiated to the target application, and in response to the resource access request, a prompt page indicating that the business resource cannot be provided is displayed.
[0047] The target application in this embodiment refers to an application with the stealth function turned on, which is inaccessible by default. That is, if you need to log in to the target application to view the relevant resources of the target application, you first need to access the first page of the target application through a specific address. When accessing pages other than the first page (for example: the homepage of the target application), including static resources, the relevant resources of the target application cannot be obtained, and a prompt page indicating that the business resources cannot be prompted will be displayed on the display device. When the server receives an access request for the target application for a page other than the first page, a prompt page is displayed on the client's display device, indicating that the business resources cannot be provided. Specifically, the prompt page can be a 404 page.
[0048] When you access the first page of the target application through a specific address and enter the authorization code, the server verifies the authorization code. If the authorization code is entered incorrectly, the verification fails. In this case, the resources of the target application cannot be displayed, and a prompt page will be displayed on the client's display device, indicating that the business resources cannot be provided.
[0049] The method described in this embodiment requires that for a target application with a stealth function enabled, the first page must be accessed first and the target application can be accessed only if the authorization code authentication succeeds. The target application cannot be accessed if the target application is accessed directly or if the authorization code authentication fails. This method can prevent possible attackers from detecting the directory of the target application by brute force scanning, thereby improving the security of the target application.
[0050] In some optional embodiments, after the authorization code is successfully authenticated, the address information of the initiator of the access request is set as a trusted address. In response to the authorization code being successfully authenticated, the method for accessing business resources further includes:
[0051] Step 22, receiving and storing cache data returned by the server of the target application, wherein the cache data includes the authorization code of successful authentication.
[0052] When the user enters the authorization code on the first page and submits it, the server verifies the authorization code. When the authorization code is successfully authenticated, the source IP that entered the authorization code is added to the whitelist, indicating that it is a trusted IP, that is, a trusted address, and then jumps to the login page of the target application. The server will create a session identifier for this authorization code authentication, that is, sessionID. The session identifier is globally unique, and based on the session identifier, a cookie is encapsulated and returned to the client. The encapsulated cookie contains the session identifier, the authorization code that passed the authorization authentication, etc. The client saves the cookie locally, which is the cache data returned by the server.
[0053] In some optional embodiments, the above step S22 further includes:
[0054] Step S23, if an access request is initiated again for the first page, or an access request is initiated for a page of relevant business resources of the target application, the login page of the target application is displayed, wherein the access request carries cached data, the authorization code in the cached data carried in the access request is authenticated, and the trusted address in the cached data is consistent with the address information of the initiator.
[0055] For client users who have visited the target application before, when they visit the first page again or directly access the target application, the server will first verify the source IP of the client (that is, the address information of the initiator) to determine whether it is on the whitelist. When the source IP of the client is on the whitelist, it means that the address information of the client is a trusted address. In addition, the cache data carried in the access request initiated by the client will also be verified. The cache data stores the authorization code. For client devices that have entered the authorization code on the first page and successfully authenticated, the cache data returned by the server is locally stored and contains the authorization code. When the server authenticates the authorization code in the cache data and determines that the client address is a trusted address, the login page of the target application will be displayed directly on the client's page without the need for authentication on the first page.
[0056] The method described in this embodiment requires that, for a client accessing the target application or the first page again, it is necessary to determine whether its address information is a trusted address and whether it carries cached data of an authenticated authorization code. When the verification is successful, the login page of the target application is directly displayed regardless of whether the client accesses the first page or the target application. By verifying authorized users by adding a whitelist, setting a cache address, and setting a session identifier, it is possible to avoid affecting authorized normal users, not changing the user's usage habits, and improving the user experience.
[0057] Furthermore, the method further comprises:
[0058] Step S24, when an access request is initiated again for the first page, if the current address information of the initiator is inconsistent with the trusted address, or the authorization code in the cache data carried in the access request is not authenticated, the first page is displayed.
[0059] For the client that visits the first page again, the authorization code and address information in its cached data are verified. If the current address information of the initiator is inconsistent with the trusted address, it may be that the IP of the initiator has changed, or the authorization code in the cached data has not been authenticated. In this case, the first page will be displayed on the client's display device, that is, the user is required to re-enter the authorization code on the first page for re-authentication. The target application can be accessed only after the authorization code is authenticated.
[0060] Step S25, when initiating an access request to a page of business resources related to the target application, if the current address information of the initiator is inconsistent with the trusted address, or the authorization code in the cached data carried in the access request is not authenticated, a prompt page indicating that the business resources cannot be provided is displayed.
[0061] For clients that directly initiate access requests to pages of business resources related to the target application, the initiator's current address information and the authorization code in the cached data are verified. If the current address information is inconsistent with the trusted address, or the authorization code in the cached data is not authenticated, a prompt page indicating that the business resources cannot be provided is directly displayed on the client's display device. Specifically, the prompt page can be a 404 page. In this case, the page will not jump to the first page, which is unknown to the outside world and will only be displayed when the first page is accessed.
[0062] The method described in this embodiment requires that, for a client accessing the first page again, it is necessary to determine whether its current address information is a trusted address and whether it carries cached data of an authenticated authorization code. If the verification fails, the page jumps to the first page so that the user can enter the authorization code again for authentication. For users who directly access the target application, if the verification fails, a prompt page indicating that business resources cannot be provided is displayed. This method ensures the privacy of the first page, that is, only users who have been issued a specific address of the first page can authenticate by entering the authorization code on the first page, and then access the page of the relevant business resources of the target application, thereby avoiding the risk of the target application being scanned and further attacked by Internet attackers, and there is no need to install additional software, thereby reducing software management costs and security vulnerabilities and risks that may be introduced by installing software.
[0063] In some optional implementations, the method for accessing the service resource is as follows: Figure 4 As shown, the method is implemented through a seven-layer application stealth service, and the knocking page represents the first page. When the application turns on the business stealth function, the Web application is inaccessible by default, and an application-specific knocking page is generated, with a specific address such as http: / / abc.yingyong.com / sc / qwerttsda and an authorization code of r4sf. Only after requesting the knocking page first can the application be accessed.
[0064] When the user visits the knocking page and enters the authorization code on the knocking page, the server verifies the authorization code. If the verification is successful, the source IP of the client is added to the whitelist, and the cached data (cookie) with the authorization code is returned, and the server jumps to the relevant page of the application (for example: login page).
[0065] When a user directly accesses the application, it is determined whether the IP address of the user's client is in the whitelist, whether the cached data in the initiated access request contains an authorization code, and whether there is a valid session. If the verification fails, the user is denied access and a 404 page is returned.
[0066] For the access request to the relevant pages of the application again, the processing flow is as follows Figure 5As shown, it is determined whether the current IP is in the whitelist or whether it carries a valid session. If the verification fails, an access error is prompted and a 404 page is displayed; if the verification passes, the IP address is added to the whitelist or the time the IP address is in the whitelist is extended, and the access page is jumped at the same time.
[0067] Without authorization, all page resources (including static resources) other than the knocking page will return a 404 page, making it impossible for attackers to detect which directories this application has through brute force scanning.
[0068] In this embodiment, a method for controlling access to business resources is provided, which is applied to a server. Figure 6 is a flow chart of a method for controlling access to business resources according to an embodiment of the present disclosure, such as Figure 6 As shown, before displaying the first page, the method includes the following steps:
[0069] Step S301: split the business resources of the target application into multiple different resource directories.
[0070] The multiple different resource directories include a public resource directory and a non-public resource directory.
[0071] In this embodiment, the server deploys a seven-layer application stealth service, which can enable the stealth service of the target application as needed. When the client user needs to access the target application with the stealth service enabled, he needs to access the first page of the target application and enter the authorization code. Only after successful verification can he access the page of related business resources of the target application.
[0072] The server will split the front-end data packets of the application and divide different business resources into different resource directories. Different resource targets can include public resource directories and non-public resource directories. The public resource directory stores single-page applications that do not require knocking, and the non-public resource directory stores single-page applications that require knocking. Public resource directories and non-public resource directories are just types of directories. Multiple different resource directories can also include other types of directories. The public resource directory also includes related resources of the first page and the environment configuration resources of the target application.
[0073] For different configuration information, the access paths and access methods of resources in the public resource directory and the non-public resource directory in the generated configuration file are different.
[0074] Step S302: acquiring configuration information of the target application, generating a random address and an authorization code when the configuration information represents a hidden resource, and constructing a specific address of the first page based on the random address.
[0075] The configuration information of the target application is used to indicate whether the target application is hidden, and can be set by the administrator. In the case where the configuration information indicates a hidden resource, it means that the target application has enabled business invisibility. To access the target application that has enabled business invisibility, you first need to access its first page. First, a random address and a corresponding authorization code are generated to form the specific address of the first page. The random address can be 12 digits, and the specific address can be in the form of "domain / sc / random address". The authorization code is used to enter numbers or letters on the page after accessing the first page. After entering the authorization code, the authorization code is authenticated.
[0076] Step S303: Send the specific address of the first page and the authorization code to the target resource access party, so that the target resource access party can access the business resources under the non-public resource directory after completing the authentication in the first page through the authorization code.
[0077] The target resource access party can be considered as a user who is authorized to access the target application after being authenticated on the first page. After the first page of the target application and the authorization code are generated, the specific address of the first page and the authorization code are sent to the target resource access party via email, SMS, etc. When the target resource access party needs to access the target application, it needs to access the first page through the specific address and enter the correct authorization code in the first page to access the target application, thereby accessing the business resources under the non-public resource directory.
[0078] The method described in this embodiment splits the business resources of the target application, generates a random address and an authorization code when the configuration information represents a hidden resource, and thus constructs a specific address of the first page. The target resource accessor can access the business resources under the non-public resource directory only after completing the authentication in the first page through the authorization code. This method splits the business resources of the target application, which can ensure that all resources can be completely invisible after the application turns on the stealth state, and can only be accessed after entering the authorization code in the first page and passing the verification, thereby ensuring the security of the resources.
[0079] In some optional embodiments, step 301 includes the following steps:
[0080] Step S41, for any business resource of the target application, if the business resource needs to be accessed after authentication through the first page, the business resource is classified into a non-public resource directory; if the business resource does not need to be accessed after authentication through the first page, the business resource is classified into a public resource directory; wherein the public resource directory includes the first page.
[0081] Split the front-end package of the target application and split different business resources into different resource directories. Specifically, business resources that need to be accessed after authentication on the first page are divided into the non-public resource directory, and business resources that do not need to be accessed after authentication on the first page are divided into the public resource directory. The public resource directory also includes resources related to the first page and resources related to the environment configuration of the target application.
[0082] When the target application opens different configuration information, the access paths corresponding to different types of resource directories in the generated configuration file are different.
[0083] In this embodiment, the front-end package of the target application is split into different types of resource directories, so that when different configuration information is subsequently enabled, corresponding access paths can be generated for different types of resource directories.
[0084] In some optional embodiments, the method further includes: generating a configuration file of the target application according to current configuration information of the target application, wherein the configuration file includes access paths of various resource directories under the current configuration information.
[0085] The current configuration information of the target application may include turning on business stealth and turning off business stealth. Corresponding configuration files will be generated according to the different configuration information of the target application. When switching the configuration information of the target application, different configuration files can be generated through scripts. Since the business resources of the target application are divided into multiple different resource directories, the access path of the public resource directory is usually the original access path, and the access path of the non-public resource directory will change with the configuration information. The access paths of various resources are specified in the configuration file.
[0086] When business invisibility is not enabled, resources in the public resource directory and the private resource directory are usually accessed according to the original path, which is equivalent to directly accessing all resources.
[0087] When business invisibility is turned on, the server backend will generate a corresponding configuration file. In the configuration file, the access path of the public resource directory is usually the original access path, while the access path of the non-public resource directory needs to be determined by a specified method (for example: reverse proxy technology), so as to ensure the security of resources in the non-public resource directory in the invisibility state.
[0088] The access path under the current configuration information is determined as follows:
[0089] Step S42, if the current configuration information represents a public resource, identify the first original access path of the public resource directory, and identify the second original access path of the non-public resource directory; determine the first original access path as the access path of the public resource directory under the current configuration information, and determine the second original access path as the access path of the non-public resource directory under the current configuration information.
[0090] The current configuration information represents public resources, indicating that the configuration information of the current target application is non-stealth, and a configuration file of the target application will be generated at this time. The configuration file stores the access paths of the public resource directory and the non-public resource directory. The original path of the public resource directory is the first original access path, and the original path of the non-public resource directory is the second original access path. Under the public configuration information, the first original access path and the second original access path are used as the access paths of the public resource directory and the non-public resource directory, respectively.
[0091] Step S43, if the current configuration information represents hidden resources, identify the third original access path of the public resource directory, and determine the third original access path as the access path of the public resource directory under the current configuration information, and reverse proxy the access path of the non-public resource directory under the current configuration information to the server of the target application.
[0092] The current configuration information represents hidden resources, indicating that the configuration information of the current target application is invisible. At this time, a configuration file for the target application will be generated. The configuration file stores the access paths of the public resource directory and the non-public resource directory. The original path of the public resource directory is the third original access path, and the third original access path is used as the access path of the public resource directory. The access path of the non-public resource directory under the current configuration information is reverse proxied to the server of the target application, that is, the non-public resource directory can be reverse proxied to the server (web_server) of the target application through the reverse proxy technology (proxy_pass). The server can query whether the authentication of the first page is passed through the specified interface. If passed, it will directly jump to the page of the non-public resource that needs to be accessed. If not, it will return to the 404 page. Switching between different configuration files can be completed by scripts.
[0093] In this embodiment, the access paths of the public resource directory and the non-public resource directory are generated according to different configuration information. The resources in the non-public resource directory cannot be accessed directly, and can only be accessed after knocking and authentication. In the incognito mode, the access path of the non-public directory will be reverse proxied to the server of the target application, so as to facilitate the authentication on the first page and ensure the security of the target application in the incognito mode.
[0094] In some optional embodiments, the method further comprises the following steps:
[0095] Step S51: When the configuration information represents a public resource, only the business resources under the public resource directory are hosted.
[0096] Step S52: When the configuration information represents hidden resources, both the business resources under the public resource directory and the non-public resource directory are managed.
[0097] When the configuration information represents hidden resources, it means that the target application is in a business stealth state. Since nginx cannot directly determine the session, all resources are hosted through gin. Among them, since the first page needs to use static resources, the hosting of front-end static resources is also included, and all front-end pages can be transferred to the specified port (for example: port 7000).
[0098] After turning on the invisibility of the target application, the management background will modify the nginx configuration and enable resource hosting.
[0099] When the configuration information represents public resources, it means that the target application is in a non-stealth state and only hosts business resources under the public resource directory.
[0100] Specifically, the default hosted static files may include: files under / public-pages (including the first page). When full-service invisibility is enabled, the hosted static resource directory may include: interfaces under the root path, such as / , / login; static files under / web-static; files under / multiple-pages, etc.
[0101] In this embodiment, a hosting mode for different configuration information is provided, which can automatically change the nginx configuration and reduce manpower consumption.
[0102] In some optional embodiments, the method for processing business resources further includes the following steps:
[0103] Step S61, configuring an authorization code submission interface and an authentication status query interface for the target application, wherein the authorization code submission interface is used to obtain the authorization code entered in the first page, and the authentication status query interface is used to feedback the authentication status in the first page.
[0104] Add an authorization code submission interface and an authentication status query interface to the target application. The authorization code submission interface is used to submit the authorization code on the first page, which can be POST / api / knock.
[0105] The authentication status query interface is used to determine the authentication status of the authorization code in the first page, that is, the front end determines whether the current authentication is completed to display different interfaces. Specifically, it can be GET / api / login / setting.
[0106] When the interface is intercepted by knock, an HTTP 404 error will be reported.
[0107] Step S62, wherein, if the current configuration information represents a hidden resource, the hidden interface in the target application is allowed to be accessed only when the authentication status fed back by the authentication status query interface represents that the authentication is passed.
[0108] The interfaces can be divided into two categories: one is the interface that can be accessed at all times, and the other is the interface that can be accessed only after knocking. The interfaces that can be accessed at all times can include some specific interfaces or services, which do not need to be hidden behind services, and also include the interface for verifying the authorization code on the first page, verifying the authorization code / api / knock.
[0109] If the current configuration information represents hidden resources, it means that the target application has enabled business stealth. The interface that can be accessed after knocking refers to the interface in stealth state. The hidden interface can be accessed only when the authentication status feedback from the authentication status query interface indicates that the authentication is passed. Hidden interfaces can include all other interfaces.
[0110] The server can also be deployed with a service stealth configuration setting interface (POST / api / config / knock) and a service stealth configuration obtaining interface (GET / api / config / knock). The server configuration items may include: switch, random address, authorization code and IP whitelist. Among them, the switch is used to turn on or off the service stealth of the target application; the random address can be 12 digits, which is used to form the specific address of the first page, and the specific address can be "domain / sc / random address"; the authorization code can be four digits, and the knocking is considered successful only after the input authorization code is successfully authenticated; the IP whitelist refers to the IP address in it. When visiting the target application or the first page again, there is no need to knock. The input is an IP address or a network segment, and it will not be checked whether the IPs in the whitelist have intersections.
[0111] In this embodiment, a device for controlling access to business resources is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0112] This embodiment provides a device for accessing service resources, such as Figure 7 As shown, including:
[0113] A first page display unit 701 is used to display a first page of a target application in response to an access request initiated for the first page of the target application, wherein the first page includes a verification control, and a specific address of the first page includes a randomly generated random path;
[0114] A login page display unit 702, configured to receive the authorization code input in the verification control, and in response to the authorization code being successfully authenticated, display the login page of the target application;
[0115] The page resource display unit 703 is used to receive the authentication information input in the login page, and in response to the authentication information being successfully authenticated, display a page of related business resources of the target application.
[0116] In some optional embodiments, the device further comprises:
[0117] A prompt page display unit is used to initiate a resource access request to the target application if no access request is initiated for the first page or if the authorization code fails to be authenticated, and in response to the resource access request, display a prompt page indicating that the business resource cannot be provided.
[0118] In some optional embodiments, after the authorization code is successfully authenticated, the address information of the initiator of the access request is set as a trusted address;
[0119] The login page display unit 702 includes:
[0120] The cache data receiving subunit is used to receive and store the cache data returned by the server of the target application, wherein the cache data includes the authorization code of successful authentication.
[0121] In some optional embodiments, the device further comprises:
[0122] The second login page display unit is used to display the login page of the target application if an access request is initiated again for the first page, or an access request is initiated for a page of a related business resource of the target application, wherein the access request carries cached data, the authorization code in the cached data carried in the access request is authenticated, and the trusted address in the cached data is consistent with the address information of the initiator.
[0123] In some optional embodiments, the second login page display unit includes:
[0124] A first page display subunit is used to display the first page when an access request is initiated again for the first page, if the current address information of the initiator is inconsistent with the trusted address, or the authorization code in the cache data carried in the access request is not authenticated;
[0125] The second prompt page display sub-unit is used to, when an access request is initiated to a page of business resources related to the target application, if the current address information of the initiator is inconsistent with the trusted address, or the authorization code in the cached data carried in the access request is not authenticated, display a prompt page indicating that the business resources cannot be provided.
[0126] In some optional embodiments, the device further comprises:
[0127] A resource splitting unit, used to split the business resources of the target application into a plurality of different resource directories, wherein the plurality of different resource directories include a public resource directory and a non-public resource directory;
[0128] An address construction unit, configured to obtain configuration information of the target application, generate a random address and an authorization code when the configuration information represents a hidden resource, and construct a specific address of the first page based on the random address;
[0129] The issuing unit is used to issue the specific address of the first page and the authorization code to the target resource access party, so that the target resource access party can access the business resources under the non-public resource directory after completing the authentication in the first page through the authorization code.
[0130] In some optional embodiments, the resource splitting unit includes:
[0131] The resource division subunit is used for any business resource of the target application. If the business resource needs to be authenticated after the first page is accessed, the business resource will be divided into a non-public resource directory; if the business resource does not need to be authenticated after the first page is accessed, the business resource will be divided into a public resource directory, and the public resource directory includes the first page.
[0132] In some optional embodiments, the device further comprises:
[0133] A configuration file generating unit is used to generate a configuration file of the target application according to the current configuration information of the target application, wherein the configuration file includes the access path of each resource directory under the current configuration information; the configuration file generating unit includes:
[0134] A first generating subunit is configured to, if the current configuration information represents a public resource, identify a first original access path of the public resource directory and a second original access path of the non-public resource directory; determine the first original access path as the access path of the public resource directory under the current configuration information, and determine the second original access path as the access path of the non-public resource directory under the current configuration information;
[0135] The second generating sub-unit is used to identify the third original access path of the public resource directory if the current configuration information represents a hidden resource, and determine the third original access path as the access path of the public resource directory under the current configuration information, and reverse proxy the access path of the non-public resource directory under the current configuration information to the server of the target application.
[0136] In some optional embodiments, the device further comprises:
[0137] A first hosting unit, configured to host only the business resources under the public resource directory when the configuration information represents a public resource;
[0138] The second hosting unit hosts both the business resources in the public resource directory and the non-public resource directory when the configuration information represents a hidden resource.
[0139] In some optional embodiments, the device further comprises:
[0140] A first interface configuration unit, configured to configure an authorization code submission interface and an authentication status query interface for the target application, wherein the authorization code submission interface is used to obtain the authorization code input in the first page, and the authentication status query interface is used to feedback the authentication status in the first page;
[0141] The first interface configuration unit is configured to allow the hidden interface in the target application to be accessed only when the authentication status fed back by the authentication status query interface indicates that the authentication is passed if the current configuration information indicates a hidden resource.
[0142] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0143] Combined with reference Figure 8 , is a schematic diagram of an electronic device provided by an embodiment of the present disclosure. The electronic device includes a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, the above method is implemented.
[0144] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0145] As a non-transitory computer-readable storage medium, the memory can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the method in the embodiment of the present disclosure. The processor executes various functional applications and data processing of the processor by running the non-transitory software programs, instructions and modules stored in the memory, that is, implementing the method in the above method embodiment.
[0146] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0147] An embodiment of the present disclosure further provides a computer-readable storage medium, where the computer-readable storage medium is used to store a computer program. When the computer program is executed by a processor, the above method is implemented.
[0148] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for controlling access to business resources, characterized in that: The method comprises: In response to an access request initiated through a specific address for a first page of a target application, displaying the first page, wherein the first page includes a verification control, and the specific address includes a randomly generated random path; receiving an authorization code input into the verification control, and in response to the authorization code being successfully authenticated, displaying a login page of the target application; Receiving authentication information input in the login page, and in response to the authentication information being successfully authenticated, displaying a page of related business resources of the target application; Before displaying the first page, the method further includes: Splitting the business resources of the target application into a plurality of different resource directories, wherein the plurality of different resource directories include a public resource directory and a non-public resource directory; Acquire configuration information of the target application, generate a random address and an authorization code when the configuration information represents a hidden resource, and construct a specific address of the first page based on the random address; The specific address of the first page and the authorization code are issued to the target resource access party, so that the target resource access party can access the business resources under the non-public resource directory after completing the authentication in the first page through the authorization code.
2. The method according to claim 1, characterized in that: The method further comprises: If no access request is initiated for the first page, or if the authorization code fails to be authenticated, a resource access request is initiated to the target application, and in response to the resource access request, a prompt page indicating that the business resource cannot be provided is displayed.
3. The method according to claim 1, characterized in that After the authorization code is successfully authenticated, the address information of the initiator of the access request is set as a trusted address; In response to the authorization code being successfully authenticated, the method further includes: Receive and store cache data returned by the server of the target application, wherein the cache data includes the authorization code of successful authentication.
4. The method according to claim 3, characterized in that The method further comprises: If an access request is initiated again for the first page, or an access request is initiated for a page of business resources related to the target application, the login page of the target application is displayed, wherein the access request carries cached data, the authorization code in the cached data carried in the access request is authenticated, and the trusted address in the cached data is consistent with the address information of the initiator.
5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: When an access request is initiated again for the first page, if the current address information of the initiator is inconsistent with the trusted address, or the authorization code in the cache data carried in the access request is not authenticated, the first page is displayed; When an access request is initiated to a page of business resources related to the target application, if the current address information of the initiator is inconsistent with the trusted address, or the authorization code in the cached data carried in the access request is not authenticated, a prompt page indicating that the business resources cannot be provided is displayed.
6. The method according to claim 1, characterized in that The business resources of the target application are divided into multiple different resource directories, including: For any business resource of the target application, if the business resource needs to be accessed after authentication through the first page, the business resource will be classified into a non-public resource directory; if the business resource does not need to be accessed after authentication through the first page, the business resource will be classified into a public resource directory, and the public resource directory includes the first page.
7. The method according to claim 1, characterized in that The method further comprises: Generate a configuration file of the target application according to the current configuration information of the target application, wherein the configuration file includes the access path of each resource directory under the current configuration information; the access path under the current configuration information is determined in the following manner: If the current configuration information represents a public resource, identify a first original access path of the public resource directory and a second original access path of the non-public resource directory; determine the first original access path as the access path of the public resource directory under the current configuration information, and determine the second original access path as the access path of the non-public resource directory under the current configuration information; If the current configuration information represents a hidden resource, identify the third original access path of the public resource directory, determine the third original access path as the access path of the public resource directory under the current configuration information, and reverse proxy the access path of the non-public resource directory under the current configuration information to the server of the target application.
8. The method according to any one of claims 1 or 7, characterized in that: The method further comprises: In the case where the configuration information represents a public resource, only the business resources under the public resource directory are hosted; In the case where the configuration information represents hidden resources, both the business resources under the public resource directory and the non-public resource directory are managed.
9. The method according to claim 1, characterized in that: The method further comprises: An authorization code submission interface and an authentication status query interface are configured for the target application, wherein the authorization code submission interface is used to obtain the authorization code entered in the first page, and the authentication status query interface is used to feedback the authentication status in the first page; If the current configuration information represents a hidden resource, the hidden interface in the target application is allowed to be accessed only when the authentication status fed back by the authentication status query interface represents that the authentication is passed.
10. A device for controlling access to business resources, characterized in that: The device comprises: A first page display unit, configured to display a first page of a target application in response to an access request initiated through a specific address, wherein the first page includes a verification control, and the specific address includes a randomly generated random path; A login page display unit, configured to receive the authorization code input in the verification control, and in response to the authorization code being successfully authenticated, display the login page of the target application; A page resource display unit, configured to receive the authentication information inputted in the login page, and in response to the authentication information being successfully authenticated, display a page of relevant business resources of the target application; A resource splitting unit, used to split the business resources of the target application into a plurality of different resource directories, wherein the plurality of different resource directories include a public resource directory and a non-public resource directory; An address construction unit, configured to obtain configuration information of the target application, generate a random address and an authorization code when the configuration information represents a hidden resource, and construct a specific address of the first page based on the random address; The issuing unit is used to issue the specific address of the first page and the authorization code to the target resource access party, so that the target resource access party can access the business resources under the non-public resource directory after completing the authentication in the first page through the authorization code.
11. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 9 is implemented.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Security access control system and method
CN114615328A
Authentication method and device, service system access method and device and storage medium
CN115208579A
Login data processing method and device, computer equipment and storage medium
CN115603958A
Web application hiding method, system and equipment based on dynamic iptables technology and medium
CN116800484A
Page access method and device, electronic equipment and storage medium
CN117055991A
