Multiply defensive capabilities: KQL/Splunk/EQL/YARA rules + STIX/MISP export + beacon analysis + campaign analytics#13
Open
cognis-digital wants to merge 2 commits into
Conversation
…beacon analysis + campaign analytics New blue-team/DFIR features (all offline, additive, public API stable): - rules: KQL (Sentinel/Defender), Splunk SPL, Elastic EQL, YARA generators alongside the existing Sigma/Suricata; quote/backslash-safe interpolation. - export (new module + subcommand): native STIX 2.1 bundles (indicator + malware SDOs, ATT&CK kill-chain phases, indicates relationships) and MISP events; --db exports the whole signature DB as a shareable feed. - beacon (new module + subcommand): beacon-cadence analysis from raw connection timestamps (mean/median interval, jitter as coefficient of variation, regularity score, verdict) with a --fail-on-beacon gate. - correlate: campaign graph analytics (hub host, density, linchpin pivot, ATT&CK rollup) via correlate --format json --analytics. - MCP: export / beacon / generate_rules tools added to the server. - 4 new demo scenarios (21-24) + fixture; README + examples refreshed. - version 1.4.0 -> 1.5.0. Tests: 973 -> 1093 (+120). All green offline.
…ectors
detectorpack.py aggregates keyless abuse.ch feeds (ThreatFox, Feodo, SSLBL JA3,
URLhaus) into one normalized, de-duplicated detector set: ~25,700 live detectors
(96 families) and a bundled 3,402-detector offline snapshot (C2-relevant IPs/JA3/
hashes/domains; URLhaus URLs stay live-only). Complements the curated family DB.
Standalone: python -m c2detect.detectorpack {count,build} [--offline] [--full].
4 tests; full suite green (1097).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multiply c2detect's defensive capabilities
Substantial new blue-team / DFIR / threat-intel features that multiply what c2detect does — all fully offline (bundled fixtures, no live network), additive to the public API, with matching tests, runnable demos, and docs. Strictly detection/defensive: no offensive C2, no evasion tooling.
New features
1. Four new detection-rule targets (
c2detect rules --format …), alongside the existing Sigma/Suricata:letindicator sets +union … | where).search … | stats …).tls.client.ja3,url.path, …).All carry the same
attack.command_and_control/T1071.001annotations. Interpolated values are backslash/double-quote-escaped so a user-extended signature DB can never emit a broken or injectable rule.2. STIX 2.1 + MISP export (new
c2detect export): native, zero-dependency emitters.indicator+malwareSDOs with kill-chain phases andindicatesrelationships; STIX-patterning expressions over network-traffic / x509 / url properties. Backslash/single-quote-safe; non-numeric ports dropped.--dbexports the whole signature DB as a standalone, shareable C2-fingerprint STIX feed.3. Beacon-cadence analysis (new
c2detect beacon): derives beacon statistics from raw connection timestamps (Zeek conn.log / proxy / EDR; epoch or ISO-8601) — mean/median interval, jitter as a scale-free coefficient of variation, a regularity score, and a verdict (beacon/jittered-beacon/irregular/insufficient-data).--fail-on-beaconCI/hunt gate. Multi-field lines prefer the fractional (Zeekts) epoch so a leading byte-count/uid isn't mistaken for the timestamp.4. Campaign graph analytics (
c2detect correlate --format json --analytics): per-campaign hub host (highest degree), density, linchpin pivot (heaviest shared value), and ATT&CK rollup — the numbers an IR lead uses to decide what to pull and what to block first.5. MCP surface grows:
export,beacon, andgenerate_rulestools added to the stdio JSON-RPC server.Demos, docs, versioning
21_beacon_timeseries,22_stix_misp_export,23_multi_siem_rules,24_campaign_analytics) + a beacon-timeseries fixture; wired intorun_all.pyand the demo test list (now 24).--analytics;--help/version examples refreshed.Public API (additive)
New exports:
to_kql, to_splunk, to_eql, to_yara, to_misp, to_stix, signatures_to_stix, campaign_analytics, analytics, BeaconAnalysis, analyze_timestamps, analyze_beacon_text, parse_timestamps. All previous exports retained; pinned bytests/test_public_api.py.Tests
973 → 1093(+120), all green offline (python -m pytest -q). Includes escaping/robustness regression tests surfaced by an internal code review (quote/backslash breakout in the new generators; non-numeric STIX ports; multi-field timestamp parsing).Every demo exits 0 under
PYTHONUTF8=1.