Skip to content

maxwellokumu/okaudit-claude-skills / log-monitoring/log-analyzer

log-analyzer

Verified

Review log data for suspicious events and help Claude explain what stands out, why it matters, and which findings deserve escalation or follow-up.

FileKindSize
README.mdmarkdown1.8 KB
SKILL.mdskill md1.7 KB
main.pyscript17.1 KB
sample_input/cloudtrail.jsonlother4.6 KB
skill.yamlconfig1.1 KB
# log-analyzer

Parse CloudTrail-format JSON-lines logs and flag suspicious events using a built-in
library of 24 patterns. Supports custom pattern overrides, date range filtering,
and live AWS CloudTrail.

---

## Requirements

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

---

## Usage

```bash
# Local file analysis
python main.py --logs sample_input/cloudtrail.jsonl

# Filter by date range
python main.py \
  --logs sample_input/cloudtrail.jsonl \
  --start "2025-07-01T00:00:00" \
  --end "2025-07-01T23:59:59"

# Add custom patterns
python main.py \
  --logs sample_input/cloudtrail.jsonl \
  --patterns custom_patterns.json

# AWS live mode (dry-run)
python main.py --mode aws --dry-run

# AWS live mode
python main.py --mode aws --start "2025-07-01T00:00:00"
```

---

## Log Format (JSON-lines)

```json
{"timestamp": "2025-07-01T10:00:00", "user": "root", "action": "DeleteTrail", "source_ip": "10.0.0.1", "resource": "cloudtrail:::main"}
```

---

## Built-in Patterns (24 total)

| Event | Severity |
|-------|----------|
| DeleteTrail | 🚨 Critical |
| StopLogging | 🚨 Critical |
| RootAccountUsage | 🚨 Critical |
| DeleteSecret | 🚨 Critical |
| ScheduleKeyDeletion | 🚨 Critical |
| ConsoleLoginFailure | πŸ”΄ High |
| UpdateLoginProfile | πŸ”΄ High |
| DeleteBucket | πŸ”΄ High |
| PutBucketPolicy | πŸ”΄ High |
| AttachUserPolicy | πŸ”΄ High |
| DeleteUser | πŸ”΄ High |
| DeleteVpc | πŸ”΄ High |
| PutBucketAcl | πŸ”΄ High |
| DisableKey | πŸ”΄ High |
| PutEventSelectors | πŸ”΄ High |
| DeleteFlowLogs | πŸ”΄ High |
| AuthorizationFailure | 🟠 Medium |
| CreateAccessKey | 🟠 Medium |
| DeleteAccessKey | 🟠 Medium |
| TerminateInstances | 🟠 Medium |
| ModifySecurityGroup | 🟠 Medium |
| PutSecretValue | 🟠 Medium |
| CreateUser | 🟑 Low |
| GetSecretValue | 🟑 Low |
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall