Skip to content

maxwellokumu/okaudit-claude-skills / log-monitoring/anomaly-detector

anomaly-detector

Verified

Compare recent activity against a historical baseline to identify behavioral anomalies and help Claude explain which users or patterns warrant deeper investigation.

FileKindSize
README.mdmarkdown1.3 KB
SKILL.mdskill md1.7 KB
main.pyscript12.6 KB
sample_input/baseline_logs.jsonlother102.4 KB
sample_input/test_logs.jsonlother17.4 KB
skill.yamlconfig1.0 KB
# anomaly-detector

Detect behavioural anomalies by comparing user activity in a test period against
a historical baseline. Uses mean + N×standard deviation thresholds per user. Also
flags new users and new source IPs not seen during the baseline period.

---

## Requirements

```bash
pip install python-dotenv
```

---

## Usage

```bash
# Basic comparison
python main.py \
  --logs sample_input/baseline_logs.jsonl \
  --test sample_input/test_logs.jsonl

# Higher sensitivity (fewer false positives)
python main.py \
  --logs sample_input/baseline_logs.jsonl \
  --test sample_input/test_logs.jsonl \
  --sensitivity 3.0

# Lower sensitivity (catch more subtle anomalies)
python main.py \
  --logs sample_input/baseline_logs.jsonl \
  --test sample_input/test_logs.jsonl \
  --sensitivity 1.5 \
  --min-events 3
```

---

## Log Format

Both files use JSON-lines format:

```json
{"timestamp": "2025-07-01T09:00:00", "user": "alice", "action": "GetObject", "source_ip": "10.0.0.1"}
```

---

## How It Works

1. Reads the baseline log and computes **per-user, per-day** action counts
2. Calculates **mean** and **standard deviation** per user
3. Sets threshold = `mean + (sensitivity × std_dev)`
4. Evaluates each user in the test file against their personal threshold
5. Flags any day where count > threshold, plus new users and new IPs
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall