mandiant / mandiant/capa

Specify/filter rules

Open
#481 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement question
Dominant language
Python
Stars
6.2k
Forks
726
Avg merge
11d 11h
Merged PRs (30d)
7

Description

For testing, linting, targeted large scale analysis, etc. it makes sense to only run specific rules. Currently this is done using the tag argument that supports one selector on all the rules meta fields.

Ideally, one could also run

  • capa -r rules/nursery/ sample
  • capa -r rule-with-dependency.yml
  • etc.

The issue: in these cases dependency rules may be missing...

  1. Should capa try to automatically resolve dependencies? Issue: where to look for these?
  2. Otherwise, how do we specify/select/filter multiple rules for a run?
  3. Most useful would be options to:
    a. filter by files, e.g. capa -r rules/ -<X> a.yml b.yml
    b. specify multiple tags, e.g. capa -r rules/ -t "get file size" "write file"

Happy to discuss if this is worth more effort or if the current workarounds suffice.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name implementation files or tests; start by tracing the capa CLI handling for rule paths, tags, and dependencies. Review how rules in rules/nursery/ and rule-with-dependency.yml are loaded, then clarify the desired behavior for multiple selectors and missing dependencies. Done requires an agreed design and coverage for the selected rule and dependency cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, reverse-engineering
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.