An access control method, apparatus, storage medium, and computer device

By acquiring plaintext data and network data of AI service access requests at the terminal and network sides, and combining them with risk scoring models and historical context information, the problem of not being able to identify security risks in the interaction between enterprise users and external AI services in existing technologies is solved, and efficient security detection and control are achieved.

CN123123033APending Publication Date: 2026-11-17HANGZHOU DPTECH TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611618941.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing detection methods cannot accurately identify security risks in interactions between enterprise users and external AI services, especially in multi-round continuous interactions where they cannot identify progressive security risks, and they have poor versatility.

Method used

By deploying a detection agent on the terminal side to obtain plaintext request data and collecting network-side access request data in the security gateway, security detection is performed using a risk scoring model and historical context information, thereby achieving unified conversion and risk scoring of the interaction content between various terminals and AI services.

Benefits of technology

It improves the versatility and accuracy of security detection, can identify progressive risks that are difficult to detect in a single detection, avoids the omission of security risks, and achieves accurate control over the interaction behavior of enterprise users with external AI services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123033A_ABST
    Figure CN123123033A_ABST
Patent Text Reader

Abstract

This application provides an access control method, apparatus, storage medium, and computer device. The method includes: for an AI service access request initiated by a terminal, obtaining target request content information related to the access request; the source of the target request content information is related to the proxy mode used by the terminal and / or whether certificate binding is enabled; using a risk scoring model, determining a first risk score based on the semantic features corresponding to the target request content information; if the access request has historical context requests, obtaining second risk scores and historical request content information for multiple target historical context requests; performing content security detection on the target request content information and historical request content information to obtain a security detection result; determining the target risk state of the terminal based on the security detection result, the first risk score, and the second risk score, and performing access control on the access request according to the target risk state.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network security technology, and more specifically, to an access control method, apparatus, storage medium, and computer device. Background Technology

[0002] With the rapid development of artificial intelligence (AI) technology, various large-scale AI models are emerging and becoming increasingly powerful, leading to more widespread use of external AI services by enterprise users. However, the frequent interactions between enterprise users and external AI services increase the risk of data leakage, necessitating security testing of these interactions.

[0003] However, traditional detection methods, such as detection using firewall devices, detection based on Secure Socket Layer (SSL) proxies, and Data Loss Prevention (DLP) technology, generally suffer from poor versatility and low detection accuracy, making it impossible to accurately and effectively control the interaction between enterprise users and external AI services. Summary of the Invention

[0004] In view of this, this application provides an access control method, apparatus, storage medium, and computer device to improve the accuracy and scenario versatility of security detection of interactions between enterprise terminals and external AI services, and to achieve accurate control over the interaction behavior between enterprise users and external AI services.

[0005] Specifically, this application is implemented through the following technical solution: In a first aspect, embodiments of this disclosure provide an access control method applied to a security gateway, comprising: For an AI service access request initiated by a terminal, target request content information related to the access request is obtained; the target request content information is plaintext request data collected and uploaded by the terminal using a detection proxy deployed on the terminal side or access request data collected in the network by the security gateway; the source of the target request content information is related to the proxy mode used by the terminal and / or whether certificate binding is enabled. Using a risk scoring model, a first risk score is determined for the access request based on the semantic features corresponding to the target request content information. If the access request has a historical context request, obtain the second risk score and historical request content information of multiple target historical context requests related to the access request; Perform content security detection on the target request content information and the historical request content information to obtain the security detection result of the access request; Based on the security detection results, the first risk score, and the second risk score, the target risk state of the terminal is determined from a variety of preset risk states, and access control is performed on the access request according to the target risk state.

[0006] Secondly, embodiments of this disclosure also provide an access control device applied to a security gateway, the device comprising: The first acquisition module is used to acquire target request content information related to the artificial intelligence service access request initiated by the terminal; the target request content information is plaintext request data collected and uploaded by the terminal using the detection proxy deployed on the terminal side or access request data collected in the network by the security gateway; the source of the target request content information is related to the proxy mode used by the terminal and / or whether certificate binding is enabled. The scoring module is used to determine the first risk score corresponding to the access request based on the semantic features corresponding to the target request content information using a risk scoring model. The second acquisition module is used to acquire, when the access request has a historical context request, the second risk score and historical request content information of multiple target historical context requests related to the access request. The detection module is used to perform content security detection on the target request content information and the historical request content information to obtain the security detection result of the access request; The control module is used to determine the target risk state of the terminal from a variety of preset risk states based on the security detection results, the first risk score and the second risk score, and to perform access control on the access request according to the target risk state.

[0007] Thirdly, an optional implementation of this disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps in the first aspect described above.

[0008] Fourthly, an optional implementation of this disclosure also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the first aspect described above.

[0009] The access control method, apparatus, storage medium, and computer device provided in this disclosure, by deploying a detection proxy on the terminal side to upload plaintext request data and supporting automatic collection of access request data from the network side by a security gateway, can obtain target request content information related to AI service access requests initiated by the terminal, even when different terminals use various proxy modes and / or open / closed certificate binding and other security measures. Based on this target request content information, security detection can be performed on the interaction content between various terminals and various AI services, improving the versatility of security detection. By first converting the target request content information into semantic features before risk scoring, it is possible to uniformly convert the target request content information into semantic objects for detection, regardless of whether it originates from plaintext request data on the terminal side or access request data from the network side, providing consistency in the detection of target request content information from various sources. By combining the first risk score and target request content information of the access request, as well as the second risk score and historical request content information of the access request's historical context, the risk status can be determined. This not only fully considers whether the request content itself is risky, but also, by incorporating historical context information, enables the identification of progressive risks that are difficult to detect in a single detection. This improves the accuracy of security detection for access requests and yields the precise target risk status for the terminal. Using the target risk status to drive access control for access requests avoids overlooking access requests with security risks, improving the rationality and accuracy of access control.

[0010] To make the above-mentioned objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] Figure 1 This is a flowchart illustrating an access control method in an exemplary embodiment of this application; Figure 2 This is another flowchart illustrating an access control method in an exemplary embodiment of this application; Figure 3 This is a schematic diagram of an access control architecture for a security gateway, as illustrated in an exemplary embodiment of this application. Figure 4 This is a schematic diagram of an access control device illustrated in an exemplary embodiment of this application; Figure 5 This is a schematic diagram of the structure of a computer device shown in an exemplary embodiment of this application. Detailed Implementation

[0012] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0013] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.

[0014] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to determination."

[0015] Research has revealed that enterprise users across various sectors are increasingly utilizing external AI services, and the methods for accessing these services are diverse. For example, employees can access large external models through web pages, IDE plugins, command-line tools, and Application Programming Interfaces (APIs). However, in using external AI services, enterprises face security challenges such as sensitive data leaks, access to shadow AI, prompt-based leaks, and difficulties in auditing.

[0016] To address the aforementioned security issues, it is necessary to conduct security testing on the interaction between enterprise terminals and AI services. Traditional testing methods can be categorized into the following three types: The first type is detection based on forward proxies or firewalls. This method identifies the target AI service accessed by the enterprise terminal through forward proxies or firewalls, using the domain name, Internet Protocol address (IP), and port. It then determines whether to allow interaction with the target AI service based on its security. This detection method has the following problems: because it doesn't decrypt the content of the AI ​​traffic, it cannot identify whether the requested content contains sensitive data; relying solely on static domain names / IPs for blocking not only fails to control access based on real-time risks but is also easily bypassed by proxies and direct IP connections; using a single domain name / IP as the blocking granularity is ineffective in scenarios where the same AI service is distributed across multiple IPs via a Content Delivery Network (CDN); and using a single access request as the blocking granularity fails to identify progressive security risks in multiple rounds of continuous interaction with the AI ​​service.

[0017] The second type is the detection method based on SSL proxies. This method uses man-in-the-middle (MITM) decryption, but it is ineffective for terminals with certificate binding enabled, thus creating a blind spot for some terminals and having poor universality. Moreover, this method also uses a single access request as the blocking granularity, so it cannot identify the progressive security risks in multiple rounds of continuous interaction with AI services.

[0018] The third category is DLP detection, but this method is mainly for outgoing scenarios of structured data such as files and emails, and its detection effect is poor for interactive content such as Prompt text and multimodal uploaded data in the AI ​​interaction process.

[0019] Therefore, there is an urgent need for a way to accurately and securely detect the interactions between various terminals and various external AI services.

[0020] Based on the above research, this disclosure provides an access control method, apparatus, storage medium, and computer device. By deploying a detection proxy on the terminal side to upload plaintext request data and supporting automatic collection of access request data from the network side by a security gateway, it can obtain target request content information related to AI service access requests initiated by the terminal, regardless of the different terminals using various proxy modes and / or open / closed certificate binding and other security measures. Based on this target request content information, security detection can be performed on the interaction content between various terminals and various AI services, improving the versatility of security detection. By first converting the target request content information into semantic features before risk scoring, it can uniformly convert the target request content information from plaintext request data on the terminal side or access request data from the network side into semantic objects before detection, providing consistency in the detection of target request content information from various sources. By combining the first risk score and target request content information of the access request, as well as the second risk score and historical request content information of the access request's historical context, the risk status can be determined. This not only fully considers whether the request content itself is risky, but also, by incorporating historical context information, enables the identification of progressive risks that are difficult to detect in a single detection. This improves the accuracy of security detection for access requests and yields the precise target risk status for the terminal. Using the target risk status to drive access control for access requests avoids overlooking access requests with security risks, improving the rationality and accuracy of access control.

[0021] The shortcomings of the above solutions are the result of the inventor's practical experience and careful research. Therefore, the discovery process of the above problems and the solutions proposed in this disclosure below are all contributions made by the inventor to this disclosure.

[0022] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0023] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0024] To facilitate understanding of this embodiment, a detailed description of the access control method disclosed in this disclosure is provided first. The execution subject of the access control method provided in this disclosure is generally a terminal device or other processing device with certain computing capabilities. The terminal device may be a user equipment (UE), a mobile device, a terminal, a personal digital assistant (PDA), a handheld device, a computer device, a network security device (such as a gateway), etc. In some possible implementations, the access control method can be implemented by the processor calling computer-readable instructions stored in the memory.

[0025] The access control method provided in this disclosure embodiment will be described below using a security gateway as an example of the execution subject.

[0026] like Figure 1 The flowchart shown is a representation of an access control method provided in this disclosure, which may include the following steps: S101: For AI service access requests initiated by the terminal, obtain target request content information related to the access request; the target request content information is plaintext request data collected and uploaded by the detection agent deployed on the terminal side or access request data collected in the network by the security gateway; the source of the target request content information is related to the proxy mode used by the terminal and / or whether certificate binding is enabled.

[0027] Here, the security gateway can be a network exit point deployed on the enterprise's intranet for accessing the internet. All outbound traffic from the intranet must pass through the gateway, which is a network security device that performs unified detection, control, auditing, and protection of outbound traffic. The terminal can be any terminal used by any enterprise user, and the AI ​​service access request can be an interaction request initiated by the terminal for any external AI service. The target request content information is used to characterize the interaction content information carried in the access request. This interaction content information may include, but is not limited to, prompts, file upload content, interaction objects (such as the specific AI service requested), API request parameter information, historical interaction content between the terminal and the interaction object, user identity, terminal information, session information, and interaction behavior characteristics.

[0028] The detection proxy can be a proxy deployed on the terminal side. This proxy can obtain the raw plaintext data of the access request initiated by the terminal through a hook and upload it to the security gateway via the upload channel between the terminal and the security gateway. Under the Transmission Control Protocol / Internet Protocol (TCP / IP) four-layer model or the Open System Interconnection (OSI) seven-layer model, the raw data of an access request initiated by the terminal can be packaged through multiple layers of the model before finally reaching the receiver. The raw plaintext data is the original request data before it is encrypted by the application layer, which can be defined as the source content of the access request on the terminal side. The access request data is the complete network data during the transmission of the access request from the terminal to the receiver, which can be defined as the source content of the access request on the network side. For ease of understanding, access request data can be understood as the information after the raw request data has been packaged through multiple layers of the model. The source of the target request content information can specifically include the terminal source and the network source. The terminal source means that the target request content information comes from the detection proxy on the terminal side, and the network source means that the target request content information comes from the communication network.

[0029] The proxy modes used by the terminal can include SSL-based forward proxy mode, API proxy mode, etc. Certificate pinning is a security mechanism that allows the terminal to trust only specific server identities, rather than all Certificate Authorities (CAs) trusted by the operating system. For any terminal using forward proxy mode, if certificate pinning is not enabled, the security gateway can collect access request data from the network through man-in-the-middle (MITM) decryption; if certificate pinning is enabled, MITM decryption will fail, thus preventing the collection of access request data from the network. Different terminals can pin different certificates. If the terminal uses reverse API proxy mode, the security gateway can directly collect access request data related to the access request from the network, regardless of whether certificate pinning is enabled.

[0030] In practice, for any AI service access request initiated by a terminal, the security gateway can determine the source of information acquisition by judging the proxy mode used by the terminal and whether the terminal has enabled certificate binding, and obtain the target request content information related to the access request from that source.

[0031] Alternatively, before any terminal initiates an AI service access request, its corresponding proxy mode and whether certificate binding is enabled are already activated. The detection proxy deployed on the terminal can determine, based on the terminal's proxy mode and certificate binding status, whether it needs to acquire and upload the plaintext request data on the terminal side. If so, the plaintext request data can be sent to the security gateway via the upload channel, allowing the security gateway to acquire the plaintext data and use it as the target request content information. If not, the detection proxy does not need to collect plaintext data; instead, the security gateway proactively collects the access request data from the network as the target request content information after receiving the AI ​​service access request from the terminal.

[0032] In one embodiment, S101 described above can be implemented according to the following steps: S101-1: Determine whether the terminal has enabled forward proxy mode.

[0033] Here, in the forward proxy mode, the security gateway acts as a middleman for Transport Layer Security (TLS). The process of the terminal accessing the external AI service is as follows: the terminal shakes hands with the security gateway, the security gateway responds with a forged website certificate issued by the enterprise's self-built root CA, the client authenticates the forged certificate and transmits traffic to the security gateway, the gateway decrypts the data based on MITM to obtain the access request data and then connects to the external AI server as a real client.

[0034] In practice, for any terminal that initiates an AI service access request, the security gateway can proactively determine whether the terminal is using forward proxy mode. If so, it can execute S101-2 below; otherwise, it can obtain the access request data through MITM decryption or other means.

[0035] S101-2: If so, determine whether the terminal has enabled certificate binding based on whether certificate enabling indication information is observed during the handshake phase with the terminal; the certificate enabling indication information includes at least the certificate binding extension information carried in the handshake message, the hash result of the subject public key information in the handshake message being hit, the server name indication in the handshake message being inconsistent with the certificate subject, and the terminal initiating a bidirectional transport layer security request.

[0036] Here, certificate activation indication information can be information that indicates the terminal has enabled certificate binding. The handshake message can be the message exchanged between the terminal and the security gateway during the TLS handshake phase, and / or the message exchanged between the security gateway and the server of the external AI service during the handshake phase. Certificate binding extension information can be certificate binding extension fields in the certificate chain (such as TLS extensions), which can be used to strongly bind the certificate subject with additional identity, keys, policies, purposes, etc., and is the core basis for trust transfer and verification in the certificate chain. The presence or absence of certificate binding extension information directly indicates whether certificate binding is enabled; if certificate binding extension information exists, certificate binding is necessarily enabled. Subject Public Key Info (SPKI) can be the public key information between the accessed external AI server subject and the terminal carried in the handshake message. The hash result of the subject public key information can be obtained by the security gateway through hash calculation; the hash result is the public key signature database maintained by the hash result of the subject public key information. The Server Name Indication (SNI) in the handshake message indicates the domain name information of the external AI server that the terminal needs to access. The certificate body is the overall subject information used by the server carried in the handshake message. If the Server Name Indication in the handshake message does not match the certificate body, it indicates that the terminal has enabled certificate binding. If the terminal initiates a Mutual TLS (mTLS) request, it indicates that this session will establish a two-way TLS connection, suggesting that the terminal may have enabled certificate binding.

[0037] In practice, when the terminal is in forward proxy mode, the security gateway can determine whether the handshake message carries any certificate activation indication information based on the handshake message during the handshake phase with the terminal and / or server. Specifically, certificate activation indication information may include, but is not limited to, certificate binding extension information in the certificate chain, SPKI hash hit, SNI and certificate body inconsistency, and client-initiated mTLS request. If yes, it can be determined that the terminal has enabled certificate binding; if not, it can be determined that the terminal has not enabled certificate binding.

[0038] Optionally, the steps S101-1 and S101-2 described above can be performed by the security gateway or by the detection agent on the terminal side.

[0039] S101-3: If so, then use the detection proxy deployed on the terminal side to collect and upload the plaintext data of the access request before the terminal performs application layer encryption on the access request.

[0040] In practical implementation, if certificate binding is enabled on the terminal, MITM decryption by the security gateway will be infeasible in forward proxy mode. Therefore, a detection proxy deployed on the terminal side can be used to obtain the plaintext data of the access request as the terminal-side source content before the terminal performs application-layer encryption on the access request. This plaintext data is then uploaded to the security gateway by the detection proxy through an upload channel. The detection proxy can obtain the plaintext data in various ways, and this embodiment does not impose specific limitations. For example, the detection proxy can obtain the plaintext data through the exported interface of the platform's TLS encryption library called by the terminal process; or through official extension point APIs or plugin extensions.

[0041] Optionally, when the detection agent uploads plaintext request data through the upload channel, it can encrypt the upload based on the encryption agreement between it and the security gateway. After obtaining the encrypted plaintext request data, the security gateway can decrypt it based on the encryption agreement to obtain the complete plaintext request data.

[0042] In another embodiment, if the terminal does not enable certificate binding, access request data of the access request is collected in the network through man-in-the-middle decryption.

[0043] In practice, if the terminal uses the forward proxy mode and certificate binding is not enabled, the security gateway can use the enterprise root certificate and MITM decryption channel to collect access request data of access requests in the network through man-in-the-middle decryption, and use it as network-side source content, which is the target request content information.

[0044] Alternatively, if the terminal enables the Application Programming Interface (API) proxy mode, access request data can be collected from the network. Here, the API proxy mode can be a proxy mode that directly sends client requests to the security gateway by rewriting the underlying Uniform Resource Locator (base_url). In this proxy mode, the terminal can configure environment variables to rewrite the API address of the external AI server to the security gateway address. The terminal directly accesses the security gateway's domain name via Hypertext Transfer Protocol Secure (HTTPS) / HTTP, and the security gateway then forwards the request to the external AI server. This mode does not require TLS MITM and does not forge external server certificates. The terminal's TLS handshake object is the gateway's own certificate. The HTTPS / HTTP request is sent completely to the security gateway, which can directly read the request message at the application layer, thus directly obtaining the access request data from the business connection. When the terminal uses API proxy mode, regardless of whether certificate binding is enabled on the terminal, the security gateway can directly collect access request data from the network.

[0045] For example, if it is determined that the terminal has enabled API proxy mode, the security gateway can directly obtain the complete request message of the access request in the network, and then obtain the access request data based on the request message.

[0046] S102: Using a risk scoring model, determine the first risk score corresponding to the access request based on the semantic features corresponding to the target request content information.

[0047] Here, semantic features are used to characterize the semantic information of an access request across multiple semantic fields. Regardless of whether the target request content comes from plaintext data from a detection agent or access request data collected from the network, semantic transformation can be used to obtain semantic features representing the semantic meaning expressed by the access request. The risk scoring model can be a pre-trained neural network model. The input of this model is the semantic features of any access request, and the output is a risk score located in the interval [0, 1]. The first risk score is used to characterize the potential risk level of the currently acquired single AI service access request.

[0048] In practice, after the security gateway obtains the target request content information of the access request, it can input the target request content into the semantic encoding module. The semantic encoding module performs semantic extraction and encoding on the target request content information to obtain the semantic features of the target request content. Then, it calls the pre-trained risk scoring model deployed in the risk detection module, inputs the semantic features into the model, and obtains the risk score output by the risk scoring model. This risk score is used as the first risk score corresponding to the access request.

[0049] In one embodiment, the semantic features of any target request content information can be determined through the following steps A1~A2: A1: Semantically analyze the target request content information according to multiple semantic fields to obtain the semantic information of the target request content information under each semantic field.

[0050] Here, multiple semantic fields may include, but are not limited to, user identity fields, terminal information fields, AI service identifier fields, interaction content fields, session context fields, API request parameters, and interaction behavior feature fields.

[0051] In practice, a semantic encoding module can be used to perform semantic parsing on the target request content information according to multiple pre-set semantic fields, determining the field information of the request content information under each semantic field, and determining the semantic information corresponding to each field. Understandably, if a target request content does not have relevant content under a certain field, such as if a certain access request does not have a historical context, the semantic information under the session context field can be a preset value, such as an empty value.

[0052] A2: Semantic features are obtained by encoding and normalizing semantic information under multiple semantic fields.

[0053] In practice, a semantic encoding module can be used to encode semantic information under multiple semantic fields to obtain initial semantic features under each semantic field. Then, a normalization function is used to normalize the initial semantic features under each semantic field to map each feature to the same feature space, thereby obtaining the target semantic features corresponding to each semantic field. Then, the target semantic features corresponding to each semantic field can form a complete high-dimensional semantic feature.

[0054] For example, regardless of whether the target request content information from the network side (such as access request data obtained through MITM decryption or access request data directly collected by a reverse proxy) or from the terminal side (plaintext request data collected by a detection proxy in the terminal's memory), the semantic encoding module can first extract field information according to multiple semantic fields to obtain field information under each semantic field. For example, extracting the Prompt text string content as field information under the interaction content field, extracting the API endpoint of the target AI service requested by the terminal as field information under the API request parameters, and extracting the context session identifier as field information under the session context field, etc. Then, the semantic encoding module can further convert these field information and the corresponding metadata of the semantic fields into a fixed high-dimensional semantic feature vector, thereby eliminating the format differences between the underlying protocol and the acquisition source, so that the target request content information from both types of sources can be processed by the risk scoring model and enter the same risk calculation process.

[0055] In this way, target request content information from both the network side and the terminal side will be converted into a unified AI interaction object (i.e., a unified semantic feature). The unified AI interaction object is not a simple data format conversion, but a cross-source semantic unified representation for AI security detection. After being mapped to the same feature space by the same normalization function, the unified AI interaction object can be output by the same risk scoring model with a unified risk score in the range [0,1].

[0056] S103: If the access request has a historical context request, obtain the second risk score and historical request content information of multiple target historical context requests related to the access request.

[0057] Here, the historical context request can be a historical access request corresponding to the same session as the currently obtained access request. The target historical context request can be at least a portion of all historical access requests related to the currently obtained access request. The historical request content information can be the target request content information corresponding to the target historical context request. The second risk score can be the first risk score determined by the risk scoring model for the target historical context request, or it can be the target risk score determined for the target historical context request.

[0058] In practice, since security checks are performed on only a single access request, progressive security risks may not be identified. Therefore, for the current access request, the security gateway can determine whether the request has a historical context. If not, it indicates that the current access request is the first request within the session and there is no progressive inducement risk. Therefore, the risk status of the current access request can be determined using the first risk score and the target request content information, and access control can be implemented based on this risk status.

[0059] If so, multiple target historical context requests related to the access request can be identified. For example, all historical access requests related to the access request can be considered as target historical context requests. Simultaneously, the historical request content information and a second risk score corresponding to each target historical context request can be obtained.

[0060] In one embodiment, S103 described above can be implemented according to the following steps: S103-1: When there is a historical context request for the access request, determine the target artificial intelligence service accessed by the terminal based on the target request content information.

[0061] Here, the target AI service refers to an external AI service that the terminal requests to access under the current access request.

[0062] For example, when a security gateway determines that an access request has a historical context, it can determine the target artificial intelligence service requested by the terminal based on information such as the external AI service identifier carried in the target request content information of the access request.

[0063] S103-2: Determine the context acquisition window based on the service type of the target AI service and / or the various historical risk states of the terminal under the target AI service.

[0064] Here, the historical risk status indicates the risk status of a terminal when accessing a target AI service through historical access requests. The service type of the target AI service can be the type of AI model used by the target AI service and / or the capability type of the target AI service, such as question answering, mapping, article generation, programming, document creation, etc. The context retrieval window indicates the number of historical access requests to be retrieved.

[0065] In practice, the security gateway can determine the maximum context length that the target AI service relies on when outputting results, based on the service type and processing capabilities of the target AI service, and use this maximum context length as the context acquisition window.

[0066] Alternatively, the security gateway can obtain the historical risk status of each historical access request between the terminal and the target AI service, and determine the context acquisition window based on the severity of each historical risk status. For example, the higher the most dangerous risk status among the historical risk statuses, the larger the context acquisition window.

[0067] Alternatively, the security gateway can determine the maximum context length that the target AI service relies on when outputting results, based on the service type and processing capabilities of the target AI service, and determine the window length to be used based on the various historical risk states of the terminal under the target AI service. The final context acquisition window to be used is then determined based on the maximum context length and the window length to be used. For example, the maximum value / weighted value between the maximum context length and the window length to be used can be used as the context acquisition window.

[0068] S103-3: According to the context acquisition window, determine each target historical context request from each historical context request related to the access request, and obtain the second risk score and historical request content information of each target historical context request.

[0069] In practice, the security gateway can determine the historical context requests within the context acquisition window based on the context acquisition window and the chronological order / request time of each historical context request related to the access request, and use these historical context requests as target historical context requests. Then, it can obtain the second risk score and historical request content information for each target historical context request.

[0070] S104: Perform content security checks on the target request content information and historical request content information to obtain the security check results of the access request.

[0071] Here, the security detection results are used to characterize whether the access request has security risks, the level of risk and the risk issues when security risks exist, and whether it carries sensitive information or information that needs attention when there are no security risks.

[0072] In practice, the security gateway can integrate the target request content information and historical request content information to obtain integrated information. Then, using a risk detection module, it applies various risk detection rules to perform information security checks on the entire information, obtaining the security detection result of the access request. Risk detection rules can include various network security-related rules such as regular expression matching rules, keyword matching rules, dictionary matching rules, and feature scanning rules.

[0073] In one embodiment, the above-described S104 can be implemented according to the following steps: S104-1: Determine the security detection strength based on the current risk status of the terminal under the target artificial intelligence service it is accessing; different risk statuses correspond to different security detection strengths.

[0074] Here, the current risk status indicates the risk status determined for the terminal during its most recent interaction with the target AI service. Understandably, if the current access request is the first request, the current risk status can be a preset state.

[0075] Security detection strength characterizes the rigor of the inspection of content information in access requests. The security detection strength varies depending on the risk level; for example, a higher risk level indicates a higher security detection strength. Different security detection strengths may require different dimensions of information to be detected and different detection methods. A higher risk level indicates a higher dimension of information to be detected and more stringent detection methods.

[0076] In practice, the security gateway can obtain the current risk status of the terminal under the target AI service, and then determine the security detection strength for the current access request based on the correlation between the risk status and the detection strength. For example, if the current risk status is safe, the security detection strength can be a first preset strength, and the information dimension to be detected can be the request content itself. If the current risk status is critical, the security detection strength can be a second preset strength (which is greater than the first preset strength). In this case, the information dimension to be detected includes not only the request content itself, but also the request 5-tuple information corresponding to the access request, the terminal traffic size, the request time, the terminal type, etc.

[0077] S104-2: Based on the security detection intensity, perform content security detection on the target request content information and determine the first detection result of the target request content information under various risky behaviors.

[0078] Here, various risky behaviors may include, but are not limited to, sensitive content interaction behaviors, unauthorized inducement behaviors, system command probing behaviors, security restriction bypassing behaviors, abnormal request timing behaviors, sensitive context acquisition behaviors, and abnormal traffic behaviors. The first detection result is used to indicate whether the target requested content information matches a risky behavior, and the specific target risky behavior that matches.

[0079] In practice, the security gateway can use detection methods that match the determined security detection strength to perform security detection on the target request information content and related information of the current access request under various information dimensions that match the strength, and determine whether the target request content information hits any of the multiple risk behaviors, thereby obtaining the first detection result.

[0080] S104-3: Based on the target request content information and historical request content information, generate the content information to be detected, and perform content security detection on the content information to be detected according to the security detection strength, and determine the second detection result of the content information to be detected under various risk behaviors.

[0081] Here, the information to be detected can be obtained by integrating the target request information and historical request information. The second detection result is used to indicate whether the information to be detected matches a risky behavior, and the specific target risky behavior that was matched.

[0082] In practice, the security gateway can first integrate the target request content information and historical request content information (e.g., information deduplication, information association, information semantic unification, etc.) to obtain the content information to be detected, including rich contextual information. Then, according to a determined security detection strength, it can use detection methods matching that strength to perform security detection on the content information to be detected under various information dimensions matching that strength, as well as the relevant information of the current access request and the target historical context request, to determine whether the content information to be detected hits any of the multiple risk behaviors, thereby obtaining the second detection result.

[0083] S104-4: Determine the security detection result of the access request based on the first detection result and the second detection result.

[0084] For example, the first and second test results can be used together as the safety test result, or the test result indicating a risk in the first and second test results can be used as the safety test result.

[0085] In this way, by simultaneously performing security checks on the target request content information of a single-round access request and on contextual security checks by combining historical request content information, not only can the risks present in a single-round access request be accurately detected, but also progressive risks that only manifest after multiple rounds are combined can be identified, thereby improving the accuracy of the determined security detection results. Furthermore, by performing contextual checks on continuous multiple rounds of AI interactions, and then comprehensively detecting behaviors such as unauthorized access inducement, system command detection, sensitive context acquisition, and bypassing security restrictions, the security detection results can reflect the risk accumulation trend of continuous interaction between the terminal and the target AI service over a period of time.

[0086] S105: Based on the security detection results, the first risk score, and the second risk score, determine the target risk state of the terminal from a variety of preset risk states, and perform access control on the access request according to the target risk state.

[0087] Here, the target risk state is used to indicate the risk state of the terminal after initiating the current access request. The preset risk states may include a safe state indicating that there is no risk, a state of concern indicating that there may be risks, a state of risk indicating that there are already risks, and a state of protection indicating that the terminal has proxy anomalies.

[0088] In practical implementation, the policy control center module can be used to determine the target risk score corresponding to the access request based on the generation time of the first risk score and each of the second risk scores, using a time-decay weighted method. Then, using the risk state machine in the policy control center module, based on the target risk score and the presence of risk indicated by the security detection results, the terminal's current state that best matches the target risk state is determined from multiple preset risk states. The security gateway can then perform access control on the access request according to the control policy matching the target risk state.

[0089] In one embodiment, the above-described S105 can be implemented according to the following steps: S105-1: Determine the target risk score based on the first risk score and the second risk score.

[0090] Here, the target risk score can be the final risk score of the terminal under the current access request.

[0091] In practice, the second risk score and the first risk score of each target historical context request can be weighted and accumulated according to time decay. For example, the target risk score R_target(t) = λ1×(R_risk(t-1)) + λ2×(R_risk(t-2)) + ... + R_risk(t); where R_target(t) represents the target risk score at time t corresponding to the current access request, R_risk(t-1) represents the second risk score at time t-1 corresponding to the previous target historical context request, R_risk(t-2) represents the second risk score at time t-2 corresponding to the previous target historical context request, ..., R_risk(t) represents the first risk score at time t, and λ1, λ2, ..., λn are weighting coefficients for time decay.

[0092] Alternatively, a maximum risk score can be determined based on the first and second risk scores. Then, based on the time of the request corresponding to the maximum risk score, the cumulative score offset of each risk score between the current time and that time relative to the maximum risk score can be determined. The target risk score can then be determined based on the maximum risk score and the cumulative score offset. Alternatively, the Markov state transitions of recent interactions between the terminal and the target AI service can be determined based on the chronological order of the times corresponding to the first and second risk scores. A target weight for the first risk score can be determined based on the transitions, and the product of this target weight and the first risk score can be used as the target risk score. Alternatively, the weighted average of the first and second risk scores, the maximum risk score, the cumulative score offset, and the target weight can be determined first. Then, the weighted average, maximum risk score, cumulative score offset, and the product of the target weight and the first risk score can be comprehensively weighted according to a preset weighting coefficient to obtain the target risk score.

[0093] S105-2: Determine whether the detection agent is abnormal through a heartbeat detection mechanism.

[0094] In practice, a heartbeat detection mechanism can be established between the security gateway and the detection agent deployed on the terminal side. When both the security gateway and the detection agent are online, they can exchange heartbeat packets according to the heartbeat sequence. If the detection agent malfunctions, the heartbeat packets will be lost. Therefore, the security gateway can determine the online status of the detection agent based on the heartbeat detection mechanism. For example, if the detection agent has continuously missed a target number of heartbeats or has not received a heartbeat from the detection agent for a preset duration, it can be determined that the detection agent has experienced an anomaly such as being offline, uninstalled, or malfunctioning, and the terminal is directly determined to be in a protected state. If the number of consecutive missing heartbeats from the detection agent does not reach the target number and the duration of not receiving a heartbeat from the detection agent does not reach the preset duration, it is determined that the detection agent is not malfunctioning, and the following S105-3 is executed.

[0095] S105-3: If not, then if the target risk score is greater than the first score threshold and / or the security detection result indicates that there is a security risk, the target risk state of the terminal is determined to be a risk state.

[0096] Here, the first scoring threshold can be a preset scoring threshold. If the security detection result indicates a risk, it means that the target request content and / or the content to be detected carries content that clearly indicates a security risk, such as high-risk or highly sensitive content. A risk state is a state that indicates the need to block the interaction between the terminal and the target AI service.

[0097] In practice, if no abnormality is detected by the detection agent, the security gateway can determine whether the target risk score is greater than the first score threshold and whether the security detection result indicates the existence of a security risk. If either the target risk score is greater than the first score threshold or the security detection result indicates the existence of a security risk, the target risk state of the terminal can be determined to be a risk state (that is, the current risk state of the terminal is switched to a risk state), and then the following S105-4 is executed.

[0098] S105-4: Based on the service identifier of the target artificial intelligence service accessed by the terminal, obtain the set of service addresses and service endpoints related to the target artificial intelligence service.

[0099] Here, the service address set may include various IP address information and / or IP address ranges that the target AI service may use. The service endpoint set may include various endpoint information and / or URL information that the target AI service may use.

[0100] In practice, if the security gateway determines that the terminal is currently in a risky state, it can use the service identifier of the target AI service accessed by the terminal as the query key to query the various IP addresses and / or IP address ranges associated with the target AI service, as well as the various endpoints and / or URLs associated with the target AI service. Then, the queried IP addresses and IP address ranges are used as a set of service addresses, and the queried endpoints and URLs are used as a set of service endpoints.

[0101] The methods for querying the service address set and service endpoint set can include, but are not limited to: The security gateway obtains the IP addresses, IP address ranges, endpoints, and URLs of the target AI service by accessing its official open-source information. The security gateway also maintains the service address set and service endpoint set between each terminal and each target AI service in real time through passive learning, Domain Name System (DNS) sniffing, and proactive threat intelligence updates, utilizing historical interaction traffic between each terminal and each target AI service. If any terminal is determined to be at risk, the security gateway can retrieve the service address set and service endpoint set related to the target AI service from the latest maintained service address set and service endpoint set.

[0102] S105-5: Based on the service address set and service endpoint set, generate access control list rules for the target artificial intelligence service, and send the access control list rules and access requests to the firewall device; the firewall device is used to perform access control on the access requests according to the latest issued access control list rules and the stored access control list rules.

[0103] In practice, the security gateway can generate various Access Control Lists (ACLs) rules to indicate the communication between the target AI service and the terminal, based on the service address set and service endpoint set. Optionally, the ACL rules generated by the security gateway can carry the target risk status of the terminal. The security gateway can then send the generated ACL rules and access requests to the firewall device. After receiving the ACL rules, the firewall device can update its locally maintained ACL information using the received ACL rules. For example, if the ACL rule issued by the security gateway is a new rule, it can be directly stored locally on the firewall device; if the ACL rule issued by the security gateway is related to the currently maintained ACL rules, it can be used to update the relevant ACL rules. Then, the firewall device performs access control on the access requests between the terminal and the target AI service according to the locally maintained updated ACL rules.

[0104] Thus, since an external AI service is typically distributed via CDN, multiple IPs, and multiple endpoints, a single external AI service has multiple IPs and multiple endpoints. Blocking only the currently accessing IP might cause the terminal to automatically switch to other IPs / ports of the same AI service, rendering the blocking ineffective. This application, by issuing ACL rules related to the service address set and service endpoint set to the firewall when a terminal is detected to be in a risky state under the target AI service, can not only block a single IP or port used by the target AI service under the current access, but also adapt to the dynamic changes of the target AI service's edge nodes under the CDN. This allows the firewall device to block all known endpoints and IP ranges of the target AI service together, truly blocking the terminal's access to the high-risk target AI service.

[0105] In another embodiment, if the detection agent does not show any abnormalities, and if the target risk score is between a first scoring threshold and a second scoring threshold, and / or the security detection result indicates that there is no security risk and that the target risk carries sensitive content, then the target risk state of the terminal is determined to be a state of concern; wherein the first scoring threshold is greater than the second scoring threshold; an access request is sent to the firewall device; the firewall device is used to perform access control on the access request according to the stored access control list rules.

[0106] Here, sensitive content can be lightweight non-compliant content that fails to trigger an alarm or block. The second scoring threshold can be preset based on experience; this embodiment does not impose specific limitations, but it must be less than the first scoring threshold. The stored access control list rules are the various ACL rules currently maintained in the firewall device. The stored ACL rules can be issued by the policy control center module or historically issued by the security gateway to the firewall device. Furthermore, by determining the target risk status in real time, the ACL rules in the firewall device can be dynamically updated according to the risk status, rather than being statically configured locally on the firewall.

[0107] The state of concern indicates that there may be potential risks in the interaction between the terminal and the target AI service, and that attention needs to be paid to it in the future. The security detection intensity in the state of concern is greater than that in the state of safety.

[0108] In practice, if the security gateway determines that the detection agent is not abnormal, and the terminal meets at least one of the following two conditions, it can determine that the terminal is in a state of concern (that is, the terminal's current risk status is switched to a state of concern).

[0109] Condition 1: The target risk score is within the closed interval formed by the first and second scoring thresholds; Condition 2: The security detection result indicates that there is no security risk, but indicates that the target request content information and / or the content to be detected carries a small amount of sensitive content.

[0110] Furthermore, if the target risk status of the terminal is determined to be in a state of concern, the security gateway can determine that there is no need to generate ACL rules and directly send the access request to the firewall device. The firewall device can then control the access request according to the latest access control list rules stored locally. Simultaneously, if the target risk status of the terminal is determined to be in a state of concern, the security gateway can perform enhanced auditing with increased security detection strength on subsequent access requests between the terminal and the target AI service.

[0111] In another embodiment, if the detection agent does not show any abnormalities, and if the target risk score is less than the second score threshold and the security detection result indicates that there is no security risk, then the target risk state of the terminal is determined to be a safe state; the access request is sent to the firewall device; the firewall device is used to perform access control on the access request according to the stored access control list rules.

[0112] For example, if the security gateway determines that the detection agent is not abnormal, and if the target risk score is less than the second score threshold and the security detection result indicates that there is no security risk, then the terminal can be determined to be in a secure state (that is, the terminal's current risk state is switched to a secure state). Without generating ACL rules, the access request can be sent directly to the firewall device. The firewall device can then perform access control on the access request according to the latest access control list rules stored locally.

[0113] In another embodiment, in order to ensure the continuity of the security gateway's detection services when the detection agent malfunctions, this application also proposes the control methods shown in steps B1 to B4 as follows: B1: If an anomaly is detected in the agent, determine that the target risk status of the terminal is in the protected state, switch the access control list between the terminal and the target artificial intelligence service to the allowed access state, and allow access requests to be sent to the target artificial intelligence service.

[0114] Here, the protective state can be a risk state to ensure the continuity of detection services. In this state, it is necessary to reduce the access control strength of the terminal. Specifically, the way to reduce the control strength is to switch the direct connection access control list between the terminal and the target artificial intelligence service to the allowed access state, that is, to switch the direct connection ACL between the terminal and the target artificial intelligence service to the allowed state, allowing the business traffic between the terminal and the target AI service to continue to pass, thus ensuring business continuity.

[0115] In practice, if the security gateway determines that the detection agent is abnormal, it can directly determine that the target risk status of the terminal is in the protected state (that is, switch the current risk status of the terminal to the protected state). At the same time, it can switch the direct connection ACL between the terminal and the target artificial intelligence service to the allowed access state and allow access requests to be sent directly to the target artificial intelligence service.

[0116] B2: If the target request content information comes from the detection proxy, then before the detection proxy recovers from the anomaly, for subsequent access requests initiated by the terminal, obtain the request metadata of the subsequent access requests, perform security checks on the request metadata, and obtain the security check results of the subsequent access requests.

[0117] Here, if the target request content information comes from the detection proxy, it means that the terminal is using the forward proxy mode and has enabled certificate binding. At this time, due to the abnormality of the detection proxy, the detection cannot obtain the plaintext data of the request on the terminal side and upload it to the gateway. In order to ensure that the detection is not interrupted during the abnormality of the detection proxy, the security gateway can detect the request metadata of subsequent access requests.

[0118] Subsequent access requests can be new access requests initiated by the terminal to the target AI service from the moment the current target request content information is obtained, throughout the entire period of anomaly detection by the agent, as well as access requests initiated by the terminal to other target AI services.

[0119] The requested metadata may include, but is not limited to, various data that does not involve application layer plaintext, such as session triples, SNI domain names in the TLS handshake, and terminal traffic size.

[0120] In practice, if the target request content information corresponding to the current access request of the terminal comes from the detection proxy, but the detection proxy is also detected to be abnormal, the security gateway can obtain the request metadata of each subsequent access request initiated by the terminal before the detection proxy recovers from the abnormality (such as before the detection proxy goes online again). The security gateway can then perform content security detection on the request metadata to obtain the security detection result of the subsequent access request.

[0121] B3: Based on the second risk score of multiple target historical context requests related to the subsequent access request, determine the first risk score of the subsequent access request, and use the first risk score as the target risk score of the subsequent access request.

[0122] Here, the multiple target historical context requests related to subsequent access requests can be the various historical context requests between the terminal and the target AI service within the context acquisition window corresponding to the subsequent access request.

[0123] In practice, during the proxy anomaly detection period, for any subsequent access request between the terminal and the target AI service, a second risk score of multiple target historical context requests related to the subsequent access request can be obtained based on the context acquisition window determined for the target AI service. Then, the average of these second risk scores, or the score weighted by time-decaying, can be used as the first risk score of the subsequent access request, and this first risk score is used as the target risk score for the subsequent access request. At this time, since the terminal's direct connection ACL is always in a allowed state, this target risk score does not need to be used for risk state switching; it is only used for scoring records, thus providing observable scores for each access request generated during the proxy anomaly detection period. Alternatively, following the steps in B4 below, this target risk score can be used for subsequent risk state switching to ensure timely blocking of subsequent access requests with a high probability of anomalies.

[0124] B4: Based on the security detection results and target risk score of subsequent access requests, determine the target risk status of the terminal, and perform access control on subsequent access requests in accordance with the target risk status.

[0125] In practical implementation, for each subsequent access request, after obtaining the security detection result and target risk score of the subsequent access request, access control can be performed on the subsequent access request according to the risk status determination method and access control method described in the above embodiments. Until the detection agent goes online, the direct connection ACL between the terminal and the target AI service can be closed, and access control can be performed on access requests after the detection agent goes online using security gateway and firewall devices.

[0126] In this way, after the detection agent malfunctions, auditing and scoring can continue for non-certificate-bound traffic that is still decrypted by the security gateway, while metadata-level auditing can be performed on certificate-bound traffic (the captured metadata includes information such as session triples, SNI domains in the TLS handshake, and traffic size that does not involve application-layer plaintext). During the agent's absence, the historically accumulated risk score continues to participate in the time-series decay calculation as a compensation score, ensuring that the security observability logic is not interrupted while allowing traffic. After the agent recovers online, it switches back to the corresponding state, thereby preventing the AI ​​service from becoming unusable due to the detection agent's malfunction.

[0127] It should be noted that the protective state does not mean abandoning risk, but rather ensuring business availability by reducing the intensity of controls when the proxy is abnormal and normal content detection cannot be implemented, while maintaining the observability of risk by enhancing auditing and historical risk compensation.

[0128] In another embodiment, when there is no historical context request for the access request, content security detection is performed on the target request content information to obtain the security detection result of the access request; based on the security detection result and the first risk score, the target risk state of the terminal is determined from a variety of preset risk states, and access control is performed on the access request according to the target risk state.

[0129] In specific implementation, for the currently acquired access request, if the access request does not have a historical context request, it can be said that the access request is the first request in the current session. At this time, the target request content information can be directly input into the risk detection module. The risk detection module uses various risk detection rules and preset detection strengths to perform information security detection on the target request content information, and obtains the security detection result of the access request. Then, the first risk score of the first request can be directly used as the target risk score. Based on the security detection result and the target risk score, the target risk state of the terminal is determined from multiple preset risk states, and access control is performed on the access request according to the target risk state. The specific process of determining the target risk state of the terminal from multiple preset risk states based on the security detection result and target risk score of the first request and performing access control can be referred to the various embodiments related to S105 above, and will not be repeated here.

[0130] Optionally, the security gateway can also be equipped with an audit module, which can be used to generate a full-process audit log during the execution of the above access control methods by the security gateway, so as to provide support for the auditing of operations and maintenance personnel.

[0131] Thus, this application, by supporting dual-source content acquisition (i.e., network-side content acquisition and terminal-side content acquisition) and semantic feature extraction (i.e., cross-source semantic unified representation for AI security detection), enables terminals with certificate binding enabled to be detected, thus compensating for the detection blind spots of traditional MITM proxies. By directly using security detection results and risk scores to drive access control, compared to traditional detection methods that rely on static domain names / IPs for control and dynamic authorization based solely on compliance status, it can more accurately reflect actual access risks. When a terminal is in a risky state, blocking service endpoint sets and service address sets at the AI ​​service granularity can address situations where single-point blocking is ineffective due to a single AI service being distributed via multiple endpoints / IPs and CDNs. During periods of proxy anomaly detection, by reducing control strength and enhancing auditing and historical risk score compensation, risk observability can be maintained while ensuring business continuity. By associating the context of multi-turn interactions and establishing a risk detection mechanism based on multi-turn interaction content, the problem of gradual information leakage caused by missed detections in a single instance can be avoided. The synergy between dual-source content acquisition and semantic feature extraction ensures that terminals using different security boundaries can enter the same detection process, resulting in a detection consistency effect that cannot be expected with single-source content solutions.

[0132] like Figure 2 The diagram shown is another flowchart of an access control method provided in an embodiment of this application, which may include the following steps: If the terminal uses forward proxy mode, whether certificate binding is enabled is determined based on whether certificate enabling indication information is observed during the handshake phase. If so, the plaintext data of the access request can be collected using the detection proxy deployed on the terminal side as the terminal-side source data (i.e., terminal-side source content). If not, the access request data can be collected in the network as network-side source data (i.e., network-side source content) through the man-in-the-middle decryption method of the enterprise root certificate.

[0133] If the terminal uses API proxy mode, it can directly collect access request data from the network as network-side source data.

[0134] The source data is used to generate a unified AI interaction object. This involves semantic parsing of the source data according to multiple semantic fields to obtain semantic information under each semantic field. The semantic information under multiple semantic fields is then encoded and normalized to obtain semantic features.

[0135] Using a risk scoring model, the first risk score is determined based on semantic features.

[0136] In the case of access requests with historical context requests, the security detection result of the access request is determined based on the historical request content information of multiple target historical context requests related to the access request and the obtained source data; and the target risk score of the access request is determined based on the second risk score and the first risk score of multiple target historical context requests.

[0137] Based on the security test results and target risk score, the target risk state of the terminal is determined from a variety of preset risk states through a risk state machine.

[0138] If the target risk status is "risky," then based on the set of service addresses and service endpoints associated with the target AI service, an access control list rule for the target AI service is generated and sent to the firewall device. If the target risk status is "secure," "protected," or "concerned," then the access request can be sent to the firewall device.

[0139] Throughout the detection process, the audit module is used to generate audit logs in order to achieve the purpose of audit traceability.

[0140] For the specific implementation process of each of the above steps, please refer to the above embodiments, which will not be repeated here.

[0141] like Figure 3The diagram illustrates an access control architecture for a security gateway provided in this application embodiment. The security gateway can utilize a detection proxy deployed on the terminal side with certificate binding enabled to obtain plaintext request data uploaded by the detection proxy through an upload channel as terminal-side source data. Alternatively, for terminals without certificate binding enabled, access request data can be collected from the network via a man-in-the-middle decryption method using the enterprise root certificate as network-side source data. Or, for terminals with API proxy mode enabled, access request data can be collected from the network via an API proxy as network-side source data. Then, for the obtained source data (terminal-side source data or network-side source data), a semantic encoding module is used to convert the source data into semantic features, obtaining the corresponding semantic features. Then, a risk detection module can be used, employing a risk scoring model, to generate a first risk score based on the semantic features. The risk detection module then performs content security detection on the target request content information and the historical request content information of multiple target historical context requests related to the access request, obtaining the security detection result of the access request. The policy control center module determines the target risk score based on the first risk score and the second risk score from multiple target historical context requests. Based on the target risk score and security detection results, the risk state machine determines the target risk state of the terminal from multiple preset risk states. Then, according to the target risk state, ACL rules are issued or updated to the firewall device, which then controls access requests based on the ACL rules. The security gateway can also be configured with an audit module to generate audit logs, achieving the purpose of audit traceability.

[0142] For details on the specific functions of each module in the above architecture, please refer to the descriptions of the above embodiments; they will not be repeated here.

[0143] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0144] Based on the same inventive concept, this disclosure also provides an access control device corresponding to the access control method. Since the principle of the device in this disclosure for solving the problem is similar to that of the access control method described above in this disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0145] like Figure 4 The diagram shown is a schematic representation of an access control device provided in an embodiment of this disclosure, comprising: The first acquisition module 401 is used to acquire target request content information related to the artificial intelligence service access request initiated by the terminal; the target request content information is plaintext request data collected and uploaded by the terminal using the detection proxy deployed on the terminal side or access request data collected in the network by the security gateway; the source of the target request content information is related to the proxy mode used by the terminal and / or whether certificate binding is enabled. The scoring module 402 is used to determine the first risk score corresponding to the access request based on the semantic features corresponding to the target request content information using a risk scoring model. The second acquisition module 403 is used to acquire, when the access request has a historical context request, a second risk score and historical request content information of multiple target historical context requests related to the access request. The detection module 404 is used to perform content security detection on the target request content information and the historical request content information to obtain the security detection result of the access request; The control module 405 is used to determine the target risk state of the terminal from a variety of preset risk states based on the security detection result, the first risk score and the second risk score, and to perform access control on the access request according to the target risk state.

[0146] In one possible implementation, the first acquisition module 401, when acquiring the target request content information related to the access request, is used to: Determine whether the terminal has enabled forward proxy mode; If so, it is determined whether the terminal has enabled certificate binding based on whether certificate enabling indication information is observed during the handshake phase with the terminal; the certificate enabling indication information includes at least certificate binding extension information carried in the handshake message, hash result of the subject public key information in the handshake message, server name indication in the handshake message being inconsistent with the certificate subject, and the terminal initiating a bidirectional transport layer security request. If so, the detection proxy deployed on the terminal side is used to collect and upload the plaintext data of the access request before the terminal performs application-layer encryption on the access request.

[0147] In one possible implementation, the first acquisition module 401 is further configured to: If the terminal does not have certificate binding enabled, the access request data of the access request is collected in the network through man-in-the-middle decryption. Alternatively, if the terminal enables the application programming interface proxy mode, the access request data of the access request can be collected in the network.

[0148] In one possible implementation, the scoring module 402 is configured to determine the semantic features according to the following steps: The target request content information is semantically parsed according to multiple semantic fields to obtain the semantic information of the target request content information under each semantic field. The semantic information under the multiple semantic fields is subjected to semantic feature encoding and normalization to obtain the semantic features.

[0149] In one possible implementation, the detection module 404, when performing content security detection on the target request content information and the historical request content information to obtain the security detection result of the access request, is used to: The security detection intensity is determined based on the current risk status of the terminal under the target artificial intelligence service it is accessing; different risk statuses correspond to different security detection intensities. Based on the security detection strength, the target request content information is subjected to content security detection to determine the first detection result of the target request content information under multiple risky behaviors; Based on the target request content information and the historical request content information, generate content information to be detected, and perform content security detection on the content information to be detected according to the security detection strength to determine the second detection result of the content information to be detected under multiple risk behaviors; Based on the first detection result and the second detection result, the security detection result of the access request is determined.

[0150] In one possible implementation, the second acquisition module 403, when acquiring the second risk score and historical request content information of multiple target historical context requests related to the access request when the access request has historical context requests, is used to: If the access request has a historical context request, the target artificial intelligence service accessed by the terminal is determined based on the target request content information; The context acquisition window is determined based on the service type of the target AI service and / or the various historical risk states of the terminal under the target AI service. According to the context acquisition window, each target historical context request is determined from each historical context request related to the access request, and the second risk score and historical request content information of each target historical context request are obtained.

[0151] In one possible implementation, the control module 405, when determining the target risk state of the terminal from multiple preset risk states based on the security detection result, the first risk score, and the second risk score, and performing access control on the access request according to the target risk state, is configured to: The target risk score is determined based on the first risk score and the second risk score; The heartbeat detection mechanism is used to determine whether the detection agent is malfunctioning. If not, then if the target risk score is greater than the first score threshold and / or the security detection result indicates that there is a security risk, the target risk state of the terminal is determined to be a risk state. Based on the service identifier of the target artificial intelligence service accessed by the terminal, obtain the set of service addresses and the set of service endpoints related to the target artificial intelligence service; Based on the set of service addresses and service endpoints, an access control list rule for the target artificial intelligence service is generated, and the access control list rule and the access request are sent to the firewall device; the firewall device is used to perform access control on the access request according to the latest issued access control list rule and the stored access control list rule.

[0152] In one possible implementation, the control module 405 is further configured to: If the detection agent does not show any abnormalities, and if the target risk score is between the first score threshold and the second score threshold, and / or if the security detection result indicates that there is no security risk and carries sensitive content, then the target risk status of the terminal is determined to be a state of concern; wherein, the first score threshold is greater than the second score threshold. The access request is sent to the firewall device; the firewall device is used to perform access control on the access request according to the stored access control list rules.

[0153] In one possible implementation, the control module 405 is further configured to: If the detection agent does not show any abnormalities, and if the target risk score is less than the second score threshold and the security detection result indicates that there is no security risk, then the target risk status of the terminal is determined to be a safe state. The access request is sent to the firewall device; the firewall device is used to perform access control on the access request according to the stored access control list rules.

[0154] In one possible implementation, the control module 405 is further configured to: If the detection agent malfunctions, the target risk status of the terminal is determined to be protected, and the access control list between the terminal and the target artificial intelligence service is switched to allowed access, allowing the access request to be sent to the target artificial intelligence service. The detection module 404 is further configured to, if the target request content information originates from the detection proxy, before the detection proxy recovers from the anomaly, obtain the request metadata of the subsequent access request initiated by the terminal, perform security detection on the request metadata, and obtain the security detection result of the subsequent access request. The control module 405 is further configured to determine a first risk score of the subsequent access request based on a second risk score of multiple target historical context requests related to the subsequent access request, and to use the first risk score as the target risk score of the subsequent access request. Based on the security detection results and target risk score of the subsequent access request, the target risk status of the terminal is determined, and access control is performed on the subsequent access request according to the target risk status.

[0155] In one possible implementation, the detection module 404 is further configured to: If the access request does not have a historical context request, perform content security detection on the target request content information to obtain the security detection result of the access request; The control module 405 is also used for: Based on the security detection results and the first risk score, the target risk state of the terminal is determined from a variety of preset risk states, and access control is performed on the access request according to the target risk state.

[0156] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.

[0157] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to in the description of the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0158] Based on the same technical concept, embodiments of this application also provide a computer device. (Refer to...) Figure 5 The diagram shown is a structural schematic of a computer device provided in an embodiment of this application, comprising: The processor 501, memory 502, and bus 503 are included. Memory 502 stores machine-readable instructions executable by the processor 501. The processor 501 executes the machine-readable instructions stored in memory 502. When the machine-readable instructions are executed by the processor 501, the processor 501 performs steps S101 to S105.

[0159] The aforementioned memory 502 includes a main memory 5021 and an external memory 5022. The main memory 5021, also known as internal memory, is used to temporarily store the computational data in the processor 501, as well as the data exchanged with external memory such as a hard disk 5022. The processor 501 exchanges data with the external memory 5022 through the main memory 5021. When the computer device is running, the processor 501 and the memory 502 communicate through the bus 503, so that the processor 501 executes the execution instructions mentioned in the above method embodiments.

[0160] This disclosure also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the access control method described in the above-described method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.

[0161] This disclosure also provides a computer program product carrying program code. The program code includes instructions that can be used to execute the steps of the access control method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0162] The computer program product can be implemented specifically through hardware, software, or a combination thereof. In one alternative embodiment, the computer program product is specifically embodied in a computer storage medium; in another alternative embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0163] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. In the several embodiments provided in this disclosure, it can be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces; the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0164] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0165] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0166] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0167] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the user through pop-up information or by asking the user to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.

[0168] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. An access control method, characterized in that, Applied to a security gateway, the method includes: For an AI service access request initiated by a terminal, target request content information related to the access request is obtained; the target request content information is plaintext request data collected and uploaded by the terminal using a detection proxy deployed on the terminal side or access request data collected in the network by the security gateway; the source of the target request content information is related to the proxy mode used by the terminal and / or whether certificate binding is enabled. Using a risk scoring model, a first risk score is determined for the access request based on the semantic features corresponding to the target request content information. If the access request has a historical context request, obtain the second risk score and historical request content information of multiple target historical context requests related to the access request; Perform content security detection on the target request content information and the historical request content information to obtain the security detection result of the access request; Based on the security detection results, the first risk score, and the second risk score, the target risk state of the terminal is determined from a variety of preset risk states, and access control is performed on the access request according to the target risk state.

2. The method according to claim 1, characterized in that, The step of obtaining the target request content information related to the access request includes: Determine whether the terminal has enabled forward proxy mode; If so, it is determined whether the terminal has enabled certificate binding based on whether certificate enabling indication information is observed during the handshake phase with the terminal; the certificate enabling indication information includes at least certificate binding extension information carried in the handshake message, hash result of the subject public key information in the handshake message, server name indication in the handshake message being inconsistent with the certificate subject, and the terminal initiating a bidirectional transport layer security request. If so, the detection proxy deployed on the terminal side is used to collect and upload the plaintext data of the access request before the terminal performs application-layer encryption on the access request.

3. The method according to claim 2, characterized in that, The method further includes: If the terminal does not have certificate binding enabled, the access request data of the access request is collected in the network through man-in-the-middle decryption. Alternatively, if the terminal enables the application programming interface proxy mode, the access request data of the access request can be collected in the network.

4. The method according to claim 1, characterized in that, The semantic features are determined according to the following steps: The target request content information is semantically parsed according to multiple semantic fields to obtain the semantic information of the target request content information under each semantic field. The semantic information under the multiple semantic fields is subjected to semantic feature encoding and normalization to obtain the semantic features.

5. The method according to claim 1, characterized in that, The step of performing content security detection on the target request content information and the historical request content information to obtain the security detection result of the access request includes: The security detection intensity is determined based on the current risk status of the terminal under the target artificial intelligence service it is accessing; different risk statuses correspond to different security detection intensities. Based on the security detection strength, the target request content information is subjected to content security detection to determine the first detection result of the target request content information under multiple risky behaviors; Based on the target request content information and the historical request content information, generate content information to be detected, and perform content security detection on the content information to be detected according to the security detection strength to determine the second detection result of the content information to be detected under multiple risk behaviors; Based on the first detection result and the second detection result, the security detection result of the access request is determined.

6. The method according to claim 1, characterized in that, When the access request has a historical context request, the method of obtaining a second risk score and historical request content information of multiple target historical context requests related to the access request includes: If the access request has a historical context request, the target artificial intelligence service accessed by the terminal is determined based on the target request content information; The context acquisition window is determined based on the service type of the target AI service and / or the various historical risk states of the terminal under the target AI service. According to the context acquisition window, each target historical context request is determined from each historical context request related to the access request, and the second risk score and historical request content information of each target historical context request are obtained.

7. The method according to claim 1, characterized in that, The step of determining the target risk state of the terminal from multiple preset risk states based on the security detection result, the first risk score, and the second risk score, and then performing access control on the access request according to the target risk state, includes: The target risk score is determined based on the first risk score and the second risk score; The heartbeat detection mechanism is used to determine whether the detection agent is malfunctioning. If not, then if the target risk score is greater than the first score threshold and / or the security detection result indicates that there is a security risk, the target risk state of the terminal is determined to be a risk state. Based on the service identifier of the target artificial intelligence service accessed by the terminal, obtain the set of service addresses and the set of service endpoints related to the target artificial intelligence service; Based on the set of service addresses and service endpoints, an access control list rule for the target artificial intelligence service is generated, and the access control list rule and the access request are sent to the firewall device; the firewall device is used to perform access control on the access request according to the latest issued access control list rule and the stored access control list rule.

8. The method according to claim 7, characterized in that, The method further includes: If the detection agent does not show any abnormalities, and if the target risk score is between the first score threshold and the second score threshold, and / or if the security detection result indicates that there is no security risk and carries sensitive content, then the target risk status of the terminal is determined to be a state of concern; wherein, the first score threshold is greater than the second score threshold. The access request is sent to the firewall device; the firewall device is used to perform access control on the access request according to the stored access control list rules.

9. The method according to claim 7, characterized in that, The method further includes: If the detection agent does not show any abnormalities, and if the target risk score is less than the second score threshold and the security detection result indicates that there is no security risk, then the target risk status of the terminal is determined to be a safe state. The access request is sent to the firewall device; the firewall device is used to perform access control on the access request according to the stored access control list rules.

10. The method according to claim 7, characterized in that, The method further includes: If the detection agent malfunctions, the target risk status of the terminal is determined to be protected, and the access control list between the terminal and the target artificial intelligence service is switched to allowed access, allowing the access request to be sent to the target artificial intelligence service. If the target request content information originates from the detection proxy, then before the detection proxy recovers from the anomaly, for subsequent access requests initiated by the terminal, the request metadata of the subsequent access requests is obtained, and the request metadata is subjected to security detection to obtain the security detection result of the subsequent access requests. Based on the second risk score of multiple target historical context requests related to the subsequent access request, a first risk score of the subsequent access request is determined, and the first risk score is used as the target risk score of the subsequent access request. Based on the security detection results and target risk score of the subsequent access request, the target risk status of the terminal is determined, and access control is performed on the subsequent access request according to the target risk status.

11. The method according to claim 1, characterized in that, The method further includes: If the access request does not have a historical context request, perform content security detection on the target request content information to obtain the security detection result of the access request; Based on the security detection results and the first risk score, the target risk state of the terminal is determined from a variety of preset risk states, and access control is performed on the access request according to the target risk state.

12. An access control device, characterized in that, The device, applied to a security gateway, includes: The first acquisition module is used to acquire target request content information related to the artificial intelligence service access request initiated by the terminal; the target request content information is plaintext request data collected and uploaded by the terminal using the detection proxy deployed on the terminal side or access request data collected in the network by the security gateway; the source of the target request content information is related to the proxy mode used by the terminal and / or whether certificate binding is enabled. The scoring module is used to determine the first risk score corresponding to the access request based on the semantic features corresponding to the target request content information using a risk scoring model. The second acquisition module is used to acquire, when the access request has a historical context request, the second risk score and historical request content information of multiple target historical context requests related to the access request. The detection module is used to perform content security detection on the target request content information and the historical request content information to obtain the security detection result of the access request; The control module is used to determine the target risk state of the terminal from a variety of preset risk states based on the security detection results, the first risk score and the second risk score, and to perform access control on the access request according to the target risk state.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the access control method as described in any one of claims 1 to 11.

14. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the access control method as described in any one of claims 1 to 11.