The present invention relates to a log output device, a log output method, and a log output program.
A log file output by a server device or the like is a record of events which occur in the device in chronological order and is a file including information such as an operating system (OS) or an application failure, defect, or warning. When a cyber attack occurs, traces of it are often recorded in log files and securing the log file without being falsified by an attacker is an important security issue.
Here, a particularly important concept is Forward Security in the context of log integrity. Forward security is the concept of ensuring that, even if a device is infected at some point, the integrity of log files output before that point is not affected. As a mechanism to realize this forward security, each time a log is output, a digest with a digital signature for that log is generated sequentially in the Trusted Execution Environment (TEE) and stored with the log file so that the integrity can be verified later (for example, refer to NPL 1).
[NPL 1] Riccardo Paccagnella, Pubali Datta, Wajih Ul Hassan, Adam Bates, Christopher W. Fletcher, Andrew Miller, Dave Tian, “Custos: Practical Tamper-Evident Auditing of Operating Systems Using Trusted Execution”, Network and Distributed Systems Security (NDSS) Symposium 2020
However, with the conventional technique described above, it is not possible to effectively output a log file while maintaining the security level. This is because the related art described above is assumed to be implemented by being directly incorporated into an audit application that outputs logs such as auditd and lacks extensibility.
The present invention was made in view of the above, and an object of the present invention is to provide a log output device, a log output method, and a log output program which enable effective log file output while maintaining a security level.
In order to solve the above-described problems and achieve the object, a log output device according to the present invention includes a calculation part configured to perform a hook for a predetermined event relating to a log message and calculate a hash value from the log message for each hook, a providing part configured to provide an encrypted digital signature to the hash value, and an output part configured to output the log message and the hash value to which the digital signature is provided.
Also, a log output method performed using a log output device according to the present invention includes a calculation step of performing a hook for a predetermined event relating to a log message and calculating a hash value from the log message for each hook, a providing step of providing an encrypted digital signature to the hash value, and an output step of outputting the log message and the hash value to which the digital signature is provided.
Furthermore, a log output program according to the present invention causes a computer to execute a calculation procedure of performing a hook for a predetermined event relating to a log message and calculating a hash value from the log message for each hook, a providing procedure of providing an encrypted digital signature to the hash value, and an output procedure of outputting the log message and the hash value to which the digital signature is provided.
The present invention enables effective log file output while maintaining a security level.
Embodiments of a log output device, a log output method, and a log output program according to the present invention will be described in detail below on the basis of the drawings. Note that, the present invention is not limited using embodiments which will be described below.
A configuration of a log output system 100 according to a first embodiment, an overview of a log output system 100-P in the related art, a configuration of a log output device 10, a specific example of log output processing, and a flow of the log output processing will be described below in order. In addition, finally, the effects of this embodiment will be described.
The configuration of the log output system 100 according to the first embodiment will be described in detail using
As shown in
The log output device 10 is an information processing device realized using a server device, a cloud system, or the like, but is not particularly limited as long as it can execute the log output processing according to this embodiment. For example, the log output device 10 may be a personal computer (PC) owned by a user of a general network, a smart phone, a tablet terminal, or the like. Note that the log output system 100 shown in
The log file 20 is a data file including M log messages (entries written to the log file 20) of log messages 20a.
The digest 30 is a hash value generated from the log file 20 including the log message 20a and the like.
A digital signature 40 is data encrypted with a private key 60. Note that it is also simply written as “signature” as appropriate.
A digest 50 with a digital signature is a digest 30 having a digital signature 40 attached thereto.
A private key 60 is data used when encrypting a digital signature 40.
The log output application is, for example, an audit application which outputs a log such as auditd, but is not particularly limited as long as it is an application which outputs a log.
The TEE is a safe execution environment (Secure World) separated from the normal execution environment (Normal World), but is not particularly limited as long as it is a secure environment in which hashing can be safely performed and the private key 60 can be safely held. For example, the log output system 100 can employ a secure environment using a trusted platform module (TPM) or the like.
The storage part 12 is a storage medium (storage) in which the log file 20 and the digest 50 with a digital signature are stored. The storage part 12 is installed inside the log output device 10 in the example of
First, the log output device 10 uses a log output application to generate a log file 20 including log messages 20a and the like (refer to
Subsequently, the log output device 10 hooks a file event (refer to
Subsequently, the log output device 10 generates a digest 30 in the TEE on the basis of the log file 20 including the log message 20a or the like (refer to
On the other hand, the log output device 10 uses the private key 60 to generate a digital signature 40 in the TEE and attaches the digital signature 40 to the digest 30 (refer to
Furthermore, the log output device 10 adds the digest 50 with a digital signature to the log file 20 and stores the log file 20 in the storage part 12 (refer to
Also, the log output device 10 can verify the integrity of the log file 20, the log message 20a, and the like. At this time, the log output device 10 first verifies the hash value using a public key (not shown) corresponding to the private key 60 used for the digital signature 40, and then further generates a hash value from the log file 20, and finally verifies the integrity of the log file 20 by verifying whether it matches the verified hash value.
As described above, in the log output system 100, by performing the processing in
Here, a difference between the log output system 100-P in the related art and the log output system 100 according to the first embodiment will be described. In the following, the log output system 100-P in the related art will be described and then the log output system 100 according to this embodiment will be described.
The log output system 100-P in the related art will be described with reference to
As shown in
The log output device 10-P generates a log file 20 including log messages 20a and the like in a log output application such as auditd (refer to
Here, in the log output system 100-P in the related art, in order to avoid successful integrity verification not being performed normally if tampering occurs before hash value generation, the log generation process (refer to
On the other hand, as described above, the log output system 100 shown in
Also, like the processing of the log output system 100 shown in
The configuration of the log output device 10 according to the first embodiment will be explained in detail with reference to
The communication part 11 manages data communication with other devices. For example, the communication part 11 performs data communication with each communication device. Furthermore, the communication part 11 can perform data communication with an operator's terminal (not shown).
The storage part 12 stores various information referred to when the control part 13 operates and various information acquired when the control part 13 operates. The storage part 12 has a log storage part 12a, a digest storage part 12b, and a log/digest storage part 12c. Here, the storage part 12 is, for example, a random access memory (RAM), a semiconductor memory device such as a flash memory, or a storage device such as a hard disk or an optical disk. Note that, although the storage part 12 is installed inside the log output device 10 in the example of
The log storage part 12a stores a log file 20. For example, the log storage part 11a stores a log file 20 including log messages 20a generated using the generation part 13a of the control part 13 and the like.
The digest storage part 12b stores the digest 30. For example, the digest storage part 12b stores a digest 30, which is a hash value calculated using the calculation part 13b of the control part 13.
The log/digest storage part 12c stores a log file 20 and a digest 50 with a digital signature. For example, the log/digest storage part 12c stores the log file 20 and the digest 50 with a digital signature output using the output part 13d of the control part 13.
The control part 13 controls the log output device 10 as a whole. The control part 13 has a generation part 13a, a calculation part 13b, a providing part 13c, an output part 13d, and a verification part 13e. Here, the control part 15 is, for example, an electronic circuit such as a central processing unit (CPU) or a micro processing unit (MPU) or an integrated circuit such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA).
The generation part 13a generates a log message 20a. Also, the generation part 13a generates a log file 20 including log messages 20a and the like. For example, the generation part 13a uses a log output application to generate a log file 20 in which information such as OS or application failures, defects, and warnings are recorded in chronological order. On the other hand, the generation part 13a stores the log file 20 including the generated log message 20a and the like in the log storage part 12a.
The calculation part 13b performs a hook for a predetermined event relating to the log message 20a, calculates a hash value from the log message 20a, and generates a digest 30 each time the hook is performed. For example, the calculation part 13b calculates the hash value by updating the hash value when a new log message is generated in a predetermined secure element and generates the digest 30. If specific examples are provided, the calculation part 13b calculates a hash value by updating the hash value each time and generates a digest 30 for each predetermined log block if an entry is written to log file 20 in a secure environment such as TEE or TPM.
The calculation part 13b performs a hook for a file open event or a file append event relating to the log message 20a on the basis of an OS interface which describes the virtual file system and generates a digest 30. For example, the calculation part 13b uses a file system described by a virtual file system description interface such as FUSE to perform a hook for a file open event or a file append event relating to the log message 20a, calculates the hash value for each hook, and generates a digest 30.
The calculation part 13b performs a file open event hook relating to the log message 20a using a system call for monitoring file system events, calculate the hash value for each hook, and generates a digest 30. For example, the calculation part 13b uses an event monitoring system call such as fanotify to perform a hook for a file open event relating to the log message 20a, calculates a hash value for each hook, and generates a digest 30.
On the other hand, the calculation part 13b stores the generated digest 30 in the digest storage part 12b.
The providing part 13c provides an encrypted digital signature 40 to the generated digest 30. For example, the providing part 13c provides a digital signature 40 obtained by encrypting the digest 30 using a private key 60 held in a predetermined secure element. That is to say, the providing part 13c acquires the digest 30 generated using the calculation part 13b, generates a digital signature 40 by encrypting the digest 30 using the private key 60, and generates a digest 50 with a digital signature by providing a digital signature 40 to the digest 30.
The output part 13d outputs the log file 20 including the log message 20a and the like and the digest 50 with a digital signature. For example, the output part 13d acquires the log file 20 including the log message 20a generated using the generation part 13a and the digest 50 with a digital signature generated using the providing part 13c and stores both the log file 20 and the digest 50 with a digital signature in the log/digest storage part 12c. Note that the output part 13d can also store the log file 20 and the digest 50 with a digital signature in a database or the like outside the log output device 10.
The verification part 13e verifies the integrity of log file 20 using the log file 20 including the log message 20a and the digest 50 with a digital signature. For example, the verification part 13e verifies the digital signature 40 and the digest 30 using the public key corresponding to the private key 60, calculates a hash value from the log file 20, and verifies whether the hash value matches the verified hash value (digest 30). Also, the verification part 13e verifies the integrity of the log file 20 when the file close event relating to the log file 20 is detected.
A specific example of the log output processing according to the first embodiment will be described with reference to
Processing of the log output device 10 based on a virtual file system description interface such as FUSE will be described as Specific Example 1 with reference to
First, the configuration of the programs and the like involved in Specific Example 1 will be described. As shown in
In the user space of the normal world, “Syslog”, “libfuse”, “File System Daemon”, “TEE client API (Application Programming Interface)”, storage (storage part 12) and the like operate. On the other hand, in the normal world kernel space, “Virtual File System (VFS)”, “FUSE module (module)”, “/dev/fuse”, “TEE driver (driver)”, and the like operate.
Also, in the secure world user space, “TEE internal API”, “Logger Core”, and the like operate. On the other hand, in the kernel space of the secure world, “TEE core” and the like operate.
The operation of the programs and the like included in Specific Example 1 will be described below. First, the log output device 10 performs a process of outputting the log file 20 on the VFS using Syslog which collects and records the log file 20 (refer to
Here, even if programs such as Syslog, libfuse, and file system daemon are attacked, the log output device 10 detects falsification or deletion of the log files 20 and the digests 30 accumulated before the attack.
Finally, the advantage of Specific Example 1 will be explained. First, the log output device 10 can directly hook an additional event or the like of an application which outputs a log using an OS interface capable of describing a virtual file system. Second, since the log output device 10 can perform flexible processing such as obtaining diff which is a difference between a current file and a write buffer when hooking a file alteration event and calculating a hash value for the changed portion, the log output device 10 can also generate hash values for non-appendable log files such as utmp and wtmp. Third, the log output device 10 can detect falsification at an early stage by detecting a file close event and performing an integrity check.
Processing of the log output device 10 using an event monitoring system call such as fanotify will be described as a second specific example with reference to
First, the overview of Specific Example 2 will be described while comparing Specific Example 2 with Specific Example 1. In Specific Example 2, the log output device 10 does not hook the file append event of the application which outputs the log, but hooks the file open event (FAN_OPEN_PERM) and the file read event (FAN_ACCESS_PERM). At this time, the log output device 10 particularly hooks the file open event and generates the digest 30.
The processing of the log output device 10 will be explained more specifically with reference to
Also, when a file is opened using an arbitrary application, the log output device 10 hooks the event, transitions to processing of the logging phase and the second commit phase (Commit 2), and permits the above file opening after generating the digest 30 (refer to
Here, if a third party tampered with the log file 20 immediately after Commit 2 (refer to
On the other hand, the log output device 10 can also transition to the logging phase and commit phase processing periodically. In the example shown in
Note that the log output device 10 can also periodically call the logging phase, as shown in
The configuration of the programs and the like involved in Specific Example 2 will be described below. As shown in
In the normal world user space, “Syslog”, “file system daemon”, “TEE client API”, a storage (storage part 12), and the like operate. On the other hand, in the normal world kernel space, “File system (FS: File System)”, “fanotify”, “TEE driver”, and the like operate.
Also, in the secure world user space, “TEE Internal API”, “Log Output Core”, and the like operate. On the other hand, in the secure world kernel space, “TEE core” and the like operate.
Subsequently, the operation of the programs and the like involved in Specific Example 2 will be described. First, the log output device 10 performs a process of outputting the log file 20 on the FS by Syslog which collects and records the log file 20 (refer to
Here, even if programs such as Syslog, fanotify, and file system daemon are attacked, the log output device 10 can detect falsification or deletion of the log files 20 and the digests 30 and the like accumulated before the attack.
Finally, the advantage of Specific Example 2 will be explained. First, the log output device 10 can generate a digest 30 by hooking a file open event by a third party or the like using a system call which monitors file system events. Second, the log output device 10 can detect falsification early by detecting a file close event and confirming the integrity.
The overall flow of log output processing according to the first embodiment will be described in detail with reference to
First, the generation part 13a generates the log file 20 including the log message 20a and the like (Step S101).
Second, the calculation part 13b hooks the file event of the log file 20 (Step S102).
Third, the calculation part 13b calculates the hash value of the log file 20 and generates the digest 30 (Step S103).
Fourth, the providing part 13c encrypts the digest 30 using the private key 60 to generate the digital signature 40 (Step S104).
Fifth, the providing part 13c provides a digital signature 40 to the digest 30 to generate a digest 50 with a digital signature (Step S105).
Sixth, the output part 13d stores the log file 20 and the digest 50 with a digital signature in the storage part 12 (Step S106) and ends the process. Note that the verification part 13e may verify the integrity of the log file 20 using the log file 20 stored in the storage part 12 and the digest 50 with a digital signature.
First, the log output process according to this embodiment described above performs a hook for a predetermined event relating to a log file 20 including a log message 20a or the like, generate a digest 30 from the log file 20 for each hook, provides an encrypted digital signature 40 to the generated digest 30, and output a log file 20 and a digest 50 with a digital signature. For this reason, in this process, it is possible to effectively output a log file while maintaining the security level.
Second, in the log output process according to the above-described embodiment, in a predetermined secure element, when a new log message is generated, a digest 30 is generated by updating the hash value and a digital signature 40 is provided by encrypting the digest 30 using a private key 60 held in the secure element. For this reason, in this process, it is possible to output log files effectively while maintaining the security level by using TEE, TPM, or the like.
Third, in the log output process according to this embodiment described above, a file open event or file append event hook is performed on the basis of the virtual file system description interface and the digest 30 is generated for each hook. For this reason, in this process, it is possible to effectively output log files while maintaining the security level by using a virtual file system description interface such as FUSE.
Fourth, in the log output process according to this embodiment described above, an event monitoring system call is used for hooking a file open event and a digest 30 is generated each time the hook is performed. For this reason, in this process, an event monitoring system call such as fanotify is used for enabling effective log file output while maintaining the security level.
Fifth, in the log output process according to this embodiment described above, the integrity of the log file 20 is verified using the log file 20 and the digest 50 with a digital signature. For this reason, in this process, it is possible to output an effective log file while maintaining the security level and to verify the integrity of the output log file.
Sixth, in the log output process according to this embodiment described above, the integrity of the log file 20 is verified when a file close event is detected. For this reason, in this process, it is possible to effectively output a log file while maintaining the security level and to effectively verify the integrity of the output log file.
Each component of each device shown in the drawings according to the above embodiment is functionally conceptual and does not necessarily need to be physically configured as shown in the drawing. That is to say, the specific forms of distribution and integration of each device are not limited to those shown in the figure and all or part of them can be configured to be functionally or physically distributed and integrated in arbitrary units in accordance with various loads and usage conditions. Furthermore, each processing function performed by each device may be implemented in whole or in part by a CPU and a program analyzed and executed by the CPU, or implemented as hardware based on wired logic.
Also, among the processes described in the above embodiments, all or a part of the processes described as being performed automatically may also be performed manually or all or a part of the processes described as being performed manually may be performed automatically by known methods. In addition, information including processing procedures, control procedures, specific names, and various data and parameters shown in the above documents and drawings can be arbitrarily changed unless otherwise specified.
In addition, it is also possible to create a program in which the processing executed by the log output device 10 described in the above embodiment is described in a computer-executable language. In this case, the same effects as those of the above embodiments can be obtained by having the computer execute the program. Furthermore, such a program may be recorded in a computer-readable recording medium and the program recorded in this recording medium may be read and executed by a computer to realize the same processing as in the above embodiments.
The memory 1010 includes a read only memory (ROM) 1011 and a RAM 1012 as shown in
Here, as shown in
Also, various data described in the above embodiments are stored as, for example, program data in the memory 1010 or the hard disk drive 1090. In addition, the CPU 1020 reads a program module 1093 and program data 1094 stored in the memory 1010 and the hard disk drive 1090 to the RAM 1012 as necessary and executes various processing procedures.
Note that the program module 1093 and the program data 1094 relating to the program are not limited to being stored in the hard disk drive 1090, may be stored in, for example, a removable storage medium, and may be read using the CPU 1020 via a disk drive or the like. Alternatively, the program module 1093 and the program data 1094 relating to the program may be stored in another computer connected over a network (local area network (LAN), wide area network (WAN), or the like) and may be read using the CPU 1020 via a network interface 1070.
The above-described embodiments and modifications thereof are included in the scope of the invention described in the claims and their equivalents, as well as in the technology disclosed by the present application.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/JP2021/046125 | 12/14/2021 | WO |