Specify/filter rules
Nobody has claimed this yet.
- 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/ samplecapa -r rule-with-dependency.yml- etc.
The issue: in these cases dependency rules may be missing...
- Should capa try to automatically resolve dependencies? Issue: where to look for these?
- Otherwise, how do we specify/select/filter multiple rules for a run?
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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