Log data is crucial for security threat detection and audit analysis. However, traditional log systems are susceptible to tampering, posing a significant security risk to information systems. Although blockchain technology has been introduced to enhance tamper resistance, existing blockchain-based log systems still suffer from storage and query efficiency issues. In this paper, we propose a novel secure and efficient log storage and query framework that combines on-chain and off-chain collaboration. An inverted index table is constructed by extracting keywords from logs, which are stored on the blockchain as on-chain data, while the logs themselves are maintained as off-chain data. This approach facilitates the rapid retrieval of specific keywords and ensures the immutability of the logs. Furthermore, we propose a secure and efficient log query method featuring a smart contract designed to automatically handle requests from legitimate log queriers. We also design a data structure based on merkle adaptive radix tree (MART) and merkle B+ tree (MBT) to store index entries, thereby achieving efficient log retrieval. We provide formal security proofs and comprehensively evaluate the proposed framework’s performance experimentally. Results demonstrate that MBT and MART reduce average query times by 20.09% and 51% respectively, compared to the state-of-the-art schemes.
Read full abstract