deploying-ransomware-canary-files

Deploys decoy canary files and monitors filesystem events with Python watchdog to detect ransomware activity.

954|172|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/xalgord/xalgorix --skill deploying-ransomware-canary-files
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: deploying-ransomware-canary-files
Source: https://github.com/xalgord/xalgorix/tree/main/internal/tools/skills/data/ransomware-defense/deploying-ransomware-canary-files
Command: npx skills add https://github.com/xalgord/xalgorix --skill deploying-ransomware-canary-files

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires watchdog, psutil, requests.

What problem does it solve?

Ransomware often encrypts business-critical data before traditional defenses react. This Skill provides an early-warning detection layer by placing decoy files in directories ransomware targets first and alerting the moment any of them are touched.

Core Features & Use Cases

  • Canary File Generation: Creates realistic decoy files (e.g., Passwords.xlsx, Financial_Report_2026.docx) with plausible fake content placed in share roots, Documents folders, and backup paths.
  • Real-Time Filesystem Monitoring: Uses Python's watchdog library to detect modify, rename, delete, and create events on canary files across Linux, macOS, and Windows.
  • Multi-Channel Alerting: Sends alerts via SMTP email, Slack webhook, and syslog with event type, file path, timestamp, SHA-256 hashes, and process information via psutil.
  • Use Case: A security team seeds canary files across network shares on a file server; when ransomware begins enumerating and encrypting files, the first canary touched triggers an immediate Slack and SIEM alert before real data is encrypted.

Quick Start

Deploy ransomware canary files across my network share roots and set up watchdog monitoring with Slack and email alerts.

Frequently Asked Questions about deploying-ransomware-canary-files

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

FAQPage Schema
How do I detect ransomware early with canary files?

Place decoy files with realistic names like Passwords.xlsx in directories ransomware enumerates first, then monitor them with Python's watchdog library. Any modify, rename, or delete event on a canary triggers an alert, since legitimate users never touch these files.

How to monitor filesystem events in Python with watchdog?

Use watchdog's FileSystemEventHandler to watch canary file paths and handle on_modified, on_deleted, on_moved, and on_created events. It uses OS-native APIs: inotify on Linux, FSEvents on macOS, and ReadDirectoryChangesW on Windows.

Why does canary monitoring miss encrypt-and-rename ransomware?

Handlers that only watch on_modified miss ransomware that writes File.xlsx.locked and unlinks the original, which fires on_moved and on_deleted instead. The handler must cover created, modified, moved, and deleted events to catch this behavior.

Where should ransomware canary files be placed?

Place canaries in every network-share root, Documents folder, user Desktop, and backup staging directory that ransomware enumerates first. Pair realistic names with _AAAA_-prefixed and ~zzzz_-suffixed twins so a canary is touched first regardless of enumeration order.

What are the limitations of canary files for ransomware defense?

Canary files are a detection layer, not a prevention mechanism, and cannot replace endpoint protection, backups, or network segmentation. They also require tuning to exclude backup and antivirus processes that may legitimately touch files and cause false alerts.