WO2023112170A1 - ログ出力装置、ログ出力方法およびログ出力プログラム - Google Patents

ログ出力装置、ログ出力方法およびログ出力プログラム Download PDF

Info

Publication number
WO2023112170A1
WO2023112170A1 PCT/JP2021/046125 JP2021046125W WO2023112170A1 WO 2023112170 A1 WO2023112170 A1 WO 2023112170A1 JP 2021046125 W JP2021046125 W JP 2021046125W WO 2023112170 A1 WO2023112170 A1 WO 2023112170A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
hash value
log output
file
output device
Prior art date
Application number
PCT/JP2021/046125
Other languages
English (en)
French (fr)
Inventor
友貴 山中
浩義 瀧口
正紀 篠原
智大 永井
泰典 和田
Original Assignee
日本電信電話株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 日本電信電話株式会社 filed Critical 日本電信電話株式会社
Priority to PCT/JP2021/046125 priority Critical patent/WO2023112170A1/ja
Publication of WO2023112170A1 publication Critical patent/WO2023112170A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web

Definitions

  • 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, etc. is a record of events that occurred within the device in chronological order, and contains information such as OS (Operating System) and application failures, defects, and warnings. .
  • OS Operating System
  • application failures defects, and warnings.
  • traces of the attack are often recorded in log files, and it is an important security issue to protect the log files from being tampered with by attackers.
  • 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.
  • a digest with a digital signature for that log is sequentially generated within the TEE (Trusted Execution Environment) and stored together with the log file so that integrity can be verified later. There is a technique for doing this (see, for example, Non-Patent Document 1).
  • a log output device executes a hook for a predetermined event related to a log message, and calculates a hash value from the log message for each hook.
  • an attachment unit for attaching an encrypted digital signature to the hash value; and an output unit for outputting the log message and the hash value to which the digital signature is attached.
  • a log output method is a log output method executed by a log output device, in which a hook of a predetermined event related to a log message is executed, and a hash value is calculated from the log message each time the hook is executed. an adding step of adding an encrypted digital signature to the hash value; and an outputting step of outputting the log message and the hash value to which the digital signature is added.
  • a log output program includes a calculation procedure for executing a hook of a predetermined event related to a log message, calculating a hash value from the log message each time the hook is executed, and encrypting the hash value. and an output procedure for outputting the log message and the hash value to which the digital signature is attached.
  • the present invention enables effective log file output while maintaining the security level.
  • FIG. 1 is a diagram showing a configuration example of a log output system according to the first embodiment.
  • FIG. 2 is a diagram showing an outline of a conventional log output system.
  • FIG. 3 is a block diagram illustrating a configuration example of a log output device according to the first embodiment;
  • FIG. 4 is a diagram illustrating a specific example 1 of log output processing according to the first embodiment.
  • FIG. 5 is a diagram illustrating a specific example 2 of log output processing according to the first embodiment.
  • FIG. 6 is a diagram illustrating a specific example 2 of log output processing according to the first embodiment.
  • FIG. 7 is a flowchart illustrating an example of the flow of log output processing according to the first embodiment.
  • FIG. 8 is a diagram showing a computer that executes a program.
  • FIG. 1 is a diagram showing a configuration example of a log output system according to the first embodiment. An example of the overall configuration of the log output system 100 will be shown below, and the log message generation processing, event hook processing, digest generation processing, digital signature attachment processing, log file storage processing, and log file verification processing will be described in this order.
  • log output system 100 has a log output device 10 .
  • log output system 100 includes log file 20, digest 30, digital signature 40, digest with digital signature 50, and private key 60 as data related to log output system 100.
  • FIG. 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 configuration of the log output system 100 will be described below.
  • 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 can execute the log output processing according to the present embodiment.
  • the log output device 10 may be a PC (Personal Computer) owned by a user of a general network, a smart phone, a tablet terminal, or the like.
  • the log output system 100 shown in FIG. 1 may include a plurality of log output devices 10 .
  • log file 20 The log file 20 is a data file containing 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 containing log messages 20a and the like.
  • Digital Signature 40 Digital Signature 40 is data encrypted with private key 60 . It should be noted that it is also simply written as “signature” as appropriate.
  • a digitally signed digest 50 is a digest 30 to which a digital signature 40 is attached.
  • Private key 60 is data used to encrypt digital signature 40 .
  • 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.
  • TEE Transactional Environment
  • normal world normal execution environment
  • TPM Trusted Platform Module
  • the storage unit 12 is a storage medium (storage) in which the log file 20 and the digitally signed digest 50 are stored. Although the storage unit 12 is installed inside the log output device 10 in the example of FIG. 1 , it may be installed outside the log output device 10 . For details of the storage unit 12, see [3. Configuration of log output device 10].
  • the log output device 10 uses a log output application to generate a log file 20 including a log message 20a (see FIG. 1(1)).
  • the log file 20 is a file in which information about events that occur in the log output device 10 (OS and application failures, defects, warnings, etc.) are recorded in chronological order.
  • the log output device 10 hooks the file event (see FIG. 1(2)).
  • the log output device 10 hooks a file open event or a file modification event such as file appending.
  • the log output device 10 uses an OS interface (suitable for “virtual file system description interface”) capable of describing a virtual file system such as FUSE (Filesystem in Userspace), and a file system event log such as fanotify. hooks the above file events using a system call that monitors the .
  • FUSE Filesystem in Userspace
  • fanotify file system event log
  • the log output device 10 generates a digest 30 within the TEE based on the message file 20 including the message 20a etc. (see FIG. 1(3)). For example, the log output device 10 sequentially updates hash values using log messages. In the example of FIG. 1, the log output device 10 includes M log messages recorded in chronological order, and therefore performs M updates (hashing). Then, the log output device 10 executes the update using the block ID, which is the identification information of the block of the log, and generates the digest 30 . At this time, the log output device 10 advances the block ID by one. In the example of FIG. 1, the log output device 10 generates the digest 30 using the block ID "e", which is an arbitrary number, and performs processing to count up the block ID to "e+1".
  • the log output device 10 uses the private key 60 to generate a digital signature 40 within the TEE, and attaches the digital signature 40 to the digest 30 (see FIG. 1(4)).
  • the log output device 10 generates a digital signature 40 by encrypting the digest 30 using a private key 60 held within the TEE, and then appends the digital signature 40 to the digest 30.
  • a digest 50 with is generated.
  • 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 unit 12 (see (5) in FIG. 1). 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).
  • the log output device 10 can also 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 generates a hash value from the log file 20. Finally, the integrity of the log file 20 is verified by verifying whether or not it matches the verified hash value.
  • FIG. 2 is a diagram showing an outline of a conventional log output system. Descriptions of the same configuration and processing as those of the log output system 100 described above will be omitted.
  • a conventional log output system 100-P has a log output device 10-P.
  • the process of generating the digest 30 is executed in a secure environment such as TEE or TPM directly incorporated in the log output application.
  • the log output device 10-P generates a log file 20 containing log messages 20a and the like in a log output application such as auditd (see FIG. 2(1)), and executes the contents on a secure element such as TEE.
  • the file is transferred to a secure environment, and a digest 30, which is a hash value corresponding to the log file 20, is generated within the environment (see FIG. 2(2)).
  • the log output device 10-P applies a digital signature 40 to the digest 30 with a secret key 60 that is safely stored in a TEE or the like, and returns it to the log output application (see (3) in FIG. 2).
  • the log output device 10-P outputs the digitally signed digest 50 together with the log file 20 to the storage unit 12-P, which is a storage, for storage (see (4) in FIG. 2).
  • the log generation process (Fig. 2 (1) ) and the digest generation process (see (2) in FIG. 2) are indivisible (atomic). That is, the log output device 10-P executes the process of generating the digest 30 and the like in a secure environment such as TEE or TPM that is 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, so there is a problem of low versatility.
  • the conventional log output system 100-P can guarantee the same level of security as This is because, in order to prevent the above hook, it is necessary to block the operation of applications that operate with root privileges such as FUSE and fanotify. This is because the cost of taking over is no different.
  • FIG. 3 is a block diagram illustrating a configuration example of a log output device according to the first embodiment;
  • the log output device 10 has a communication section 11 , a storage section 12 and a control section 13 .
  • the log output device 10 has an input unit (for example, keyboard, mouse, etc.) for receiving various operations from the administrator of the log output device 10, and a display unit (for example, liquid crystal display, etc.) for displaying various information. You may
  • the communication unit 11 manages data communication with other devices. For example, the communication unit 11 performs data communication with each communication device. Further, the communication unit 11 can perform data communication with an operator's terminal (not shown).
  • the storage unit 12 stores various information referred to when the control unit 13 operates and various 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.
  • the storage unit 12 is, for example, a RAM (Random Access Memory), a semiconductor memory device such as a flash memory, or a storage device such as a hard disk or an optical disk.
  • the storage unit 12 is installed inside the log output device 10 in the example of FIG. good.
  • the log storage unit 12a stores a log file 20.
  • the log storage unit 11a stores a log file 20 including log messages 20a generated by the generation unit 13a of the control unit 13 and the like.
  • the digest storage unit 12b stores the digest 30.
  • FIG. 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.
  • FIG. 12b is a hash value calculated by the calculation unit 13b of the control unit 13.
  • the log/digest storage unit 12c stores the log file 20 and the digest 50 with a digital signature.
  • 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 .
  • the control unit 13 controls the entire log output device 10 .
  • the control unit 13 has a generation unit 13a, a calculation unit 13b, an addition unit 13c, an output unit 13d, and a verification unit 13e.
  • the control unit 15 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).
  • the generator 13a generates a log message 20a.
  • the generation unit 13a also generates a log file 20 including log messages 20a and the like.
  • the generation unit 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.
  • the generation unit 13a stores the log file 20 including the generated log message 20a and the like in the log storage unit 12a.
  • the calculator 13b executes a hook for a predetermined event related to the log message 20a, calculates a hash value from the log message 20a, and generates a digest 30 each time the hook is hooked.
  • the calculation unit 13b calculates a hash value by updating the hash value when a new log message is generated in a predetermined secure element, and generates the digest 30 .
  • the calculation unit 13b calculates a hash value by updating the hash value each time an entry is written to the log file 20 in a secure environment such as TEE or TPM, A digest 30 is generated for each predetermined log block.
  • the calculation unit 13b executes a hook for a file open event or a file append event for the log message 20a based on an OS interface that describes the virtual file system, calculates a hash value for each hook, and generates a digest 30. do.
  • the calculation unit 13b uses a file system described by a virtual file system description interface such as FUSE to execute a hook for a file open event or a file append event for the log message 20a, and calculates a hash value for each hook. and generate a digest 30.
  • the calculation unit 13b uses a system call for monitoring file system events to hook a file open event related to the log message 20a, calculates a hash value for each hook, and generates a digest 30.
  • 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 a digest 30.
  • the calculation unit 13b stores the generated digest 30 in the digest storage unit 12b.
  • the adding unit 13c adds an encrypted digital signature 40 to the generated digest 30.
  • the adding unit 13c adds a digital signature 40 obtained by encrypting the digest 30 using a secret key 60 held in a predetermined secure element. That is, the granting unit 13c acquires the digest 30 generated by the calculating unit 13b, generates the digital signature 40 by encrypting the digest 30 using the private key 60, and applies the digital signature 40 to the digest 30.
  • a digitally signed digest 50 is generated by the addition.
  • the output unit 13d outputs the log file 20 including the log message 20a and the digest 50 with a digital signature.
  • the output unit 13d acquires the log file 20 including the log message 20a generated by the generation unit 13a and the digest 50 with a digital signature generated by the attachment 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 outside the log output device 10. FIG.
  • the verification unit 13e verifies the integrity of the log file 20 using the log file 20 including the log message 20a and the digest 50 with the digital signature. For example, the verification unit 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 determines that the hash value is a verified hash value (digest 30) is verified. Further, the verification unit 13e verifies the integrity of the log file 20 when the file close event related to the log file 20 is detected.
  • FIG. 4 is a diagram illustrating a specific example 1 of log output processing according to the first embodiment.
  • TEE is used as a secure environment
  • FUSE is used as a virtual file system description interface
  • the log output device 10 executes processing for outputting the log file 20 on the VFS by Syslog for collecting and recording the log file 20 .
  • the log output device 10 is a file system capable of defining various processes for the FUSE module, which is the FUSE program module, the FUSE device file (/dev/fuse), the FUSE itself, libfuse, and the log file 20.
  • the process of hooking file open events and file modification events and the process of calling the log output function (logger) in the TEE are executed by the daemon (see FIG. 4 (2)).
  • 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 (Fig. 4 ( 3) See).
  • the log output device 10 executes processing for notifying completion of the logging phase, which is a hashing process, by the log output core (see FIG. 4(4)).
  • the file system daemon passes through the generated digest 50 with a digital signature, etc., and executes the process of storing it in the storage (FIG. 4 ( 5) See).
  • the log output device 10 detects falsification or deletion of the log files 20 and digests 30 accumulated before the attack. can do.
  • the log output device 10 can directly hook an additional event or the like of an application that outputs a log using an OS interface capable of describing a virtual file system. Secondly, 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, when hooking a file modification event, and calculating a hash value for the modified part. Therefore, hash values can be generated even for non-appendable log files such as utmp and wtmp. Third, the log output device 10 can detect falsification early by detecting a file close event and performing an integrity check.
  • FIG. 5 and 6 are diagrams showing a specific example 2 of log output processing according to the first embodiment.
  • TEE is used as a secure environment and fanotify is used as an event monitoring system call will be described below.
  • 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). At this time, the log output device 10 especially hooks the file open event and generates the digest 30 .
  • the processing of the log output device 10 will be explained more specifically.
  • the log output device 10 permits file opening when log output processing by a legitimate application is started (see FIG. 5 (1)).
  • the log output device 10 shifts to processing of the logging phase and the first commit phase (Commit Phase) (commit 1).
  • the commit phase is a process of adding a digital signature 40 to the digest 30 generated in the logging phase and completing hashing.
  • the log file 20 is protected by commit 1 during the period up to (1) in FIG. That is, the above period is a period during which the integrity of the log file 20 is guaranteed by the commit 1 process.
  • the log output device 10 hooks the event, shifts to the processing of the logging phase and the second commit phase (commit 2), and digest 30 is generated, the above file opening is permitted (see FIG. 5(2)). That is, the log output device 10 can generate the digest 30 by catching an open event by a third party.
  • the log file 20 is protected by commit 2 during the period from (1) to (2) in FIG. That is, the above period is a period during which the integrity of the log file 20 is ensured by the commit 2 process.
  • the log output device 10 can also shift to the logging phase and commit phase processing periodically.
  • the log output device 10 shifts to the processing of the logging phase and the third commit phase (commit 3) after commit 2, and generates the digest 30 (see (4) in FIG. 5).
  • the log file 20 is protected by commit 3 during the period from (2) to (4) in FIG.
  • the above period is the period during which the integrity of the log file 20 is ensured by the commit 3 process.
  • the log output device 10 can also periodically call the logging phase as shown in FIG.
  • the log output device 10 may maintain the number of logged lines for each log file, and update the number of logged lines after executing the logging phase for those after that number of lines.
  • the log output device 10 may recognize the difference using a snapshot and execute the logging phase for the difference.
  • the log output device 10 executes a process of outputting the log file 20 on the FS by Syslog that collects and records the log file 20 . (See FIG. 6(1)).
  • the log output device 10 executes the process of hooking a file open event and the process of calling the log output function in the TEE by fanotify and the file system daemon (see FIG. 6(2)).
  • 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 (FIG.
  • the log output device 10 executes a process of notifying the completion of the logging phase, which is the hashing process, by the log output core (see (4) in FIG. 6).
  • the file system daemon passes through the generated digest 50 with a digital signature, etc., and executes the process of storing it in the storage (FIG. 6 ( 5) See).
  • the log output device 10 detects falsification and deletion of the log files 20 and digests 30 accumulated before the attack. can do.
  • 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 that monitors file system events. Secondly, the log output device 10 can detect falsification at an early stage by detecting the file close event and confirming the integrity.
  • FIG. 7 is a flowchart illustrating an example of the flow of log output processing according to the first embodiment. Note that steps S101 to S106 below can also be performed in a different order. Also, some of steps S101 to S106 below may be omitted.
  • the generation unit 13a generates the log file 20 containing the log message 20a and the like (step S101).
  • the calculation unit 13b hooks the file event of the log file 20 (step S102).
  • the calculation unit 13b calculates the hash value of the log file 20 and generates the digest 30 (step S103).
  • the granting unit 13c encrypts the digest 30 using the private key 60 to generate the digital signature 40 (step S104).
  • the adding unit 13c adds a digital signature 40 to the digest 30 to generate a digitally signed digest 50 (step S105).
  • the output unit 13d stores the log file 20 and the digitally signed digest 50 in the storage unit 12 (step S106), and ends the process.
  • the verification unit 13e may verify the integrity of the log file 20 using the log file 20 stored in the storage unit 12 and the digest 50 with a digital signature.
  • the digest 30 is generated by updating the hash value, and is sent to the secure element.
  • a digital signature 40 is given by encrypting the digest 30 using a held private key 60 . Therefore, in this process, by using TEE, TPM, etc., it is possible to effectively output a log file while maintaining the security level.
  • a file open event or file append event hook is executed based on the virtual file system description interface, and the digest 30 is generated for each hook. Therefore, in this process, by using a virtual file system description interface such as FUSE, it is possible to effectively output a log file while maintaining the security level.
  • an event monitoring system call is used to hook a file open event, and a digest 30 is generated for each hook. Therefore, in this process, an event monitoring system call such as fanotify is used to enable effective log file output while maintaining the security level.
  • the integrity of the log file 20 is verified using the log file 20 and the digest 50 with a digital signature. Therefore, 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.
  • the integrity of the log file 20 is verified when a file close event is detected. Therefore, 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.
  • the specific form of distribution and integration of each device is not limited to the one shown in the figure, and all or part of them can be functionally or physically distributed and integrated in arbitrary units according to various loads and usage conditions. Can be integrated and configured.
  • 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.
  • ⁇ program ⁇ 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. Further, such a program may be recorded in a computer-readable recording medium, and the program recorded in this recording medium may be read by a computer and executed to realize processing similar to that of the above embodiments.
  • FIG. 8 is a diagram showing a computer that executes a program.
  • computer 1000 includes, for example, memory 1010, CPU 1020, hard disk drive interface 1030, disk drive interface 1040, serial port interface 1050, video adapter 1060, and network interface 1070. , and these units are connected by a bus 1080 .
  • the memory 1010 includes a ROM (Read Only Memory) 1011 and a RAM 1012, as illustrated in FIG.
  • the ROM 1011 stores a boot program such as BIOS (Basic Input Output System).
  • Hard disk drive interface 1030 is connected to hard disk drive 1090 as illustrated in FIG.
  • Disk drive interface 1040 is connected to disk drive 1100 as illustrated in FIG.
  • a removable storage medium such as a magnetic disk or optical disk is inserted into the disk drive 1100 .
  • the serial port interface 1050 is connected to, for example, a mouse 1110 and a keyboard 1120 as illustrated in FIG.
  • Video adapter 1060 is connected to display 1130, for example, as illustrated in FIG.
  • the hard disk drive 1090 stores an OS 1091, application programs 1092, program modules 1093, and program data 1094, for example. That is, the above program is stored in, for example, the hard disk drive 1090 as a program module in which instructions to be executed by the computer 1000 are described.
  • the various data described in the above embodiments are stored as program data in the memory 1010 or the hard disk drive 1090, for example. Then, the CPU 1020 reads the program modules 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.
  • program module 1093 and program data 1094 related to the program are not limited to being stored in the hard disk drive 1090. For example, they may be stored in 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 are stored in another computer connected via a network (LAN (Local Area Network), WAN (Wide Area Network), etc.), and via the network interface 1070 It may be read by CPU 1020 .
  • LAN Local Area Network
  • WAN Wide Area Network

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Storage Device Security (AREA)

Abstract

ログ出力装置(10)は、ログメッセージを生成する生成部(13a)と、ログメッセージに関する所定のイベントのフックを実行し、当該フックのたびにログメッセージからハッシュ値を算出する算出部(13b)と、算出されたハッシュ値に対して、暗号化したデジタル署名を付与する付与部(13c)と、ログメッセージとデジタル署名が付与されたハッシュ値とを出力する出力部(13d)と、ログメッセージとデジタル署名が付与されたハッシュ値とを用いてログメッセージの完全性を検証する検証部(13e)と、を備える。

Description

ログ出力装置、ログ出力方法およびログ出力プログラム
 本発明は、ログ出力装置、ログ出力方法およびログ出力プログラムに関する。
 サーバ機器等で出力されるログファイルは、当該機器内で起こった出来事について時系列順で記録したものであり、OS(Operating System)やアプリケーションの障害・不具合・警告等の情報を含むファイルである。サイバー攻撃が発生すると、その痕跡がログファイルに記録されていることが多く、当該ログファイルを攻撃者に改ざんされることなく保全することは、セキュリティ上の重要な課題となる。
 ここで、特に重要な概念が、ログ保全の文脈におけるフォワードセキュリティ(Forward Security)である。フォワードセキュリティとは、ある時点で機器が感染したとしても、その時点より前に出力されたログファイルの完全性には影響がないことを担保する、という考え方である。このフォワードセキュリティを実現するための仕組みとして、ログ出力のたびに、そのログに対するデジタル署名付きダイジェストをTEE(Trusted Execution Environment)内で逐次生成し、ログファイルとともに保管することで、後に完全性検証を行う技術がある(例えば、非特許文献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
 しかしながら、上述した従来技術では、セキュリティレベルを維持した効果的なログファイルの出力をすることができない。なぜならば、上記の先行技術は、auditd等のログを出力する監査アプリケーションに直接組み込む形での実装が想定されており、拡張性に乏しいからである。
 本発明は、上記に鑑みてなされたものであって、セキュリティレベルを維持した効果的なログファイルの出力を可能にするログ出力装置、ログ出力方法およびログ出力プログラムを提供することを目的とする。
 上述した課題を解決し、目的を達成するために、本発明に係るログ出力装置は、ログメッセージに関する所定のイベントのフックを実行し、前記フックのたびに前記ログメッセージからハッシュ値を算出する算出部と、前記ハッシュ値に対して、暗号化したデジタル署名を付与する付与部と、前記ログメッセージと前記デジタル署名が付与された前記ハッシュ値とを出力する出力部と、を備えることを特徴とする。
 また、本発明に係るログ出力方法は、ログ出力装置によって実行されるログ出力方法であって、ログメッセージに関する所定のイベントのフックを実行し、前記フックのたびに前記ログメッセージからハッシュ値を算出する算出工程と、前記ハッシュ値に対して、暗号化したデジタル署名を付与する付与工程と、前記ログメッセージと前記デジタル署名が付与された前記ハッシュ値とを出力する出力工程と、を含むことを特徴とする。
 また、本発明に係るログ出力プログラムは、ログメッセージに関する所定のイベントのフックを実行し、前記フックのたびに前記ログメッセージからハッシュ値を算出する算出手順と、前記ハッシュ値に対して、暗号化したデジタル署名を付与する付与手順と、前記ログメッセージと前記デジタル署名が付与された前記ハッシュ値とを出力する出力手順と、をコンピュータに実行させることを特徴とする。
 本発明では、セキュリティレベルを維持した効果的なログファイルの出力を可能にする。
図1は、第1の実施形態に係るログ出力システムの構成例を示す図である。 図2は、従来のログ出力システムの概要を示す図である。 図3は、第1の実施形態に係るログ出力装置の構成例を示すブロック図である。 図4は、第1の実施形態に係るログ出力処理の具体例1を示す図である。 図5は、第1の実施形態に係るログ出力処理の具体例2を示す図である。 図6は、第1の実施形態に係るログ出力処理の具体例2を示す図である。 図7は、第1の実施形態に係るログ出力処理の流れの一例を示すフローチャートである。 図8は、プログラムを実行するコンピュータを示す図である。
 以下に、本発明に係るログ出力装置、ログ出力方法およびログ出力プログラムの実施形態を図面に基づいて詳細に説明する。なお、本発明は、以下に説明する実施形態により限定されるものではない。
〔第1の実施形態〕
 以下に、第1の実施形態に係るログ出力システム100の構成、従来のログ出力システム100-Pの概要、ログ出力装置10の構成、ログ出力処理の具体例、ログ出力処理の流れを順に説明し、最後に本実施形態の効果を説明する。
[1.ログ出力システム100の構成]
 図1を用いて、第1の実施形態に係るログ出力システム100の構成を詳細に説明する。図1は、第1の実施形態に係るログ出力システムの構成例を示す図である。以下に、ログ出力システム100全体の構成例を示した上で、ログメッセージ生成処理、イベントフック処理、ダイジェスト生成処理、デジタル署名付与処理、ログファイル格納処理、ログファイル検証処理の順に説明する。
(1-1.ログ出力システム100全体の構成例)
 図1で示すように、ログ出力システム100は、ログ出力装置10を有する。また、ログ出力システム100には、ログ出力システム100に関与するデータとして、ログファイル20、ダイジェスト30、デジタル署名40、デジタル署名付きダイジェスト50および秘密鍵60が含まれる。また、ログ出力システム100には、ログ出力装置10内に、ログ出力アプリケーション、TEEおよび記憶部12が含まれる。以下では、ログ出力システム100の各構成について説明する。
(ログ出力装置10)
 ログ出力装置10は、サーバ装置やクラウドシステム等により実現される情報処理装置であるが、本実施形態に係るログ出力処理を実行できる装置であれば、特に限定されない。例えば、ログ出力装置10は、一般的なネットワーク等の利用者が所有するPC(Personal Computer)、スマートフォン、タブレット端末等であってもよい。なお、図1に示したログ出力システム100には、複数台のログ出力装置10が含まれてもよい。
(ログファイル20)
 ログファイル20は、ログメッセージ20a・・・のM個のログメッセージ(ログファイル20に書き込まれるエントリ)が含まれるデータファイルである。
(ダイジェスト30)
 ダイジェスト30は、ログメッセージ20a等を含むログファイル20から生成されたハッシュ値である。
(デジタル署名40)
 デジタル署名40は、秘密鍵60によって暗号化されたデータである。なお、適宜、単に「署名」とも表記する。
(デジタル署名付きダイジェスト50)
 デジタル署名付きダイジェスト50は、デジタル署名40が付与されたダイジェスト30である。
(秘密鍵60)
 秘密鍵60は、デジタル署名40を暗号化する際に使用されるデータである。
(ログ出力アプリケーション)
 ログ出力アプリケーションは、例えば、auditd等のログを出力する監査アプリケーションであるが、ログを出力するアプリケーションであれば、特に限定されない。
(TEE)
 TEEは、通常の実行環境(ノーマルワールド)とは分離された安全な実行環境(セキュアワールド)であるが、ハッシュ化を安全に実行したり、秘密鍵60を安全に保持したりすることができるセキュアな環境であれば、特に限定されない。例えば、ログ出力システム100には、TPM(Trusted Platform Module)等を用いたセキュアな環境を採用することもできる。
(記憶部12)
 記憶部12は、ログファイル20やデジタル署名付きダイジェスト50が格納される記憶媒体(ストレージ)である。図1の例では、記憶部12は、ログ出力装置10の内部に設置されているが、ログ出力装置10の外部に設置されてもよい。なお、記憶部12の詳細については、[3.ログ出力装置10の構成]にて後述する。
(1-2.ログメッセージ生成処理)
 まず、ログ出力装置10は、ログ出力アプリケーションを用いてログメッセージ20a等を含むログファイル20を生成する(図1(1)参照)。ここで、ログファイル20は、ログ出力装置10内で起こった出来事についての情報(OSやアプリケーションの障害・不具合・警告等)を時系列順で記録されたものである。
(1-3.イベントフック処理)
 次に、ログ出力装置10は、ファイルイベントをフック(hook)する(図1(2)参照)。例えば、ログ出力装置10は、ファイルオープンイベントやファイルの追記等のファイル改変イベントをフックする。このとき、ログ出力装置10は、FUSE(Filesystem in Userspace)等の仮想ファイルシステムを記述することのできるOS用のインターフェイス(適宜、「仮想ファイルシステム記述インターフェイス」)や、fanotify等のファイルシステムのイベントを監視するシステムコール(適宜、「イベント監視システムコール」)を利用して、上記のファイルイベントをフックする。なお、FUSEやfanotify等によるイベントフック処理の詳細については、[4.ログ出力処理の具体例]にて後述する。
(1-4.ダイジェスト生成処理)
 続いて、ログ出力装置10は、TEE内において、メッセージ20a等を含むメッセージファイル20をもとにダイジェスト30を生成する(図1(3)参照)。例えば、ログ出力装置10は、ログメッセージを用いて逐次ハッシュ値をアップデート(update)する。図1の例では、ログ出力装置10は、時系列順で記録されたログメッセージがM個含まれるので、M回のアップデート(ハッシュ化)を実行する。そして、ログ出力装置10は、ログのブロックの識別情報であるブロックIDを用いてアップデートを実行し、ダイジェスト30を生成する。このとき、ログ出力装置10は、ブロックIDを1つ進める処理を行う。図1の例では、ログ出力装置10は、任意の数字であるブロックID「e」を用いてダイジェスト30を生成し、ブロックIDを「e+1」にカウントアップする処理を行う。
(1-5.デジタル署名付与処理)
 一方、ログ出力装置10は、TEE内において、秘密鍵60を用いてデジタル署名40を生成し、デジタル署名40をダイジェスト30に付与する(図1(4)参照)。例えば、ログ出力装置10は、TEE内に保持された秘密鍵60を用いてダイジェスト30を暗号化することによってデジタル署名40を生成し、その後、デジタル署名40をダイジェスト30に付与することによってデジタル署名付きダイジェスト50を生成する。
(1-6.ログファイル格納処理)
 そして、ログ出力装置10は、ログファイル20にデジタル署名付きダイジェスト50を付与して、記憶部12に格納する(図1(5)参照)。このとき、ログ出力装置10は、ログファイル20とデジタル署名付きダイジェスト50とを、図示しないデータベースに格納してもよい。
(1-7.ログファイル検証処理)
 また、ログ出力装置10は、ログファイル20やログメッセージ20a等の完全性を検証することもできる。このとき、ログ出力装置10は、まず、デジタル署名40に用いた秘密鍵60に対応する公開鍵(不図示)を用いてハッシュ値の検証を行い、その後、さらにログファイル20からハッシュ値を生成し、最後に、検証済みハッシュ値と一致するか否かを検証することで、ログファイル20の完全性を検証する。
 上述してきたように、ログ出力システム100では、上記の図1(1)~(5)の処理を実行することで、TEE内の秘密鍵60を不正に入手されなければ、ログファイル20を改ざんされず、または改ざんされても即時に気付くことのできる仕組みを可能とする。また、ログ出力システム100では、上記の図1(3)のダイジェスト生成処理において、TEE等の環境内でのみ有効なカウンタの値(ブロックID「e」)を用いることによって、仮に秘密鍵60が漏洩したとしても過去のハッシュ値を再現できない仕組みを可能とする。
[2.従来のログ出力システム100-Pの概要]
 ここで、従来のログ出力システム100-Pと第1の実施形態に係るログ出力システム100との差異について説明する。以下では、従来のログ出力システム100-Pについて説明した上で、本実施形態に係るログ出力システム100について説明する。
(2-1.従来のログ出力システム100-P)
 図2を用いて、従来のログ出力システム100-Pについて説明する。図2は、従来のログ出力システムの概要を示す図である。なお、上述したログ出力システム100と同様の構成や処理については、説明を省略する。
 図2で示すように、従来のログ出力システム100-Pは、ログ出力装置10-Pを有する。従来のログ出力システム100-Pでは、上述したログ出力システム100と異なり、ダイジェスト30の生成処理は、ログ出力アプリケーションに直接組み込まれたTEEやTPM等のセキュアな環境で実行される。
 ログ出力装置10-Pは、auditd等のログ出力アプリケーション内でログメッセージ20a等を含むログファイル20を生成し(図2(1)参照)、その内容をTEE等のセキュアエレメント上で実行されるセキュアな環境に転送し、同環境内でログファイル20に対応したハッシュ値であるダイジェスト30を生成する(図2(2)参照)。その後、ログ出力装置10-Pは、ダイジェスト30に対し、TEE等に安全に保管されている秘密鍵60でデジタル署名40を施し、ログ出力アプリケーションに返却する(図2(3)参照)。ログ出力装置10-Pは、デジタル署名付きダイジェスト50をログファイル20とともにストレージである記憶部12-Pに出力し、格納する(図2(4)参照)。
 ここで、従来のログ出力システム100-Pでは、ハッシュ値生成前に改ざんが行われた場合に完全性の検証が正常に実行できないことを回避するために、ログ生成処理(図2(1)参照)とダイジェスト生成処理(図2(2)参照)が不可分(atomic)となる構成としている。すなわち、ログ出力装置10-Pは、auditd等のログ出力アプリケーションに直接組み込まれたTEEやTPM等のセキュアな環境で、ダイジェスト30の生成処理等を実行する。このため、従来のログ出力システム100-Pでは、任意のログ出力アプリケーションを用いることができないので、汎用性が低いという問題点がある。
(2-2.ログ出力システム100)
 これに対して、上述したように、第1の実施形態に係る図1に示したログ出力システム100は、FUSEやfanotify等を用いてログファイル20への書き込みイベントや読み込みイベント等のフックを実行し、当該フックのたびにダイジェスト30を生成する。このため、ログ出力システム100は、ストレージ上にログを出力する任意のアプリケーションに対して、デジタル署名付きダイジェスト50を生成できるようになり、攻撃者によるログ改ざんを防止することができる。
 また、図1に示したログ出力システム100の処理のように、FUSEやfanotify等を用いて出力イベントや追記イベントをフックしてハッシュ値生成を行ったとしても、従来のログ出力システム100-Pと同等のセキュリティレベルを担保できる。なぜならば、上記のフックを妨げるためには、FUSEやfanotify等のルート(root)権限で動作するアプリケーションの動作を阻害する必要があるが、これはauditd等のログを出力するためのアプリケーションを直接乗っ取るコストと変わらないためである。
[3.ログ出力装置10の構成]
 図3を用いて、第1の実施形態に係るログ出力装置10の構成を詳細に説明する。図3は、第1の実施形態に係るログ出力装置の構成例を示すブロック図である。ログ出力装置10は、通信部11、記憶部12および制御部13を有する。なお、ログ出力装置10は、ログ出力装置10の管理者から各種操作を受け付ける入力部(例えば、キーボードやマウス等)や、各種情報を表示するための表示部(例えば、液晶ディスプレイ等)を有してもよい。
(3-1.通信部11)
 通信部11は、他の装置との間でのデータ通信を司る。例えば、通信部11は、各通信装置との間でデータ通信を行う。また、通信部11は、図示しないオペレータの端末との間でデータ通信を行うことができる。
(3-2.記憶部12)
 記憶部12は、制御部13が動作する際に参照する各種情報や、制御部13が動作した際に取得した各種情報を記憶する。記憶部12は、ログ記憶部12a、ダイジェスト記憶部12bおよびログ・ダイジェスト記憶部12cを有する。ここで、記憶部12は、例えば、RAM(Random Access Memory)、フラッシュメモリ等の半導体メモリ素子、または、ハードディスク、光ディスク等の記憶装置等である。なお、図3の例では、記憶部12は、ログ出力装置10の内部に設置されているが、ログ出力装置10の外部に設置されてもよいし、複数の記憶部が設置されていてもよい。
(ログ記憶部12a)
 ログ記憶部12aは、ログファイル20を記憶する。例えば、ログ記憶部11aは、制御部13の生成部13aによって生成されたログメッセージ20a等を含むログファイル20を記憶する。
(ダイジェスト記憶部12b)
 ダイジェスト記憶部12bは、ダイジェスト30を記憶する。例えば、ダイジェスト記憶部12bは、制御部13の算出部13bによって算出されたハッシュ値であるダイジェスト30を記憶する。
(ログ・ダイジェスト記憶部12c)
 ログ・ダイジェスト記憶部12cは、ログファイル20およびデジタル署名付きダイジェスト50を記憶する。例えば、ログ・ダイジェスト記憶部12cは、制御部13の出力13dによって出力されたログファイル20およびデジタル署名付きダイジェスト50を記憶する。
(3-3.制御部13)
 制御部13は、当該ログ出力装置10全体の制御を司る。制御部13は、生成部13a、算出部13b、付与部13c、出力部13dおよび検証部13eを有する。ここで、制御部15は、例えば、CPU(Central Processing Unit)やMPU(Micro Processing Unit)等の電子回路やASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)等の集積回路である。
(生成部13a)
 生成部13aは、ログメッセージ20aを生成する。また、生成部13aは、ログメッセージ20a等を含むログファイル20を生成する。例えば、生成部13aは、ログ出力アプリケーションを用いて、OSやアプリケーションの障害、不具合、警告等の情報が時系列順で記録されたログファイル20を生成する。一方、生成部13aは、生成したログメッセージ20a等を含むログファイル20をログ記憶部12aに格納する。
(算出部13b)
 算出部13bは、ログメッセージ20aに関する所定のイベントのフックを実行し、当該フックのたびにログメッセージ20aからハッシュ値を算出し、ダイジェスト30を生成する。例えば、算出部13bは、所定のセキュアエレメントにおいて、ログメッセージが新たに生成された場合にはハッシュ値を更新することによってハッシュ値を算出し、ダイジェスト30を生成する。具体的な例を挙げると、算出部13bは、TEEやTPM等のセキュアな環境において、ログファイル20にエントリが書き込まれた場合には、都度ハッシュ値を更新することによってハッシュ値を算出し、所定のログブロックごとにダイジェスト30を生成する。
 算出部13bは、仮想ファイルシステムを記述するOS用インターフェイスに基づいて、ログメッセージ20aに関するファイルオープンイベントまたはファイル追記イベントのフックを実行し、当該フックのたびにハッシュ値を算出し、ダイジェスト30を生成する。例えば、算出部13bは、FUSE等の仮想ファイルシステム記述インターフェイスが記述したファイルシステムを用いて、ログメッセージ20aに関するファイルオープンイベントまたはファイル追記イベントのフックを実行し、当該フックのたびにハッシュ値を算出し、ダイジェスト30を生成する。
 算出部13bは、ファイルシステムのイベントを監視するシステムコールを用いて、ログメッセージ20aに関するファイルオープンイベントのフックを実行し、当該フックのたびにハッシュ値を算出し、ダイジェスト30を生成する。例えば、算出部13bは、fanotify等のイベント監視システムコールを用いて、ログメッセージ20aに関するファイルオープンイベントのフックを実行し、当該フックのたびにハッシュ値を算出し、ダイジェスト30を生成する。
 一方、算出部13bは、生成したダイジェスト30をダイジェスト記憶部12bに格納する。
(付与部13c)
 付与部13cは、生成されたダイジェスト30に対して、暗号化したデジタル署名40を付与する。例えば、付与部13cは、所定のセキュアエレメントに保持される秘密鍵60を用いてダイジェスト30を暗号化したデジタル署名40を付与する。すなわち、付与部13cは、算出部13bによって生成されたダイジェスト30を取得し、秘密鍵60を用いてダイジェスト30を暗号化することによってデジタル署名40を生成し、ダイジェスト30に対してデジタル署名40を付与することによってデジタル署名付きダイジェスト50を生成する。
(出力部13d)
 出力部13dは、ログメッセージ20a等を含むログファイル20とデジタル署名付きダイジェスト50とを出力する。例えば、出力部13dは、生成部13aによって生成されたログメッセージ20a等を含むログファイル20と、付与部13cによって生成されたデジタル署名付きダイジェスト50とを取得し、両者をともにログ・ダイジェスト記憶部12cに格納する。なお、出力部13dは、ログファイル20とデジタル署名付きダイジェスト50とを、ログ出力装置10外部のデータベース等に格納することもできる。
(検証部13e)
 検証部13eは、ログメッセージ20a等を含むログファイル20とデジタル署名付きダイジェスト50とを用いて、ログファイル20の完全性を検証する。例えば、検証部13eは、秘密鍵60に対応する公開鍵を用いてデジタル署名40およびダイジェスト30の検証を実行し、ログファイル20からハッシュ値を算出し、当該ハッシュ値が検証済みハッシュ値(ダイジェスト30)と一致するか否かを検証する。また、検証部13eは、ログファイル20に関するファイルクローズイベントを検知した場合には、ログファイル20の完全性を検証する。
[4.ログ出力処理の具体例]
 図4~図6を用いて、第1の実施形態に係るログ出力処理の具体例を説明する。以下では、具体例1として、仮想ファイルシステム記述インターフェイスの処理を説明し、具体例2として、イベント監視システムコールの処理を説明する。
(4-1.具体例1)
 図4を用いて、具体例1として、FUSE等の仮想ファイルシステム記述インターフェイスに基づくログ出力装置10の処理について説明する。図4は、第1の実施形態に係るログ出力処理の具体例1を示す図である。以下では、セキュアな環境としてTEE、仮想ファイルシステム記述インターフェイスとしてFUSEを採用した具体例について説明するが、本実施形態に係るログ出力処理を実行できる環境およびインターフェイスであれば、特に限定されない。
(プログラム等の構成)
 まず、具体例1に関与するプログラム等の構成について説明する。図4に示すように、ログ出力装置10内の領域がノーマルワールドとセキュアワールドとに分離され、それぞれユーザ空間で動作するプログラム等とカーネル空間で動作するプログラム等とが示される。また、上記のユーザ空間のプログラム等は非特権モードで動作し、上記のカーネル空間のプログラム等は特権モード(privileged mode)で動作する。
 ノーマルワールドのユーザ空間では、「Syslog」、「libfuse」、「ファイルシステム・デーモン(File System Deamon)」、「TEEクライアント(client)API(Application Programming Interface)」、ストレージ(記憶部12)等が動作する。一方、ノーマルワールドのカーネル空間では、「仮想ファイルシステム(VFS:Virtual File System)」、「FUSEモジュール(module)」、「/dev/fuse」、「TEEドライバ(driver)」等が動作する。
 また、セキュアワールドのユーザ空間では、「TEE内部(internal)API」、「ログ出力コア(Logger Core)」等が動作する。一方、セキュアワールドのカーネル空間では、「TEEコア(core)」等が動作する。
(プログラム等の動作)
 次に、具体例1に関与するプログラム等の動作について説明する。まず、ログ出力装置10は、ログファイル20の収集や記録を行うSyslogによって、VFS上にログファイル20を出力する処理を実行する。(図4(1)参照)。次に、ログ出力装置10は、FUSEのプログラムモジュールであるFUSEモジュール、FUSEのデバイスファイル(/dev/fuse)、FUSE本体であるlibfuse、ログファイル20に対して様々な処理を定義可能なファイルシステム・デーモンによって、ファイルオープンイベントやファイル改変イベントをフックする処理や、TEE内のログ出力機能(logger)を呼び出す処理を実行する(図4(2)参照)。続いて、ログ出力装置10は、TEEクライアントAPI、TEEドライバ、TEEコア、TEE内部APIによって、ハッシュ値であるダイジェスト30を生成する処理や、デジタル署名40を付与する処理を実行する(図4(3)参照)。また、ログ出力装置10は、ログ出力コアによって、ハッシュ化過程であるロギング・フェーズ(Logging Phase)の完了を通知する処理を実行する(図4(4)参照)。最後に、ログ出力装置10は、上記の完了通知を受け付けた場合には、ファイルシステム・デーモンによって、生成したデジタル署名付きダイジェスト50等をパススルーし、ストレージに格納する処理を実行する(図4(5)参照)。
 ここで、ログ出力装置10は、上記のSyslog、libfuse、ファイルシステム・デーモン等のプログラムが攻撃されたとしても、攻撃以前に蓄積されたログファイル20やダイジェスト30等については、改ざんや削除を検知することができる。
(具体例1の利点)
 最後に、具体例1の利点について説明する。第1に、ログ出力装置10は、仮想ファイルシステムを記述することのできるOS用インターフェイスを用いて、ログを出力するアプリケーションの追記イベント等を直接フックすることができる。第2に、ログ出力装置10は、ファイル改変イベントをフックした際に現ファイルと書き込みバッファの差分であるdiffを取得して、変更箇所に対してハッシュ値を算出するような柔軟な処理が可能なため、utmpやwtmp等の非追記型ログファイルに対してもハッシュ値を生成することができる。第3に、ログ出力装置10は、ファイルクローズイベントを検知して完全性確認(Integrity Check)を行うことで、改ざんを早期に発見することができる。
(4-2.具体例2)
 図5および図6を用いて、具体例2として、fanotify等のイベント監視システムコールを用いたログ出力装置10の処理について説明する。図5および図6は、第1の実施形態に係るログ出力処理の具体例2を示す図である。以下では、セキュアな環境としてTEE、イベント監視システムコールとしてfanotifyを採用した具体例について説明するが、本実施形態に係るログ出力処理を実行できる環境およびシステムコールであれば、特に限定されない。
(具体例2の概要)
 まず、具体例2の概要について具体例1と比較しつつ説明する。具体例2においては、ログ出力装置10は、ログを出力するアプリケーションのファイル追記イベントをフックせず、ファイルオープンイベント(FAN_OPEN_PERM)やファイル読み出しイベント(FAN_ACCESS_PERM)をフックする。このとき、ログ出力装置10は、特にファイルオープンイベントをフックし、ダイジェスト30を生成する。
 図5を用いて、ログ出力装置10の処理について、さらに具体的に説明する。図5に示すように、ログ出力装置10は、正規のアプリケーションによるログ出力処理が開始された場合には、ファイルオープンを許可する(図5(1)参照)。このとき、ログ出力装置10は、オープンされたログファイル20に差分があれば、ロギング・フェーズおよび1回目のコミット・フェーズ(Commit Phase)(コミット1)の処理に移行する。ここで、コミット・フェーズは、ロギング・フェーズにおいて生成されたダイジェスト30にデジタル署名40を付与し、ハッシュ化を完了する過程である。このとき、図5に示すように、図5(1)までの期間において、ログファイル20は、コミット1により保護される。すなわち、上記の期間は、コミット1の処理によってログファイル20の完全性が担保される期間である。
 また、ログ出力装置10は、任意のアプリケーションによるファイルオープンが行われた場合には、当該イベントをフックし、ロギング・フェーズおよび2回目のコミット・フェーズ(コミット2)の処理に移行し、ダイジェスト30を生成した後に、上記のファイルオープンを許可する(図5(2)参照)。すなわち、ログ出力装置10は、第三者によるオープンイベントを捉えてダイジェスト30を生成することができる。このとき、図5に示すように、図5(1)~(2)までの期間において、ログファイル20は、コミット2により保護される。すなわち、上記の期間は、コミット2の処理によってログファイル20の完全性が担保される期間である。
 ここで、コミット2の直後に第三者によってログファイル20の改ざんが行われたとすると(図5(3)参照)、上記コミット2による保護期間に生成されたログファイル20は安全であるが、図5(2)のオープンイベント以降に生成されたログファイル20については第三者による改ざんが可能となる。
 一方、ログ出力装置10は、定期的にロギング・フェーズおよびコミット・フェーズの処理に移行することもできる。図5に示す例では、ログ出力装置10は、コミット2の後にロギング・フェーズおよび3回目のコミット・フェーズ(コミット3)の処理に移行し、ダイジェスト30を生成する(図5(4)参照)。このとき、図5に示すように、図5(2)~(4)までの期間において、ログファイル20は、コミット3により保護される。すなわち、上記の期間は、コミット3の処理によってログファイル20の完全性が担保される期間である。
 なお、ログ出力装置10は、図5に示すように、定期的にロギング・フェーズを呼び出すこともできる。例えば、ログ出力装置10は、各ログファイルに対して、ロギング済み行数を保持し、その行数以降のものに対してロギング・フェーズを実行した後、ロギング済み行数を更新してもよい。また、ログ出力装置10は、スナップショットを用いて差分を認識し、差分に対してロギング・フェーズを実行してもよい。
(プログラム等の構成)
 次に、具体例2に関与するプログラム等の構成について説明する。図6に示すように、ログ出力装置10内の領域がノーマルワールドとセキュアワールドとに分離され、それぞれユーザ空間で動作するプログラム等とカーネル空間で動作するプログラム等が示される。また、上記のユーザ空間のプログラム等は非特権モードで動作し、上記のカーネル空間のプログラム等は特権モードで動作する。
 ノーマルワールドのユーザ空間では、「Syslog」、「ファイルシステム・デーモン」、「TEEクライアントAPI」、ストレージ(記憶部12)等が動作する。一方、ノーマルワールドのカーネル空間では、「ファイルシステム(FS:File System)」、「fanotify」、「TEEドライバ」等が動作する。
 また、セキュアワールドのユーザ空間では、「TEE内部API」、「ログ出力コア」等が動作する。一方、セキュアワールドのカーネル空間では、「TEEコア」等が動作する。
(プログラム等の動作)
 続いて、具体例2に関与するプログラム等の動作について説明する。まず、ログ出力装置10は、ログファイル20の収集や記録を行うSyslogによって、FS上にログファイル20を出力する処理を実行する。(図6(1)参照)。次に、ログ出力装置10は、fanotify、ファイルシステム・デーモンによって、ファイルオープンイベントをフックする処理や、TEE内のログ出力機能を呼び出す処理を実行する(図6(2)参照)。続いて、ログ出力装置10は、TEEクライアントAPI、TEEドライバ、TEEコア、TEE内部APIによって、ハッシュ値であるダイジェスト30を生成する処理や、デジタル署名40を付与する処理を実行する(図6(3)参照)。また、ログ出力装置10は、ログ出力コアによって、ハッシュ化過程であるロギング・フェーズの完了を通知する処理を実行する(図6(4)参照)。最後に、ログ出力装置10は、上記の完了通知を受け付けた場合には、ファイルシステム・デーモンによって、生成したデジタル署名付きダイジェスト50等をパススルーし、ストレージに格納する処理を実行する(図6(5)参照)。
 ここで、ログ出力装置10は、上記のSyslog、fanotify、ファイルシステム・デーモン等のプログラムが攻撃されたとしても、攻撃以前に蓄積されたログファイル20やダイジェスト30等については、改ざんや削除を検知することができる。
(具体例2の利点)
 最後に、具体例2の利点について説明する。第1に、ログ出力装置10は、ファイルシステムのイベントを監視するシステムコールを用いて、第三者等によるファイルオープンイベントをフックし、ダイジェスト30を生成することができる。第2に、ログ出力装置10は、ファイルクローズイベントを検知して完全性確認を行うことで、改ざんを早期に発見することができる。
[5.ログ出力処理の流れ]
 図7を用いて、第1の実施形態に係るログ出力処理全体の流れを詳細に説明する。図7は、第1の実施形態に係るログ出力処理の流れの一例を示すフローチャートである。なお、下記のステップS101~S106は、異なる順序で実行することもできる。また、下記のステップS101~S106のうち、省略される処理があってもよい。
 第1に、生成部13aは、ログメッセージ20a等が含まれるログファイル20を生成する(ステップS101)。
 第2に、算出部13bは、ログファイル20のファイルイベントをフックする(ステップS102)。
 第3に、算出部13bは、ログファイル20のハッシュ値を算出し、ダイジェスト30を生成する(ステップS103)。
 第4に、付与部13cは、ダイジェスト30を秘密鍵60を用いて暗号化し、デジタル署名40を生成する(ステップS104)。
 第5に、付与部13cは、ダイジェスト30に対してデジタル署名40を付与し、デジタル署名付きダイジェスト50を生成する(ステップS105)。
 第6に、出力部13dは、ログファイル20とデジタル署名付きダイジェスト50とを記憶部12に格納し(ステップS106)、処理を終了する。なお、検証部13eは、記憶部12に格納されたログファイル20とデジタル署名付きダイジェスト50とを用いて、ログファイル20の完全性を検証してもよい。
[第1の実施形態の効果]
 第1に、上述した本実施形態に係るログ出力処理では、ログメッセージ20a等を含むログファイル20に関する所定のイベントのフックを実行し、当該フックのたびにログファイル20からダイジェスト30を生成し、生成したダイジェスト30に対して、暗号化したデジタル署名40を付与し、ログファイル20とデジタル署名付きダイジェスト50とを出力する。このため、本処理では、セキュリティレベルを維持した効果的なログファイルの出力を可能にする。
 第2に、上述した本実施形態に係るログ出力処理では、所定のセキュアエレメントにおいて、ログメッセージが新たに生成された場合にはハッシュ値を更新することによってダイジェスト30を生成し、当該セキュアエレメントに保持される秘密鍵60を用いてダイジェスト30を暗号化したデジタル署名40を付与する。このため、本処理では、TEEやTPM等を利用することによって、セキュリティレベルを維持した効果的なログファイルの出力を可能にする。
 第3に、上述した本実施形態に係るログ出力処理では、仮想ファイルシステム記述インターフェイスに基づいて、ファイルオープンイベントまたはファイル追記イベントのフックを実行し、当該フックのたびにダイジェスト30を生成する。このため、本処理では、FUSE等の仮想ファイルシステム記述インターフェイスを利用することによって、セキュリティレベルを維持した効果的なログファイルの出力を可能にする。
 第4に、上述した本実施形態に係るログ出力処理では、イベント監視システムコールを用いて、ファイルオープンイベントのフックを実行し、当該フックのたびにダイジェスト30を生成する。このため、本処理では、fanotify等のイベント監視システムコールを利用することによって、セキュリティレベルを維持した効果的なログファイルの出力を可能にする。
 第5に、上述した本実施形態に係るログ出力処理では、ログファイル20とデジタル署名付きダイジェスト50とを用いて、ログファイル20の完全性を検証する。このため、本処理では、セキュリティレベルを維持した効果的なログファイルの出力を可能とし、かつ出力したログファイルの完全性を検証することができる。
 第6に、上述した本実施形態に係るログ出力処理では、ファイルクローズイベントを検知した場合には、ログファイル20の完全性を検証する。このため、本処理では、セキュリティレベルを維持した効果的なログファイルの出力を可能とし、かつ出力したログファイルの完全性を効果的に検証することができる。
〔システム構成等〕
 上記実施形態に係る図示した各装置の各構成要素は機能概念的なものであり、必ずしも物理的に図示のごとく構成されていることを要しない。すなわち、各装置の分散・統合の具体的形態は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。さらに、各装置にて行なわれる各処理機能は、その全部または任意の一部が、CPUおよび当該CPUにて解析実行されるプログラムにて実現され、あるいは、ワイヤードロジックによるハードウェアとして実現され得る。
 また、上記実施形態において説明した各処理のうち、自動的に行われるものとして説明した処理の全部または一部を手動的に行うこともでき、あるいは、手動的に行われるものとして説明した処理の全部または一部を公知の方法で自動的に行うこともできる。この他、上記文書中や図面中で示した処理手順、制御手順、具体的名称、各種のデータやパラメータを含む情報については、特記する場合を除いて任意に変更することができる。
〔プログラム〕
 また、上記実施形態において説明したログ出力装置10が実行する処理をコンピュータが実行可能な言語で記述したプログラムを作成することもできる。この場合、コンピュータがプログラムを実行することにより、上記実施形態と同様の効果を得ることができる。さらに、かかるプログラムをコンピュータ読み取り可能な記録媒体に記録して、この記録媒体に記録されたプログラムをコンピュータに読み込ませて実行することにより上記実施形態と同様の処理を実現してもよい。
 図8は、プログラムを実行するコンピュータを示す図である。図8に例示するように、コンピュータ1000は、例えば、メモリ1010と、CPU1020と、ハードディスクドライブインタフェース1030と、ディスクドライブインタフェース1040と、シリアルポートインタフェース1050と、ビデオアダプタ1060と、ネットワークインタフェース1070とを有し、これらの各部はバス1080によって接続される。
 メモリ1010は、図8に例示するように、ROM(Read Only Memory)1011及びRAM1012を含む。ROM1011は、例えば、BIOS(Basic Input Output System)等のブートプログラムを記憶する。ハードディスクドライブインタフェース1030は、図8に例示するように、ハードディスクドライブ1090に接続される。ディスクドライブインタフェース1040は、図8に例示するように、ディスクドライブ1100に接続される。例えば、磁気ディスクや光ディスク等の着脱可能な記憶媒体が、ディスクドライブ1100に挿入される。シリアルポートインタフェース1050は、図8に例示するように、例えば、マウス1110、キーボード1120に接続される。ビデオアダプタ1060は、図8に例示するように、例えばディスプレイ1130に接続される。
 ここで、図8に例示するように、ハードディスクドライブ1090は、例えば、OS1091、アプリケーションプログラム1092、プログラムモジュール1093、プログラムデータ1094を記憶する。すなわち、上記のプログラムは、コンピュータ1000によって実行される指令が記述されたプログラムモジュールとして、例えば、ハードディスクドライブ1090に記憶される。
 また、上記実施形態で説明した各種データは、プログラムデータとして、例えば、メモリ1010やハードディスクドライブ1090に記憶される。そして、CPU1020が、メモリ1010やハードディスクドライブ1090に記憶されたプログラムモジュール1093やプログラムデータ1094を必要に応じてRAM1012に読み出し、各種処理手順を実行する。
 なお、プログラムに係るプログラムモジュール1093やプログラムデータ1094は、ハードディスクドライブ1090に記憶される場合に限られず、例えば着脱可能な記憶媒体に記憶され、ディスクドライブ等を介してCPU1020によって読み出されてもよい。あるいは、プログラムに係るプログラムモジュール1093やプログラムデータ1094は、ネットワーク(LAN(Local Area Network)、WAN(Wide Area Network)等)を介して接続された他のコンピュータに記憶され、ネットワークインタフェース1070を介してCPU1020によって読み出されてもよい。
 上記の実施形態やその変形は、本願が開示する技術に含まれると同様に、請求の範囲に記載された発明とその均等の範囲に含まれるものである。
 10、10-P ログ出力装置
 11 通信部
 12、12-P 記憶部
 12a ログ記憶部
 12b ダイジェスト記憶部
 12c ログ・ダイジェスト記憶部
 13 制御部
 13a 生成部
 13b 算出部
 13c 付与部
 13d 出力部
 13e 検証部
 20 ログファイル
 20a ログメッセージ
 30 ダイジェスト
 40 デジタル署名
 50 デジタル署名付きダイジェスト
 60 秘密鍵
 100 ログ出力システム

Claims (8)

  1.  ログメッセージに関する所定のイベントのフックを実行し、前記フックのたびに前記ログメッセージからハッシュ値を算出する算出部と、
     前記ハッシュ値に対して、暗号化したデジタル署名を付与する付与部と、
     前記ログメッセージと前記デジタル署名が付与された前記ハッシュ値とを出力する出力部と、
     を備えることを特徴とするログ出力装置。
  2.  前記算出部は、所定のセキュアエレメントにおいて、前記ログメッセージが新たに生成された場合にはハッシュ値を更新することによって前記ハッシュ値を算出し、
     前記付与部は、前記セキュアエレメントに保持される秘密鍵を用いて前記ハッシュ値を暗号化した前記デジタル署名を付与する、
     ことを特徴とする請求項1に記載のログ出力装置。
  3.  前記算出部は、仮想ファイルシステムを記述するOS(Operating System)用インターフェイスに基づいて、前記ログメッセージに関するファイルオープンイベントまたはファイル追記イベントのフックを実行し、前記フックのたびに前記ハッシュ値を算出する、
     ことを特徴とする請求項1または2に記載のログ出力装置。
  4.  前記算出部は、ファイルシステムのイベントを監視するシステムコールを用いて、前記ログメッセージに関するファイルオープンイベントのフックを実行し、前記フックのたびに前記ハッシュ値を算出する、
     ことを特徴とする請求項1から3のいずれか1項に記載のログ出力装置。
  5.  前記ログメッセージと前記デジタル署名が付与された前記ハッシュ値とを用いて、前記ログメッセージの完全性を検証する検証部、
     をさらに備えることを特徴とする請求項1から4のいずれか1項に記載のログ出力装置。
  6.  前記検証部は、前記ログメッセージに関するファイルクローズイベントを検知した場合には、前記ログメッセージの完全性を検証する、
     ことを特徴とする請求項5に記載のログ出力装置。
  7.  ログ出力装置によって実行されるログ出力方法であって、
     ログメッセージに関する所定のイベントのフックを実行し、前記フックのたびに前記ログメッセージからハッシュ値を算出する算出工程と、
     前記ハッシュ値に対して、暗号化したデジタル署名を付与する付与工程と、
     前記ログメッセージと前記デジタル署名が付与された前記ハッシュ値とを出力する出力工程と、
     を含むことを特徴とするログ出力方法。
  8.  ログメッセージに関する所定のイベントのフックを実行し、前記フックのたびに前記ログメッセージからハッシュ値を算出する算出手順と、
     前記ハッシュ値に対して、暗号化したデジタル署名を付与する付与手順と、
     前記ログメッセージと前記デジタル署名が付与された前記ハッシュ値とを出力する出力手順と、
     をコンピュータに実行させることを特徴とするログ出力プログラム。
PCT/JP2021/046125 2021-12-14 2021-12-14 ログ出力装置、ログ出力方法およびログ出力プログラム WO2023112170A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/046125 WO2023112170A1 (ja) 2021-12-14 2021-12-14 ログ出力装置、ログ出力方法およびログ出力プログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/046125 WO2023112170A1 (ja) 2021-12-14 2021-12-14 ログ出力装置、ログ出力方法およびログ出力プログラム

Publications (1)

Publication Number Publication Date
WO2023112170A1 true WO2023112170A1 (ja) 2023-06-22

Family

ID=86773803

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/046125 WO2023112170A1 (ja) 2021-12-14 2021-12-14 ログ出力装置、ログ出力方法およびログ出力プログラム

Country Status (1)

Country Link
WO (1) WO2023112170A1 (ja)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009169924A (ja) * 2007-12-18 2009-07-30 Nippon Telegr & Teleph Corp <Ntt> 特徴的キーワード検出装置、特徴的キーワード検出方法、プログラムおよび記録媒体
US9754086B1 (en) * 2014-05-19 2017-09-05 Symantec Corporation Systems and methods for customizing privacy control systems
US10007795B1 (en) * 2014-02-13 2018-06-26 Trend Micro Incorporated Detection and recovery of documents that have been compromised by malware
CN111177703A (zh) * 2019-12-31 2020-05-19 青岛海尔科技有限公司 操作系统数据完整性的确定方法及装置
CN111259348A (zh) * 2020-02-20 2020-06-09 国网信息通信产业集团有限公司 一种安全运行可执行文件的方法及系统
CN111444528A (zh) * 2020-03-31 2020-07-24 海信视像科技股份有限公司 数据安全保护方法、装置及存储介质
CN113468535A (zh) * 2020-03-31 2021-10-01 华为技术有限公司 可信度量方法及相关装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009169924A (ja) * 2007-12-18 2009-07-30 Nippon Telegr & Teleph Corp <Ntt> 特徴的キーワード検出装置、特徴的キーワード検出方法、プログラムおよび記録媒体
US10007795B1 (en) * 2014-02-13 2018-06-26 Trend Micro Incorporated Detection and recovery of documents that have been compromised by malware
US9754086B1 (en) * 2014-05-19 2017-09-05 Symantec Corporation Systems and methods for customizing privacy control systems
CN111177703A (zh) * 2019-12-31 2020-05-19 青岛海尔科技有限公司 操作系统数据完整性的确定方法及装置
CN111259348A (zh) * 2020-02-20 2020-06-09 国网信息通信产业集团有限公司 一种安全运行可执行文件的方法及系统
CN111444528A (zh) * 2020-03-31 2020-07-24 海信视像科技股份有限公司 数据安全保护方法、装置及存储介质
CN113468535A (zh) * 2020-03-31 2021-10-01 华为技术有限公司 可信度量方法及相关装置

Similar Documents

Publication Publication Date Title
US11176255B2 (en) Securely booting a service processor and monitoring service processor integrity
US11503030B2 (en) Service processor and system with secure booting and monitoring of service processor integrity
EP3255549B1 (en) Verifiable audit log
US11502845B2 (en) Network interface device and method
US20070168670A1 (en) Secure bytecode instrumentation facility
CN110770729B (zh) 用于证明虚拟机完整性的方法和设备
US10250588B1 (en) Systems and methods for determining reputations of digital certificate signers
US20080313475A1 (en) Methods and systems for tamper resistant files
JP6063321B2 (ja) サーバ装置およびハッシュ値処理方法
US10713392B2 (en) Network interface device and method
JP6054225B2 (ja) 構成情報管理装置および構成情報管理方法
De Carvalho et al. Secure cloud storage service for detection of security violations
WO2023112170A1 (ja) ログ出力装置、ログ出力方法およびログ出力プログラム
CN114818005B (zh) 一种Linux系统完整性检查方法与系统
AU2021477953A1 (en) Log output device, log output method, and log output program
JP6072584B2 (ja) サーバ装置およびプログラム管理方法
Van Oorschot et al. Reducing unauthorized modification of digital objects
JP5955165B2 (ja) 管理装置、管理方法及び管理プログラム
Zlatkovski et al. A new real-time file integrity monitoring system for windows-based environments
CN114201761B (zh) 在可信计算系统中增强度量代理安全性
JP6063317B2 (ja) 端末装置および判定方法
CN115694790B (zh) 基于量子安全的数字资产存证方法、装置、设备及介质
US11163909B2 (en) Using multiple signatures on a signed log
WO2024125107A1 (zh) 移动端安全切面防护方法、装置、存储介质及电子设备
Daniel et al. Safeguarding Forensic Integrity of Virtual Environment Evidence

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21968087

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2023567357

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: AU2021477953

Country of ref document: AU