implementing-log-integrity-with-blockchain

Solid

Build an append-only log integrity chain using SHA-256 hash chaining for tamper detection. Each log entry is hashed with the previous entry's hash to create a blockchain-like structure where modifying any entry invalidates all subsequent hashes. Implements log ingestion, chain verification, tamper detection with pinpoint identification, and periodic checkpoint anchoring to external timestamping services.

AI & Automation 36,355 stars 4443 forks Updated 2 months ago Apache-2.0

Install

View on GitHub

Quality Score: 92/100

Stars 20%
100
Recency 20%
75
Frontmatter 20%
70
Documentation 15%
81
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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. ```bash python scripts/agent.py --log-file /var/log/syslog --chain-file log_chain.json --verify --output integrity_report.json ``` ## Examples ### Chain Entry Structure ```json {"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, chai...

Details

Author
mukul975
Repository
mukul975/Anthropic-Cybersecurity-Skills
Created
8 months ago
Last Updated
2 months ago
Language
Python
License
Apache-2.0

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

lgpd-audit-logging

Design and implement tamper-evident, transactionally serialized audit logging as a recommended engineering control for LGPD accountability (Art. 6, X) and security (Art. 46). Outputs Prisma schema, concurrency-safe hash-chain writer, DB write-protection triggers, and external WORM/SIEM anchoring verification.

277 Updated today
goul4rt
AI & Automation Listed

ai-native-proof-ledger

Design, implement, audit, or review verifiable history for ordinary SaaS, mobile, and serverless apps — tamper-evident audit trails, hash chains, Merkle transparency logs, witnessed checkpoints, external timestamp/chain anchoring, attestations, verifiable databases, consortium ledgers, and AI-agent action receipts. Use when a user asks to make history or audit logs tamper-evident or independently verifiable, anchor records to a blockchain, add proof/receipts/dispute bundles, choose between OpenTimestamps / EAS / immudb / Tessera / Rekor / Fabric / ChainMaker-style options, or review "blockchain" claims in a product. Do NOT use for crypto token/NFT features, mining, or trading — and do NOT use when the user only needs ordinary application logging with no external verification promise.

0 Updated today
lizliz404
AI & Automation Listed

algo-blockchain-basics

"Explain blockchain fundamentals including distributed ledger architecture, consensus mechanisms, and block structure. Use this skill when the user needs to understand blockchain concepts, evaluate whether blockchain fits a use case, or design a blockchain-based solution — even if they say 'how does blockchain work', 'do I need blockchain', or 'distributed ledger'.".

27 Updated 4 months ago
charlieviettq