Documentation
How a rule is written, and how to run one over a saved event stream.
Source opens early 2027. The full documentation ships with it.
The rule format
A Capsule rule is one capsule block with a dotted name. Inside it:
meta: ID, author, confidence, severity, ATT&CK techniques, sources, licenses, attribution and a description.list: a named list of values, such as tool names or ports. Shared lists live inlists.*files.group: one piece of evidence over behavior events. A group can ask for one event or a sequence, withsame storyline:,within 120s:andthen.require: how many groups must match, for example2 of (a, b, c) and a. The name afterandis mandatory evidence.explain: the verdict text, filled from the match with{rule},{group},{count},{key}and{groups}.
An example
capsule credential_access.lsass_dump_exfil {
meta {
id = "MC-CRED-0004"
confidence = 75
severity = "malicious"
attack = ["T1003.001", "T1041"]
}
group dump_then_exit : behavior {
same storyline:
within 120s:
file where op == "write" and path contains "lsass" nocase and path ends_with ".dmp" nocase
then net_connect where remote_port in dump_ports
}
require 1 of (dump_then_exit)
explain "Rule {rule}: {group} matched {count} time(s) for {key}. Groups: {groups}."
}
Excerpt. The full rule also lists its sources and licenses. It is derived from Sigma rules by Florian Roth (Nextron Systems), Teymur Kheirkhabarov and oscd.community, under DRL-1.1.
The rule needs two facts in order, from the same storyline, within 120 seconds: a write of a file named like an LSASS dump, and then an outbound connection to one of the ports in dump_ports. One fact alone does not match.
Check a rule directory
malcap rules check compiles every rule and list under a directory and prints the counts. Today it reports:
$ malcap rules check rules/
static rules: 0
behavior rules: 65
lists: 75
Replay a stream
malcap replay runs the behavior rules over a JSON Lines file of events and prints each match with its explanation and the events behind it. Use it to test a rule, or to check the rules against telemetry from your own systems.
malcap replay events.jsonl --rules rules/
malcap replay events.jsonl --rules rules/ --json
The exit code is 0 when nothing matched, 1 when a rule matched, and 2 on an error. Each event is one envelope of the event schema, which is a draft at version 0.3.
A replay of the synthetic credential-access demo stream gives 2 matches, MC-CRED-0003 and MC-CRED-0004. A replay of the synthetic benign day gives 0.
What will be public
| Document | Contents |
|---|---|
| Vision and roadmap | Scope, components, principles, and phase by phase progress. |
| Capsule format | The rule grammar, the layers and the event schema. |
| Writing rules | How to write, test and submit a rule, with fixtures. |
| Architecture | Component boundaries and the decision records behind them. |
| Threat model | What MalCap defends against, and what it does not. |
| Development | Build setup and coding standards. |
Source opens early 2027. The repositories are private until then, so this page links to none of them.