New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Log Integrity with Blockchain

Free

Ensure tamper-evident log storage with SHA-256 chaining.

Get this skill

Free · Opens the source repo

What Log Integrity with Blockchain does

The Log Integrity with Blockchain skill provides a robust solution for maintaining the integrity of log entries through SHA-256 hash chaining. By building an append-only log, each entry incorporates the hash of the previous entry, ensuring that any tampering is easily detectable. This skill is particularly useful for organizations that need to comply with regulatory requirements or perform forensic investigations, as it allows for reliable log storage and verification.

With this skill, users can ingest logs from various sources including syslog, JSON, and plain text files. The process involves computing a SHA-256 hash that combines the previous entry's hash, a timestamp, and the log content itself. This creates a secure chain of log entries that can be stored as a JSON ledger. Users can also verify the integrity of the log chain by recomputing the hashes and detecting any discrepancies, ensuring that the log data remains trustworthy over time.

This skill is designed for security professionals, system administrators, and developers who are tasked with implementing security controls and improving the architecture of their systems. It provides a clear methodology for establishing tamper-evident logging practices, which are crucial for maintaining the security and compliance of any IT environment. By anchoring checkpoint hashes to external timestamping services, users can further enhance the reliability of their log entries, making this skill a comprehensive tool for log integrity management.

When to use it

Use this skill when implementing log integrity measures in environments that require compliance and security assessments.

When not to use it

This skill may not be suitable for scenarios where log integrity is not a priority or where simpler logging solutions suffice.

What you can build with it

Compliance Logging

Use this skill to ensure that log entries meet compliance requirements by maintaining a tamper-evident record.

Forensic Investigations

Employ the skill to verify the integrity of logs during forensic investigations, helping to identify unauthorized changes.

Security Architecture Improvement

Integrate this skill into your security architecture to enhance log integrity and support security assessments.

How to install Log Integrity with Blockchain

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/implementing-log-integrity-with-blockchain --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

Implementing Log Integrity with Blockchain

When to Use

  • When deploying or configuring implementing log integrity with blockchain capabilities in your environment
  • When establishing security controls aligned to compliance requirements
  • When building or improving security architecture for this domain
  • When conducting security assessments that require this implementation

Prerequisites

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

  1. Install dependencies: pip install requests
  2. Ingest log entries from syslog, JSON, or plain text files.
  3. For each entry, compute SHA-256 hash of: previous_hash + timestamp + log_content.
  4. Store the chain as a JSON ledger with entry index, timestamp, content hash, previous hash, and chain hash.
  5. Verify chain integrity by recomputing all hashes and detecting breaks.
  6. Optionally anchor checkpoint hashes to an external timestamping service.
python scripts/agent.py --log-file /var/log/syslog --chain-file log_chain.json --verify --output integrity_report.json

Examples

Chain Entry Structure

{"index": 42, "timestamp": "2024-01-15T10:30:00Z", "content_hash": "a1b2c3...",
 "prev_hash": "d4e5f6...", "chain_hash": "SHA256(prev_hash + timestamp + content_hash)"}

Tamper Detection

If entry 42 is modified, chain_hash[42] will not match SHA256(chain_hash[41] + ...), and all entries from 42 onward will be flagged as invalid.

Frequently asked questions about Log Integrity with Blockchain

Similar skills