Skip to content
Skillpedia
Deploy & cloud (DevOps)35k · #5907

implementing-log-integrity-with-blockchain

Builds an immutable log integrity chain using blockchain. Ensures logs are not altered and detects tampering.

What it does

This tool creates a secure, tamper-proof log. Each new entry in the log contains a unique code (hash) of the previous entry, ensuring any modification is easily detected.

When to use it

  • ✓To reliably store security logs.
  • ✓When you need to prove a record hasn't been altered.
  • ✓For audits and forensic investigations.

Example of what to ask your AI

“Create a secure log for my web server logs and check if they have been tampered with.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-log-integrity-with-blockchain/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-log-integrity-with-blockchain/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool takes each new piece of information (log), adds a unique code from the previous information and a timestamp, and generates a new code. If someone tries to change something, the codes won't match anymore, revealing the tampering.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill implementing-log-integrity-with-blockchain

Or download just the file:

curl -L https://raw.githubusercontent.com/mukul975/Anthropic-Cybersecurity-Skills/main/skills/implementing-log-integrity-with-blockchain/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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.

FAQ

What is a 'hash'?

It's like a unique fingerprint for each piece of information. Even a tiny change in the text generates a completely different fingerprint.

Why use 'blockchain' here?

It's not a full blockchain, but it uses the idea of chaining information with codes. This makes the log very secure against changes, like a chain where each link depends on the previous one.

How do I know if something was changed?

The tool compares the calculated codes with the original codes. If there's a difference at any point in the chain, it warns that the log has been tampered with from that point onwards.

Details

Original description by the author

Builds an append-only log integrity chain using SHA-256 hash chaining, where each entry incorporates the previous entry's hash so tampering invalidates all subsequent hashes; covers log ingestion (syslog/JSON/plain text), chain verification, pinpoint tamper detection, and checkpoint anchoring to external timestamping services. Use for tamper-evident log storage for compliance or forensics, or to v

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#5907
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills