fim
File and Registry Integrity Monitoring (FIM/RIM) in LimaCharlie — the Integrity extension for monitoring file system and registry changes with pattern-based rules. Covers rule patterns, platform-specific syntax, FIM_HIT events, Linux eBPF vs inotify limitations, and CLI management. Use when setting up integrity monitoring, writing FIM patterns, or troubleshooting FIM_HIT events.
What this skill does
# File & Registry Integrity Monitoring (FIM)
The Integrity extension (`ext-integrity`) automates integrity checks of file systems and registry values through pattern-based rules. When a monitored file or registry key is modified, a `FIM_HIT` event appears in the sensor timeline.
## Core Concepts
- FIM is consolidated with EDR — no separate agent needed
- Real-time alerts for modifications
- One year of historical FIM data via Insight
- Rules are scoped by **platform** and **sensor tags**
## Enabling
```bash
limacharlie extension subscribe --name ext-integrity --oid <oid>
```
## Managing Rules
```bash
# List rules
limacharlie extension request --name ext-integrity --action list_rules --oid <oid> --output yaml
# Add rule
limacharlie extension request --name ext-integrity --action add_rule --data '{"name":"linux-ssh-configs","patterns":["/root/.ssh/*","/home/*/.ssh/*"],"tags":["server"],"platforms":["linux"]}' --oid <oid> --output yaml
# Remove rule
limacharlie extension request --name ext-integrity --action remove_rule --data '{"name":"linux-ssh-configs"}' --oid <oid> --output yaml
```
## Rule Patterns
Patterns support wildcards: `*` (any characters), `?` (single character), `+` (one or more characters).
### Windows File Patterns
| Pattern | Monitors |
|---------|----------|
| `?:\\Windows\\System32\\drivers` | drivers directory on any drive |
| `C:\\Windows\\System32\\specialfile.exe` | specific file on C: |
| `?:\\inetpub\\wwwroot` | IIS web root on any drive |
**Gotcha**: Windows directory separators (backslash) MUST be escaped with double-backslash `\\` in patterns.
### Windows Registry Patterns
All registry monitoring patterns MUST begin with `\REGISTRY`, followed by the hive and then the path.
| Pattern | Monitors |
|---------|----------|
| `\REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\Run*` | System Run key (persistence) |
| `\REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce*` | System RunOnce key |
| `\REGISTRY\USER\S-*\Software\Microsoft\Windows\CurrentVersion\Run*` | All users' Run keys |
**Gotcha**: the prefix is `\REGISTRY`, NOT `HKLM` or `HKEY_LOCAL_MACHINE`. This is a common mistake.
### Linux Patterns
| Pattern | Monitors |
|---------|----------|
| `/root/.ssh/authorized_keys` | Root SSH authorized keys |
| `/home/*/.ssh/*` | All users' SSH directories |
| `/etc/passwd` | User account file |
| `/etc/shadow` | Password hash file |
| `/etc/crontab` | System cron |
### macOS Patterns
| Pattern | Monitors |
|---------|----------|
| `/Users/*/Library/Keychains/*` | User keychains |
| `/Library/Keychains` | System keychains |
| `/Library/LaunchDaemons/*` | Launch daemons (persistence) |
| `/Library/LaunchAgents/*` | Launch agents (persistence) |
## Linux Support Differences
### Linux with eBPF Support
On eBPF-capable systems, FIM capabilities are on par with Windows and macOS — full file notification with efficient kernel-level monitoring.
### Legacy Support (inotify)
On systems without eBPF, FIM uses `inotify` (active monitoring, not passive):
- **Paths with wildcards are less efficient** and only support monitoring up to **20 sub-directories** covered by the wildcard
- **Final wildcard `*` required for directory monitoring**: omitting the final `*` results in only the top-level directory being monitored, not its contents
- Example: `/home/*/.ssh/*` works, but `/home/*/.ssh` only monitors the `.ssh` directory entry itself
## FIM_HIT Event Structure
When a monitored path is modified, a `FIM_HIT` event is generated containing:
- The file or registry path that was modified
- Process information (which process made the change)
- Timestamp of the modification
Use `FIM_HIT` events in D&R rules for automated response:
```yaml
# Example: detect FIM hits on critical Windows persistence locations
event: FIM_HIT
op: starts with
path: event/FILE_PATH
value: \REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
```
## IaC Format
```yaml
extension_config:
ext-integrity:
data:
rules:
- name: windows-persistence
patterns:
- '?\Windows\System32\drivers'
- '\REGISTRY\MACHINE\Software\Microsoft\Windows\CurrentVersion\Run*'
tags: [windows-server]
platforms: [windows]
- name: linux-ssh
patterns:
- '/root/.ssh/*'
- '/home/*/.ssh/*'
tags: [linux-server]
platforms: [linux]
usr_mtd:
enabled: true
expiry: 0
```
## Gotchas Summary
| Gotcha | Detail |
|--------|--------|
| Windows paths need `\\` | Backslash must be escaped as double-backslash |
| Registry prefix is `\REGISTRY` | NOT `HKLM` or `HKEY_LOCAL_MACHINE` |
| Linux inotify: 20 sub-dir limit | Wildcard paths limited on non-eBPF systems |
| Linux inotify: final `*` needed | Omitting final wildcard monitors only directory entry |
| FIM needs ext-integrity subscribed | 403 errors indicate missing subscription |
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.