Disclosure of Invention
The present application mainly aims to provide a system detection method, an apparatus, an electronic device, and a storage medium, which can improve the capability of a system to deal with security threats and reduce security risks during operation.
In order to achieve the above object, a first aspect of the embodiments of the present application provides a system detection method, including:
when the system is started, acquiring a first policy in the security policy set as a current security policy;
judging whether the current security policy is a starting security policy;
if yes, starting according to the starting security policy, and detecting the system according to the security policy set;
if not, detecting whether a trigger condition is generated in real time in the system running process after normal starting, and if so, extracting a safety strategy corresponding to the trigger condition in the safety strategy set to detect the system.
Further, before the obtaining a first policy in the security policy set as a current security policy, the method includes:
judging whether a security policy checking task exists or not;
if not, starting normally;
and if so, executing the step of acquiring the first policy in the security policy set as the current security policy.
Further, the detecting the system according to the security policy set includes:
detecting the system according to the current security policy to obtain a detection result;
sending the detection result to a preset strategy engine so that the strategy engine obtains a corresponding processing result according to the detection result;
and extracting the next security policy of the current security policy as the current security policy, and executing the step of judging whether the current security policy is the starting security policy.
Further, when the system is started, before the first policy in the security policy set is obtained as the current security policy, the method includes:
obtaining an attack model sample;
extracting security elements involved in the attack model sample;
and designing a corresponding security policy based on the security elements involved in each attack model to obtain the security policy set.
Further, the preset policy engine stores the security policy set.
A second aspect of the embodiments of the present application provides a system detection apparatus, including:
the acquisition module is used for acquiring a first policy in the security policy set as a current security policy when the system is started;
the first judgment module is used for judging whether the current security policy is a starting security policy or not;
the first detection module is used for starting according to the starting security policy if the system is in the normal state and detecting the system according to the security policy set;
and the second detection module is used for detecting whether a trigger condition is generated in real time in the system running process after normal starting if the trigger condition is not generated, and extracting the security policy corresponding to the trigger condition from the security policy set to detect the system if the trigger condition is generated.
Further, the apparatus further comprises:
the second judgment module is used for judging whether a security policy checking task exists or not;
the starting module is used for normally starting if the starting module does not exist;
the obtaining module is further configured to execute the step of obtaining a first policy in the security policy set as a current security policy, if the first policy exists.
Further, the first detection module comprises:
the detection submodule is used for detecting the system according to the current security strategy to obtain a detection result;
the sending submodule is used for sending the detection result to a preset strategy engine so that the strategy engine obtains a corresponding processing result according to the detection result;
and the extraction submodule is used for extracting the next security policy of the current security policy as the current security policy and executing the first judgment module.
A third aspect of embodiments of the present application provides an electronic device, including:
the system detection method is characterized in that the system detection method provided by the first aspect of the embodiment of the present application is implemented when the processor executes the program.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the system detection method provided in the first aspect of the embodiments of the present application.
As can be seen from the foregoing embodiments of the present application, according to the system detection method, apparatus, electronic device, and storage medium provided by the present application, when a system is started, a first policy in the security policy set is obtained as a current security policy, whether the current security policy is a start security policy is determined, if yes, the system is started according to the start security policy, and the system is detected according to the security policy set, if not, whether a trigger condition is generated in a system operation process after normal start is detected in real time, and if a trigger condition is generated, a security policy corresponding to the trigger condition is extracted from the security policy set to detect the system, so that a capability of the system against security threats is improved, and security risks during operation are reduced.
Detailed Description
In order to make the purpose, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a schematic flow chart of a system detection method according to an embodiment of the present application, where the method is applicable to an electronic device, and the electronic device includes: cell-phone, panel computer, portable computer, wearable equipment, intelligent terminal, unmanned aerial vehicle, automotive electronics etc. this method mainly includes following steps:
s101, when a system is started, a first policy in the security policy set is obtained to serve as a current security policy;
the System is an embedded System on Chip (SoC) and generally includes a plurality of processor/controller cores, a performance acceleration module, a programmable module, a sensor and a peripheral interface, and is used for completing personal functions such as calculation, social contact, communication, cross sensing, artificial intelligence and financial payment.
The security policy refers to a policy established for the attack model and used for enabling the system to normally operate, and the type of the policy includes access control, information flow, survival constraint, TOCTOU, communication and the like.
In one embodiment of the present application, before step S101, the following steps are further included:
judging whether a security policy checking task exists or not; if not, starting normally; if yes, go to step 101.
In one embodiment of the present application, referring to fig. 2, before step S101, the method further includes the following steps:
s1, obtaining an attack model sample;
the attack model comprises types of common malicious software attack, system malicious software attack, side channel attack, common hardware attack, reverse engineering, malicious hardware injection attack and the like, and specific attack models are further included under each type, for example, the common malicious software attack comprises buffer overflow, code injection, BIOS infection and return programming attack. The attack model is shown in table 1:
TABLE 1
S2, extracting the security elements involved in the attack model sample;
the security elements refer to relevant information related to the attack model, and include confidential information, Don't' care status, DFD-related function, DFT-related function, update information, bypass information, debug interface information, fault/error injection information, and the like.
Illustratively, let a1 be secret information, a2 be Don't' care status, a3 be DFD related function, a4 be DFT related function, a5 be update information, a6 be bypass information, a7 be debug interface information, and a8 be fault/error injection information. The security elements corresponding to the attack model are shown in table 2:
TABLE 2
S3, designing corresponding security policy based on the security elements involved in each attack model, and obtaining the security policy set.
The set of security policies is shown in table 3 below:
TABLE 3
S102, judging whether the current security policy is a starting security policy;
if yes, executing step S103, starting according to the starting security policy, and detecting the system according to the security policy set;
illustratively, the boot policy includes that no IP has access to the internal registers of the encryption engine during boot, that the encryption engine has access to only the IP associated with the encryption process during boot, etc.
In one embodiment of the present application, referring to fig. 3, step S103 includes:
s1031, detecting the system according to the current security policy to obtain a detection result;
for example, if the current security policy is that no IP has access to the internal registers of the encryption engine during boot-up, then the system is tested to determine if any IP has access to the internal registers of the encryption engine during boot-up. The detection result is that there is an IP to access the internal register of the encryption engine and at the same time, the IP is recorded, or there is no IP to access the internal register of the encryption engine.
If the current security policy is that the encryption engine can only access the IP related to the encryption process during startup, the detection of the system is to detect whether the encryption engine has access to the IP unrelated to the encryption process during startup. The detection result is yes or no, and if yes, the accessed IP is recorded at the same time.
S1032, sending the detection result to a preset strategy engine so that the strategy engine obtains a corresponding processing result according to the detection result;
in one embodiment of the present application, a security policy set is stored in a policy engine, and the policy engine performs decision processing on a detection result based on the security policy set.
S1033, extracting the next security policy of the current security policy as the current security policy, and executing step S101.
The order of the security policies in the security policy set can be defined by a user or a developer according to requirements.
If not, executing step S104, and detecting whether a trigger condition is generated in real time in the system running process after normal start, and if so, extracting a security policy corresponding to the trigger condition from the security policy set to detect the system.
The trigger condition may be that a suspected attack action occurs, or that an element to be protected is read or written during current operation. Illustratively, the trigger condition is a 7: and (4) reading the debugging interface information, extracting the security policy related to a7 in the security policy set, wherein the attack models related to the security element a7 are A-US-2, A-US-3 and A-NH-1 in correspondence to the table 2, and extracting the security policies IF-4, F-2, AC-1, L-2, L-3, AC-10, AC-12 and L-1 in correspondence to the table 3.
It is understood that the trigger condition and the security policy corresponding to the trigger condition may be one or more.
In the embodiment of the application, when a system is started, a first policy in the security policy set is obtained as a current security policy, whether the current security policy is a starting security policy is judged, if yes, the system is started according to the starting security policy, the system is detected according to the security policy set, if not, whether a trigger condition is generated or not is detected in real time in the system operation process after normal starting, and if the trigger condition is generated, a security policy corresponding to the trigger condition is extracted from the security policy set to detect the system, so that the capability of the system for dealing with security threats is improved, and the security risk during operation is reduced.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a system detection device according to an embodiment of the present application, the device mainly includes:
the device comprises an acquisition module 201, a first judgment module 202, a first detection module 203 and a second detection module 204.
An obtaining module 201, configured to obtain a first policy in the security policy set as a current security policy when a system is started;
a first determining module 202, configured to determine whether the current security policy is a start security policy;
the first detection module 203, configured to start according to the start security policy if the system is in the normal state, and detect the system according to the security policy set;
in one embodiment of the present application, the first detection module 203 includes:
the detection submodule is used for detecting the system according to the current security strategy to obtain a detection result;
the sending submodule is used for sending the detection result to a preset strategy engine so that the strategy engine obtains a corresponding processing result according to the detection result;
and the extraction submodule is used for extracting the next security policy of the current security policy as the current security policy and executing the first judgment module.
In one embodiment of the present application, the preset policy engine stores the set of security policies.
The second detecting module 204 is configured to detect whether a trigger condition is generated in real time in a system running process after normal startup if the trigger condition is not generated, and extract a security policy corresponding to the trigger condition from the security policy set to detect the system if the trigger condition is generated.
In one embodiment of the present application, the apparatus further comprises:
the second judgment module is used for judging whether a security policy checking task exists or not;
the starting module is used for normally starting if the starting module does not exist;
the obtaining module 201 is further configured to, if the current security policy exists, execute a step of obtaining a first policy in the security policy set as the current security policy.
In one embodiment of the present application, the apparatus further comprises:
the sample acquisition module is used for acquiring an attack model sample;
the element extraction module is used for extracting the security elements involved in the attack model sample;
and the strategy design module is used for designing a corresponding security strategy based on the security elements involved in each attack model to obtain the security strategy set.
In this embodiment, when a system is started, a first policy in the security policy set is obtained as a current security policy, whether the current security policy is a start security policy is determined, if yes, the system is started according to the start security policy, and the system is detected according to the security policy set, if not, whether a trigger condition is generated is detected in real time in a system operation process after normal start, and if the trigger condition is generated, a security policy corresponding to the trigger condition is extracted from the security policy set to detect the system, so that the capability of the system to deal with security threats is improved, and the security risk during operation is reduced.
Further, the electronic device includes: a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the system detection method as described in the embodiments of fig. 1 to 3.
An embodiment of the present application further provides a computer-readable storage medium, where the computer-readable storage medium may be disposed in the electronic device in each of the above embodiments, and the computer-readable storage medium may be a storage unit disposed in the main control chip and the data acquisition chip in each of the above embodiments. The computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the system detection method described in the foregoing embodiments shown in fig. 1 to 2.
For example, the electronic device may be any of various types of computer system apparatuses that are mobile or portable and perform wireless communication. In particular, the electronic apparatus may be a mobile phone or a smart phone (e.g., iPhone-based, Android-based phone), a portable game device (e.g., Nintendo DS, playstatio portable, Gameboy Advance, iPhone), a laptop, a PDA, a portable internet appliance, a music player, and a data storage device, other handheld devices, and a head-mounted device (HMD) such as a watch, a headset, a pendant, a headset, etc., and other wearable devices (e.g., electronic glasses, electronic clothes, an electronic bracelet, an electronic necklace, an electronic tattoo, an electronic device, or a smart watch).
The electronic apparatus may also be any of a number of electronic devices including, but not limited to, cellular phones, smart phones, other wireless communication devices, personal digital assistants, audio players, other media players, music recorders, video recorders, cameras, other media recorders, radios, medical devices, vehicle transportation equipment, calculators, programmable remote controllers, pagers, laptop computers, desktop computers, printers, netbook computers, Personal Digital Assistants (PDAs), Portable Multimedia Players (PMPs), moving picture experts group (MPEG-1 or MPEG-2) audio layer 3(MP3) players, portable medical devices, and digital cameras and combinations thereof.
In some cases, the electronic device may perform a variety of functions (e.g., playing music, displaying video, storing pictures, and receiving and sending telephone calls). If desired, the electronic apparatus may be a portable device such as a cellular telephone, media player, other handheld device, wristwatch device, pendant device, earpiece device, or other compact portable device.
As shown in fig. 5, the electronic device 10 may include control circuitry, which may include storage and processing circuitry 30. The storage and processing circuitry 30 may include memory, such as hard drive memory, non-volatile memory (e.g., flash memory or other electronically programmable erase limit memory used to form solid state drives, etc.), volatile memory (e.g., static or dynamic random access memory, etc.), and so forth, although the embodiments of the present application are not limited thereto. Processing circuitry in the storage and processing circuitry 30 may be used to control the operation of the electronic device 10. The processing circuitry may be implemented based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio codec chips, application specific integrated circuits, display driver integrated circuits, and the like.
The storage and processing circuitry 30 may be used to run software within the electronic device 10 such as, for example, an Internet browsing application, a Voice Over Internet Protocol (VOIP) telephone call application, an email application, a media playing application, operating system functions, etc. Such software may be used to perform control operations such as, for example, camera-based image capture, ambient light measurement based on an ambient light sensor, proximity sensor measurement based on a proximity sensor, information display functionality based on status indicators such as status indicator lights of light emitting diodes, touch event detection based on a touch sensor, functionality associated with displaying information on multiple (e.g., layered) displays, operations associated with performing wireless communication functions, operations associated with collecting and generating audio signals, control operations associated with collecting and processing button press event data, and other functions in the electronic device 10, and the like, without limitation of the embodiments of the present application.
The electronic device 10 may also include input-output circuitry 42. The input-output circuitry 42 may be used to enable the electronic device 10 to enable input and output of data, i.e., to allow the electronic device 10 to receive data from external devices and also to allow the electronic device 10 to output data from the electronic device 10 to external devices. The input-output circuitry 42 may further include the sensor 32. The sensors 32 may include ambient light sensors, optical and capacitive based proximity sensors, touch sensors (e.g., optical based touch sensors and/or capacitive touch sensors, where the touch sensors may be part of a touch display screen or may be used independently as a touch sensor structure), acceleration sensors, and other sensors, among others.
Input-output circuitry 42 may also include one or more displays, such as display 14. The display 14 may include one or a combination of liquid crystal displays, organic light emitting diode displays, electronic ink displays, plasma displays, displays using other display technologies. The display 14 may include an array of touch sensors (i.e., the display 14 may be a touch display screen). The touch sensor may be a capacitive touch sensor formed by a transparent touch sensor electrode (e.g., an Indium Tin Oxide (ITO) electrode) array, or may be a touch sensor formed using other touch technologies, such as acoustic wave touch, pressure sensitive touch, resistive touch, optical touch, and the like, and the embodiments of the present application are not limited thereto.
The electronic device 10 may also include an audio component 36. The audio component 36 may be used to provide audio input and output functionality for the electronic device 10. Audio components 36 in electronic device 10 may include speakers, microphones, buzzers, tone generators, and other components for generating and detecting sound.
The communication circuitry 38 may be used to provide the electronic device 10 with the ability to communicate with external devices. The communication circuit 38 may include analog and digital input-output interface circuits, and wireless communication circuits based on radio frequency signals and/or optical signals. The wireless communication circuitry in communication circuitry 38 may include radio-frequency transceiver circuitry, power amplifier circuitry, low noise amplifiers, switches, filters, and antennas. For example, the wireless Communication circuitry in Communication circuitry 38 may include circuitry to support Near Field Communication (NFC) by transmitting and receiving Near Field coupled electromagnetic signals. For example, the communication circuitry 38 may include a near field communication antenna and a near field communication transceiver. The communications circuitry 38 may also include a cellular telephone transceiver and antenna, a wireless local area network transceiver circuit and antenna, and the like.
The electronic device 10 may further include a battery, power management circuitry, and other input-output units 40. The input-output unit 40 may include buttons, joysticks, click wheels, scroll wheels, touch pads, keypads, keyboards, cameras, light emitting diodes and other status indicators, etc.
A user may enter commands through input-output circuitry 42 to control the operation of electronic device 10, and may use output data of input-output circuitry 42 to enable receipt of status information and other outputs from electronic device 10.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In view of the above description of the system detection method, apparatus, electronic device and storage medium provided in the present application, those skilled in the art will recognize that there may be variations in the embodiments and applications of the system detection method, apparatus, electronic device and storage medium provided in the present application.