feat: support per-technique filtering of custom context menu items (#92)#805
Open
workmcg wants to merge 4 commits into
Open
feat: support per-technique filtering of custom context menu items (#92)#805workmcg wants to merge 4 commits into
workmcg wants to merge 4 commits into
Conversation
…k#92) Documents the optional limit_techniques field on custom context menu items, per the approach proposed in issue mitre-attack#92. Signed-off-by: Mukul Chauhan <work.mukul.chauhan@gmail.com>
Adds ContextMenuTechniqueFilter type and appliesTo() method, plus unit tests. Part of the limit_techniques proposal in issue mitre-attack#92. Signed-off-by: Mukul Chauhan <work.mukul.chauhan@gmail.com>
Wires ContextMenuItem.appliesTo() into the context menu component/template so items respect limit_techniques for the technique/tactic being viewed. Signed-off-by: Mukul Chauhan <work.mukul.chauhan@gmail.com>
Passes the optional limit_techniques field through to each ContextMenuItem when loading assets/config.json. Signed-off-by: Mukul Chauhan <work.mukul.chauhan@gmail.com>
workmcg
force-pushed
the
context-menu-limit-techniques
branch
from
July 20, 2026 12:50
ac57cd0 to
a660afe
Compare
|
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.



Closes #92
What this does
Adds an optional
limit_techniquesfilter to custom context menu items defined inassets/config.json. Today every custom context menu option is applied to every technique in a layer; this lets an option be scoped to specific techniques.{ "label": "foo", "url": "https://test.com", "limit_techniques": ["T1098", { "id": "T1059", "tactic": "execution" }] }Design note - multi-tactic techniques
@rjsmitre raised on the issue that for multi-tactic techniques we need a way to say whether an entry applies to all instances of the technique or only some.
Rather than invent new semantics, this follows the pattern the layer format already uses for exactly this ambiguity. Technique objects in a layer file take an optional
tacticfield, and the spec states that if the field is not present, the annotations apply under every tactic the technique belongs to.limit_techniquesmirrors that:"T1059") applies to that technique under any tactic it appears in{ id, tactic }pair scopes the entry to that technique under one tactic, withtacticin shortname/phase-name form, matching the layer format'stacticfieldThis keeps the simple case simple and stays consistent with vocabulary contributors already know from layer files.
Backward compatibility
No breaking changes.
limit_techniquesis optional; when it is absent or an empty array,appliesTo()returnstrueand behaviour is identical to today - the item applies to every technique.Changes
context-menu-item.ts- adds theContextMenuTechniqueFiltertype, storeslimit_techniques, and addsappliesTo(technique, tactic)context-menu-item.spec.ts- 7 unit tests covering: unset filter, empty filter, bare-ID match across tactics, bare-ID non-match,{ id, tactic }scoped match, scoped non-match, and a mixed listlimit_techniquesfromcustom_context_menu_itemsapplicableContextMenuItemsTesting
npm testinnav-app. The new specs cover the filter semantics directly; existing specs confirm the default path is unchanged.