System Overview
Keralis is a distributed system for monitoring log file integrity, using the Hedera blockchain to ensure immutability and constant monitoring of sensitive data.
General Architecture

Global diagram of Keralis architecture
The Keralis system consists of two main servers that interact with the Hedera blockchain to ensure the integrity of log files and detect any modification or deletion of them.
System Components
Sender/Client Server
This server manages log production, their initial processing, and their secure transfer to the blockchain server.
Main Features:
- Automatic detection of new log files
- SHA-256 hash generation for each file
- Asymmetric encryption of logs for secure transmission
- Exposure of a REST API for hash verification
- SFTP transfer of files to the blockchain server
Processing Flow:
- Log files are generated in
/root/keralis/logs/
- The
senderV1.py
script continuously monitors this directory - For each newly detected file:
- A SHA-256 hash is calculated (file .hash)
- An encrypted version is generated (file .log.enc)
- Both files are sent via SFTP to the blockchain server
- The REST API exposes endpoints allowing other components to verify file hashes
Blockchain Server
This server forms the core of the security system, ensuring verification, storage, and monitoring of logs.
Main Features:
- Reception and storage of files from the client server in a database
- Publication of hashes on the Hedera blockchain via a dedicated TopicID
- Periodic verification of file integrity
- Alert generation in case of detected modification/deletion
- Monitoring dashboard accessible via web interface
Processing Flow:
- The
auto3.js
script receives files sent by SFTP - The .hash and .log.enc files are stored in dedicated MongoDB collections
- Each hash is published on the Hedera blockchain as an immutable message in the topic
- The
file-integrity-checker.js
service periodically monitors integrity:- It queries the client server API to get current hashes
- It compares these values with those stored in MongoDB and on the blockchain
- In case of difference, it generates an email alert
- The
dashboard.js
provides a web interface to visualize the system status
Hedera Blockchain
The Hedera blockchain is used as an immutable and public register for log file hashes, offering:
- Hash storage via the HCS service (Hedera Consensus Service)
- A dedicated TopicID for message publication
- Public verifiability of hashes via hashscan.io
- Timestamped proof of anteriority for each entry
Complete Workflow
- Log Generation: Applications produce log files on the client server
- Initial Processing: The sender system calculates the SHA-256 hash and encrypts the content
- Secure Transfer: Files are transferred via SFTP to the blockchain server
- Structured Storage: Files and their metadata are stored in MongoDB
- Blockchain Publication: Hashes are published on the Hedera blockchain
- Continuous Verification: The integrity checker constantly monitors for modifications
- Instant Alerts: Email alerts are sent in case of detected alteration
- Visualization: The web dashboard allows monitoring of the entire system
This distributed architecture ensures that even if one component is compromised, the overall integrity of the system remains verifiable and intrusions are immediately detected.