Computer virus checking and killing method, system and device
Technical field
The present invention relates to computing machine and communication technical field, relate in particular to a kind of computer virus checking and killing method, a kind of computer virus checking and killing system and a kind of computer virus checking and killing device.
Background technology
Cloud computing refers to a kind of payment and use pattern of information technology infrastructure, and user obtains resource requirement by network in the mode of as required, easily expanding.Cloud computing is also extended to payment and the use pattern of service, and user obtains required service by network in the mode of as required, easily expanding.The core concept of cloud computing, is resource (the resource here comprises storage resources, computational resource, various application software) unified management and the scheduling connecting with network in a large number, and forming a resource pool provides service as required to user.Provide the network of resource to be called as in " cloud ".
Cloud computing is an important application scene of hardware virtualization technology.Hardware virtualization technology fictionalizes one or more virtual machine on a physical host, thereby makes several even tens virtual machines can share the hardware resource of a physical host.Cloud service business provides many virtual machines (these virtual machines can be distributed in different physical hosts) to rent for user, when these virtual machines are during all in running status, has been equivalent to form a huge computer cluster network.If wherein a virtual machine is with computer virus, just likely propagate to other virtual machines in cluster network, cause that network congestion, information are stolen, network connects fault etc.
For solving the killing problem of virtual machine Computer virus, prior art provides two kinds of solutions.The one, user installs antivirus software and carries out checking and killing virus in virtual machine, and its process is similar with the checking and killing virus process in normal hosts; The 2nd, the online antivirus website that user provides by the browser access antivirus software manufacturer of virtual machine, according to Website page, the browser plug-in of the forms such as ActiveX, java applet is installed in prompting, when this online antivirus website of subsequent access, carry out online antivirus by the interacting message of browser plug-in and online antivirus website.
Inventor is realizing in process of the present invention, find that prior art at least exists following defect: prior art all need to be installed checking and killing virus client in virtual machine, user need to select to install suitable antivirus software or select the suitable online antivirus website of access, technical ability to user is had relatively high expectations, and operates comparatively loaded down with trivial details.
Summary of the invention
The embodiment of the present invention provides a kind of computer virus checking and killing method, in order to solve the loaded down with trivial details problem of virtual machine checking and killing virus process operation in prior art.
Accordingly, the embodiment of the present invention also provides a kind of computer virus checking and killing device.
The technical scheme that the embodiment of the present invention provides is as follows:
A kind of computer virus checking and killing method, comprising:
Checking and killing virus server obtains the memory location of virtual machine image data;
According to the mirror image data of the memory location carry virtual machine of virtual machine image data, described mirror image data is mapped as to a virtual disk in checking and killing virus server file system;
Operation virus scanning engine, according to the feature of known viruse in virus characteristic storehouse, scans described virtual disk; If scanning result is found virus, call corresponding antivirus applet and carry out virus sweep.
A kind of computer virus checking and killing device, comprising:
Mirror image data acquisition module, for obtaining the memory location of virtual machine image data;
Carry module, for according to the memory location of virtual machine image data, the mirror image data of carry virtual machine, is mapped as a virtual disk in checking and killing virus server file system by described mirror image data;
Scanning execution module, for after the mirror image data of carry module carry virtual machine, triggers operation virus scanning engine, according to the feature of known viruse in virus characteristic storehouse, described virtual disk is scanned;
Virus killing execution module, if find virus for the scanning result of scanning execution module, calls corresponding antivirus applet and carries out virus sweep.
The first mirror image data of carry virtual machine of technical scheme checking and killing virus server of the embodiment of the present invention, and the virtual disk shining upon after mirror image data carry is carried out to virus scan; In the time that scanning result is found virus, call corresponding antivirus applet and carry out virus sweep, thereby realize the object of virtual machine being carried out to checking and killing virus.In this scheme, without antivirus software is installed in virtual machine, without user's operation of killing virus, greatly simplify user's operation.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the main principle flow chart of realizing of the embodiment of the present invention;
The deployed environment schematic diagram of the computer virus checking and killing system that Fig. 2 a provides for the embodiment of the present invention;
Fig. 2 b be in the embodiment of the present invention in the first distributed storage device the schematic diagram of memory image data;
Fig. 2 c be in the embodiment of the present invention in the second distributed storage device the schematic diagram of memory image data;
The detail flowchart of the computer virus checking and killing method that Fig. 3 provides for the embodiment of the present invention;
The structural representation of a kind of computer virus checking and killing device that Fig. 4 provides for the embodiment of the present invention;
The structural representation of carry module in the computer virus checking and killing device that Fig. 5 provides for the embodiment of the present invention;
The structural representation of determining unit in the computer virus checking and killing device that Fig. 6 provides for the embodiment of the present invention.
Embodiment
Prior art is except existing user to operate problem comparatively loaded down with trivial details, that checking and killing virus risk is larger, unpractical owing to requiring all virtual machine user all antivirus software to be consciously initiatively installed, therefore also there is the unmanageable problem of virus killing coverage rate, once certain customers do not install antivirus software on request, still can cause computer virus to be propagated in network; In virtual machine, install under the scene of antivirus software in addition, upgraded and safeguard that the antivirus software in each virtual machine is also comparatively restive.
For solving the problem of prior art, the embodiment of the present invention provides a kind of checking and killing method and killing system of computer virus.In the present embodiment, computer virus is the concept of a broad sense, comprises the various malicious codes such as wooden horse, rogue program.
Below in conjunction with each accompanying drawing, embodiment of the present invention technical scheme main realized to principle, embodiment and the beneficial effect that should be able to reach is explained in detail.
As shown in Figure 1, to realize principle process as follows for the embodiment of the present invention main:
Step 10, checking and killing virus server obtains the memory location of virtual machine image data.
Wherein, mirror image data refers to the static store form of virtual machine instance, wherein comprises VME operating system file and user file etc.In cloud computing infrastructure framework, the storage resources of virtual machine and operation resource may be distributed in different physical entities.In the time distributing certain user to use a virtual machine, pass through to load the mirror image data of this virtual machine for starting the physical host of virtual machine, realize the object that starts virtual machine.
The storage mode of load data in mirror image data (comprising VME operating system file and user file etc.) is identical with the storage mode of data in personal computer, identical for storing the Field Definition etc. of physical disk sector of data.Difference is that different virtual machine manufacturers encapsulates on the basis of load data, has increased data head, thereby has generated new mirror image data; Or some manufacturers have also carried out the processing such as compression to mirror image data.
Step 20, checking and killing virus server, according to the mirror image data of the memory location carry virtual machine of virtual machine image data, is mapped as a virtual disk in checking and killing virus server file system by described mirror image data.
Specifically, in different operating system, the form of the result of carry operation also can be different for carry.In the present embodiment, virtual disk refers to the storage object that can be identified by the operating system of checking and killing virus server.
In the situation that checking and killing virus server is Windows series operating system, after carry completes, mirror image data is mapped as a driver in checking and killing virus server file system; In the situation that checking and killing virus server is Linux, UNIX series operating system, after carry completes, mirror image data is mapped as a block device in checking and killing virus server file system.No matter be driver or block device, follow-up principle of operation is substantially similar.
Step 30, checking and killing virus server operation virus scanning engine, scans described driver or block device; If scanning result is found virus, carry out virus sweep.
Alternatively, because once virtual machine is in state of activation (being under the scene that is activated of virtual machine), mirror image data may be by real time modifying, if the now mirror image data of carry virtual machine, and the driver shining upon after carry or block device are carried out to virus scan, may will cannot ensure that scanning result can correctly reflect the safety case of the mirror image data after real time modifying, also may impact the performance of virtual machine in addition, therefore before step 10, also comprise:
Checking and killing virus server obtains virtual machine work at present state, and the duty of described virtual machine is for activating, hang up or shutdown; The work at present state of determining described virtual machine is unactivated state.
That is to say, checking and killing virus server is selected the virtual machine that work at present state is unactivated state, execution step 10~step 30.
Further, in step 20, checking and killing virus server obtains behind the memory location of virtual machine image data, determines the Format Type of mirror image data, then calls corresponding carry program carry virtual machine image data according to the type of mirror image data.Concrete horizontal glass really will be elaborated in embodiment in the back as the mode of data type.
Alternatively, know in time the safety case of virtual machine in order to make user, particularly scanning result finds that viral virtual machine user knows the safety case of virtual machine in time, after step 30, also comprises: checking and killing virus server finds that by scanning result viral information notifies to virtual machine user.For example, checking and killing virus server sends circular mail to the mailbox of described virtual machine user, carries scanning result and find viral information in this circular mail; Or the terminal device to described virtual machine user sends a notification message, in this notification message, carry scanning result and find viral information.
Below will be according to foregoing invention principle of the present invention, introduce in detail an embodiment the main principle that realizes of the inventive method is explained in detail and is illustrated.
The deployed environment schematic diagram of the computer virus checking and killing system that accompanying drawing 2a provides for the embodiment of the present invention.In this system, comprise at least one checking and killing virus server, at least one elasticity computing controller, at least one physical host and distributed storage device.Wherein, elasticity computing controller is a core component in existing cloud computing infrastructure framework, it is the maincenter of managing memory source, computational resource and other resources, wherein in the managing listings of storage, store the information such as memory address of mirror image data corresponding to the mark of the physical host for starting each virtual machine, each virtual machine instance, as shown in table 1.In the time distributing certain user to use a virtual machine, by reading this managing listings, instruction, for starting the physical host of this virtual machine, is read mirror image data and is loaded from the memory address of these virtual machine image data, thereby starts virtual machine.
In the present embodiment, the mirror image data of each virtual machine is stored in distributed storage device, wherein distributed storage device is respectively with storage area network (SAN, Storage Area Network) and network attached storage (NAS, Network Attached Storage) describe for example.
The storage mode of mirror image data in distributed storage device is relevant with the type of distributed storage device.For example, for SAN, virtual machine image data are the hard disk sector data in designated memory space (being virtual machine image data field).Other equipment, for example, for starting the physical host of virtual machine, can be used in request of access the mode of carrying " IP address+port numbers " and visit virtual machine image data field corresponding to virtual machine to be started on SAN, " IP address+port numbers " corresponding a memory block in SAN.As shown in accompanying drawing 2b.
For NAS, virtual machine image data are the image file under designated store path.Other equipment, for example, for starting the physical host of virtual machine, can pass through network file system(NFS) (NFS, Network File System) and visit virtual machine image file corresponding to virtual machine to be started on NAS.As shown in accompanying drawing 2c.
In table 1, the mirror image data of virtual machine VM1 and WM2 is stored in NAS, and the mirror image data of virtual machine VM3 is stored in NAS.
It should be noted that: shown in accompanying drawing 2a is the example that framework is implemented on a kind of cloud computing basis, the computer virus checking and killing method that the embodiment of the present invention provides is also applicable to other framework scenes, for example, in other framework scenes, be the corresponding relation of being safeguarded virtual machine mark and mirror image data address by management database.
Table 1
The detail flowchart of the computer virus checking and killing method that accompanying drawing 3 provides for the embodiment of the present invention.
Step 301, checking and killing virus startup of server scan task.
Alternatively, checking and killing virus server, according to configuration information, periodically starts scan task, for example, start weekly single pass task.In addition, can also select most of virtual machines to start scan task in the time period of unactivated state, for example 23:00~morning at night 6:00.The duty of virtual machine can obtain according to historical statistical data.
Step 302, checking and killing virus server reads the duty of current each virtual machine from elasticity computing controller.The duty of virtual machine is for activating, hang up or shutdown.Unactivated state refers to be hung up or shutdown.
Checking and killing virus server can adopt the mode of parallel processing or serial processing, to each virtual machine execution step 303~step 311, is here illustrated as an example of virtual machine WM1 example.
Step 303, checking and killing virus server judges whether the duty of virtual machine is state of activation, if state of activation is not carried out checking and killing virus to this virtual machine, if unactivated state not enters step 304.
Alternatively, if virtual machine is state of activation, checking and killing virus server can again read the duty of this virtual machine after waiting for setting-up time section.Setting-up time section rule of thumb statistics arranges, for example, wait for 2 hours and read the duty of this virtual machine afterwards again.
In the present embodiment, the work at present state of WM1 is off-mode.
Step 304, checking and killing virus server obtains the memory location of described virtual machine image data.
Alternatively, in the present embodiment, checking and killing virus server is by carrying out interacting message with elasticity computing controller, obtain elasticity and calculate the memory location of the mirror image data that in controller management list, virtual machine WM1 is corresponding, as in SAN system, the memory location of mirror image data is the address in mirror image data district, in NAS system, and the store path that the memory location of mirror image data is image file.
When implementing in framework in other forms of cloud computing, can be from obtain the memory location of virtual machine image data for the database of safeguarding virtual machine mark and mirror image data address corresponding relation.
Step 305, checking and killing virus server is determined the type of data format of described virtual machine image data.
Alternatively, the mode of determining the type of data format of mirror image data includes but not limited to:
Mode one:
Checking and killing virus server is first according to the memory location of described virtual machine image data, and whether test can successfully read the data head of mirror image data.
If can successfully read the data head of mirror image data, according to described data head, determine the type of data format of described mirror image data.For example, according to the definition of mirror image data form, type of data format field from described memory address in reading out data head, the field reading and all types of mark are compared, if consistent, determine that the type of virtual machine image data is type of data format corresponding to type identification consistent with the field reading.The type of mirror image data comprises QCOW (QEMU Copy-on-write), VMDK (VMWare Virtual Machine Disk Format), VHD (Microsoft Virtual Hard Disk format), VDI (Sun xVM VirtualBox Virtual Disk Images) etc., and a kind of dummy machine system can compatible multiple mirror image data type.
If can not successfully read the data head of mirror image data, test according to RAW form whether can successfully resolve described mirror image data, if parse operation success determines that the type of data format of described mirror image data is RAW form; Otherwise None-identified appearance is as data type, and carry is failed.The mode of RAW form memory image data is identical with the mode of storing data in personal computer, are corresponding relations of 1: 1 with physical disk data, in physical disk data, do not encapsulate, therefore resolve according to physical disk data layout, the feature of physical disk data layout includes but not limited to: the 0th sector (first 512 bytes) are Main Boot Record (MBR, Main Boot Record), there is signature word " 55AA " in this end, sector; Taking the 0th sector initial position as benchmark, the data that side-play amount is 01BEH-01FDH are disk partition tables, wherein comprise the field of describing each partitioned file system banner, etc.
Mode two:
When according to user's virtual machine application, while creating mirror image data corresponding to virtual machine instance, the type identification of the mirror image data of each virtual machine is recorded in database, in the present embodiment, type identification can be recorded in the managing listings of elasticity computing controller maintenance, as shown in table 2.In the time that checking and killing virus server need to be known the type of certain virtual machine image data, as need to be known the mirror image data type of virtual machine WM1 time, by carrying out interacting message with elasticity computing controller, obtain the type of the mirror image data of storing in the list of elasticity calculating controller management.The type that for example checking and killing virus server sends to elasticity computing controller the memory location " 192.168.0.1:/vmimages/vm1.raw " that carries virtual machine mark " WM1 " or virtual machine image data is confirmed request message, elasticity computing controller is according to the virtual machine mark of carrying or the memory location of virtual machine image data, searching and managing list, and the type of the mirror image data finding " raw " is carried in type confirmation response message and returns to checking and killing virus server.Checking and killing virus server extracts the type of the mirror image data carrying from type confirmation response message.
Table 2
In the present embodiment, the mirror image data type of virtual machine WM1 is QCOW.
Step 306, checking and killing virus server, according to described type of data format, calls corresponding carry program carry virtual machine image data.
In the present embodiment, checking and killing virus server is according to the mirror image data type QCOW of WM1, the mirror image data of the carry program carry WM1 that calling data Format Type QCOW is corresponding.
Existing operating system all provides order or the command history that can realize carry function mostly, as the order such as mount, kpartx in linux system.
In carry process, according to the corresponding relation of mirror image data type and file system type, determine the file system type (being the file system type of virtual machine) of virtual machine image data inside.The file system type of mirror image data inside can be 16 file allocation table (FAT16, File Allocation Table), FAT32, the second extended file system (EXT2, Second extended file system), the 3rd extended file system (EXT3, Third extended file system), network file system(NFS) (NTFS, New Technology File System) etc., in carry process, need to realize the support to file system with driver corresponding to file system type.
After carry completes, mirror image data is mapped as a driver in checking and killing virus server file system, and the follow-up operation to file in this driver is equivalent to the operation to file in virtual machine.
After the mirror image data of checking and killing virus server carry WM1, the mirror image data of WM1 is mapped as to driver DriverW1.
Step 307, the driver that checking and killing virus server shines upon virtual machine image data carries out virus scan, obtains scanning result.
Checking and killing virus server operation virus scanning engine, according to the feature of known viruse in enterprise-level virus characteristic storehouse, scans described driver DriverW1.
Step 308, checking and killing virus server judges in scanning result, whether to find virus, if so, enter step 309, otherwise enters step 311.
Step 309, calls corresponding antivirus applet and carries out virus sweep or isolation.
Step 310, checking and killing virus server finds that by scanning result viral information notifies to virtual machine user.
For example, checking and killing virus server sends circular mail to the mailbox of described virtual machine user, carries scanning result and find viral information in this circular mail; Or the terminal device to described virtual machine user sends a notification message, in this notification message, carry scanning result and find viral information.Wherein, scanning result finds that viral information can comprise introduction of each virus in the viral list of finding from scanning result, viral list etc.
Step 309 and step 310, also can executed in parallel without the restriction of sequencing.
Step 311, the mirror image data of cancellation carry virtual machine.
The technical scheme that the embodiment of the present invention provides is the mirror image data of carry virtual machine first, and the driver shining upon after mirror image data carry is carried out to virus scan; In the time that scanning result is found virus, call corresponding antivirus applet and carry out virus sweep, thereby realize the object of virtual machine being carried out to checking and killing virus.In this scheme, without antivirus software is installed in virtual machine, therefore greatly simplify user's operation, solved the antivirus software version updating being arranged in virtual machine and safeguarded unmanageable problem.And can carry out checking and killing virus to all virtual machines in specified scope, thereby ensure the coverage rate of checking and killing virus.
In addition, owing to only need in checking and killing virus server, virus scanning engine being installed, in each virtual machine, install compared with antivirus software with prior art, saved storage space.Due to compared with virtual machine, the advantage of checking and killing virus server on handling property and storage space, can support high-end virus scanning engine and enterprise-level virus characteristic storehouse, thereby has improved the effect of checking and killing virus.
Correspondingly, the embodiment of the present invention also provides a kind of computer virus checking and killing device, and as shown in Figure 4, this device comprises mirror image data acquisition module 401, carry module 402, scanning execution module 403, virus killing execution module 404, specific as follows:
Mirror image data acquisition module 401, for obtaining the memory location of virtual machine image data;
Carry module 402, for according to the memory location of virtual machine image data, the mirror image data of carry virtual machine, is mapped as a virtual disk in checking and killing virus server file system by described mirror image data;
Scanning execution module 403, for after the mirror image data of carry module 402 carry virtual machines, triggers operation virus scanning engine, and described virtual disk is scanned;
Virus killing execution module 404, if find virus for the scanning result of scanning execution module 403, carries out virus sweep.
Alternatively, in order to ensure the accuracy of scanning result and to reduce the impact on virtual machine performance, described computer virus checking and killing device also comprises:
Duty acquisition module 405, for obtaining virtual machine work at present state, the duty of described virtual machine is for activating, hang up or shutdown; In the time that the work at present state of confirming described virtual machine is unactivated state, triggering mirror image data acquisition module 401 obtains the memory location of described virtual machine image data.
Accompanying drawing 5 is the structural representation of carry module in described computer virus checking and killing device, and carry module 402 comprises:
Determining unit 501, for determining the type of described virtual machine image data;
Carry unit 502, for the type of the virtual machine image data determined according to determining unit 501, calls the virtual machine image data on the memory location of virtual machine image data described in corresponding carry program carry.
Please refer to accompanying drawing 6, is the structural representation of determining unit 501 in described computer virus checking and killing device.Determining unit 501 specifically comprises:
The first test subelement 601, for according to the memory location of described virtual machine image data, tests the data head that whether can successfully read mirror image data;
First determines subelement 602, if can successfully read the data head of mirror image data for the first test subelement 601, according to the type of data format field in described data head, determines the type of data format of described mirror image data;
The second test subelement 603, if can not successfully read the data head of mirror image data for the first test subelement 601, tests according to RAW form whether can successfully resolve described mirror image data;
Second determines subelement 604, if can successfully resolve described mirror image data for the second test subelement 603, determines that the type of data format of described mirror image data is RAW form.
One of ordinary skill in the art will appreciate that all or part of step realizing in above-described embodiment method is can carry out the hardware that instruction is relevant by program to complete, this program can be stored in a computer read/write memory medium, as: ROM/RAM, magnetic disc, CD etc.
Obviously, those skilled in the art can carry out various changes and modification and not depart from the spirit and scope of the present invention the present invention.Like this, if these amendments of the present invention and within modification belongs to the scope of the claims in the present invention and equivalent technologies thereof, the present invention is also intended to comprise these changes and modification interior.