implementing-log-integrity-with-blockchain

Builds a SHA-256 hash-chained append-only log ledger with tamper detection and checkpoint anchoring.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill implementing-log-integrity-with-blockchain
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-log-integrity-with-blockchain
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/security-operations/implementing-log-integrity-with-blockchain
Command: npx skills add https://github.com/xalgord/xalgorix --skill implementing-log-integrity-with-blockchain

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires requests, and includes scripts (resource) components.

What problem does it solve?

Security teams need to prove that log files have not been altered after the fact, but plain log files can be silently edited by attackers covering their tracks. This Skill creates a blockchain-style hash chain over log entries so any modification is detected and pinpointed to the exact entry.

Core Features & Use Cases

  • Hash-Chained Log Ingestion: Ingests syslog, JSON, or plain text logs and chains each entry to the previous one using SHA-256 over previous hash, timestamp, and content.
  • Tamper Detection with Pinpointing: Recomputes every hash from index 0 during verification and reports the first broken index, flagging all subsequent entries as invalid.
  • Checkpoint Anchoring: Anchors periodic checkpoint hashes to external timestamping services (RFC 3161 TSA / OpenTimestamps) so a full chain rewrite is detectable.
  • Use Case: A SOC team chains its syslog stream into a JSON ledger stored on WORM storage, then runs verification after an incident to prove which log entries are intact and identify exactly where tampering began.

Quick Start

Run the agent script against a log file with verification enabled to build the hash chain and produce an integrity report, for example by asking to verify /var/log/syslog into log_chain.json and output integrity_report.json.

Frequently Asked Questions about implementing-log-integrity-with-blockchain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect tampering in log files with hash chaining?

Hash chaining computes SHA-256 over the previous entry's hash, timestamp, and content for each log entry, so modifying any entry invalidates its hash and all subsequent ones. Verification recomputes every hash from index 0 and reports the first broken index.

How to verify a blockchain-style log integrity chain in Python?

Run the agent script with the --verify flag against the chain file, for example: python scripts/agent.py --log-file /var/log/syslog --chain-file log_chain.json --verify --output integrity_report.json. The report pinpoints the first entry where the recomputed hash diverges.

Why should checkpoint hashes be anchored to an external timestamping service?

Without external anchoring, an attacker who rewrites the entire chain including the genesis entry produces a valid-looking ledger. Anchoring checkpoints to an RFC 3161 TSA or OpenTimestamps makes a full rewrite detectable against an independent witness.

What log formats does hash chain ingestion support?

The ingestion step accepts syslog, JSON, and plain text log files. Each entry is stored in a JSON ledger with its index, timestamp, content hash, previous hash, and chain hash.

Why does log chain verification fail even when only one entry changed?

Each chain hash depends on the previous entry's hash, so a single modified entry breaks the chain at that point and invalidates every entry after it. Verification flags the first broken index and all subsequent entries as invalid by design.

What are the limitations of hash chaining for log integrity?

Hash chaining only works if the ledger is stored on append-only or off-host storage such as WORM or S3 Object Lock; a writable ledger next to the logs allows tamper-then-rechain attacks. The hashed material must also include the index and timestamp to prevent reordering or replay.