Skip to content

feat: add crowdsec-hub-authoring skill - #33

Merged
sabban merged 6 commits into
mainfrom
skill/hub-authoring
Nov 30, 2026
Merged

sabban merged 6 commits into
mainfrom
skill/hub-authoring

Conversation

@sabban

@sabban sabban commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a third skill, skills/crowdsec-hub-authoring/, for writing, testing and reviewing items for crowdsecurity/hub. It's the skill we already use to review hub PRs, now published here and brought in line with this repo's conventions.

The operational crowdsec skill deliberately puts parser/scenario/WAF-rule authoring out of scope. This skill covers that gap.

Layout

SKILL.md routes by task and lists the hub's non-negotiables. Each file under references/ covers one item type:

File Covers
overview.md repo layout, naming/author rules, what gets rejected, CI gates
parsers.md stages, grok / UnmarshalJSON, source_ip, timestamps
scenarios.md bucket tuning, labels / behaviors / MITRE taxonomy
whitelists-postoverflows.md app-level false-positive suppression
collections-and-docs.md collections, contexts, item .md, acquisition examples
testing.md cscli hubtest, asserts, CI failures
appsec-rules.md WAF rules, vpatch-CVE-…, nuclei tests
review-checklist.md PR review / self-review checklist

Its rules come from the CrowdSec docs, the hub's CI and lint code, and maintainer review comments on hub PRs. Each rule cites the PR numbers it comes from.

Verification

Each reference doc has a verified: block with env: hubtest and CrowdSec 1.8.2. Its examples and commands were run in a hub checkout, using a separate test CrowdSec instance passed with -c:

Doc What was run
parsers.md Example parser through hubtest with both the syslog and non-syslog log_type. The anchored pattern drops a line with trailing text. cscli explain --log/--file -v and hubtest explain also run.
scenarios.md Example leaky scenario overflows in a scenario test: 6 events against a capacity of 5.
testing.md Full loop: hubtest create, run with an empty assert, paste the generated asserts, test passes.
whitelists-postoverflows.md Parser whitelist with a positive case plus path-traversal and POST negatives. Matrix postoverflow with crowdsecurity/http-probing: the benign overflow is flagged Whitelisted, the malicious control is not.
collections-and-docs.md Example collection and context load as local items (cscli … inspect, crowdsec -t). Acquisition examples were not run.
appsec-rules.md Example vpatch through hubtest run --appsec, using the hub's docker/appsec OpenResty target and nuclei: the exploit is blocked. A negative-control rule fails the test, as it should.
review-checklist.md, overview.md The cscli explain, hubtest run, hub search and hubtest create commands they list. The CI gates were not run.

One finding went into the content: hubtest keeps postoverflow-whitelisted overflows in results, and the generated asserts don't check that flag. whitelists-postoverflows.md now says to assert Overflow.Whitelisted by hand.

Other changes

  • check-verification.py now accepts hubtest as a canonical env. validate.yml runs it on every skill under skills/, not only skills/crowdsec.
  • release.yml attaches a crowdsec-hub-authoring-skill-vX.Y.Z.zip for the claude.ai uploader. The README mentions it.
  • plugin.json registers the skill. marketplace.json and plugin.json get updated descriptions and keywords. There is no version bump; the release workflow handles that.
  • CLAUDE.md adds a layout section and the hubtest verification method. README.md adds a coverage table. CHANGELOG.md adds an Unreleased entry.

Follow-up

Shipping the skill as a separate plugin in the marketplace, so it can be installed without the operational skill, is left for a later PR.

claude plugin validate . passes. Its two warnings (root CLAUDE.md, missing icon) are already on main.

🤖 Generated with Claude Code

sabban and others added 3 commits November 27, 2026 10:08
New skill for writing, testing and reviewing crowdsecurity/hub items:
parsers, scenarios, whitelists/postoverflows, collections, contexts,
AppSec rules, cscli hubtest tests and a PR review checklist. Distilled
from the CrowdSec docs, the hub CI/lint code and maintainer review
comments on hub PRs.

Registered in plugin.json; README, CLAUDE.md layout map and CHANGELOG
updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lease

- Run each reference doc's examples and commands against CrowdSec 1.8.2
  with cscli hubtest / cscli explain (AppSec via the hub docker/appsec
  target + nuclei) and record `verified:` blocks with env: hubtest.
- whitelists-postoverflows.md: hubtest keeps postoverflow-whitelisted
  overflows in results; assert Overflow.Whitelisted by hand.
- check-verification.py: hubtest is a canonical env; validate workflow
  runs the checker on every skill.
- release workflow: attach crowdsec-hub-authoring-skill-vX.Y.Z.zip.
- CLAUDE.md, README, CHANGELOG updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@buixor buixor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's discuss

Comment thread .claude-plugin/plugin.json Resolved
notes: "example vpatch rule + hubtest create/run --appsec with the hub docker/appsec OpenResty target and nuclei; negative control fails"
---

# Authoring — AppSec (WAF) rules

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to mention the companion .md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added (0b2230d).

notes: "example leaky scenario overflows in a hubtest scenario test (6 events > capacity 5)"
---

# Authoring — scenarios

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same remarks as above : we need indication on the existing tools (debug mode, replay etc.) for the LLM to test the scenarios.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debugging section added (0b2230d).

Comment thread skills/crowdsec-hub-authoring/SKILL.md Resolved
sabban and others added 2 commits November 27, 2026 15:52
- plugin/marketplace descriptions: "WAF rules" instead of "AppSec rules".
- Drop counts that go stale (242 vpatch rules, ~1500 PRs).
- appsec-rules.md: same-name .md for WAF rules; pointer to
  crowdsec-local-mcp (also in scenarios.md).
- review-checklist.md: keep checkboxes, move reasons/precedents to
  overview.md to remove the overlap.
- parsers.md: step-by-step grok debugging (explain -v, debug: true,
  GREEDYDATA bisect, where base patterns are defined).
- scenarios.md: Debugging section (explain, debug: true, replay).
  Both verified on CrowdSec 1.8.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tested crowdsec-local-mcp 0.9.3 over stdio: WAF and scenario tools,
both Docker harnesses (positive and negative cases), prepare_waf_pr on
a hub clone. Replace the README-based pointer with what it actually
does and its pitfalls (lax validation, prepare_waf_pr paths/overwrite,
spoofable: 0 lint hint, private IPs whitelisted in the scenario stack).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sabban
sabban merged commit dcc03d4 into main Nov 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants