Log output device, log output method, and log output program
The log output device and method enhance scalability and security by executing hooks and assigning encrypted digital signatures to log messages within a TEE, ensuring secure and tamper-proof log file output.
Patent Information
- Application Number
- JP2023567357
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2041-12-14
AI Technical Summary
Existing log output technologies lack scalability and security, as they assume direct incorporation into audit applications like auditd, leading to poor versatility and security vulnerabilities.
A log output device and method that includes a calculation unit to execute hooks for log messages, assign encrypted digital signatures to hash values, and output the signed hash values along with the log messages, utilizing a Trusted Execution Environment (TEE) for secure processing.
Enables effective and secure output of log files, maintaining integrity and detecting tampering, even in the presence of security threats, by using hooks and digital signatures within a TEE.
Smart Images

Figure 0007800561000001 
Figure 0007800561000002 
Figure 0007800561000003
Abstract
Description
[Technical Field]
[0001] The present invention relates to a log output device, a log output method, and a log output program. [Background technology]
[0002] Log files output by server devices and other equipment are chronological records of events that occurred within the device, and contain information on faults, malfunctions, warnings, etc. of the OS (Operating System) and applications. When a cyber-attack occurs, traces of the attack are often recorded in the log files, and preserving these log files without tampering with them by attackers is an important security issue.
[0003] Here, a particularly important concept is forward security in the context of log preservation. Forward security is the idea of ensuring that even if a device is infected at a certain point in time, the integrity of log files output before that point will not be affected. One mechanism for realizing this forward security is a technology in which, each time a log is output, a digitally signed digest of the log is generated in a Trusted Execution Environment (TEE) and stored together with the log file, thereby enabling later integrity verification (see, for example, Non-Patent Document 1). [Prior art documents] [Non-patent literature]
[0004] [Non-Patent Document 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 Summary of the Invention [Problem to be solved by the invention]
[0005] However, the above-mentioned conventional technology cannot output log files effectively while maintaining a security level because it is assumed that the above-mentioned conventional technology will be implemented by directly incorporating it into an audit application that outputs logs, such as auditd, and therefore has poor scalability.
[0006] The present invention has been made in view of the above, and aims to provide a log output device, a log output method, and a log output program that enable effective output of log files while maintaining a security level. [Means for solving the problem]
[0007] In order to solve the above-mentioned problems and achieve the objectives, the log output device of the present invention is characterized by comprising: a calculation unit that executes hooks of specified events related to log messages and calculates a hash value from the log message each time the hook is executed; an assignment unit that assigns an encrypted digital signature to the hash value; and an output unit that outputs the log message and the hash value to which the digital signature has been assigned.
[0008] In addition, the log output method of the present invention is a log output method executed by a log output device, and is characterized in that it includes a calculation step of executing a hook of a specified event related to a log message and calculating a hash value from the log message each time the hook is executed, an assignment step of assigning 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 has been assigned.
[0009] In addition, the log output program of the present invention is characterized in that it executes a hook for a specified event related to a log message, and causes a computer to execute the following steps: a calculation procedure for calculating a hash value from the log message each time the hook is executed; an assignment procedure for assigning an encrypted digital signature to the hash value; and an output procedure for outputting the log message and the hash value to which the digital signature has been assigned. [Effects of the Invention]
[0010] The present invention enables effective output of log files while maintaining a security level. [Brief explanation of the drawings]
[0011] [Figure 1] FIG. 1 is a diagram illustrating an example of the configuration of a log output system according to the first embodiment. [Figure 2] FIG. 2 is a diagram showing an outline of a conventional log output system. [Figure 3] FIG. 3 is a block diagram illustrating an example of the configuration of the log output device according to the first embodiment. [Figure 4] FIG. 4 is a diagram illustrating a specific example 1 of the log output process according to the first embodiment. [Figure 5] FIG. 5 is a diagram illustrating a specific example 2 of the log output process according to the first embodiment. [Figure 6] FIG. 6 is a diagram illustrating a specific example 2 of the log output process according to the first embodiment. [Figure 7]FIG. 7 is a flowchart showing an example of the flow of the log output process according to the first embodiment. [Figure 8] FIG. 8 is a diagram illustrating a computer that executes a program. DETAILED DESCRIPTION OF THE INVENTION
[0012] Hereinafter, 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 with reference to the accompanying drawings. However, the present invention is not limited to the embodiments described below.
[0013] [First embodiment] Below, we will explain in order the configuration of the log output system 100 related to the first embodiment, an overview of the conventional log output system 100-P, the configuration of the log output device 10, a specific example of the log output process, and the flow of the log output process, and finally explain the effects of this embodiment.
[0014] [1. Configuration of the log output system 100] The configuration of a log output system 100 according to the first embodiment will be described in detail using Fig. 1. Fig. 1 is a diagram showing an example of the configuration of the log output system according to the first embodiment. Below, an example of the overall configuration of the log output system 100 will be shown, followed by an explanation of the log message generation process, event hook process, digest generation process, digital signature assignment process, log file storage process, and log file verification process in that order.
[0015] (1-1. Example of the overall configuration of the log output system 100) 1, the log output system 100 includes a log output device 10. The data involved in the log output system 100 includes a log file 20, a digest 30, a digital signature 40, a digitally signed digest 50, and a private key 60. The log output system 100 also includes a log output application, a TEE, and a storage unit 12 within the log output device 10. Each component of the log output system 100 will be described below.
[0016] (Log output device 10) The log output device 10 is an information processing device realized by a server device, a cloud system, or the like, but is not particularly limited as long as it is a device that can execute the log output process according to this embodiment. For example, the log output device 10 may be a PC (Personal Computer), a smartphone, a tablet terminal, or the like owned by a user of a general network, etc. Note that the log output system 100 shown in FIG. 1 may include multiple log output devices 10.
[0017] (Log file 20) The log file 20 is a data file that includes M log messages 20a... (entries written to the log file 20).
[0018] (Digest 30) The digest 30 is a hash value generated from the log file 20 that includes the log message 20a and the like.
[0019] (Digital Signature 40) The digital signature 40 is data encrypted using a private key 60. It is also referred to simply as a "signature" where appropriate.
[0020] (Digest 50 with digital signature) The digitally signed digest 50 is the digest 30 to which the digital signature 40 has been added.
[0021] (Private key 60) The private key 60 is data used to encrypt the digital signature 40 .
[0022] (log output application) The log output application is, for example, an audit application that outputs a log, such as auditd, but is not particularly limited as long as it is an application that outputs a log.
[0023] (TEE) The TEE is a secure 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 that can safely execute hashing and safely store the private key 60. For example, the log output system 100 can also employ a secure environment that uses a TPM (Trusted Platform Module) or the like.
[0024] (Storage unit 12) The memory unit 12 is a storage medium (storage) that stores the log file 20 and the digitally signed digest 50. In the example of Fig. 1, the memory unit 12 is installed inside the log output device 10, but it may also be installed outside the log output device 10. Details of the memory unit 12 will be described later in [3. Configuration of the Log Output Device 10].
[0025] (1-2. Log message generation process) First, the log output device 10 uses a log output application to generate a log file 20 containing log messages 20a etc. (See FIG. 1(1)). Here, the log file 20 is a chronological record of information about events that occurred within the log output device 10 (such as faults, malfunctions, and warnings of the OS and applications).
[0026] (1-3. Event hook processing) Next, the log output device 10 hooks file events (see FIG. 1(2)). For example, the log output device 10 hooks file open events and file modification events such as appending a file. At this time, the log output device 10 hooks the file events by using an OS interface that can describe a virtual file system such as FUSE (Filesystem in Userspace) (referred to as a "virtual file system description interface"), or a system call that monitors file system events such as fanotify (referred to as an "event monitoring system call"). Details of event hooking using FUSE, fanotify, etc. will be described later in [4. Specific Examples of Log Output Processing].
[0027] (1-4. Digest generation process) Next, the log output device 10 generates a digest 30 based on the message file 20 containing the message 20a etc. in the TEE (see FIG. 1(3)). For example, the log output device 10 sequentially updates the hash value using the log message. In the example of FIG. 1, the log output device 10 performs M updates (hashing) because the log message contains M log messages recorded in chronological order. Then, the log output device 10 performs an update using a block ID, which is identification information for a block of the log, to generate the digest 30. At this time, the log output device 10 performs a process of incrementing the block ID by one. In the example of FIG. 1, the log output device 10 generates the digest 30 using a block ID "e", which is an arbitrary number, and performs a process of counting up the block ID to "e+1".
[0028] (1-5. Digital signature processing) Meanwhile, the log output device 10 generates a digital signature 40 using a private key 60 in the TEE and assigns the digital signature 40 to the digest 30 (see FIG. 1(4)). For example, the log output device 10 generates the digital signature 40 by encrypting the digest 30 using the private key 60 held in the TEE, and then assigns the digital signature 40 to the digest 30 to generate a digitally signed digest 50.
[0029] (1-6. Log file storage process) Then, the log output device 10 adds a digitally signed digest 50 to the log file 20 and stores it in the storage unit 12 (see FIG. 1(5)). At this time, the log output device 10 may store the log file 20 and the digitally signed digest 50 in a database (not shown).
[0030] (1-7. Log file verification process) The log output device 10 can also verify the integrity of the log file 20, the log message 20a, etc. In this case, the log output device 10 first verifies the hash value using a public key (not shown) corresponding to the private key 60 used in the digital signature 40, then generates a hash value from the log file 20, and finally verifies whether the hash value matches the verified hash value, thereby verifying the integrity of the log file 20.
[0031] As described above, the log output system 100 performs the processes shown in (1) to (5) in Fig. 1, thereby enabling a mechanism that prevents the log file 20 from being tampered with, or that can immediately detect tampering if the private key 60 in the TEE is not obtained illegally. Also, in the digest generation process shown in (3) in Fig. 1, the log output system 100 uses a counter value (block ID "e") that is valid only within an environment such as the TEE, thereby enabling a mechanism that prevents past hash values from being reproduced even if the private key 60 is leaked.
[0032] [2. Overview of the conventional log output system 100-P] Here, the differences between the conventional log output system 100-P and the log output system 100 according to the first embodiment will be explained. Below, the conventional log output system 100-P will be explained first, followed by the log output system 100 according to this embodiment.
[0033] (2-1. Conventional log output system 100-P) A conventional log output system 100-P will be described with reference to Fig. 2. Fig. 2 is a diagram showing an outline of the conventional log output system. Note that a description of the same configuration and processing as those of the log output system 100 described above will be omitted.
[0034] 2, a conventional log output system 100-P includes a log output device 10-P. Unlike the log output system 100 described above, the conventional log output system 100-P generates the digest 30 in a secure environment such as a TEE or TPM directly incorporated in the log output application.
[0035] The log output device 10-P generates a log file 20 including a log message 20a and the like in a log output application such as auditd (see FIG. 2(1)), transfers the contents of the log file 20 to a secure environment executed on a secure element such as a TEE, and generates a digest 30, which is a hash value corresponding to the log file 20, in the same environment (see FIG. 2(2)). The log output device 10-P then affixes a digital signature 40 to the digest 30 using a private key 60 securely stored in the TEE or the like, and returns the digest 30 to the log output application (see FIG. 2(3)). The log output device 10-P outputs the digitally signed digest 50 together with the log file 20 to the memory unit 12-P, which is a storage, for storage (see FIG. 2(4)).
[0036] In the conventional log output system 100-P, in order to prevent integrity verification from being unable to be performed normally if tampering occurs before hash value generation, the log generation process (see FIG. 2(1)) and the digest generation process (see FIG. 2(2)) are configured to be inseparable (atomic). That is, the log output device 10-P executes the process of generating the digest 30 in a secure environment such as a TEE or TPM directly incorporated into a log output application such as auditd. For this reason, the conventional log output system 100-P cannot use any log output application, resulting in low versatility.
[0037] (2-2. Log output system 100) In contrast to this, as described above, the log output system 100 shown in Fig. 1 according to the first embodiment uses FUSE, fanotify, etc. to execute hooks for write events and read events in the log file 20, and generates a digest 30 for each such hook. As a result, the log output system 100 can generate a digitally signed digest 50 for any application that outputs a log to storage, thereby preventing log tampering by an attacker.
[0038] Furthermore, even if hash values are generated by hooking output events or append events using FUSE, fanotify, or the like, as in the processing of the log output system 100 shown in Figure 1, the same level of security as the conventional log output system 100-P can be ensured. This is because, in order to prevent the above hooking, it is necessary to inhibit the operation of applications that run with root privileges, such as FUSE and fanotify, which involves the same cost as directly taking over an application that outputs logs, such as auditd.
[0039] [3. Configuration of the log output device 10] The configuration of the log output device 10 according to the first embodiment will be described in detail with reference to Fig. 3. Fig. 3 is a block diagram showing an example of the configuration of the log output device according to the first embodiment. The log output device 10 has a communication unit 11, a storage unit 12, and a control unit 13. The log output device 10 may also have an input unit (e.g., a keyboard, a mouse, etc.) that accepts various operations from an administrator of the log output device 10, and a display unit (e.g., a liquid crystal display, etc.) that displays various information.
[0040] (3-1. Communications Department 11) The communication unit 11 controls data communication with other devices. For example, the communication unit 11 performs data communication with each communication device. The communication unit 11 can also perform data communication with an operator's terminal (not shown).
[0041] (3-2. Storage section 12) The storage unit 12 stores various pieces of information referenced by the control unit 13 when it operates, and various pieces of information acquired when the control unit 13 operates. The storage unit 12 has a log storage unit 12a, a digest storage unit 12b, and a log / digest storage unit 12c. Here, the storage unit 12 is, for example, a semiconductor memory element such as RAM (Random Access Memory) or flash memory, or a storage device such as a hard disk or optical disk. Note that, in the example of FIG. 3, the storage unit 12 is installed inside the log output device 10, but it may be installed outside the log output device 10, or multiple storage units may be installed.
[0042] (Log storage unit 12a) The log storage unit 12a stores the log file 20. For example, the log storage unit 11a stores the log file 20 including the log message 20a generated by the generation unit 13a of the control unit 13 and the like.
[0043] (Digest storage unit 12b) The digest storage unit 12b stores the digest 30. For example, the digest storage unit 12b stores the digest 30, which is a hash value calculated by the calculation unit 13b of the control unit 13.
[0044] (Log digest storage unit 12c) The log / digest storage unit 12c stores the log file 20 and the digitally signed digest 50. For example, the log / digest storage unit 12c stores the log file 20 and the digitally signed digest 50 output by the output 13d of the control unit 13.
[0045] (3-3. Control unit 13) The control unit 13 is responsible for overall control of the log output device 10. The control unit 13 has a generation unit 13a, a calculation unit 13b, an assignment unit 13c, an output unit 13d, and a verification unit 13e. Here, the control unit 13 is, for example, an electronic circuit such as a CPU (Central Processing Unit) or an MPU (Micro Processing Unit), or an integrated circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array).
[0046] (Generation unit 13a) The generation unit 13a generates a log message 20a. The generation unit 13a also generates a log file 20 that includes the log message 20a, etc. For example, the generation unit 13a uses a log output application to generate the log file 20 in which information such as OS and application failures, malfunctions, and warnings is recorded in chronological order. Meanwhile, the generation unit 13a stores the log file 20 that includes the generated log message 20a, etc. in the log storage unit 12a.
[0047] (Calculation unit 13b) The calculation unit 13b executes a hook for a predetermined event related to the log message 20a, and calculates a hash value from the log message 20a at each hook, generating the digest 30. For example, when a new log message is generated in a predetermined secure element, the calculation unit 13b updates the hash value to calculate the hash value and generates the digest 30. As a specific example, when an entry is written to the log file 20 in a secure environment such as a TEE or TPM, the calculation unit 13b calculates the hash value by updating the hash value each time, and generates the digest 30 for each predetermined log block.
[0048] The calculation unit 13b executes hooking of a file open event or a file append event related to the log message 20a based on an OS interface that describes the virtual file system, calculates a hash value for each hook, and generates the digest 30. For example, the calculation unit 13b executes hooking of a file open event or a file append event related to the log message 20a using a file system described by a virtual file system description interface such as FUSE, calculates a hash value for each hook, and generates the digest 30.
[0049] The calculation unit 13b uses a system call that monitors events in a file system to execute a hook for a file open event related to the log message 20a, calculates a hash value for each hook, and generates the digest 30. For example, the calculation unit 13b uses an event monitoring system call such as fanotify to execute a hook for a file open event related to the log message 20a, calculates a hash value for each hook, and generates the digest 30.
[0050] On the other hand, the calculation unit 13b stores the generated digest 30 in the digest storage unit 12b.
[0051] (Giving section 13c) The adding unit 13c adds an encrypted digital signature 40 to the generated digest 30. For example, the adding unit 13c adds the digital signature 40 by encrypting the digest 30 using a private key 60 held in a predetermined secure element. That is, the adding unit 13c acquires the digest 30 generated by the calculation unit 13b, generates the digital signature 40 by encrypting the digest 30 using the private key 60, and adds the digital signature 40 to the digest 30 to generate a digitally signed digest 50.
[0052] (output section 13d) The output unit 13d outputs the log file 20 including the log message 20a and the like, and the digitally signed digest 50. For example, the output unit 13d acquires the log file 20 including the log message 20a and the like generated by the generation unit 13a, and the digitally signed digest 50 generated by the addition unit 13c, and stores both of them in the log / digest storage unit 12c. The output unit 13d can also store the log file 20 and the digitally signed digest 50 in a database or the like external to the log output device 10.
[0053] (Verification section 13e) The verification unit 13e verifies the integrity of the log file 20 using the log file 20, which includes the log message 20a and the like, and the digitally signed digest 50. For example, the verification unit 13e verifies the digital signature 40 and the digest 30 using a 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). Furthermore, when the verification unit 13e detects a file close event related to the log file 20, it verifies the integrity of the log file 20.
[0054] [4. Specific examples of log output processing] Specific examples of log output processing according to the first embodiment will be described with reference to Figures 4 to 6. Below, processing of a virtual file system description interface will be described as Specific Example 1, and processing of an event monitoring system call will be described as Specific Example 2.
[0055] (4-1. Example 1) 4, the 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. Fig. 4 is a diagram showing specific example 1 of the log output processing according to the first embodiment. Below, a specific example will be described in which TEE is used as the secure environment and FUSE is used as the virtual file system description interface, but there are no particular limitations as long as the environment and interface can execute the log output processing according to this embodiment.
[0056] (Program structure) First, the configuration of the programs involved in Example 1 will be described. As shown in Fig. 4, the area within the log output device 10 is separated into a normal world and a secure world, and programs that run in the user space and programs that run in the kernel space are shown. The programs in the user space run in non-privileged mode, and the programs in the kernel space run in privileged mode.
[0057] In the user space of the normal world, "Syslog", "libfuse", "File System Daemon", "TEE client API (Application Programming Interface)", storage (storage unit 12), etc. run. On the other hand, in the kernel space of the normal world, "Virtual File System (VFS)", "FUSE module", " / dev / fuse", "TEE driver", etc. run.
[0058] In addition, the "TEE internal API" and "Logger Core" run in the user space of the secure world, while the "TEE core" runs in the kernel space of the secure world.
[0059] (Program operation, etc.) Next, the operations of the programs involved in Example 1 will be described. First, the log output device 10 executes a process of outputting the log file 20 to the VFS using Syslog, which collects and records the log file 20 (see FIG. 4(1)). Next, the log output device 10 executes a process of hooking file open events and file modification events and a process of calling the log output function (logger) in the TEE using the FUSE module, which is a FUSE program module, the FUSE device file ( / dev / fuse), libfuse, which is the FUSE main body, and a file system daemon that can define various processes for the log file 20 (see FIG. 4(2)). Next, the log output device 10 executes a process of generating a digest 30, which is a hash value, and a process of assigning a digital signature 40 using the TEE client API, TEE driver, TEE core, and TEE internal API (see FIG. 4(3)). Furthermore, the log output device 10 executes a process of notifying the completion of the logging phase, which is a hashing process, using the log output core (see FIG. 4(4)). Finally, when the log output device 10 receives the above completion notification, it executes a process to pass through the generated digitally signed digest 50 etc. by the file system daemon and store it in storage (see Figure 4 (5)).
[0060] Here, even if the above-mentioned Syslog, libfuse, file system daemon, or other programs are attacked, the log output device 10 can detect tampering or deletion of log files 20 and digests 30 accumulated before the attack.
[0061] (Advantages of Example 1) Finally, the advantages of Specific Example 1 will be explained. First, the log output device 10 can directly hook append events of applications that output logs using an OS interface that can describe a virtual file system. Second, the log output device 10 can perform flexible processing such as obtaining a diff, which is the difference between the current file and the write buffer, and calculating a hash value for the changed portion when a file modification event is hooked, so that hash values can also be generated for non-appendable log files such as utmp and wtmp. Third, the log output device 10 can detect tampering early by detecting a file close event and performing an integrity check.
[0062] (4-2. Example 2) 5 and 6, processing of the log output device 10 using an event monitoring system call such as fanotify will be described as specific example 2. Figures 5 and 6 are diagrams showing specific example 2 of log output processing according to the first embodiment. Below, a specific example will be described in which TEE is used as the secure environment and fanotify is used as the event monitoring system call, but there are no particular limitations as long as the environment and system call can execute the log output processing according to this embodiment.
[0063] (Summary of Example 2) First, an overview of Specific Example 2 will be described in comparison with Specific Example 1. In Specific Example 2, the log output device 10 does not hook the file append event of the application that outputs the log, but hooks the file open event (FAN_OPEN_PERM) and the file read event (FAN_ACCESS_PERM). In this case, the log output device 10 particularly hooks the file open event and generates the digest 30.
[0064] The processing of the log output device 10 will be described in more detail with reference to FIG. 5. As shown in FIG. 5, when a log output process by a legitimate application is started, the log output device 10 permits file opening (see FIG. 5(1)). At this time, if there is a difference in the opened log file 20, the log output device 10 proceeds to the processing of the logging phase and the first commit phase (Commit Phase 1). Here, the commit phase is a process of adding a digital signature 40 to the digest 30 generated in the logging phase and completing hashing. At this time, as shown in FIG. 5, the log file 20 is protected by Commit 1 during the period up to FIG. 5(1). In other words, the above period is a period during which the integrity of the log file 20 is guaranteed by the processing of Commit 1.
[0065] Furthermore, when a file is opened by any application, the log output device 10 hooks the event, transitions to the logging phase and the second commit phase (commit 2), generates a digest 30, and then allows the file to be opened (see FIG. 5(2)). That is, the log output device 10 can capture an open event by a third party and generate a digest 30. At this time, as shown in FIG. 5, during the period from FIG. 5(1) to FIG. 5(2), the log file 20 is protected by commit 2. That is, during the above period, the integrity of the log file 20 is guaranteed by the processing of commit 2.
[0066] Here, if a third party tampers with the log file 20 immediately after commit 2 (see Figure 5(3)), the log file 20 generated during the protection period set by commit 2 above will be safe, but the log file 20 generated after the open event in Figure 5(2) will be susceptible to tampering by a third party.
[0067] On the other hand, the log output device 10 can also periodically transition to the logging phase and commit phase processing. In the example shown in Fig. 5, the log output device 10 transitions to the logging phase and the third commit phase (commit 3) processing after commit 2, and generates digest 30 (see Fig. 5(4)). At this time, as shown in Fig. 5, the log file 20 is protected by commit 3 during the period from Fig. 5(2) to Fig. 5(4). In other words, the above period is the period during which the integrity of the log file 20 is guaranteed by the processing of commit 3.
[0068] The log output device 10 may also periodically invoke the logging phase as shown in Fig. 5. For example, the log output device 10 may hold the number of logged lines for each log file, and update the number of logged lines after executing the logging phase for lines after that number. The log output device 10 may also recognize differences using snapshots and execute the logging phase for the differences.
[0069] (Program structure) Next, the configuration of the programs involved in Example 2 will be described. As shown in Fig. 6, the area within the log output device 10 is separated into a normal world and a secure world, and programs that run in the user space and programs that run in the kernel space are shown, respectively. The programs in the user space run in non-privileged mode, and the programs in the kernel space run in privileged mode.
[0070] In the user space of the normal world, "Syslog", "File system daemon", "TEE client API", storage (memory unit 12), etc. run. On the other hand, in the kernel space of the normal world, "File system (FS)", "fanotify", "TEE driver", etc. run.
[0071] In addition, the "TEE internal API" and "log output core" run in the user space of the secure world, while the "TEE core" runs in the kernel space of the secure world.
[0072] (Program operation, etc.) Next, the operation of the programs involved in Example 2 will be described. First, the log output device 10 executes a process of outputting the log file 20 to the FS using Syslog, which collects and records the log file 20 (see FIG. 6(1)). Next, the log output device 10 executes a process of hooking a file open event and a process of calling the log output function in the TEE using fanotify and the file system daemon (see FIG. 6(2)). Next, the log output device 10 executes a process of generating a digest 30, which is a hash value, and a process of adding a digital signature 40 using the TEE client API, TEE driver, TEE core, and TEE internal API (see FIG. 6(3)). Furthermore, the log output device 10 executes a process of notifying the completion of the logging phase, which is the hashing process, using the log output core (see FIG. 6(4)). Finally, when the log output device 10 receives the completion notification, it executes a process of passing through the generated digest 50 with the digital signature and storing it in storage using the file system daemon (see FIG. 6(5)).
[0073] Here, even if the above-mentioned programs such as Syslog, fanotify, file system daemon, etc. are attacked, the log output device 10 can detect tampering or deletion of log files 20, digests 30, etc. accumulated before the attack.
[0074] (Advantages of Example 2) Finally, the advantages of specific example 2 will be described. First, the log output device 10 can hook a file open event by a third party or the like using a system call that monitors file system events, and generate a digest 30. Second, the log output device 10 can detect tampering early by detecting a file close event and performing integrity verification.
[0075] [5. Log output process flow] The overall flow of the log output process according to the first embodiment will be described in detail with reference to Fig. 7. Fig. 7 is a flowchart showing an example of the flow of the log output process according to the first embodiment. Note that the following steps S101 to S106 may be executed in a different order. Also, some of the following steps S101 to S106 may be omitted.
[0076] First, the generating unit 13a generates the log file 20 including the log message 20a and the like (step S101).
[0077] Second, the calculation unit 13b hooks the file event of the log file 20 (step S102).
[0078] Third, the calculation unit 13b calculates a hash value of the log file 20 and generates a digest 30 (step S103).
[0079] Fourth, the granting unit 13c encrypts the digest 30 using the private key 60 to generate the digital signature 40 (step S104).
[0080] Fifth, the adding unit 13c adds the digital signature 40 to the digest 30 to generate the digitally signed digest 50 (step S105).
[0081] Sixth, the output unit 13d stores the log file 20 and the digitally signed digest 50 in the storage unit 12 (step S106), and then ends the process. Note that the verification unit 13e may verify the integrity of the log file 20 using the log file 20 and the digitally signed digest 50 stored in the storage unit 12.
[0082] [Effects of the first embodiment] First, the log output process according to the present embodiment described above executes a hook for a predetermined event related to the log file 20 containing the log message 20a, etc., and each time the hook is executed, a digest 30 is generated from the log file 20, an encrypted digital signature 40 is added to the generated digest 30, and the log file 20 and the digitally signed digest 50 are output. This process therefore enables effective output of the log file while maintaining a high level of security.
[0083] Secondly, in the log output process according to the present embodiment described above, when a new log message is generated in a specific secure element, a digest 30 is generated by updating the hash value, and a digital signature 40 is added by encrypting the digest 30 using a private key 60 held in the secure element. Therefore, in this process, by using a TEE, TPM, etc., it is possible to output a log file effectively while maintaining a security level.
[0084] Third, in the log output process according to the present embodiment described above, a file open event or a file append event is hooked based on the virtual file system description interface, and a digest 30 is generated each time the hook is executed. Therefore, in this process, by using a virtual file system description interface such as FUSE, it is possible to output a log file effectively while maintaining a security level.
[0085] Fourth, in the log output process according to the present embodiment described above, an event monitoring system call is used to execute a hook for a file open event, and a digest 30 is generated each time the hook is executed. Therefore, in this process, by using an event monitoring system call such as fanotify, it is possible to output a log file effectively while maintaining a security level.
[0086] Fifth, in the log output process according to the present embodiment described above, the integrity of the log file 20 is verified using the log file 20 and the digitally signed digest 50. Therefore, this process enables the effective output of a log file while maintaining a security level, and also makes it possible to verify the integrity of the output log file.
[0087] Sixth, in the log output process according to the present embodiment described above, when a file close event is detected, the integrity of the log file 20 is verified. Therefore, this process enables effective output of a log file while maintaining a security level, and can effectively verify the integrity of the output log file.
[0088] [System configuration, etc.] The components of each device shown in the drawings according to the above embodiments are conceptual functional units and do not necessarily have to be physically configured as shown. In other words, the specific form of distribution and integration of each device is not limited to that shown, and all or part of each device can be functionally or physically distributed and integrated in any unit depending on various loads, usage conditions, etc. Furthermore, all or any part of the processing functions performed by each device can be realized by a CPU and a program analyzed and executed by the CPU, or can be realized as hardware using wired logic.
[0089] Furthermore, among the processes described in the above embodiments, all or part of the processes described as being performed automatically can be performed manually, or all or part of the processes described as being performed manually can be performed automatically using a known method.In addition, the information including the processing procedures, control procedures, specific names, various data and parameters shown in the above documents and drawings can be changed as desired unless otherwise specified.
[0090] 〔program〕 It is also possible to create a program written in a computer-executable language that executes the processes executed by the log output device 10 described in the above embodiment. In this case, the same effects as those of the above embodiment can be obtained by having a computer execute the program. Furthermore, such a program may be recorded on a computer-readable recording medium, and the program recorded on the recording medium may be read and executed by a computer to realize processes similar to those of the above embodiment.
[0091] 8 is a diagram showing a computer that executes a program. As shown in the example of FIG. 8, a computer 1000 includes, for example, a memory 1010, a CPU 1020, a hard disk drive interface 1030, a disk drive interface 1040, a serial port interface 1050, a video adapter 1060, and a network interface 1070, and these components are connected by a bus 1080.
[0092] As shown in FIG. 8, the memory 1010 includes a ROM (Read Only Memory) 1011 and a RAM 1012. The ROM 1011 stores a boot program such as a BIOS (Basic Input Output System). The hard disk drive interface 1030 is connected to a hard disk drive 1090 as shown in FIG. 8. The disk drive interface 1040 is connected to a disk drive 1100 as shown in FIG. 8. A removable storage medium such as a magnetic disk or an optical disk is inserted into the disk drive 1100. The serial port interface 1050 is connected to a mouse 1110 and a keyboard 1120 as shown in FIG. 8. The video adapter 1060 is connected to a display 1130 as shown in FIG. 8.
[0093] 8, the hard disk drive 1090 stores, for example, an OS 1091, an application program 1092, a program module 1093, and program data 1094. That is, the above programs are stored, for example, on the hard disk drive 1090 as program modules in which instructions to be executed by the computer 1000 are written.
[0094] The various data described in the above embodiment are stored as program data, for example, in the memory 1010 or the hard disk drive 1090. The CPU 1020 then reads the program module 1093 and the program data 1094 stored in the memory 1010 or the hard disk drive 1090 into the RAM 1012 as needed, and executes various processing procedures.
[0095] Note that the program module 1093 and program data 1094 related to the program are not limited to being stored in the hard disk drive 1090, and may be stored in, for example, a removable storage medium and read by the CPU 1020 via a disk drive or the like. Alternatively, the program module 1093 and program data 1094 related to the program may be stored in another computer connected via a network (such as a LAN (Local Area Network) or WAN (Wide Area Network)) and read by the CPU 1020 via the network interface 1070.
[0096] The above-described embodiments and their modifications are included in the technology disclosed in this application, as well as in the scope of the invention described in the claims and their equivalents. [Explanation of symbols]
[0097] 10, 10-P log output device 11 Communications Department 12, 12-P storage section 12a Log storage unit 12b Digest storage unit 12c Log digest storage 13 Control Unit 13a Generator 13b Calculation part 13c Granting Division 13d Output section 13e Verification Department 20 Log Files 20a Log Messages 30 Digest 40 Digital Signatures 50 Digitally Signed Digests 60 private key 100 Log Output System
Claims
1. a calculation unit that executes hooking of a predetermined event related to a log message and calculates a hash value from the log message each time the hooking is executed; an adding unit that adds an encrypted digital signature to the hash value; an output unit that outputs the log message and the hash value to which the digital signature is added; a verification unit that verifies the integrity of the log message by using the log message and the hash value to which the digital signature is added; Equipped with when the log message is newly generated in a predetermined secure element, the calculation unit counts up an identification number of the log message and calculates the hash value by updating the hash value using the identification number; the granting unit grants the digital signature obtained by encrypting the hash value using a private key held in the secure element; the verification unit verifies the integrity of the log message including the incremented identification number. A log output device characterized by:
2. the calculation unit executes hooking of a file open event or a file append event related to the log message based on an interface for an OS (Operating System) that describes a virtual file system, and calculates the hash value each time the hooking is executed.
2. The log output device according to claim 1.
3. the calculation unit executes hooking of a file open event related to the log message using a system call that monitors events in a file system, and calculates the hash value for each hooking.
3. The log output device according to claim 1, wherein the log output device is a log output device.
4. a verification unit that verifies the integrity of the log message by using the log message and the hash value to which the digital signature is added; 4. The log output device according to claim 1, further comprising:
5. A log output method executed by a log output device, comprising: a calculation step of executing a hook of a predetermined event related to a log message and calculating a hash value from the log message each time the hook is executed; an adding step of adding an encrypted digital signature to the hash value; an output step of outputting the log message and the hash value to which the digital signature has been added; a verification step of verifying the integrity of the log message using the log message and the hash value to which the digital signature is added; Including, the calculation step, when the log message is newly generated in a predetermined secure element, counts up an identification number of the log message and calculates the hash value by updating the hash value using the identification number; the attaching step attaches the digital signature obtained by encrypting the hash value using a private key held in the secure element; the verifying step verifies the integrity of the log message including the incremented identification number; A log output method comprising:
6. a calculation step of executing a hook of a predetermined event related to a log message and calculating a hash value from the log message each time the hook is executed; a step of adding an encrypted digital signature to the hash value; an output step of outputting the log message and the hash value to which the digital signature has been added; a verification step of verifying the integrity of the log message using the log message and the hash value to which the digital signature is added; on the computer, the calculation step includes, when the log message is newly generated in a predetermined secure element, counting up an identification number of the log message and updating the hash value using the identification number to calculate the hash value; the attaching step includes attaching the digital signature obtained by encrypting the hash value using a private key held in the secure element; the verification step verifies the integrity of the log message including the incremented identification number; A log output program characterized by:
Citation Information
Patent Citations
Operating system data integrity determination method and device
CN111177703A
Method and system for safely running executable file
CN111259348A
Data safety protection method and device and storage medium
CN111444528A
Trusted measurement method and related device
CN113468535A
Characteristic keyword detection device, characteristic keyword detecting method, program and recording medium
JP2009169924A