跳到正文
cccskills
免费在 GitHub 公开

threat-detection

This skill should be used when the user asks to "analyze logs for threats", "detect suspicious activity", "scan for brute force attempts", "identify injection attacks", or "audit access patterns for anomalies".

中文简介正在准备中。当前显示原文说明。

实测评分 未实测

查看安装方法

包含的文件(3)

  • SKILL.md6.4 KB
  • references/threat-indicators.md3.9 KB
  • scripts/threat_signal_analyzer.py15.9 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Threat Detection

Category: Engineering Domain: Security Operations

Overview

The Threat Detection skill provides automated analysis of log files for suspicious patterns including brute force attempts, injection attempts, path traversal, admin path probing and request flooding. It helps security teams triage log data and identify threats before they escalate.

Clarify First

Before analyzing logs, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

  • Log file & source type: auth / access / application logs to analyze (--file; the subject of detection).
  • Threat category: injection / auth (brute force) / traversal / probe / rate (--category; focuses the scan).
  • Minimum severity: the reporting/alert threshold (--min-severity; changes which signals surface and any SIEM/CI gate).

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Quick Start

# Analyze a log file for threat signals
python scripts/threat_signal_analyzer.py --file /var/log/auth.log

# Analyze with specific threat category
python scripts/threat_signal_analyzer.py --file access.log --category injection

# JSON output for SIEM integration
python scripts/threat_signal_analyzer.py --file auth.log --format json

# Set minimum severity
python scripts/threat_signal_analyzer.py --file access.log --min-severity high

Tools Overview

threat_signal_analyzer.py

Analyzes log files for suspicious activity patterns across multiple threat categories.

FeatureDescription
Brute force detectionCounts failed login lines per source IP across the whole file
Injection scanningDetects SQL injection, XSS, command injection in requests
Path traversalDetects ../ sequences and their URL-encoded forms
Admin probingFlags requests to admin and sensitive paths such as /admin, /.env and /.git
Rate analysisCounts requests per source IP across the whole file and flags high volumes

Workflows

Log Analysis Workflow

  1. Collect - Gather logs from auth, access, application sources
  2. Analyze - Run threat_signal_analyzer.py across log files
  3. Triage - Review critical and high severity findings first
  4. Correlate - Cross-reference findings across log sources
  5. Respond - Block IPs, reset credentials, escalate as needed

Incident Investigation Workflow

  1. Scope - Identify time window and affected systems
  2. Scan - Run analyzer on all relevant log files
  3. Timeline - Build timeline from threat signals
  4. Impact - Assess what was accessed or modified
  5. Contain - Block threat actors and patch vulnerabilities

Continuous Monitoring

# Cron job: analyze auth logs every hour
python scripts/threat_signal_analyzer.py --file /var/log/auth.log --format json --min-severity high > /tmp/threat_report.json

# CI/CD: scan application logs on deployment
python scripts/threat_signal_analyzer.py --file app.log --category injection --format json

Scope & Limitations

In Scope:

  • Rule-based scanning of a single log file with threat_signal_analyzer.py for SQL injection, XSS, command injection, path traversal, failed authentication and brute force, admin path probing, and request flooding.
  • Filtering by --category (injection, auth, traversal, probe, rate) and --min-severity, with text or JSON output.
  • Attack categories, severity levels, common log formats, scanner indicators and an incident response playbook in references/threat-indicators.md.

Out of Scope:

  • Real-time monitoring, alert routing or SIEM integration. The script reads one file per run.
  • Running an incident response (see engineering/incident-commander/) and building a security operations program (see engineering/senior-secops/).
  • Vault audit log analysis (see engineering/secrets-vault-manager/).
  • Blocking IPs or changing any system. The script reports signals only.

Important Caveats:

  • Detection uses regular expressions on log lines and simple counts. Encoded or new attack strings can be missed, and legitimate traffic can match.
  • Brute force and flooding thresholds count events per IP across the whole file, not within a time window.
  • The script does not detect privilege escalation, check IP reputation or flag unusual access times.
  • A quiet report does not mean no attack took place. Findings need correlation with other sources before any response.

Reference Documentation

  • Threat Indicators - Common attack patterns, indicators of compromise, response playbooks

Common Patterns Quick Reference

Threat Categories

CategorySignalsSeverity
Brute force5+ failed logins from same IP in the file (3-4 is Medium)High
SQL injectionUNION SELECT, OR 1=1, DROP TABLE in requestsCritical
XSSscript tags, javascript: URIs, event handlers in inputHigh
Path traversal../ sequences, /etc/passwd access attemptsHigh
Command injection; cat /etc/passwd,nc, backtick usage
Admin probing/admin, /wp-admin, /phpmyadmin access attemptsMedium
Rate floodingMore than 500 requests from a single IP in the file (more than 200 is Medium)High

Severity Levels

  • CRITICAL - Active exploitation attempt (injection, RCE)
  • HIGH - Likely attack in progress (brute force, XSS, path traversal, flooding)
  • MEDIUM - Suspicious activity requiring investigation
  • LOW - Informational, possible false positive

Response Actions

SeverityImmediate ActionFollow-Up
CriticalBlock IP, alert SOCIncident report, forensics
HighRate limit, monitorReview access, check damage
MediumLog and monitorWeekly review
LowLog onlyMonthly trend analysis

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

This skill should be used when the user asks to "check accessibility", "audit WCAG compliance", "scan HTML for a11y issues", "check color contrast", or "find accessibility violations in web pages".

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9702026年10月23日 更新

Design and run statistically rigorous A/B tests and experiments. Use when planning experiments, calculating sample sizes, designing test variants, selecting metrics, analyzing results, or when someone says "let's test that."

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9702026年10月23日 更新

Design and analyze A/B tests: sample size, test duration, and statistical significance for conversion experiments. Use when setting up an A/B test, calculating sample size, designing an experiment, or analyzing results.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9702026年10月23日 更新

Sales execution across pipeline, discovery, demos, negotiation, and closing. Use when qualifying opportunities, running MEDDIC discovery, building account plans, handling objections, structuring proposals, or forecasting pipeline.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9702026年10月23日 更新

Design ad creative across Google, Meta, LinkedIn, Twitter/X, and TikTok with platform format specs, headline formulas, and A/B testing. Use when writing ad copy, generating headline variations, creating ad sets, or validating creative.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9702026年10月23日 更新

aeo

免费

Answer Engine Optimization (AEO): optimize content to be cited by LLMs (ChatGPT, Claude, Perplexity, Gemini) in their answers. Use when designing content for LLM citation, auditing citability, or structuring Q&A schema.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9702026年10月23日 更新

查看 borghei 的全部技能

报告此技能的问题